[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#2453: rc.local script is never executed



>> belong to some package.  Does anyone know of an easy way to list all
>> files that don't belong to any package?

Here's a makefile that I run (with make -j2) on my system. To use it
yourself, you'll need to:
	1) put in tabs before the indented commands, instead of the
spaces there now; I cut and pasted this via gpm...
	2) Change the DIRS line. If you've only got one partition,
running this with DIRS=/ will suffice; the specific values are the
places where my laptop had symlinks off the root for particular
packages.

The count rule is vaguely interesting, but it's "diffs" that produces
the useful bit: diffs between the list of installed files and the list
that dpkg claims. You may wish to add additional grep -v lines to
allfiles, after running this once, to see things that you "know"
shouldn't be under dpkg. (There's something to be said for having a
way to inform dpkg of these new files, something like dpkg --register,
that perl's h2ph (for example) could run, but it wouldn't help much
for uucp [though it might make sense for log files, in which case
/var/spool could be the only real "exception".])
					_Mark_ <eichin@cygnus.com>
					Cygnus Support, Eastern USA


all: diffs

DIRS=/ /usr/unsupported/ /usr/athena/ /usr/openwin/ /usr/vice/ /usr/cygnus/ /us\r/src/ /usr/cygnus/cns5/

info:
        ln -s /var/lib/dpkg/info

allfiles:
        -find ${DIRS} -xdev -print \
                | grep -v '^/var/lib/dpkg' \
                | grep -v '^/root' \
                | grep -v '^/usr/lib/perl5/i486-linux' \
                | grep -v '^/var/spool/uucp' \
                | grep -v '^/var/run' \
                | grep -v '^/var/log' \
        > allfiles

allfiles.sort: allfiles
        sort -o allfiles.sort -u allfiles

star.list: info
        rm -f star.list star.files
        dpkg --list | awk '/^ii/ { print $$2 }' | while read i; do \
                cat info/$${i}*.list >> star.list; \
                cat info/$${i}*.conffiles >> star.list; \
                echo $${i}.list >> star.files; done

star.list.sort: star.list
        sort -o star.list.sort -u star.list

diffs: star.list.sort allfiles.sort
        diff -ur allfiles.sort star.list.sort > diffs

.PHONY: allfiles star.list

clean:
        rm -f allfiles allfiles.sort star.list star.list.sort star.files

count:
        egrep \^- diffs | grep -v /etc/rc | egrep -v ~$ | grep -v cns5 | grep -\v /var | wc -l


Reply to: