]> granicus.if.org Git - shadow/commitdiff
Add cleanup script
authorNicolas François <nicolas.francois@centraliens.net>
Sat, 20 Sep 2014 14:14:33 +0000 (16:14 +0200)
committerNicolas François <nicolas.francois@centraliens.net>
Sat, 20 Sep 2014 22:17:24 +0000 (00:17 +0200)
tests/cleanup.sh [new file with mode: 0755]

diff --git a/tests/cleanup.sh b/tests/cleanup.sh
new file mode 100755 (executable)
index 0000000..26b1b27
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+for t in *
+do
+       if [ ! -d $t/data ]; then continue; fi
+       for i in passwd group shadow gshadow
+       do
+               if [ -f $t/data/$i ]
+               then
+                       if cmp -s $t/config/etc/$i $t/data/$i
+                       then
+                               echo "# $t/data/$i identical to config"
+                               svn rm "$t/data/$i"
+                       fi
+               fi
+       done
+done
+
+for t in *
+do
+       cd $t
+       if [ ! -d data ]; then cd ..; continue; fi
+       for i in data/*
+       do
+               if [ ! -f $i ]; then continue; fi
+               if ! grep -q $i *.test
+               then
+                       echo "# $t/$i not used"
+                       svn rm "$i"
+               fi
+       done
+       cd ..
+done