aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-06-13build: distribute new test script, filefrag-extent-comparefiemap-copyJim Meyering1-0/+1
* tests/Makefile.am (EXTRA_DIST): Add filefrag-extent-compare.
2010-06-13build: distribute new file, fiemap.hJim Meyering1-0/+1
* src/Makefile.am (noinst_HEADERS): Add fiemap.h.
2010-06-11copy.c: add FIEMAP_FLAG_SYNC to fiemap ioctlJie Liu1-0/+1
* src/copy.c (fiemap_copy): Force kernel to sync the source file before mapping.
2010-06-11tests: accommodate varying filefrag -v "flags" outputJim Meyering1-1/+2
* tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output
2010-06-11fiemap.h: include <stdint.h>, not <linux/types.h>Jim Meyering1-1/+1
* src/fiemap.h: Include stdint.h, not linux/types.h, now that this file uses only portable type names.
2010-06-11copy.c: ensure proper alignment of fiemap bufferPaul Eggert1-7/+8
* src/copy.c (fiemap_copy): Ensure that our fiemap buffer is large enough and well-aligned. Replace "0LL" with equivalent "0" as 3rd argument to lseek.
2010-06-11copy.c: adjust comments, tweak semanticsJim Meyering1-26/+36
* src/copy.c (fiemap_copy): Rename from fiemap_copy_ok. Add/improve comments. Remove local, "fail". (fiemap_copy): Do not require caller to set "normal_copy_required" before calling fiemap_copy. Report ioctl failure if it's the 2nd or subsequent call.
2010-06-11tests: improve fiemap test to work with 4 FS types; fall back on ext4Jim Meyering2-11/+95
* tests/cp/sparse-fiemap: Improve. * tests/filefrag-extent-compare: New file.
2010-06-11tests: relax the root-tests cross-checkJim Meyering1-1/+1
* cfg.mk (sc_root_tests): Allow spaces before "require_root_", now that tests/cp/sparse-fiemap has a conditional use.
2010-06-11tests: test fiemap-enabled cp more thoroughlyJim Meyering1-29/+32
* tests/cp/sparse-fiemap: More tests.
2010-06-11tests: require root only if current partition is neither btrfs nor xfsJim Meyering1-22/+27
* tests/cp/sparse-fiemap: Don't require root access if current partition is btrfs or xfs. Use init.sh, not test-lib.sh.
2010-06-11tests: exercise more of the new FIEMAP copying codeJim Meyering1-0/+38
* tests/cp/sparse-fiemap: Ensure that a file with many extents (more than fit in copy.c's internal 4KiB buffer) is copied properly.
2010-06-11tests: sparse-fiemap: factor out some set-upJim Meyering1-4/+4
* tests/cp/sparse-fiemap: Cd into test directory sooner.
2010-06-11tests: add a new test for FIEMAP-copyJie Liu2-0/+57
* tests/cp/sparse-fiemap: Add a new test for FIEMAP-copy against a loopbacked ext4 partition. * tests/Makefile.am (sparse-fiemap): Reference the new test.
2010-06-11cp: Add FIEMAP support for efficient sparse file copyJie Liu2-0/+261
* src/fiemap.h: Add fiemap.h for fiemap ioctl(2) support. Copied from linux's include/linux/fiemap.h, with minor formatting changes. * src/copy.c (copy_reg): Now, when `cp' invoked with --sparse=[WHEN] option, we will try to do FIEMAP-copy if the underlaying file system support it, fall back to a normal copy if it fails.
2010-06-11build: update gnulib submodule to latestJim Meyering1-0/+0
2010-06-11build: don't let a large sparse temporary file cause "make dist" to failJim Meyering1-0/+11
* bootstrap.conf (bootstrap_epilogue): Replace the offending grep command from po/Makefile.in.in's $(DOMAIN).pot-update rule.
2010-06-10ls: avoid just-introduced buffer overrunJim Meyering1-1/+1
* src/ls.c (gobble_file): Revert part of my preceding change, to avoid clobbering stack.
2010-06-08maint: adjust INT_BUFSIZE_BOUND usage for maintainabilityJim Meyering3-7/+7
* src/tail.c (xlseek): Give INT_BUFSIZE_BOUND a variable name, not a type name. * src/ls.c (gobble_file, format_user_or_group_width): Likewise. * src/head.c (elide_tail_bytes_pipe): Likewise. (elide_tail_lines_seekable, main): Likewise. [This change is not complete -- there are doubtless other uses that can be updated in the same way.]
2010-06-08sort: avoid unnecessary use of sprintfJim Meyering1-12/+13
sprintf is relatively heavy-weight. * src/sort.c (key_warnings): Use umaxtostr and stpcpy rather than sprintf. Also, replace each INT_BUFSIZE_BOUND "type_name" argument with the equivalent variable name. More maintainable that way.
2010-06-08dirname: tweak summary wordingEric Blake3-6/+11
* doc/coreutils.texi (dirname invocation): Reword to be more precise. * src/dirname.c (usage): Likewise. * THANKS: Update. Reported by Filipus Klutiero, bug 6175.
2010-06-02doc: mention the new coreutils@ mailing listsJim Meyering1-0/+3
* README-package-renamed-to-coreutils: Mention the new mailing list and a mirror.
2010-06-02touch: remove support for --file=REF_FILE optionJim Meyering3-7/+7
* src/touch.c (main): Remove support for the deprecated, long-named --file option, which is an alternate name for --reference (-r). That option was undocumented with the arrival of --reference, in the 1995-10-29 commit, 8b92864e1d. Since the 2009-02-09 commit, ed85df444a, use of --file has elicited a warning. Not only was this code due for removal, but the long-name-use-detecting code was buggy in that it would use a stale or uninitialized "long_idx", as reported by Robin H. Johnson in http://bugs.gentoo.org/322421. * NEWS (Changes in behavior): Mention it.
2010-05-31maint: make spacing around "=" consistent, even in IF_LINTJim Meyering17-26/+26
E.g., - size_t desired_width IF_LINT (= 0); + size_t desired_width IF_LINT ( = 0); Use this command: g grep -l IF_LINT | grep '\.[ch]$' \ | xargs perl -pi -e 's/(IF_LINT \()= /$1 = /'
2010-05-31maint: replace each "for (;;)" with "while (true)"Jim Meyering25-51/+51
Run this command: git ls-files | grep '\.[ch]$' \ | xargs perl -pi -e 's/for \(;;\)/while (true)/g' ...except for randint.c, which does not include stdbool.h. In that case, use "while (1)". * gl/lib/randint.c (randint_genmax): Use "while (1)" for infloops. * src/cat.c (simple_cat, cat): Use "while (true)" for infloops. * gl/lib/randread.c (readsource, readisaac): Likewise. * src/copy.c (copy_reg): Likewise. * src/csplit.c (record_line_starts, process_regexp): Likewise. * src/cut.c (set_fields): Likewise. * src/dd.c (iread, parse_symbols): Likewise. * src/df.c (find_mount_point, main): Likewise. * src/du.c (main): Likewise. * src/expand.c (expand): Likewise. * src/factor.c (factor_using_division, do_stdin): Likewise. * src/fmt.c (get_space): Likewise. * src/ls.c (decode_switches): Likewise. * src/od.c (main): Likewise. * src/pr.c (main, read_line): Likewise. * src/shred.c (dopass, genpattern): Likewise. * src/sort.c (initbuf, fillbuf, getmonth, keycompare): Likewise. * src/split.c (bytes_split, lines_split): Likewise. * src/tac.c (tac_seekable): Likewise. * src/test.c (and, or): Likewise. * src/tr.c (squeeze_filter, main): Likewise. * src/tsort.c (search_item): Likewise. * src/unexpand.c (unexpand): Likewise. * src/uniq.c (main): Likewise. * src/yes.c (main): Likewise.
2010-05-31maint: correct indentation of case_GETOPT_* macro usesJim Meyering2-4/+4
* src/base64.c (main): Correct indentation of syntactically questionable case_GETOPT_HELP_CHAR and case_GETOPT_VERSION_CHAR macros. * src/who.c (main): Likewise.
2010-05-31stat: use gnulib's alignof moduleJim Meyering2-4/+4
* src/stat.c (alignof): Remove definition. Instead, include "alignof.h", and sort the #include directives. And get its definition from the gnulib module by that name: * bootstrap.conf (gnulib_modules): Add alignof.
2010-05-31tests: remove unnecessary single quotes in perl hash use: ->{'SYM'}Jim Meyering7-11/+16
Run this command: git grep -l "limits->{'" \ | xargs perl -pi -e "s/limits->{'(.*?)'}/limits->{\$1}/g" * cfg.mk (sc_prohibit_perl_hash_quotes): New rule to match. * tests/misc/join: Remove quotes. * tests/misc/sort: Likewise. * tests/misc/sort-merge: Likewise. * tests/misc/test: Likewise. * tests/misc/unexpand: Likewise. * tests/misc/uniq: Likewise.
2010-05-29truncate: improve handling of non regular filesPádraig Brady4-45/+27
Previously we copied `dd` and suppressed error messages when truncating neither regular files or shared mem objects. This was valid for `dd`, as truncation is ancillary to copying it may also do, but for `truncate` we should display all errors. Also we used the st_size from non regular files which is undefined, so we display an error when the user tries this. * src/truncate (do_truncate): Error when referencing the size of non regular files or non shared memory objects. Display all errors returned by ftruncate(). (main): Error when referencing the size of non regular files or non shared memory objects. Don't suppress error messages for any file types that can't be opened for writing. * tests/misc/truncate-dir-fail: Check that referencing the size of a directory is not supported. * tests/misc/truncate-fifo: Ensure the test doesn't hang by using the `timeout` command. Don't test the return from running ftruncate on the fifo as it's system dependent as to whether this fails or not. NEWS: Mention the change in behavior. Reported by Jim Meyering.
2010-05-28truncate: support sizes relative to an existing filePádraig Brady4-17/+36
* doc/coreutils.texi (truncate invocation): Mention that --reference bases the --size rather than just setting it. * src/truncate.c (usage): Likewise. Also remove the clause describing --size and --reference as being mutually exclusive. (do_truncate): Add an extra parameter to hold the size of a referenced file, and use it if positive. (main): Pass the size of a referenced file to do_truncate(). * tests/misc/truncate-parameters: Adjust for the new combinations. * NEWS: Mention the change Suggested by Richard W.M. Jones
2010-05-26tests: update help-version to work with parted, tooJim Meyering1-0/+3
* tests/misc/help-version: Add init code for GNU Parted.
2010-05-25maint: don't emit an extra newline in each of two diagnosticsJim Meyering2-2/+2
* src/shuf.c (main): Remove a stray newline in a diagnostic. * src/od.c (main): Likewise. Detected via these: git grep -A1 'error *(.*,$' | grep -C1 '\\n"[,)]' git grep 'error *(.*;$' | grep '\\n"[,)]'
2010-05-25maint: remove unneeded double quotes on RHS of shell assignmentsJim Meyering3-6/+6
Run this command: git grep -l 'LC_[A-Z]*="' \ | xargs perl -pi -e 's/(LC_[A-Z]*)="(.*?)"/$1=$2/' * src/Makefile.am: Write LC_ALL=$$locale, not LC_ALL="$$locale". * src/date.c (main): Similar, in a comment. * tests/misc/sort-month: Write LC_ALL=$LOC, not LC_ALL="$LOC".
2010-05-24maint: remove a redundant sort parameter from a testPádraig Brady1-1/+1
* tests/misc/sort-month: Remove the -b option which is redundant and ignored.
2010-05-24sort: adjust the leading blanks --debug warningPádraig Brady2-6/+9
* src/sort.c (key_warnings): Always warn about significant leading blanks when character offsets are specified, unless they key is possibly a line offset, i.e. of the form -k1.x,1.y. Also suppress this warning if the user could be sorting right aligned indexes.
2010-05-23maint: make copyright comment consistent with all othersJim Meyering1-2/+2
* tests/misc/mktemp: Change punctuation to make copyright paragraph consistent with all of the others.
2010-05-21tests: fix cp-a-selinux to skip cleanly upon mkfs failureJim Meyering1-3/+2
* tests/cp/cp-a-selinux: Initialize skip, to avoid a syntax error in subsequent "test". Remove redirect-to-/dev/null, now that output is always to a log file.
2010-05-19du: recognize -d N as equivalent to --max-depth=NJon Ringuette4-8/+19
* NEWS (New features): Mention it. * src/du.c (DEBUG_OPT): Remove. Use long-named ---debug instead. Commented out. (MAX_DEPTH_OPTION): Remove. Use 'd' instead. (main): Insert literal "d:"; remove DEBUG_OPT. * doc/coreutils.texi (du invocation): Add -d to indices. * tests/du/max-depth: Exercise -d, too.
2010-05-19tests: exercise du's --max-depth optionJim Meyering2-0/+32
* tests/Makefile.am (TESTS): Add du/max-depth. * tests/du/max-depth: New file.
2010-05-18tests: fix sort-debug-keys when fr_FR.utf8 not availablePádraig Brady1-1/+2
* tests/misc/sort-debug-keys: Correctly check for the absence of the French UTF8 locale.
2010-05-17maint: fix the fs-magic-compare ruleJim Meyering1-1/+1
* src/Makefile.am (fs-def): Sort definitions. This is required by fs-magic-compare's use of join.
2010-05-17tests: update init.sh from gnulibJim Meyering1-14/+31
* tests/init.sh: Update from gnulib.
2010-05-17build: avoid a new -Wformat-induced warningJim Meyering1-1/+1
* src/sort.c (mark_key): Add a cast-to-int of a printf field width, to placate -Wformat.
2010-05-16doc: fix sort info about version sort skipping blanksPádraig Brady1-1/+1
* doc/coreutils.text (sort invocation): leading blanks are significant for 'V'.
2010-05-16sort: --debug: output data independent warnings and infoPádraig Brady5-55/+283
* src/sort.c (usage): Mention --debug can output warnings to stderr. Also split the translatable string to aid translation. (default_key_compare): A new function refactored from main(), and now also called from the new key_warnings() function. (key_to_opts): A new function refactored from incompatible_options(), and now also called from the new key_warnings() function. (key_numeric): A new function refactored to test if key is numeric. (key_warnings): A new function to output warnings to stderr, about questionable use of various options. Currently it warns about zero length keys and ineffective global options. (incompatible_options): Refactor out key_to_opts() (main): Use key_init() to initialize gkey. Refactor out default_key_compare(). Call key_warnings() in debug mode. * doc/coreutils.texi (sort invocation): Mention that warnings are output by --debug. * tests/misc/sort-debug-warn: A new test for debug warnings. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature
2010-05-12tests: fix sort-debug-keys when fr_FR.utf8 not availablePádraig Brady1-4/+3
* tests/misc/sort-debug-keys: Don't verify (or even run) the fr_FR tests when that locale is not available on the system.
2010-05-12sort: add a --debug option to highlight key extentsPádraig Brady5-60/+557
* src/sort (usage): Add description for --debug. (write_bytes): Pass a line structure so it can subsequently be passed to compare to highlight the keys when in debug mode. Also transform TAB and NUL characters written to stdout so that the highlighting in debug mode aligns correctly. (human_numcompare): Pass an "endptr" so we can record the extent of the number matched. (general_numcompare): Likewise. (find_unit_order): Likewise. (getmonth): Likewise. (numcompare): Likewise. Note we reuse find_unit_order() for this, which is a good enough approximation, and means we don't need to change the strnumcmp() interface. (check_mixed_SI_IEC): Return whether iec_present, so that can be used to set the "endptr" in find_unit_order. Also make the key parameter optional, which will be the case from numcompare(). (count_tabs): A new function to determine how much to adjust the mbswidth() values by (TABs don't have a width). (mark_key): A new function to output the key highlighting to stdout. (debug_key): A new function to determine the offset and width of the key highlighting. (key_compare): Pass the show_debug parameter so the key highlighting is only displayed when explicitly called. For each key type, set the length (lena) and whether leading blanks are auto skipped (skipb) which are then used by debug_key() to highlight the portion of the key used in the comparison. (compare): Pass the show_debug parameter so the key highlighting is only displayed when explicitly called. Call debug_key() to highlight the last resort comparison. (check): Output highlighting for disorder line to stdout. (main): Process the --debug option and make it mutually exlusive with the -o option as I don't see it useful there, even potentially harmful if someone left a --debug in by mistake when updating a file. Also restricting debug output to stdout, simplifies the logic for dealing with temporary files. * doc/coreutils.texi (sort invocation): Describe the --debug option, and reference it from the --key description. * tests/misc/sort-debug-keys: A new test for highlighting keys. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature.
2010-05-11build: record the gettext-0.18 requirement also in configure.acJim Meyering1-1/+1
* configure.ac: Require gettext-0.18 here, too.
2010-05-11build: update gnulib submodule to latestJim Meyering2-1/+1
* tests/init.sh: Update from gnulib, to fix typo.
2010-05-10build: record that when building from git, gettext-0.18 is requiredJim Meyering1-1/+1
* bootstrap.conf (buildreq): Require gettext-0.18.