Package: cruft
Version: 0.9.6-0.4

When cruft is run on a Debian Sarge system with ~4000 packages installed
it generates the following error:

./dpkg: line 3: /usr/bin/sort: Argument list too long

and then reports an extremely large amount of cruft.
 
The problem appears to be in the /usr/lib/cruft/explain/dpkg script
The line:
sort /var/lib/dpkg/info/*.list

will fail for a sufficiently large number of installed packages
due to the unix ARG_MAX limit.

The standard workaround to bypass this limit is to use find and xargs instead.
The output of sort from *.list also has a large number of duplicates
such as ./ and /etc and so forth, so adding a uniq might not be a bad idea 
either.

The following script could be used instead that is not subject to this limit

#!/bin/sh

find /var/lib/dpkg/info -name '*.list' -print0 | xargs -0 cat | sort | uniq



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to