diff svn2cl @ 20:627a2524520d

Cleanups, rename svn2cl.xsl to xml2cl.csl.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 20 May 2020 12:42:41 +0300
parents cdd7f7b6d4b0
children 31f6639b7a77
line wrap: on
line diff
--- a/svn2cl	Wed May 20 10:44:27 2020 +0300
+++ b/svn2cl	Wed May 20 12:42:41 2020 +0300
@@ -44,7 +44,7 @@
 CHANGELOG="ChangeLog"
 
 # do command line checking
-prog=`basename $0`
+prog="$(basename $0)"
 while [ -n "$1" ]
 do
   case "$1" in
@@ -77,7 +77,7 @@
       shift
       ;;
     -V|--version)
-      echo "$prog $VERSION";
+      echo "${prog} $VERSION";
       echo "Written by Arthur de Jong."
       echo "Modified by Matti Hamalainen."
       echo "Copyright (C) 2005-2008 Arthur de Jong."
@@ -87,7 +87,7 @@
       exit 0
       ;;
     -h|--help)
-      echo "Usage: $prog [OPTION]..."
+      echo "Usage: ${prog} [OPTION]..."
       echo "Generate a ChangeLog from a checked out subversion repository."
       echo ""
       echo "  --strip-prefix NAME    prefix to strip from all entries, defaults"
@@ -103,8 +103,8 @@
       exit 0
       ;;
     *)
-      echo "$prog: invalid option -- $1"
-      echo "Try \`$prog --help' for more information."
+      echo "${prog}: invalid option -- $1"
+      echo "Try \`${prog} --help' for more information."
       exit 1
       ;;
   esac
@@ -117,13 +117,8 @@
 fi
 
 # find the directory that this script resides in
-prog="$0"
-while test -h "$prog"; do
-  prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"`
-done
-dir=`dirname $prog`
-dir=`cd $dir && pwd`
-XSL="$dir/svn2cl.xsl"
+dir="$(dirname "$(realpath "$0")")"
+XSL="${dir}/xml2cl.xsl"
 
 # redirect stdout to the changelog file if needed
 if test "x$CHANGELOG" != "x-"; then