summaryrefslogtreecommitdiff
path: root/tests/misc/sort-version
AgeCommit message (Collapse)Author
2011-01-01maint: update all copyright year number rangesJim Meyering
Run "make update-copyright".
2010-11-17tests: substitute the single-program $VERBOSE/--version usesJim Meyering
Automatically make all of the changes like this: -test "$VERBOSE" = yes && chgrp --version +print_ver_ chgrp git grep -l 'VERBOSE.*--version'|xargs perl -pi -e \ 's/test "\$VERBOSE" = yes && (\w+) --version/print_ver_ $1/'
2010-11-17tests: convert first batch of tests from test-lib.sh to init.shJim Meyering
Initially, I did this, git grep -l srcdir/test-lib.sh|xargs perl -p0i -e '~180-byte script' but that line would have been much longer than the maximum permitted by coreutils' commit hook, and wasn't readable besides, so here's a more readable version: lhs=$(printf '%s\\n' \ 'if test "$VERBOSE" = yes; then' \ ' set -x' \ ' touch --version' \ 'fi' \ '' \ '. $srcdir/test-lib.sh' \ | sed 's/\$/\\\$/g;s/touch/(\\w+)/') rhs=$(printf '%s\\n' \ '. "${srcdir=.}/init.sh"; path_prepend_ ../src' \ 'test "$VERBOSE" = yes && FIXME --version' \ | sed 's/\$/\\\$/g;s/FIXME/\$1/') git grep -l srcdir/test-lib.sh|xargs perl -p0i -e "s,$lhs,$rhs,"
2010-01-13tests: don't silently skip the sort-version testsJim Meyering
* tests/misc/sort-version: Don't use <<- and indented here-doc contents. s/<<-/<</ and unindent the here-document contents. Otherwise, bash would ignore the indented delimiter and use EOF, thus silently skipping this test. OpenBSD5.4's shell reported the failure: $ printf 'cat<<-x\n foo\n x\n'|sh sh: <stdin>[4]: here document `x' unclosed [Exit 1] by contrast, bash warns but still exits successfully: $ printf 'cat<<-x\n foo\n x\n'|bash && echo you lose bash: line 3: warning: here-document at line 1 delimited by \ end-of-file (wanted `x') foo x you lose
2010-01-01maint: update all FSF copyright year lists to include 2010Jim Meyering
Use this command: git ls-files | grep -v COPYING \ | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \ build-aux/update-copyright
2009-10-30tests: factor 350 fail=0 initializations into test-lib.shJim Meyering
Run this command to remove the factored-out "fail=0" lines. perl -ni -e '/^fail=0$/ or print' $(g grep -l '^fail=0$') * tests/test-lib.sh: Initialize fail=0 here, not in 300+ scripts. * tests/...: nearly all bourne shell scripts Suggested by Eric Blake.
2009-08-25global: convert indentation-TABs to spacesJim Meyering
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
2009-06-23maint: update all Copyright year lists to include 2009Jim Meyering
2008-10-03ls and sort: use filevercmp instead of strverscmpKamil Dudka
* src/ls.c (cmp_version): Use filevercmp instead of strverscmp. * src/sort.c (usage): Remove mna reference to strverscmp(3). (compare_version): Use filevercmp instead of strverscmp. * bootstrap.conf: Add filevercmp to list of gnulib modules. * tests/misc/sort-version: Remove conflicting string and enhance test. * NEWS: Mention the change.
2008-09-10tests: use "Exit $fail", not (exit $fail); exit $failJim Meyering
* tests/test-lib.sh (Exit): New function by Ralf Wildenhues in automake http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=20594c08f63 * tests/**: Convert all uses: This restrictive change converted the vast majority: git grep -l '^(exit \$fail); exit \$fail$' \ | xargs perl -pi -e 's/'^\(exit \$fail\); exit \$fail$/Exit \$fail/' And this did the rest, plus a few undesirable ones, so I manually backed out the changes to ChangeLog-* and build-aux/check.mk: git grep -l -E '\(exit [^)]+\); exit ' \ | xargs perl -pi -e 's/\(exit (.+?)\); exit \1/Exit $1/'
2008-08-15adjustJim Meyering
2008-08-15sort: new option, --sort=version, for version number orderingBruce Korb
* src/sort.c [struct keyfield] (version): New member. (usage): Describe --version-sort. (sort_options): Add 'V'. (long_options): Add "version-sort". (CHECK_TABLE, _ct_, SORT_TABLE, _st_): Define new macros. (check_args, sort_args, sort_types): Use these new macros in declarations. (ARGMATCH_VERIFY): Remove use. No longer needed. (compare_version): New function. (key_compare): Add a case. (check_ordering_compatibility): Handle new type. (main): Likewise. Reformat two expressions for readability. * tests/misc/sort-version: new test file * tests/Makefile.am: add it to the list * doc/coreutils.texi (sort invocation): Document it. * NEWS: Mention the new feature.