[packages/adapter: 443/631] - find adapter.awk

glen glen at pld-linux.org
Mon Sep 12 20:11:35 CEST 2016


commit ebbb01a1880622b9e4cb32ba0caf9bc94b1a4ca1
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Tue Apr 28 21:11:52 2009 +0000

    - find adapter.awk
    
    Changed files:
        adapter.sh -> 1.37

 adapter.sh | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/adapter.sh b/adapter.sh
index 47c0af7..06340ae 100644
--- a/adapter.sh
+++ b/adapter.sh
@@ -18,11 +18,12 @@ rev=${r%% *}
 VERSION="v0.31/$rev"
 VERSIONSTRING="\
 Adapter adapts .spec files for PLD Linux.
-$VERSION (C) 1999-2008 Free Penguins".
+$VERSION (C) 1999-2009 Free Penguins".
 
-self=$(basename "$0")
-adapter=$(dirname "$0")/adapter.awk
-usage="Usage: $self [FLAGS] SPECFILE
+PROGRAM=${0##*/}
+dir=$(d=$0; [ -L "$d" ] && d=$(readlink "$d"); dirname "$d")
+adapter=$dir/adapter.awk
+usage="Usage: $PROGRAM [FLAGS] SPECFILE
 
 -s|--no-sort|--skip-sort
 	skip BuildRequires, Requires sorting
@@ -46,7 +47,7 @@ if [ ! -x /usr/bin/patch ]; then
 	exit 1
 fi
 
-t=$(getopt -o hsomdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$self" -- "$@") || exit $?
+t=$(getopt -o hsomdaV --long help,version,sort,sort-br,no-macros,skip-macros,skip-desc,skip-defattr -n "$PROGRAM" -- "$@") || exit $?
 eval set -- "$t"
 
 while true; do
@@ -79,7 +80,7 @@ while true; do
 		break
 	;;
 	*)
-		echo >&2 "$self: Internal error: [$1] not recognized!"
+		echo >&2 "$PROGRAM: Internal error: \`$1' not recognized!"
 		exit 1
 		;;
 	esac
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/adapter.git/commitdiff/6ca0126d4d0c8c79feb7db10b0a0fade0f3b8885



More information about the pld-cvs-commit mailing list