Skip to content
rewrite of Debian "cruft" package
Branch: master
Clone or download
Latest commit ac8908b Nov 17, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
debian release Nov 17, 2018
.gitignore gitignore: Nano swap files Mar 10, 2016
LICENSE cp /usr/share/common-licenses/GPL-2 LICENSE Aug 14, 2016
Makefile Enable full hardening Feb 24, 2016
README.md Update README.md Oct 23, 2018
cruft-ng.8 match a single file given as $arg1 Nov 5, 2015
cruft-ng.sh regression test: prefer in-tree pgm if available Jun 17, 2015
cruft.cc typos Aug 14, 2016
dpkg.h split out read_dpkg_* functions Oct 10, 2014
dpkg_exclude.cc add support for dpkg's path-exclude option Nov 28, 2015
dpkg_exclude.h add support for dpkg's path-exclude option Nov 28, 2015
dpkg_lib.cc convert one last url to https Aug 14, 2016
dpkg_popen.cc also consider all intermediate subdirectories under /etc Jan 2, 2018
explain.cc remove more duplicates / tiny speed-up Jan 2, 2018
explain.h split out read_explain() Oct 15, 2014
filters.cc remove more duplicates / tiny speed-up Jan 2, 2018
filters.h dpkg_lib: add starting point URL Oct 18, 2014
mlocate.cc drop our copy of db.h, use the one provided by mlocate instea Nov 17, 2018
mlocate.h trim mlocate.h Oct 15, 2014
shellexp.c run 'deheader' tool May 12, 2015
test_dpkg.cc add new test_dpkg for development Jan 18, 2016
test_excludes.cc add support for dpkg's path-exclude option Nov 28, 2015
test_explain.cc use unsigned int when appropriate Nov 23, 2014
test_filters.cc use unsigned int when appropriate Nov 23, 2014
test_mlocate.cc handle DEBUG info in a consistent way May 11, 2015
usr_merge.cc add support for systems with UsrMerge Jan 17, 2016
usr_merge.h add support for systems with UsrMerge Jan 17, 2016

README.md

cruft-ng, a rewrite of Debian 'cruft' engine

Cruft is built as a main shell scripts that spawn hundreds of helper processes (other shell scripts, perl programs, C programs).

This project attempts to keep all the main functionality in one process; while output remains 100% identical to cruft's one.

Here are some benchmarks.

This is written in C++, but it is mostly pure C + strings + vectors.

cruft-ng needs cruft ruleset:

  • /usr/lib/cruft/explain/ : this is a set of shell/perl scripts, only the most CPU-intensive - dpkg - is ignored and replaced with native C++ code

  • /usr/lib/cruft/filters-unex/ : these are glob-like files, quite like, but not totally the same than in your standard shell. this re-uses cruft' shellexp.c

Some assumption differs:

  • We are not in 1998 anymore, this should not be a problem to keep 32 or 64mb of data in memory; so the intermediary spooling in /var/spool/cruft/ is un-needed; unless it is processed by external tools

  • Debian

  • cruft-ng uses mlocate binary database instead of running 'find' on the whole file system, this way, it can also be setgid mlocate to be able to access the db and be run by any user; while cruft need to be run as root.

  • cruft scan /home with find twice, only to detect files not owned by /home/$user & broken symlinks; cruft-ng never scan /home (cruft also give false positives for files created/deleted between the two 'find' runs)

TODO:

  • command switches are currenlty not implemented

  • cruft-ng doesn't detect broken symlinks at this time; it's a different topic and should be split in a separate tool. (and this really needs 'find' and can't be done with mlocate db).

COPYRIGHT:

This is licensed GPL-2+, as cruft itself. This reuses shellexp.c, explain/* and filters-unex/* from cruft.

1998-2000 Anthony Towns 2005-2011 Marcin Owsiany 2014 Alexandre Detiste

You can’t perform that action at this time.