git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux/dnf-history
diff options
context:
space:
mode:
authorHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-11-01 13:30:58 +0100
committerHarald Pfeiffer <harald.pfeiffer _ xmart.de> 2018-11-01 13:30:58 +0100
commit0632591996893fe136a1f2fe44d9b9f404f41f3e (patch)
tree7340edbe7c212da3db45a83219147143a3268c8d /documentation/aux/dnf-history
downloadfedora-laptop-0632591996893fe136a1f2fe44d9b9f404f41f3e.tar.bz2
Initial commit
Diffstat (limited to 'documentation/aux/dnf-history')
-rwxr-xr-xdocumentation/aux/dnf-history21
1 files changed, 21 insertions, 0 deletions
diff --git a/documentation/aux/dnf-history b/documentation/aux/dnf-history
new file mode 100755
index 0000000..716d22c
--- /dev/null
+++ b/documentation/aux/dnf-history
@@ -0,0 +1,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."