git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/documentation/aux/yum-history
diff options
context:
space:
mode:
authorH. P. <harald.p.@bechtle.com> 2019-11-25 10:04:43 +0100
committerH. P. <harald.p.@bechtle.com> 2019-11-25 10:04:43 +0100
commit737cf3c79a03489a53b250cf53cf2a8f53f603a4 (patch)
treef6bd73a2c3a78e3731c413d4ebd09fc47c477139 /documentation/aux/yum-history
parent7bde242bc4d99505955f023b4a71aa08b3a762fd (diff)
downloadrhel-scripts-737cf3c79a03489a53b250cf53cf2a8f53f603a4.tar.bz2
+documentation scripts
Diffstat (limited to 'documentation/aux/yum-history')
-rwxr-xr-xdocumentation/aux/yum-history21
1 files changed, 21 insertions, 0 deletions
diff --git a/documentation/aux/yum-history b/documentation/aux/yum-history
new file mode 100755
index 0000000..8a8a2a2
--- /dev/null
+++ b/documentation/aux/yum-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 yum history"
+true>"$ODETFIL";[ "$?" -ne 0 ]&&echo "failed."&&exit 1||echo -n "."
+LCNT=0
+for i in $(sudo yum history list all|grep -vP -- '^--|^ID|^Loaded|^history|leaves'|sed 's/^[\ \t]\+\([0-9]\+\).*/\1/g');do
+ ((++LCNT))
+ [ "$(($LCNT % 3))" -eq 0 ]&&echo -n "."||true
+ sudo yum history info "$i" 2>>"$ODETFIL"|grep -i Command\ line>>"$ODETFIL"
+ #[ "$?" -ne 0 ]&&break
+done;echo "done."
+#[ "$?" -ne 0 ]&&echo "failed."||echo "done."