SPECS: rpmdb-checkdir.sh (NEW) - script to check ownership of perl...

glen glen at pld-linux.org
Tue Aug 22 21:22:37 CEST 2006


Author: glen                         Date: Tue Aug 22 19:22:37 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- script to check ownership of perl (perl-dirs) and pear dirs (php-pear)

---- Files affected:
SPECS:
   rpmdb-checkdir.sh (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SPECS/rpmdb-checkdir.sh
diff -u /dev/null SPECS/rpmdb-checkdir.sh:1.1
--- /dev/null	Tue Aug 22 21:22:37 2006
+++ SPECS/rpmdb-checkdir.sh	Tue Aug 22 21:22:32 2006
@@ -0,0 +1,18 @@
+#!/bin/sh
+find $(pwd) -type d | while read dir; do
+	whose=$(rpm -qf "$dir")
+	count=$(echo "$whose" | wc -l)
+	case $count in
+	0) # bad
+		echo >&2 "Not owned: $dir"
+		;;
+	1) # extra check
+		if [[ "$whose" = *is*not* ]]; then
+			echo >&2 "Disowned: $dir $whose"
+		fi
+		;;
+	*) # hehe
+		echo >&2 "Duplicate: $dir" $whose
+	esac
+
+done
================================================================


More information about the pld-cvs-commit mailing list