comparison 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
comparison
equal deleted inserted replaced
19:0accb32904e7 20:627a2524520d
42 GROUPBYDAY="yes" 42 GROUPBYDAY="yes"
43 INCLUDEREV="no" 43 INCLUDEREV="no"
44 CHANGELOG="ChangeLog" 44 CHANGELOG="ChangeLog"
45 45
46 # do command line checking 46 # do command line checking
47 prog=`basename $0` 47 prog="$(basename $0)"
48 while [ -n "$1" ] 48 while [ -n "$1" ]
49 do 49 do
50 case "$1" in 50 case "$1" in
51 --strip-prefix) 51 --strip-prefix)
52 STRIPPREFIX="$2" 52 STRIPPREFIX="$2"
75 --stdout) 75 --stdout)
76 CHANGELOG="-" 76 CHANGELOG="-"
77 shift 77 shift
78 ;; 78 ;;
79 -V|--version) 79 -V|--version)
80 echo "$prog $VERSION"; 80 echo "${prog} $VERSION";
81 echo "Written by Arthur de Jong." 81 echo "Written by Arthur de Jong."
82 echo "Modified by Matti Hamalainen." 82 echo "Modified by Matti Hamalainen."
83 echo "Copyright (C) 2005-2008 Arthur de Jong." 83 echo "Copyright (C) 2005-2008 Arthur de Jong."
84 echo "" 84 echo ""
85 echo "This is free software; see the source for copying conditions. There is NO" 85 echo "This is free software; see the source for copying conditions. There is NO"
86 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 86 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
87 exit 0 87 exit 0
88 ;; 88 ;;
89 -h|--help) 89 -h|--help)
90 echo "Usage: $prog [OPTION]..." 90 echo "Usage: ${prog} [OPTION]..."
91 echo "Generate a ChangeLog from a checked out subversion repository." 91 echo "Generate a ChangeLog from a checked out subversion repository."
92 echo "" 92 echo ""
93 echo " --strip-prefix NAME prefix to strip from all entries, defaults" 93 echo " --strip-prefix NAME prefix to strip from all entries, defaults"
94 echo " to the name of the current directory" 94 echo " to the name of the current directory"
95 echo " --linelen NUM maximum length of an output line" 95 echo " --linelen NUM maximum length of an output line"
101 echo " -h, --help display this help and exit" 101 echo " -h, --help display this help and exit"
102 echo " -V, --version output version information and exit" 102 echo " -V, --version output version information and exit"
103 exit 0 103 exit 0
104 ;; 104 ;;
105 *) 105 *)
106 echo "$prog: invalid option -- $1" 106 echo "${prog}: invalid option -- $1"
107 echo "Try \`$prog --help' for more information." 107 echo "Try \`${prog} --help' for more information."
108 exit 1 108 exit 1
109 ;; 109 ;;
110 esac 110 esac
111 done 111 done
112 112
115 echo "No Subversion repository found from this directory." 115 echo "No Subversion repository found from this directory."
116 exit 2 116 exit 2
117 fi 117 fi
118 118
119 # find the directory that this script resides in 119 # find the directory that this script resides in
120 prog="$0" 120 dir="$(dirname "$(realpath "$0")")"
121 while test -h "$prog"; do 121 XSL="${dir}/xml2cl.xsl"
122 prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"`
123 done
124 dir=`dirname $prog`
125 dir=`cd $dir && pwd`
126 XSL="$dir/svn2cl.xsl"
127 122
128 # redirect stdout to the changelog file if needed 123 # redirect stdout to the changelog file if needed
129 if test "x$CHANGELOG" != "x-"; then 124 if test "x$CHANGELOG" != "x-"; then
130 exec > "$CHANGELOG" 125 exec > "$CHANGELOG"
131 fi 126 fi