[packages/rpm-build-tools] add pldnotify script to inform about your ~/rpm packages only

glen glen at pld-linux.org
Tue Dec 24 21:33:08 CET 2013


commit 338aaca981cb5c5d1532ea1cd8a155f15fb97e3a
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Sep 19 01:58:40 2013 +0300

    add pldnotify script to inform about your ~/rpm packages only

 pldnotify.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
---
diff --git a/pldnotify.sh b/pldnotify.sh
new file mode 100755
index 0000000..78dc07d
--- /dev/null
+++ b/pldnotify.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Walks your %_topdir (or any other dir specified by $1) and checks with pldnotify.awk for updates
+# and shows only relevant diffs of those packages only.
+#
+# Setup your cron to give you work early morning :)
+# 6 30 * * * /some/path/pldnotify.sh
+#
+# Idea based on PLD-doc/notify-specsupdate.sh script
+# Author: Elan Ruusamäe <glen at pld-linux.org>
+
+set -e
+dir=$(dirname "$0")
+topdir=${1:-$(rpm -E %_topdir)}
+pldnotify=${0%/*}/pldnotify.awk
+debug=0
+
+# run pldnotify with debug mode if this script executed with "-x"
+case "$-" in
+*x*)
+	debug=1
+	;;
+esac
+
+xtitle() {
+	local prefix="[$(date '+%Y-%m-%d %H:%M:%S')] pldnotify: "
+	local msg="$prefix"$(echo "$*" | tr -d '\r\n')
+	case "$TERM" in
+	cygwin|xterm*)
+		echo >&2 -ne "\033]1;$msg\007\033]2;$msg\007"
+	;;
+	screen*)
+		echo >&2 -ne "\033]0;$msg\007"
+	;;
+	esac
+	echo "$msg"
+}
+
+xtitle "Checking packages in $topdir/*"
+for spec in $topdir/*/*.spec; do
+	pkg=${spec##*/}
+
+	xtitle "Checking $pkg"
+	out=$($pldnotify -vDEBUG=$debug < $spec); rc=$?
+	if [ $rc != 0 ]; then
+		echo >&2 "$out"
+		continue
+	fi
+
+	echo "$out" | grep -v "seems ok" || :
+done
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/338aaca981cb5c5d1532ea1cd8a155f15fb97e3a



More information about the pld-cvs-commit mailing list