/[vps]/baselayout-vserver/trunk/src/core/scripts/svn2cl.sh
Gentoo

Contents of /baselayout-vserver/trunk/src/core/scripts/svn2cl.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 127 - (show annotations) (download) (as text)
Fri Dec 2 10:56:06 2005 UTC (12 years, 6 months ago) by phreak
File MIME type: text/x-sh
File size: 4162 byte(s)
Import the latest baselayout changes. Merging revision 1658.
1 #!/bin/sh
2
3 # svn2cl.sh - front end shell script for svn2cl.xsl, calls xsltproc
4 # with the correct parameters
5 #
6 # Copyright (C) 2005 Arthur de Jong.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
16 # distribution.
17 # 3. The name of the author may not be used to endorse or promote
18 # products derived from this software without specific prior
19 # written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29 # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33 # exit on any failures
34 set -e
35
36 # svn2cl version
37 VERSION="0.3"
38
39 # set default parameters
40 STRIPPREFIX=`basename $(pwd)`
41 LINELEN=75
42 GROUPBYDAY="no"
43 INCLUDEREV="no"
44 CHANGELOG="ChangeLog"
45
46 # do command line checking
47 prog=`basename $0`
48 while [ -n "$1" ]
49 do
50 case "$1" in
51 --strip-prefix)
52 STRIPPREFIX="$2"
53 shift 2
54 ;;
55 --linelen)
56 LINELEN="$2";
57 shift 2
58 ;;
59 --group-by-day)
60 GROUPBYDAY="yes";
61 shift
62 ;;
63 -r|--include-rev)
64 INCLUDEREV="yes";
65 shift
66 ;;
67 -o|--output)
68 CHANGELOG="$2"
69 shift 2
70 ;;
71 --stdout)
72 CHANGELOG="-"
73 shift
74 ;;
75 -V|--version)
76 echo "$prog $VERSION";
77 echo "Written by Arthur de Jong."
78 echo ""
79 echo "Copyright (C) 2005 Arthur de Jong."
80 echo "This is free software; see the source for copying conditions. There is NO"
81 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
82 exit 0
83 ;;
84 -h|--help)
85 echo "Usage: $prog [OPTION]..."
86 echo "Generate a ChangeLog from a checked out subversion repository."
87 echo ""
88 echo " --strip-prefix NAME prefix to strip from all entries, defaults"
89 echo " to the name of the current directory"
90 echo " --linelen NUM maximum length of an output line"
91 echo " --group-by-day group changelog entries by day"
92 echo " -r, --include-rev include revision numbers"
93 echo " -o, --output FILE output to FILE instead of ChangeLog"
94 echo " -f, --file FILE alias for -o, --output"
95 echo " --stdout output to stdout instead of ChangeLog"
96 echo " -h, --help display this help and exit"
97 echo " -V, --version output version information and exit"
98 exit 0
99 ;;
100 *)
101 echo "$prog: invalid option -- $1"
102 echo "Try \`$prog --help' for more information."
103 exit 1
104 ;;
105 esac
106 done
107
108 # find the directory that this script resides in
109 prog="$0"
110 while [ -h "$prog" ]
111 do
112 prog=`ls -ld "$prog" | sed "s/^.*-> \(.*\)/\1/;/^[^/]/s,^,$(dirname "$prog")/,"`
113 done
114 dir=`dirname $prog`
115 dir=`cd $dir && pwd`
116 XSL="$dir/svn2cl.xsl"
117
118 # redirect stdout to the changelog file if needed
119 if [ "x$CHANGELOG" != "x-" ]
120 then
121 exec > "$CHANGELOG"
122 fi
123
124 # actually run the command we need
125 svn --verbose --xml log | \
126 xsltproc --stringparam strip-prefix "$STRIPPREFIX" \
127 --stringparam linelen $LINELEN \
128 --stringparam groupbyday $GROUPBYDAY \
129 --stringparam include-rev $INCLUDEREV \
130 "$XSL" -

  ViewVC Help
Powered by ViewVC 1.1.20