summaryrefslogtreecommitdiff
path: root/NEWS
AgeCommit message (Collapse)Author
2010-12-22post-release administriviaJim Meyering
* NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
2010-12-22version 8.8Jim Meyering
* NEWS: Record release date.
2010-12-19sort: use at most 8 threads by defaultPádraig Brady
* src/sort.c (main): If --parallel isn't specified, restrict the number of threads to 8 by default. If the --parallel option is specified, then allow any number of threads to be set, independent of the number of processors on the system. * doc/coreutils.texi (sort invocation): Document the changes to determining the number of threads to use. Mention the memory overhead when using multiple threads. * tests/misc/sort-spinlock-abuse: Allow single core systems that support pthreads. * tests/misc/sort-stale-thread-mem: Likewise. * tests/misc/sort-unique-segv: Likewise. * NEWS: Mention the change in behaviour.
2010-12-16sort: do not generate thousands of subprocesses for 16-way mergePaul Eggert
Without this change, tests/misc/sort-compress-hang would consume more than 10,000 process slots on my RHEL 5.5 x86-64 server, making it likely for other applications to fail due to lack of process slots. With this change, the same benchmark causes 'sort' to consume at most 19 process slots. The change also improved wall-clock time by 2% and user+system time by 14% on that benchmark. * NEWS: Document this. * src/sort.c (MAX_PROCS_BEFORE_REAP): Remove. (reap_exited): Renamed from reap_some; this is a more accurate name, since "some" incorrectly implies that it reaps at least one process. All uses changed. (reap_some): New function: it *does* reap at least one process. (pipe_fork): Do not allow more than NMERGE + 2 subprocesses. (mergefps, sort): Omit check for exited processes: no longer needed, and anyway the code consumed too much CPU per line when 2 < nprocs.
2010-12-16sort: fix hang with sort --compressPaul Eggert
* NEWS: Document this. * src/sort.c (UNCOMPRESSED, UNREAPED, REAPED): New constants. (struct tempnode): New member 'state', to hold these constants. The pid member is now undefined if state == UNCOMPRESSED. (struct sortfile): Replace member 'pid' with member 'temp'. (uintptr): Remove. (proctab_hasher, proctab_comparator, register_proc, delete_proc): Proctab entries are now struct tempnode *, not pid_t, to handle the case where multiple tempnode objects correspond to the same pid. This avoids a race condition that can cause a hang. (register_proc): Arg is now struct tempnode *, not pid_t. All callers changed. (delete_proc): Set tempnode state to REAPED. (create_temp_file): No need to set pid member here; it's now done when the pid is known. (maybe_create_temp, create_temp): Remove PPID arg. Return struct tempnode *, not char *. All callers changed. (maybe_create_temp): Set node state to UNCOMPRESSED or UNREAPED. No need to set node->pid to 0. (open_temp): Replace NAME and PID args with a single TEMP arg. All callers changed. Wait only for unreaped children. (zaptemp): Wait for decompressor to finish before removing its temporary-file input. This avoids .nfsXXXX hassles with NFS and fixes a race (leading to a hang) regardless of NFS. (open_input_files): Adjust to new way of dealing with temp files and their subprocesses. * tests/Makefile.am (TESTS): Add misc/sort-compress-hang. * tests/misc/sort-compress-hang: New file.
2010-12-16sort: don't dump core when merging from input twicePaul Eggert
* NEWS: Document this. * src/sort.c (avoid_trashing_input): The previous fix to this function didn't fix all the problems with this code. Replace it with something simpler: just copy the input file. This doesn't change the number of files, so return void instead of the updated file count. Caller changed. * tests/misc/sort-merge-fdlimit: Test for the bug.
2010-12-14sort: document --compress reaper fixesPaul Eggert
* NEWS: Document the --compress reaper fixes installed yesterday.
2010-12-11sort: avoid segfault when using two or more threadsJim Meyering
This change does not fix the actual bug. That was done by commit c9db0ac6, "sort: preallocate merge tree nodes to heap". The fix was to store each "node" structure on the heap, not on the stack. Otherwise, a node from one thread's stack could be used in another thread after the first thread had expired (via pthread_join). This bug was very hard to trigger when using spinlocks, but easier once we began using mutexes. * NEWS (Bug fixes): Mention it. For details, see http://debbugs.gnu.org/7597.
2010-12-11sort: use mutexes, not spinlocks (avoid busy loop on blocked output)Chen Guo
Running a command like this on a multi-core system sort < big-file | less would peg all processors at near 100% utilization. * src/sort.c: (struct merge_node) Change member lock to mutex. All uses changed. * tests/Makefile.am (XFAIL_TESTS): Remove definition, now that this test passes once again. I.e., the sort-spinlock-abuse test no longer fails. * NEWS (Bug reports): Mention this. Reported by DJ Lucas in http://debbugs.gnu.org/7489.
2010-12-03cp: fix bug with fine-grained src to nearby coarse-grained destPaul Eggert
The actual fix is in gnulib's lib/utimecmp.c. * NEWS: Document fix.
2010-12-01sort -u: fix a thread-race pointer corruption bugPaul Eggert
* src/sort.c (write_unique): Save the entire "struct line", not just a pointer to one. Otherwise, with a multi-thread run, sometimes, with some inputs, fillbuf would would win a race and clobber a "saved->text" pointer in one thread just before it was dereferenced in a comparison in another thread. * NEWS (Bug fixes): Mention it.
2010-11-22split: add --number to generate a particular number of filesChen Guo
* src/split.c (usage, long_options, main): New options --number, --unbuffered, --elide-empty-files. (set_suffix_length): New function to auto increase suffix length to handle a specified number of files. (create): New function. Refactored from cwrite() and ofile_open(). (bytes_split): Add max_files argument to support byte chunking. (lines_chunk_split): New function. Split file into chunks of lines. (bytes_chunk_extract): New function. Extract a chunk of file. (of_info): New struct. Used by functions lines_rr and ofile_open to keep track of file descriptors associated with output files. (ofile_open): New function. Shuffle file descriptors when there are more output files than available file descriptors. (lines_rr): New function to distribute lines round-robin to files. (chunk_parse): New function. Parses K/N syntax. * tests/misc/split-bchunk: New test for byte chunking. * tests/misc/split-lchunk: New test for line delimited chunking. * tests/misc/split-rchunk: New test for round-robin chunking. * tests/Makefile.am: Reference new tests. * tests/misc/split-fail: Add failure scenarios for new options. * tests/misc/split-l: Fix a typo. s/ln/split/. * doc/coreutils.texi (split invocation): Document --number. * NEWS: Mention the new feature. * .mailmap: Map new email address for shortlog. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2010-11-18maint: avoid NEWS-related syntax-check failureJim Meyering
* NEWS: Add 2nd blank line to separate latest changes from those of 8.7, to avoid syntax-check failure.
2010-11-18od: fix bugs in displaying floating-point valuesPaul Eggert
* NEWS: Describe patch. * bootstrap.conf (gnulib_modules): Add ftoastr. * src/od.c: Include ftoastr.h, not float.h. (FLT_DIG, DBL_DIG): Remove. No need to verify LDBL_DIG. (FMT_BYTES_ALLOCATED): No need to worry about floating point now, since this format is no longer used for floating point. (PRINT_FIELDS): New macro, with most of the guts of the old PRINT_TYPE. (PRINT_TYPE): Rewrite to use PRINT_FIELDS. (PRINT_FLOATTYPE): New macro. This uses the new functions from ftoastr. (print_float, print_double, print_long_double): Reimplement using PRINT_FLOATTYPE. (decode_one_format): Calculate field widths based on ftoastr-supplied macros. * tests/Makefile.am (TESTS): Add misc/od-float. * tests/misc/od-float: New file.
2010-11-13doc: tweak NEWS and coreutils.texiPaul Eggert
* doc/coreutils.texi (stat invocation): Add sentence-ending period. * NEWS: Correct stat change description: s/floating point //. * cfg.mk (old_NEWS_hash): Update, to match this NEWS change.
2010-11-13post-release administriviaJim Meyering
* NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
2010-11-13version 8.7Jim Meyering
* NEWS: Record release date.
2010-11-13stat: do not provide variable precision time stampsJim Meyering
* src/stat.c: Don't include fstimeprec.c. (out_epoch_sec): Don't call fstimeprec. * NEWS: Update description. * doc/coreutils.texi: Likewise.
2010-11-11csplit: fix a memory leak per input bufferPádraig Brady
* src/csplit.c (free_buffer): Also free the line offsets buffers (remove_line): Also free the containing structure * tests/misc/csplit-heap: A new test to trigger with leaks of this magnitude. * tests/Makefile.am: Reference the new test * NEWS: Mention the fix Reported by David Hofstee
2010-11-10csplit: avoid buffer overrun when writing more than 999 filesJim Meyering
Without this fix, seq 1000 | csplit - /./ '{*}' would write the NUL-terminated file name, xx1000, into a buffer of size 6. * src/csplit.c (main): Use properly sized file name buffer. * NEWS (Bug fixes): Mention it. * tests/misc/csplit-1000: New test to trigger the bug. * tests/Makefile.am (TESTS): Add misc/csplit-1000.
2010-11-06stat: use e.g. %.3X instead of %X.%3:X for sub-second precisionPaul Eggert
* NEWS: Document this. * doc/coreutils.texi (stat invocation): Likewise. * gl/lib/fstimeprec.c, gl/lib/fstimeprec.h, gl/modules/fstimeprec: * gl/modules/fstimeprec-tests, gl/tests/test-fstimeprec.c: New files. * bootstrap.conf (gnulib_modules): Add fstimeprec. * src/stat.c: Include fstimeprec.h. Don't include xstrtol.h. (decimal_point, decimal_point_len): New static vars. (main): Initialize them. (epoch_sec, out_ns): Remove. (out_int, out_uint): Now returns whatever printf returned. (out_minus_zero, out_epoch_secs): New functions. (print_stat): Use out_epoch_sec instead of out_ns and epoch_sec. (print_stat, print_it, usage): Remove the %:X-style formats. * tests/misc/stat-nanoseconds: Set TZ=UTC0 to avoid problems with weird time zones. Use a time stamp near the Epoch so that we don't have to worry about leap seconds. Redo test cases to match new behavior. * tests/touch/60-seconds: Change %Y.%:Y to %.9Y, to adjust to new behavior.
2010-11-04cp: NEWS entry for previous fixEric Blake
Resolves bug#7324 * NEWS: Document the extent of the Solaris crash.
2010-11-03stat: revert %X-%Y-%Z change; use e.g., %:X to print fractional secondsJim Meyering
This reverts part of the recent commit 9069af45, "stat: print timestamps to full resolution", which made %X, %Y, %Z print floating point numbers. We prefer to retain portability of %X, %Y and %Z uses, while still providing access to full-resolution time stamps via modified format strings. Also make the new %W consistent. * src/stat.c: Include "xstrtol.h". (print_it): Accept a new %...:[XYZ] format directive, e.g., %:X, to print the nanoseconds portion of the corresponding time. For example, %3.3:Y prints the zero-padded, truncated, milliseconds part of the time of last modification. (print_it): Update print_func signature to match. (neg_to_zero): New helper function. (epoch_time): Remove function; replace with... (epoch_sec): New function; use timetostr. (out_ns): New function. Use "09" only when no other modifier is specified. (print_statfs): Change type of "m" to unsigned int, now that it must accommodate values larger than 255. (print_stat): Likewise. Map :X to a code of 'X' + 256. Likewise for Y, Z and W. (usage): Update. * tests/touch/60-seconds: Use %Y.%:Y in place of %Y. * tests/misc/stat-nanoseconds: New file. * tests/Makefile.am (TESTS): Add it. * NEWS (Changes in behavior): Mention this. With improvements by Pádraig Brady. Thanks to Andreas Schwab for raising the issue.
2010-10-27cp: make --attributes-only override --reflink completelyPádraig Brady
* doc/coreutils.texi (cp invocation): Change the description slightly so as users might not immediately discount using this option. Mention that --reflink is overridden by the other linking options and --attributes-only, and give an example where this might be useful. * src/copy.c (copy_internal): Bypass the reflink if --attributes-only is specifed. * tests/cp/reflink-perm: Ensure both --reflink modes are overridden by --attributes-only. * NEWS: Mention the change in behavior. Reported by Jim Meyering.
2010-10-25tail: support rechecking currently missing remote dirsPádraig Brady
src/tail.c (main): As an optimization, don't bother checking for stdin or remote files, when ---disable-inotify is specified. To improve the fix in commit 61b77891, set the disable_inotify flag when we fall back to polling, so that we recheck remote files. NEWS: Mention the fix
2010-10-15post-release administriviaJim Meyering
* NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.
2010-10-15version 8.6Jim Meyering
* NEWS: Record release date.
2010-10-12tail: fix checking of currently unavailable directoriesPádraig Brady
* src/tail.c (tail_forever_inotify): Handle the case where tail --follow=name with inotify, is not able to add a watch on a specified directory. This may happen due to inotify resource limits or if the directory is currently missing or inaccessible. In all these cases, revert to polling which will try to reopen the file later. Note inotify returns ENOSPC when it runs out of resources, and instead we report a particular error message, lest users think one of their file systems is full. (main): Document another caveat with using inotify, where we currently don't recheck directories recreated after the initial watch is setup. * tests/tail-2/F-vs-rename: Fix the endless loop triggered by the above issue. * tests/tail-2/inotify-hash-abuse: Likewise. * tests/tail-2/wait: Don't fail in the resource exhaustion case. * tests/tail-2/F-vs-missing: A new test for this failure mode which was until now just triggered on older buggy linux kernels which returned ENOSPC constantly from inotify_add_watch(). * NEWS: Mention the fix.
2010-10-07split: fix reporting of read errorsPádraig Brady
The bug was introduced with commit 23f6d41f, 19-02-2003. * src/split.c (bytes_split, lines_split, line_bytes_split): Correctly check the return from full_read(). * tests/misc/split-fail: Ensure split fails when it can't read its input. * NEWS: Mention the fix.
2010-10-05stat: drop %C support when printing file system detailsEric Blake
* src/stat.c (print_statfs, usage): Drop %C, since it applies to files, not file systems. (out_file_context): Match style of other out_* functions. (print_stat): Update caller. * doc/coreutils.texi (stat invocation): Document %C. * NEWS: Document the change.
2010-10-01stat: print SELinux context when availableEric Blake
* src/stat.c (default_format): Include context when present. * NEWS: Update blurb explaining the replacement for -Z.
2010-10-01stat: optimize and translate default format stringsEric Blake
Yes, this patch intentionally leaks the results of default_format(), since it is called only twice, and since the results are in scope until main() exits. Not worth the extra code to pacify valgrind. * src/stat.c (main): Hoist default format computation out of loop. (do_statfs, do_stat): Move default format generation... (default_format): ...into new function. Allocate the result in pieces, rather than repeating mostly-similar chunks. Allow translation of verbose format. Pass a second format to do_stat, for the one aspect of the default format that is conditional on file type. * NEWS: Document the translation aspect.
2010-10-01stat: print timestamps to full resolutionEric Blake
* src/stat.c (epoch_time): New function. (print_stat): Use it for %[WXYZ]. * NEWS: Document this. * tests/touch/60-seconds: Adjust test to match. * tests/misc/stat-birthtime: Likewise.
2010-10-01stat: support printing birthtimeEric Blake
* src/stat.c (print_stat): New %w and %W formats. (do_stat): Include %w in default format. (usage): Document new specifiers. * doc/coreutils.texi (stat invocation): Likewise. * NEWS: Likewise.
2010-09-30maint: mention the du-exclude--vs--cycle-dir fixJim Meyering
* NEWS (Bug fixes): Mention the du-exclude--vs--cycle-dir fix. Reported by Graham Cobb in http://bugs.debian.org/598438, that bug was fixed by the 2010-07-24 commit, 77428214f, "du: tune, and fix some -L bugs with dangling or cyclic symlinks"
2010-09-29tr: fix various issues with case conversionPádraig Brady
This valid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:]- ' '[:lower:]_' This invalid translation spec aborted: LC_ALL=en_US.iso-8859-1 tr '[:upper:] ' '[:lower:]' This was caused by commit 6efd1046, 05-01-2008, "Avoid tr case-conversion failure in some locales" This misaligned conversion spec was allowed: LC_ALL=C tr 'A-Y[:lower:]' 'a-z[:upper:]' This was caused by commit af5d0c36, 21-10-2007, "tr: do not reject an unmatched [:lower:] or [:upper:] in SET1" This misaligned spec was allowed by extending the class: LC_ALL=C tr '[:upper:] ' '[:lower:]' * src/tr.c (validate_case_classes): A new function to check alignment of case conversion classes. Also it adjusts the length of the sets so that locales with different numbers of upper and lower case characters, don't cause issues. (string2_extend): Disallow extending the case conversion class as in the above example. That is locale dependent and most likely not what the user wants. (validate): Do the simple test for "restricted" char classes earlier, so we don't redundantly do more expensive validation. (main): Remove the case class validation, and simplify. * tests/misc/tr-case-class: A new test to test the various alignment and locale issues, associated with case conversion. * tests/misc/tr: Move case conversion tests to new tr-case-class. * tests/Makefile.am: Reference the new test. * NEWS: Mention the fixes.
2010-09-17rm: remove no-op -d optionEric Blake
* src/rm.c (long_opts, main): Resolve a fixme. * NEWS: Document the change. Based on a report by William Plusnick.
2010-08-28tac: avoid double freeJim Meyering
* src/tac.c (main): Reading a line longer than 16KiB would cause tac to realloc its primary buffer. Then, just before exit, tac would mistakenly free the original (now free'd) buffer. This bug was introduced by commit be6c13e7, "maint: always free a buffer, to avoid even semblance of a leak". * NEWS (Bug fixes): Mention it. * tests/misc/tac (double-free): New test, to exercise this. Reported by Salvo Tomaselli in <http://bugs.debian.org/594666>.
2010-08-27stat: add %m to output the mount point for a fileAaron Burgemeister
* src/find-mount-point.c: A new file refactoring find_mount_point() out from df.c * src/find-mount-point.h: Likewise. * src/df.c: Use the new find-mount-point module. * src/stat.c (print_stat): Handle the new %m format. (find_bind_mount): A new function to return the bind mount for a file if any. (out_mount_mount): Print the bind mount for a file, or else the standard mount point given by the find-mount-point module. (usage): Document the %m format directive. * src/Makefile.am: Reference the refactored find-mount-point.c * po/POTFILES.in: Add find_mount_point.c to the translation list * doc/coreutils.texi (stat invocation): Document %m, and how it may differ from the mount point that df outputs. * test/misc/stat-mount: A new test to correlate mount points output from df and stat. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature * THANKS: Add the author Signed-off-by: Pádraig Brady <P@draigBrady.com>
2010-08-25df: always print the device name for bind mounted filesPádraig Brady
* src/df (show_point): Remove the optimization for comparing the specified path with the device name, as this produces inconsistent results in the presence of bind mounts. For bind mounts, the device name is populated with the bind mount target. * NEWS: Mention the change in behavior.
2010-08-06sort: support all combinations of -d, -f, -i, -R, and -VPaul Eggert
* NEWS: Document this. * src/sort.c (getmonth): Omit LEN arg, as MONTH is now null-terminated. (compare_random): Don't null-terminate keys, as caller now does that. (compare_version): Remove. (debug_key): Null-terminate string for getmonth. (keycompare): Support combining -R with any of -d, -f, -i, -V. Also, support combining -V with any of -d, -i. (check_ordering_compatibility): Allow newly-supported combinations. * tests/misc/sort (02q, 02r, 02s): New tests, for new combinations. (incompat2): Now test -nR, since -fR are now compatible.
2010-08-02sort: revert recent -h changes and use a more-conservative approachPaul Eggert
* NEWS: Document changes to sort -h, which are now minor with respect to the pre-July-30th version. * doc/coreutils.texi (sort invocation): Likewise. The documentation now describes how -h comparison is done rather than being vague with border cases. * src/sort.c (long_double, strtold): Move back to general_numcompare. (LD, compute_human): Remove. (find_unit_order): Remove THOU_SEP parameter, since thousands separators are now allowed by all callers. Revert to previous behavior of sorting by suffix, and returning the order rather than 2 * order + binary, since we no longer care whether binary powers are being used. However, treat all zeros the same, instead of sorting 0M before 0G; this is more consistent with the desired behavior of sorting -1G before -1M. * tests/misc/sort (h1, h3, h6): Adjust to match mostly-reverted behavior. However, check that all zeros sort together. * tests/misc/sort-debug-keys: Omit a "_", since the trailing "i" in "1234Gi" is no longer part of the key.
2010-07-30sort: -h now handles comparisons such as 6000K vs 5M and 5MiB vs 5MBPaul Eggert
* NEWS: Document changes to sort -h. * doc/coreutils.texi (sort invocation): Likewise. * src/sort.c (long_double, strtold): Move to prelude, since they're now used by multiple functions. (LD): New macro. (struct keyfield.iec_present): Remove this member. All uses removed. (check_mixed_SI_IEC): Remove. This code was busted in the presence of multiple threads, as it had a race condition. (find_unit_order): Remove arg KEY; add arg THOU_SEP; arg ENDPTR is now char ** rather than char const **. Return an integer that distinguishes decimal from binary powers. Parse the number consistently with the intersection of strtold and strnumcmp. Set *ENDPTR unconditionally. (compute_human): New static function. (human_numcompare): Remove arg KEY. Remove 'const' from other args. Use strnumcmp if possible, but fall back on floating point if not. (numcompare, general_numcompare): Arg EA is now char ** rather than char const **. (numcompare): Adjust to new find_unit_order signature and behavior. (keycompare): Adjus to new human_numcompare signature. * tests/misc/sort (h1, h3, h4, h6): Adjust to new behavior. * tests/misc/sort-debug-keys: Likewise.
2010-07-25du: add NEWS entry for recent du -L fixesPaul Eggert
2010-07-13maint: reorganize latest NEWSPádraig Brady
* NEWS: Add another blank line before the previous version. (Bug fixes): Move to the start. (Changes in behavior): Add the item about the du mem usage change from the "New features" section.
2010-07-13sort: parallelize internal sortChen Guo
This patch is by Gene Auyeung, Chris Dickens, Chen Guo, and Mike Nichols, based off of a patch by Paul Eggert, Glen Lenker, et. al., with a basic heap implementation based off of the GDSL heap, originally by Nicolas Darnis. The number of sorts done in parallel is limited to the number of available processors by default, or can be further restricted with the --parallel option. On a dual-die, 8 core Intel Xeon, results show sorting with 8 threads is almost 4 times faster than using a single thread. Timings when sorting a 96MB file: THREADS TIME (s) 1 5.10 2 2.87 4 1.75 8 1.31 Single threaded sorting has also been improved, especially for cheaper comparison operations: COMMAND BEFORE (s) AFTER (s) sort 8.822 8.716 sort -g 10.336 10.222 sort -n 3.077 2.961 LANG=C sort 2.169 2.066 * bootstrap.conf: Add heap, pthread. * coreutils.texi (sort): Describe the new --parallel option. * gl/lib/heap.c: New file. Very basic heap implementation. * gl/lib/heap.h: New file. * gl/modules/heap: New file. * src/Makefile.am: Add LIB_PTHREAD. * src/sort.c: Include heap.h, nproc.h, pthread.h. (MAX_MERGE): New macro. (SUBTHREAD_LINES_HEURISTIC, PARALLEL_OPTION): New constants. (MERGE_END, MERGE_ROOT): New constants. (struct merge_node): New struct. (struct merge_node_queue): New struct. (sortlines temp): Remove declaration. (usage, long_options, main): New option, --parallel. (specify_nthreads): New function. (mergelines): New signature, to emphasize the fact that the HI area must be part of the destination. All callers changed. (sequential_sort): New function, renamed from sortlines. Merge in the functionality of sortlines_temp. (compare_nodes): New function. (lock_node, unlock_node): New functions. (queue_destroy): New function. (queue_init): New function. (queue_insert): New function. (queue_pop): New function. (write_unique): New function. (mergelines_node): New function. (check_insert): New function. (update_parent): New function. (merge_loop): New function. (sortlines): Rewrite to support and use parallelism, with a new signature. All callers changed. (struct thread_args): New struct. (sortlines_thread): New function. (sortlines_temp): Remove. (sort): New argument NTHREADS. All uses changed. Output moved to mergelines_node. (main): disable threading if we are sorting at random. * tests/Makefile.am (TESTS): Add misc/sort-benchmark-random. * tests/misc/sort-benchmark-random: New file. Signed-off-by: Pádraig Brady <P@draigBrady.com>
2010-07-04du: use less than half as much memory when tracking hard linksJim Meyering
When processing a hard-linked file, du must keep track of the file's device and inode numbers in order to avoid counting its storage more than once. When du would process many hard linked files -- as are created by some backup tools -- the amount of memory required for the supporting data structure could become prohibitively large. This patch takes advantage of the fact that the amount of information in the numbers of the typical dev,inode pair is far less than even 32 bits, and hence usually fits in the space of a pointer, be it 32 or 64 bits wide. A typical du traversal examines files on no more than a handful of distinct devices, so the device number can be encoded in just a few bits. Similarly, few inode numbers use all of the high bits in an ino_t. Before, we would represent the dev,inode pair using a naive struct, and allocate space for each. Thus, an entry in the hash table consisted of a pointer (to that struct) and a "next" pointer. With this change, we encode the dev,inode information and put those bits in place of the pointer, and thus do away with the need to allocate additional space for each dev,inode pair. * src/du.c: Include "di-set.h". Don't include "hash.h"; it's no longer used. (INITIAL_DI_SET_SIZE): Define. (di_set): New global, to replace "htab". (entry_hash, entry_compare, hash_init): Remove functions. (hash_ins): Use di-set functions, rather than ones from the hash module. (main): Likewise. * bootstrap.conf (gnulib_modules): Add the new di-set module. * NEWS (New features): Mention it.
2010-07-03du: don't miscount duplicate directories or link-count-1 filesPaul Eggert
* NEWS: Mention this. * src/du.c (hash_all): New static var. (process_file): Use it. (main): Set it. * tests/du/hard-link: Add a couple of test cases to help make sure this bug stays squashed. * tests/du/files0-from: Adjust existing tests to reflect change in semantics with duplicate arguments.
2010-07-01cp: add an option to only copy the file attributesPádraig Brady
* src/copy.c (copy_attr): A new function which merges copy_attr_by_fd and copy_attr_by_name. Also display all errors when --attributes-only * src/copy.c (copy_reg): Skip copying the file contents if specified. Refactor the SELinux error handling code a little and display all SELinux errors when only copying attributes. * src/copy.h (struct cp_options): Add a data_copy_required boolean * src/cp.c (main): Default to copying data but don't if specified * src/install.c: Default to copying data * src/mv.c: Likewise tests/cp/reflink-perm: Add a test to check that --attributes-only does not copy data * tests/cp/acl: Likewise. Also refactor to remove redundant acl manipulation * doc/coreutils.texi (cp invocation): Describe the new option * NEWS: Mention the new feature
2010-07-01ls: use the POSIX date style when the locale does not specify onePádraig Brady
Previously we defaulted to "long-iso" format in locales without specific format translations, like the en_* locales for example. This reverts part of commit 6837183d, 08-11-2005, "ls ... acts like --time-style='posix-long-iso' if the locale settings are messed up" * src/ls.c (decode_switches): Only use the ISO format when specified. * NEWS: Mention the change in behavior. Reported by Daniel Qarras at http://bugzilla.redhat.com/525134