diff options
Diffstat (limited to 'main/lzo/util')
-rw-r--r-- | main/lzo/util/check.sh | 37 | ||||
-rw-r--r-- | main/lzo/util/checkasm.sh | 53 | ||||
-rw-r--r-- | main/lzo/util/notime.pl | 5 | ||||
-rw-r--r-- | main/lzo/util/overlap.sh | 28 | ||||
-rw-r--r-- | main/lzo/util/shortf.pl | 5 | ||||
-rw-r--r-- | main/lzo/util/table.pl | 5 | ||||
-rw-r--r-- | main/lzo/util/uncompr.pl | 5 |
7 files changed, 80 insertions, 58 deletions
diff --git a/main/lzo/util/check.sh b/main/lzo/util/check.sh index f412803f..9c7790ad 100644 --- a/main/lzo/util/check.sh +++ b/main/lzo/util/check.sh @@ -4,24 +4,32 @@ set -e # # usage: util/check.sh [directory] # -# This script runs lzotest with all algorithms on a complete directory tree. +# This script runs lzotest with all algorithms +# on a complete directory tree. # It is not suitable for accurate timings. # -# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +# Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer # -LZOTEST="lzotest" -test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest" -test -x ./lzotest.exe && LZOTEST="./lzotest.exe" -test -x ./lzotest.out && LZOTEST="./lzotest.out" +if test "X$LZOTEST" = X; then +LZOTEST="./lzotest/lzotest" +for d in ./lzotest .; do + for ext in "" .exe .out; do + if test -f "$d/lzotest$ext" && test -x "$d/lzotest$ext"; then + LZOTEST="$d/lzotest$ext" + break 2 + fi + done +done +fi -dir="${*-.}" +dir="${1-.}" -TMPFILE="/tmp/lzo_$$.tmp" -rm -f $TMPFILE -(find $dir/ -type f -print > $TMPFILE) || true +TMPFILE="/tmp/lzotest_$$.tmp" +rm -f "$TMPFILE" +(find "$dir/." -type f -print | LC_ALL=C sort > "$TMPFILE") || true -## methods=`$LZOTEST -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'` +## methods=`"$LZOTEST" -m | sed -n 's/^ *-m\([0-9]*\).*/\1/p'` ## methods="9721 9722 9723 9724 9725 9726 9727 9728 9729" methods="21 31 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 61 71 81" methods="$methods 111 112 115" @@ -33,11 +41,12 @@ methods="$methods 902 912 942 962 972 982 992" LFLAGS="-q -T -n2 -S" LFLAGS="-q -T -n2" -for i in $methods; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS +for m in $methods; do + cat "$TMPFILE" | "$LZOTEST" "-m$m" -@ $LFLAGS done -rm -f $TMPFILE +rm -f "$TMPFILE" echo "Done." exit 0 +# vim:set ts=4 sw=4 et: diff --git a/main/lzo/util/checkasm.sh b/main/lzo/util/checkasm.sh index 4fee682e..aef5ec00 100644 --- a/main/lzo/util/checkasm.sh +++ b/main/lzo/util/checkasm.sh @@ -8,39 +8,48 @@ set -e # on a complete directory tree. # It is not suitable for accurate timings. # -# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +# Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer # -LZOTEST="lzotest" -test -x ./lzotest/lzotest && LZOTEST="./lzotest/lzotest" -test -x ./lzotest.exe && LZOTEST="./lzotest.exe" -test -x ./lzotest.out && LZOTEST="./lzotest.out" -LFLAGS="-q" +if test "X$LZOTEST" = X; then +LZOTEST="./lzotest/lzotest" +for d in ./lzotest .; do + for ext in "" .exe .out; do + if test -f "$d/lzotest$ext" && test -x "$d/lzotest$ext"; then + LZOTEST="$d/lzotest$ext" + break 2 + fi + done +done +fi -dir="${*-.}" +dir="${1-.}" -TMPFILE="/tmp/lzo_$$.tmp" -rm -f $TMPFILE -(find $dir/ -type f -print > $TMPFILE) || true +TMPFILE="/tmp/lzotest_$$.tmp" +rm -f "$TMPFILE" +(find "$dir/." -type f -print | LC_ALL=C sort > "$TMPFILE") || true + +LFLAGS="-q" -for i in 11; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S +for m in 11; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A -S done -for i in 61; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +for m in 61; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F -S done -for i in 71 81; do - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -A -S - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F - cat $TMPFILE | $LZOTEST -m${i} -@ $LFLAGS -F -S +for m in 71 81; do + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -A -S + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F + cat "$TMPFILE" | "$LZOTEST" -m${m} -@ $LFLAGS -F -S done -rm -f $TMPFILE +rm -f "$TMPFILE" echo "Done." exit 0 +# vim:set ts=4 sw=4 et: diff --git a/main/lzo/util/notime.pl b/main/lzo/util/notime.pl index 5fa7d4d1..a4e92b0a 100644 --- a/main/lzo/util/notime.pl +++ b/main/lzo/util/notime.pl @@ -1,6 +1,5 @@ #! /usr/bin/perl -## -## vi:ts=4 +## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*- ## ##---------------------------------------------------------------------------## ## @@ -10,7 +9,7 @@ ## Description: ## Remove timing values from a table created by table.pl ## -## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +## Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer ## ##---------------------------------------------------------------------------## diff --git a/main/lzo/util/overlap.sh b/main/lzo/util/overlap.sh index 8f3b16b1..2e1ffa4d 100644 --- a/main/lzo/util/overlap.sh +++ b/main/lzo/util/overlap.sh @@ -4,24 +4,32 @@ set -e # # usage: util/overlap.sh [directory] # -# This script runs the overlap example program on a complete directory tree. +# This script runs the overlap example program +# on a complete directory tree. # -# Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +# Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer # -OVERLAP="overlap" -test -x ./examples/overlap && OVERLAP="./examples/overlap" -test -x ./overlap.exe && OVERLAP="./overlap.exe" +OVERLAP="./examples/overlap" +for d in ./examples .; do + for ext in "" .exe .out; do + if test -f "$d/overlap$ext" && test -x "$d/overlap$ext"; then + OVERLAP="$d/overlap$ext" + break 2 + fi + done +done -dir="${*-.}" +dir="${1-.}" TMPFILE="/tmp/lzo_$$.tmp" -rm -f $TMPFILE -(find $dir/ -type f -print0 > $TMPFILE) || true +rm -f "$TMPFILE" +(find "$dir/." -type f -print0 | LC_ALL=C sort -z > "$TMPFILE") || true -cat $TMPFILE | xargs -0 -r $OVERLAP +cat "$TMPFILE" | xargs -0 -r "$OVERLAP" -rm -f $TMPFILE +rm -f "$TMPFILE" echo "Done." exit 0 +# vim:set ts=4 sw=4 et: diff --git a/main/lzo/util/shortf.pl b/main/lzo/util/shortf.pl index 3e447cdd..44a2e839 100644 --- a/main/lzo/util/shortf.pl +++ b/main/lzo/util/shortf.pl @@ -1,6 +1,5 @@ #! /usr/bin/perl -## -## vi:ts=4 +## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*- ## ##---------------------------------------------------------------------------## ## @@ -10,7 +9,7 @@ ## Description: ## Create short files for compression test ## -## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +## Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer ## ##---------------------------------------------------------------------------## diff --git a/main/lzo/util/table.pl b/main/lzo/util/table.pl index 8b352073..abc193ea 100644 --- a/main/lzo/util/table.pl +++ b/main/lzo/util/table.pl @@ -1,6 +1,5 @@ #! /usr/bin/perl -## -## vi:ts=4:et +## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*- ## ##---------------------------------------------------------------------------## ## @@ -10,7 +9,7 @@ ## Description: ## Convert the output of the LZO lzotest program into a nice table. ## -## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +## Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer ## ##---------------------------------------------------------------------------## diff --git a/main/lzo/util/uncompr.pl b/main/lzo/util/uncompr.pl index 54ec9e06..d6fafb02 100644 --- a/main/lzo/util/uncompr.pl +++ b/main/lzo/util/uncompr.pl @@ -1,6 +1,5 @@ #! /usr/bin/perl -## -## vi:ts=4 +## vim:set ts=4 sw=4 et: -*- coding: utf-8 -*- ## ##---------------------------------------------------------------------------## ## @@ -10,7 +9,7 @@ ## Description: ## Create incompressible files for compression test ## -## Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer +## Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer ## ##---------------------------------------------------------------------------## |