xgrep() { command grep "$@" || : ; }
sort_C() { LC_ALL=C command sort "$@"; }
+sort_stable_k2()
+{
+ awk '{ printf("%08d %s\n", NR, $0) }' | sort_C -k3,3 -k1,1 |
+ awk '{ print $2 " " $3 }'
+}
+
tac() { sed '1!G;h;$!d'; }
# Split $1 into $prefix_:$suffix_
$1
EOF
- # POSIX compat issue: sort -s (stable), but supported in bsd and gnu
- Branchlist=$(xecho "$Branchlist" | sort_C -k2 -s | tac | uniq -s40)
+ Branchlist=$(xecho "$Branchlist" | sort_stable_k2 | tac | uniq -s40)
TmpPack_Encrypted="$Localdir/tmp_pack_ENCRYPTED_.$$"
TmpObjlist="$Localdir/tmp_packrevlist.$$"