git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux/dnf-history
blob: 716d22c41bd99d0addba01ffdd40651910d39969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# we need to use sudo, better fetch the session now so it doesn't feck up our
# nice output later on, tee hee.
sudo echo -n ""
[ "$?" -ne 0 ]&&echo "Not allowed to proceed :("&&exit 1
SCDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#SCDIR="$HOME"
source "$SCDIR/ctrl-c"||exit 1
ODETFIL="$SCDIR/../packages-raw"

echo -n "Fetching dnf history"
true>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||echo -n "."
LCNT=0
for i in $(sudo dnf history|sed 's/^[\ \t]\+\([0-9]\+\).*/\1/g'|grep -vP -- '^--|^ID');do
	((++LCNT))
	[ "$(($LCNT % 3))" -eq 0 ]&&echo -n "."||true
	sudo dnf history info "$i" 2>>"$ODETFIL"|grep -i Command\ line>>"$ODETFIL"
	#[ "$?" -ne 0 ]&&break
done;echo "done."
#[ "$?" -ne 0 ]&&echo "failed."||echo "done."