PLD-doc: notify-specsupdate.sh (NEW) - i'll put this to my crontab
glen
glen at pld-linux.org
Fri Nov 20 15:35:59 CET 2009
Author: glen Date: Fri Nov 20 14:35:59 2009 GMT
Module: PLD-doc Tag: HEAD
---- Log message:
- i'll put this to my crontab
---- Files affected:
PLD-doc:
notify-specsupdate.sh (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: PLD-doc/notify-specsupdate.sh
diff -u /dev/null PLD-doc/notify-specsupdate.sh:1.1
--- /dev/null Fri Nov 20 15:35:59 2009
+++ PLD-doc/notify-specsupdate.sh Fri Nov 20 15:35:53 2009
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Takes auto updated PLD-update-TODO and checks against local version new diffs
+# after which checks only pkgs are you checked out locally in ~/rpm/packages,
+# and shows only relevant diffs of those packages only.
+#
+# $Id$
+# Author: Elan Ruusamäe <glen at pld-linux.org>
+
+set -e
+dir=$(dirname "$0")
+topdir=$(rpm -E %_topdir)/packages
+file=PLD-update-TODO
+cd $dir
+
+buf=$(cvs status -v $file)
+status=$(echo "$buf" | sed -rne 's/.+Status: (.+)$/\1/p')
+if [ "$status" != "Needs Patch" ]; then
+ # No new changes
+ exit 0
+fi
+
+reporev=$(echo "$buf" | sed -rne 's/.+Repository revision:[^0-9]+([.0-9]+).+/\1/p')
+workrev=$(echo "$buf" | sed -rne 's/.+Working revision:[^0-9]+([.0-9]+)/\1/p')
+
+if [ -z "$reporev" -o -z "$workrev" ]; then
+ echo >&2 "No revno found!"
+ exit 1
+fi
+
+diff=$(cvs diff -u -r$workrev -r$reporev $file || :)
+files=$(echo "$diff" | sed -rne 's/^[-+]([^(]+).+OLD.+NEW.+/\1/p' | sort -u)
+
+for pkg in $files; do
+ [ -d "$topdir/$pkg" ] || continue
+ echo "$pkg:"
+ echo "$diff" | grep -E "^[-+]$pkg" || :
+done
+
+# diffs show, cvs up
+#cvs up $file
================================================================
More information about the pld-cvs-commit
mailing list