3 # This script checks the contents of a dist tarball against a make
4 # clean'ed working copy. The idea is to see if we have unused files
5 # sitting in cvs that could be removed or if we have files that should
6 # be dist'ed but aren't.
8 # Of course, a working copy will have a number of files that the
9 # tarball shouldn't have (e.g. autogen.sh) and vice versa
10 # (e.g. Makefile). Fortunately, that's a pretty small fixed list so
11 # we just filter out those differences.
13 # The script should be run on a ./configure'd component from the
14 # modular release, for example:
16 # ./check-tarball.sh cvs/lib/Xi
18 # will check the Xi library, assuming that ./configure has already
19 # been run in that working copy. As the script runs, it will make
20 # clean the working copy.
22 # At the end of the run, the script will diff the list of files in the
23 # working copy against the list of files in the tarball. Files in the
24 # working copy but not in the tarball will show up as deleted lines in
25 # the diff output. For example, lib/Xi has XFreeLst.c in the working
26 # copy but it isn't dist'ed, giving this output:
28 # --- module-files-24058.txt 2005-09-28 14:09:48.000000000 -0400
29 # +++ tar-files-24058.txt 2005-09-28 14:09:49.000000000 -0400
44 if test ! -e $dir/Makefile
; then
45 echo $dir not .
/configure
\'d
, bailing out
52 # We can't easily extract name and version from the configure.ac, so
53 # we just glob for the dist tarball.
55 tarball
=$dir/*.
tar.bz2
57 blacklist
="config.log config.status autogen.sh$ Makefile.in$ Makefile$ config.h$ .libs/ .deps/ configure$ ^autom4te.cache.* CVS/.* .*/$ .cvsignore$ .*tar.bz2$ .*tar.gz$ .*\.o$ .*\.lo$ .*\.Plo$ .*\.la$ .*\.pc$ stamp-h.$ ^libtool$ .*~$"
59 # handle grep escape madness
60 escaped_blacklist
=$
(for f
in $blacklist; do echo -n '\('$f'\)\|'; done)
61 escaped_blacklist
=${escaped_blacklist%%\\|}
63 module_files
=module-files-$$.txt
64 tar_files
=tar-files-$$.txt
66 find -L $dir -type f |
sed -e "s,^$dir/,," |
grep -v $escaped_blacklist |
sort > $module_files
68 tar tf
$tarball | cut
-d / -f 2- |
grep -v $escaped_blacklist |
sort |
tail +2 > $tar_files
71 echo === diffs to module files
: ===
74 diff -u $module_files $tar_files
76 rm $module_files $tar_files