diff options
author | Todd T. Fries <todd@cvs.openbsd.org> | 2008-04-07 20:59:42 +0000 |
---|---|---|
committer | Todd T. Fries <todd@cvs.openbsd.org> | 2008-04-07 20:59:42 +0000 |
commit | c69718dd2cb4d5e2f687c2cd6a45358314c29dbd (patch) | |
tree | 411f4d284b4de7c8ab602d1b9bc7b3a3cec09f31 /distrib | |
parent | 347ae250b9591741d71fdd3cbb8c0bea87b50363 (diff) |
make better, add sanity
Diffstat (limited to 'distrib')
-rw-r--r-- | distrib/sets/lists/Makefile | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/distrib/sets/lists/Makefile b/distrib/sets/lists/Makefile index c077b44db..ec738a49e 100644 --- a/distrib/sets/lists/Makefile +++ b/distrib/sets/lists/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.2 2007/03/30 03:55:28 todd Exp $ +# $OpenBSD: Makefile,v 1.3 2008/04/07 20:59:41 todd Exp $ # Various list maintenance functions @@ -6,6 +6,7 @@ # mdtomi: move common md file lines to mi, if present # dupes: detect (nothing more) duplicate entries in each arch's complete file # list +# sanity: sanity check sets for wrong filecounts across archs all: sort @@ -19,40 +20,50 @@ sort: done basefiles!= cd xbase;echo md.* -archs = ${basefiles:S/md\.//} +archs = ${basefiles:S/^md.//} mdtomi: @echo "Checking for common md file lines for migration to mi files:" - @dir=$$(mktemp -d /tmp/mdtomi.XXXXXXXXXX); \ + @for xdir in x*; do \ + dir=$$(mktemp -d /tmp/mdtomi.XXXXXXXXXX); \ i1=first; \ for a in ${archs}; do \ - sort */md.$$a >> $$dir/$$a; \ - [ "X$$i1" = "Xfirst" ] && { \ + sort $$xdir/md.$$a >> $$dir/$$a; \ + if [ "X$$i1" = "Xfirst" ]; then \ i1=$$dir/$$a; \ - } || { \ + else \ cat $$i1 $$dir/$$a | sort | uniq -d >> $$dir/mi.tmp; \ echo "===> ($$(echo $$(cat $$dir/mi.tmp|wc -c)))\c"; \ echo " $$i1 vs $$dir/$$a"; \ mv $$dir/mi.tmp $$dir/mi; \ i1=$$dir/mi; \ - }; \ + fi; \ done; \ echo "If any common md files were found, migrating to mi files:"; \ cat $$dir/mi | while read line; do \ echo "==> $$line"; \ - for line2 in $$(grep $$line */m*); do \ + for line2 in $$(grep "^$$line$$" $$xdir/m*); do \ f=$${line2%:*}; \ grep -v $$line $$f > $$f.tmp && mv $$f.tmp $$f; \ - d=$${f%/*}; \ echo "===> -$$line2"; \ done; \ echo "===> +$$d/mi"; \ - echo $$line >> $$d/mi; \ - done; rm -rf $$dir + echo $$line >> $$xdir/mi; \ + done; rm -rf $$dir; \ + done dupes: - @for arch in ${archs}; do \ - echo "===> $$arch"; \ - cat */md.$$arch */mi | sort | uniq -d; \ + @for d in x*; do \ + for arch in ${archs}; do \ + [ -f $$d/md.$$arch ] || continue; \ + echo "===> $$d/$$arch"; \ + cat $$d/md.$$arch $$d/mi | sort | uniq -d; \ + done; \ done +sanity: + @for d in x*; do \ + [ "$$d" = "xfont" ] && continue; \ + echo "==> $$d"; \ + (cd $$d; cat md* | sort | uniq -c | sort -n ); \ + done |