chiark / gitweb /
test suite: Always pass LC_COLLATE=C to sort(1).
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Jul 2018 23:15:44 +0000 (00:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 4 Jul 2018 23:15:48 +0000 (00:15 +0100)
Specifically, by replacing every invocation of sort with the new
function t-sort.  The one case where we already took care of this, we
change LC_ALL to LC_COLLATE, which should be sufficient.

Closes:#903006.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
tests/lib
tests/lib-core
tests/lib-gdr
tests/lib-import-chk
tests/tartree-edit
tests/tests/checkout
tests/tests/import-native
tests/tests/manpages-format

index dcff9e6d17a4fea7004ca61c1ab7f80c30835128..4912f019b71c8d2fce214d36315a071b6b710412 100644 (file)
@@ -7,6 +7,7 @@ dgit (5.7~) unstable; urgency=medium
   * dgit(7): Mention git-debrebase and gbp pq alongside git-dpm,
     in the comment about handling patch stacks.
   * dgit update-vcs-git: Honour --package properly.
+  * test suite: Always pass LC_COLLATE=C to sort(1).  Closes:#903006.
 
  --
 
index bad47c90de92c9549a300b8e2aa23e04cf91a476..4ef275ca1641f62804675c91ab1cf516b66d5692 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -153,7 +153,7 @@ t-reporefs () {
         exec >"$outputfile"
         if test -d $whichrepo; then
                cd $whichrepo
-               git show-ref |sort
+               git show-ref |t-sort
        fi)
 }
 
index e2b6c0623d6b423301ed7eee59f57ac80bb00d9b..724c8acafbf3c21600f906c30b54fc58b5cc7a35 100644 (file)
@@ -40,3 +40,7 @@ t-filter-out-git-hyphen-dir () {
        path="${path%:}"
        PATH="$path"
 }
+
+t-sort () {
+       LC_COLLATE=C sort "$@"
+}
index 7b4f0858afece955e7ce5a969001e933ee0a9b21..22ea6d1fa88bab61758b410d47dcd3bf2951652b 100644 (file)
@@ -141,7 +141,7 @@ t-gdr-good () {
                test $cnparents = $enparents
 
                local cndparents=`
-       for f in $parents; do echo $f; done | sort -u | wc -w
+       for f in $parents; do echo $f; done | t-sort -u | wc -w
                                `
                test $cndparents = $cnparents
 
index 88984c1b625ebf61425aecfb882f939f1eab2fe0..d6633f96316057f9f2fe96792e493ff850ea91e0 100644 (file)
@@ -1,11 +1,11 @@
 
 t-import-chk-authorship () {
        perl -ne 'print $1,"\n" if m/^ -- (\S.*\>)  /' debian/changelog \
-               | sort -u \
+               | t-sort -u \
                > $tmp/authorship.changelog
        ${import_chk_changelog_massage:-:} $tmp/authorship.changelog
        git log --pretty=format:'%an <%ae>%n%cn <%ce>' \
-               | sort -u \
+               | t-sort -u \
                > $tmp/authorship.commits
        diff $tmp/authorship.{changelog,commits}
 }
@@ -63,7 +63,7 @@ t-import-chk2() {
        t-ref-same refs/heads/first-2nd-import
 
        for orig in ../${p}_${v%-*}.orig*.tar.*; do
-               tar -atf $orig | LC_ALL=C sort >../files.o
+               tar -atf $orig | t-sort >../files.o
                pfx=$(perl <../files.o -ne '
                        while (<>) {
                                m#^([^/]+/)# or exit 0;
@@ -87,7 +87,7 @@ t-import-chk2() {
                        t-ref-same-val "$orig $start" "$imp"
                done
                git ls-tree -r --name-only "$t_ref_val:" \
-                       | sort >../files.g
+                       | t-sort >../files.g
                diff ../files.{o,g}
        done
        cd ..
index 40bd6e9620974f376a4cbcd57c9aaec782df7964..78f0e4f65ec2c4470a04309055e6008c53f5e09d 100755 (executable)
@@ -17,7 +17,7 @@ gitfetchdiff_list () {
        git for-each-ref --format '%(refname) %(objectname)' \
                refs/remotes/"$1" \
        | sed 's/^refs\/remotes\/[^\/]*\///' \
-       | sort >"$play/$2"
+       | t-sort >"$play/$2"
 }
 
 gitfetchdiff () {
index 4b205f3d89ed152176c1caf448998ebdcfefed1b..bc3d6ef468328d640cbb3842ae19410e071af2a2 100755 (executable)
@@ -39,7 +39,7 @@ dgit checkout unstable
 END
 diff -u ../reflog.{expect,got}
 
-git for-each-ref --format='%(refname)' refs/heads | sort >../refs.got
+git for-each-ref --format='%(refname)' refs/heads | t-sort >../refs.got
 cat >../refs.expect <<END
 refs/heads/dgit/sid
 refs/heads/dgit/stable
index 1e093437049b3c3c3ee57baed33188706c8c1815..0766841b9e314650b16ab89782682638b1bd2599 100755 (executable)
@@ -8,7 +8,7 @@ t-tstunt-parsechangelog
 mkdir $tmp/aside
 
 versions=""
-for f in $(find $tmp/mirror -name \*.dsc | sort); do
+for f in $(find $tmp/mirror -name \*.dsc | t-sort); do
        perl -i -pe '
                $_="" if m/^-----BEGIN PGP SIGNED/..!m/\S/;
                $_="" if m/^-----BEGIN PGP SIGNATURE/..0;
index 3f3362b6ea8e3dd429593b3ca0596a02f0a482d8..7ba2f9df3f1ae11703d9564991b0108d5dd4187a 100755 (executable)
@@ -7,7 +7,7 @@ t-dependencies man-db make groff git-debrebase
 
 cd $root
 
-printenv |grep MAKE ||: |sort
+printenv |grep MAKE ||: |t-sort
 manpages=$(MAKEFLAGS= MAKELEVEL= make list-manpages)
 
 export MANWIDTH=80