summaryrefslogtreecommitdiff
path: root/ports
diff options
context:
space:
mode:
authorJuergen Daubert <jue@jue.li>2008-10-24 23:27:17 +0200
committerJuergen Daubert <jue@jue.li>2008-10-24 23:27:17 +0200
commit21d79a3d8dd19c1b4df9b45b0880b9e85fd5b474 (patch)
tree55ae5fd5c1fbc2bdfcc5df0930c9229d6254f743 /ports
parent86ce42c1b9189b13aaaa10fd90e79d0358739ef9 (diff)
downloadiso-21d79a3d8dd19c1b4df9b45b0880b9e85fd5b474.tar.gz
iso-21d79a3d8dd19c1b4df9b45b0880b9e85fd5b474.tar.xz
added script checkportstree
Diffstat (limited to 'ports')
-rwxr-xr-xports/checkportstree35
1 files changed, 35 insertions, 0 deletions
diff --git a/ports/checkportstree b/ports/checkportstree
new file mode 100755
index 0000000..5eaaf2c
--- /dev/null
+++ b/ports/checkportstree
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# checkportstree
+#
+# v1.0 jue 2008-10-23
+#
+# Simple script to find duplicate, missing and orphaned packages.
+# We collect the package-names in a temporary file, find dups from
+# here with 'uniq -d' and dups/orphaned packages by comparing our
+# list with packages.all
+
+
+ALL_PKGS=../packages.all
+
+if [ ! -f $ALL_PKGS ]; then
+ echo "File $ALL_PKGS missing, run 'make packages.all' to create"
+ exit 1
+fi
+
+pkgs_d=$(mktemp)
+pkgs_u=$(mktemp)
+
+find -name '*.pkg.tar.gz' | sed 's|^.*/||;s|#.*$||' | sort > $pkgs_d
+cat $pkgs_d | uniq > $pkgs_u
+
+dups=$(cat $pkgs_d | uniq -d)
+missing=$(comm -3 $ALL_PKGS $pkgs_u | sort | cut -f1)
+orphan=$(comm -3 $ALL_PKGS $pkgs_u | sort | cut -s -f2)
+
+echo "Checking the ports tree for duplicate, missing and orphaned packages..."
+echo "* Duplicates:" $dups
+echo "* Missing: " $missing
+echo "* Orphaned: " $orphan
+
+rm $pkgs_d $pkgs_u

Generated by cgit