summaryrefslogtreecommitdiff
path: root/tests/du/inodes.sh
AgeCommit message (Collapse)Author
2013-07-29tests: fix another test failure in test/du/inodes.shBernhard Voelker
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/5584121 du(1) uses the first file object of the two test files linked to the same inode, 'd/f' and 'd/h', whatever the system returns first. Use 'd/f' in both the expected and the actual output. * test/du/inodes.sh: Change the expected output as described above when returning the --all directory entries (without -l). Also replace the name of the hardlink 'd/h' by 'd/f' in the actual output.
2013-07-28maint: cleanup compare calls in test/du/inodes.shBernhard Voelker
* test/du/inodes.sh: In the cases where compare() fails, that function would show the unified diff automatically. Therefore, remove the excess "cat out". In the cases where expecting an empty file, use compare() again rather than the simpler "test -s" because possible error reports will then include the file's content for the same reason as above.
2013-07-28tests: fix intermittent failure in test/du/inodes.shPádraig Brady
Prompted by the continuous integration build failure at: http://hydra.nixos.org/build/5582213 * test/du/inodes.sh: Due to undefined order in returned directory entries, the expected output might not match, so sort both expected and actual output when returning --all directory entries. Also use a simpler test for ensuring no errors are output.
2013-07-27du: add --inodes optionBernhard Voelker
This new option can be used to find directories with a huge amount of files. The GNU find utility has the printf format "%h" which prints the number of entries in a directory, but this is non-cumulative and doesn't handle hard links. * src/du.c (struct duinfo): Add new member for counting inodes. (duinfo_init): Initialize inodes member with Zero. (duinfo_set): Set inodes counter to 1. (duinfo_add): Sum up the 2 given inodes counters. (opt_inodes): Add new boolean flag to remember if the --inodes option has been specified. (INODES_OPTION): Add new enum value to be used ... (long_options): ... here. (usage): Add description of the new option. (print_size): Pass inodes counter or size to print_only_size, depending on the inodes mode. (process_file): Adapt threshold handling: with --inodes, print or elide the entries according to the struct member inodes. (main): Add a case for accepting the new INODES_OPTION. Print a warning diagnostic when --inodes is used together with the option --apparent-size or -b. Reset the output_block_size to 1 ... and thus ignoring the options -m and -k. * tests/du/inodes.sh: Add a new test. * tests/local.mk (all_tests): Mention it. * doc/coreutils.texi (du invocation): Document the new option. * NEWS: Mention the new option.