ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/cms-cvs-utils.spec
(Generate patch)

Comparing COMP/CMSDIST/cms-cvs-utils.spec (file contents):
Revision 1.1 by eulisse, Thu Jun 22 15:03:45 2006 UTC vs.
Revision 1.10 by eulisse, Tue Dec 5 11:26:34 2006 UTC

# Line 1 | Line 1
1   ### RPM cms cms-cvs-utils 1.0
2 < ## INITENV ALIAS project source projch.sh
3 < ## INITENV ALIAS cmscvsroot source cmscvsroot.sh
2 > ## INITENV ALIAS_SH project source %i/bin/projch.sh
3 > ## INITENV ALIAS_SH cmscvsroot source %i/bin/cmscvsroot.sh
4 > ## INITENV ALIAS_CSH project source %i/bin/projch.csh
5 > ## INITENV ALIAS_CSH cmscvsroot source %i/bin/cmscvsroot.csh
6 > ## INITENV ALIAS clcommit %i/bin/clcommit.sh
7   Source: none
8  
9   %prep
# Line 26 | Line 29 | fi
29   export VERSIO
30   #CVS STUFF
31   cvsbase=":kserver:cmscvs.cern.ch:/cvs_server/repositories"
32 + case $1 in
33 +    CMSSW )
34 +    cvsbase=":kserver:cmscvs.cern.ch:/cvs_server/repositories"
35 +    ;;
36 +    * )
37 +    cvsbase=":kserver:isscvs.cern.ch/local/reps"
38 +    ;;
39 + esac
40 +    
41   CVSROOT="${cvsbase}/$1"; export CVSROOT
42  
43   #SRT STUFF
# Line 54 | Line 66 | endif
66  
67   #CVS Stuff
68   set cvsbase = ":kserver:cmscvs.cern.ch:/cvs_server/repositories"
69 + if ( $argv[1] != "CMSSW" ) then
70 +    set cvsbase=":kserver:isscvs.cern.ch/local/reps"
71 + endif
72 +
73   setenv CVSROOT "${cvsbase}/$argv[1]"
74  
75   #SRT STUFF
# Line 73 | Line 89 | else
89  
90   #CVS STUFF
91   cvsbase=":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
92 + case $1 in
93 +    CMSSW )
94 +        cvsbase=":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
95 +    ;;
96 +    * )
97 +        cvsbase=":pserver:anonymous@isscvs.cern.ch/local/reps"
98 +    ;;
99 + esac
100 +
101   CVSROOT="${cvsbase}/$1"; export CVSROOT
102  
103   fi
# Line 87 | Line 112 | else
112  
113   #CVS Stuff
114   set cvsbase = ":pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories"
115 + if ( $argv[1] != "CMSSW" ) then
116 +    set cvsbase=":pserver:anonymous@isscvs.cern.ch/local/reps"
117 + endif
118   setenv CVSROOT "${cvsbase}/$argv[1]"
119  
120   endif
121   EOF_CMSCVSROOT_CSH
122  
123 + cat << \EOF_CLCOMMIT > %i/bin/clcommit.sh
124 + #! /bin/sh
125 +
126 + # commit version 0.9.4
127 +
128 + # Copyright (C) 1999, 2000, Free Software Foundation
129 +
130 + # This script is Free Software, and it can be copied, distributed and
131 + # modified as defined in the GNU General Public License.  A copy of
132 + # its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
133 +
134 + # Originally by Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
135 + # Heavily modified by Alexandre Oliva <oliva@dcc.unicamp.br>
136 +
137 + # This scripts eases checking in changes to CVS-maintained projects
138 + # with ChangeLog files.  It will check that there have been no
139 + # conflicting commits in the CVS repository and print which files it
140 + # is going to commit to stderr.  A list of files to compare and to
141 + # check in can be given in the command line.  If it is not given, all
142 + # files in the current directory (and below, unless `-l' is given) are
143 + # considered for check in.
144 +
145 + # The commit message will be extracted from the differences between a
146 + # file named ChangeLog* in the commit list, or named after -C, and the
147 + # one in the repository (unless a message was specified with `-m' or
148 + # `-F').  An empty message is not accepted (but a blank line is).  If
149 + # the message is acceptable, it will be presented for verification
150 + # (and possible edition) using the $PAGER environment variable (or
151 + # `more', if it is not set, or `cat', if the `-f' switch is given).
152 + # If $PAGER exits successfully, the modified files (at that moment)
153 + # are checked in, unless `-n' was specified, in which case nothing is
154 + # checked in.
155 +
156 + # usage: commit [-v] [-h] [-f] [-l] [-n] [-q] [-z N] [-C ChangeLog_file]
157 + #               [-m msg|-F msg_file] [--] [file|dir ...]
158 +
159 + # -f      --fast        don't check (unless *followed* by -n), and just
160 + #         --force       display commit message instead of running $PAGER
161 + # -l      --local       don't descend into subdirectories
162 + # -m msg  --message=msg set commit message
163 + #         --msg=msg     same as -m
164 + # -F file --file=file   read commit message from file
165 + # -C file --changelog=file extract commit message from specified ChangeLog
166 + # -n      --dry-run     don't commit anything
167 + # -q      --quiet       run cvs in quiet mode
168 + # -zN     --compress=N  set compression level (0-9, 0=none, 9=max)
169 + # -v      --version     print version information
170 + # -h,-?   --help        print short or long help message
171 +
172 + name=commit
173 + : ${CVS=cvs}
174 + cvsopt=
175 + updateopt=
176 + commitopt=
177 + dry_run=false
178 + commit=:
179 + update=:
180 + log_file="${TMPDIR-/tmp}/commitlog.$$"
181 +
182 + rm -f "$log_file"
183 + trap 'rm -f "$log_file"; exit 1' 1 2 15
184 +
185 + # this just eases exit handling
186 + main_repeat=":"
187 + while $main_repeat; do
188 +
189 + repeat="test $# -gt 0"
190 + while $repeat; do
191 +    case "$1" in
192 +    -f|--force|--fast)
193 +        update=false
194 +        PAGER=cat
195 +        shift
196 +        ;;
197 +    -l|--local)
198 +        updateopt="$updateopt -l"
199 +        commitopt="$commitopt -l"
200 +        shift
201 +        ;;
202 +    -m|--message|--msg)
203 +        if test $# = 1; then
204 +            echo "$name: missing argument for $1" >&2
205 +            break
206 +        fi
207 +        if test -f "$log_file"; then
208 +            echo "$name: you can have at most one of -m and -F" >&2
209 +            break
210 +        fi
211 +        shift
212 +        echo "$1" > "$log_file"
213 +        shift
214 +        ;;
215 +    -F|--file)
216 +        if test -f "$log_file"; then
217 +            echo "$name: you can have at most one of -m and -F" >&2
218 +            break
219 +        fi
220 +        if test $# = 1; then
221 +            echo "$name: missing argument for $1" >&2
222 +            break
223 +        fi
224 +        shift
225 +        if cat < "$1" > "$log_file"; then :; else
226 +            break
227 +        fi
228 +        shift
229 +        ;;
230 +    -C|--[cC]hange[lL]og)
231 +        if test $# = 1; then
232 +            echo "$name: missing argument for $1" >&2
233 +            break
234 +        fi
235 +        shift
236 +        if test ! -f "$1"; then
237 +            echo "$name: ChangeLog file \`$1' does not exist" >&2
238 +            break
239 +        fi
240 +        ChangeLog="$1"
241 +        ;;
242 +    -n|--dry-run)
243 +        PAGER=cat
244 +        commit=false
245 +        update=true
246 +        shift
247 +        ;;
248 +    -q|--quiet)
249 +        cvsopt="$cvsopt -q"
250 +        shift
251 +        ;;
252 +    -z|--compress)
253 +        if test $# = 1; then
254 +            echo "$name: missing argument for $1" >&2
255 +            break
256 +        fi
257 +        case "$2" in
258 +        [0-9]) :;;
259 +        *)  echo "$name: invalid argument for $1" >&2
260 +            break
261 +            ;;
262 +        esac
263 +        cvsopt="$cvsopt -z$2"
264 +        shift
265 +        shift
266 +        ;;
267 +
268 +    -m*|-F*|-C*|-z*)
269 +        opt=`echo "$1" | sed '1s/^\(..\).*$/\1/;q'`
270 +        arg=`echo "$1" | sed '1s/^-[a-zA-Z0-9]//'`
271 +        shift
272 +        set -- "$opt" "$arg" ${1+"$@"}
273 +        ;;
274 +    --message=*|--msg=*|--file=*|--[Cc]hange[Ll]og=*|--compress=*)
275 +        opt=`echo "$1" | sed '1s/^\(--[^=]*\)=.*/\1/;q'`
276 +        arg=`echo "$1" | sed '1s/^--[^=]*=//'`
277 +        shift
278 +        set -- "$opt" "$arg" ${1+"$@"}
279 +        ;;
280 +
281 +    -v|--version)
282 +        sed '/^# '$name' version /,/^# Heavily modified by/ { s/^# //; p; }; d' < $0
283 +        exit 0
284 +        ;;
285 +    -\?|-h)
286 +        sed '/^# usage:/,/# -h/ { s/^# //; p; }; d' < $0 &&
287 +        echo
288 +        echo "run \`$name --help | more' for full usage"
289 +        exit 0
290 +        ;;
291 +    --help)
292 +        sed '/^# '$name' version /,/^[^#]/ { /^[^#]/ d; s/^# //; p; }; d' < $0
293 +        exit 0
294 +        ;;
295 +    --)
296 +        shift
297 +        repeat=false
298 +        ;;
299 +    -*)
300 +        echo "$name: invalid flag $1" >&2
301 +        break
302 +        ;;
303 +    *)
304 +        repeat=false
305 +        ;;
306 +    esac
307 + done
308 + # might have used break 2 within the previous loop, but so what
309 + $repeat && break
310 +
311 + $update && \
312 + if echo "$name: checking for conflicts..." >&2
313 +   ($CVS $cvsopt -q -n update $updateopt ${1+"$@"} 2>/dev/null \
314 +    | while read line; do
315 +        echo "$line"
316 +        echo "$line" >&3
317 +      done | grep '^C') 3>&1 >/dev/null; then
318 +  echo "$name: some conflicts were found, aborting..." >&2
319 +  break
320 + fi
321 +
322 + if test ! -f "$log_file"; then
323 +  if test -z "$ChangeLog"; then
324 +    for f in ${1+"$@"}; do
325 +      case "$f" in
326 +      ChangeLog* | */ChangeLog*)
327 +        if test -z "$ChangeLog"; then
328 +            ChangeLog="$f"
329 +        else
330 +            echo "$name: multiple ChangeLog files: $ChangeLog and $f" >&2
331 +            break
332 +        fi
333 +        ;;
334 +      esac
335 +    done
336 +  fi
337 +
338 +  echo "$name: checking commit message..." >&2
339 +  $CVS $cvsopt diff -u ${ChangeLog-ChangeLog} \
340 +  | while read line; do
341 +      case "$line" in
342 +      "--- "*) :;;
343 +      "-"*)
344 +        echo "$name: *** Warning: the following line in ChangeLog diff is suspicious:" >&2
345 +        echo "$line" | sed 's/^.//' >&2;;
346 +      "+ "*)
347 +        echo "$name: *** Warning: lines should start with tabs, not spaces; ignoring line:" >&2
348 +        echo "$line" | sed 's/^.//' >&2;;
349 +      "+") echo;;
350 +      "+        "*) echo "$line";;
351 +      esac
352 +    done \
353 +  | sed -e 's,\+        ,,' -e '/./p' -e '/./d' -e '1d' -e '$d' > "$log_file" \
354 +  || break
355 + # The sed script above removes "+TAB" from the beginning of a line, then
356 + # deletes the first and/or the last line, when they happen to be empty
357 + fi
358 +
359 + if grep '[^     ]' < "$log_file" > /dev/null; then :; else
360 +  echo "$name: empty commit message, aborting" >&2
361 +  break
362 + fi
363 +
364 + if grep '^$' < "$log_file" > /dev/null; then
365 +  echo "$name: *** Warning: blank lines should not appear within a commit messages." >&2
366 +  echo "$name: *** They should be used to separate distinct commits." >&2
367 + fi
368 +
369 + ${PAGER-more} "$log_file" || break
370 +
371 + sleep 1 # give the user some time for a ^C
372 +
373 + # Do not check for empty $log_file again, even though the user might have
374 + # zeroed it out.  If s/he did, it was probably intentional.
375 +
376 + if $commit; then
377 +    echo " $CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break"
378 +  $CVS $cvsopt commit $commitopt -F $log_file ${1+"$@"} || break
379 + fi
380 +
381 + main_repeat=false
382 + done
383 +
384 + rm -f "$log_file"
385 +
386 + # if main_repeat was not set to `false', we failed
387 + $main_repeat && exit 1
388 + exit 0
389 + EOF_CLCOMMIT
390 +
391   chmod +x %i/bin/projch.sh
392   chmod +x %i/bin/projch.csh
393   chmod +x %i/bin/cmscvsroot.sh
394   chmod +x %i/bin/cmscvsroot.csh
395 + chmod +x %i/bin/clcommit.sh
396  
397   ln -sf %i/etc/profile.d/init.sh %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.sh
398 < ln -sf %i/etc/profile.d/init.sh %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
398 > ln -sf %i/etc/profile.d/init.csh %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
399  
400   %files
401   %i
# Line 106 | Line 403 | ln -sf %i/etc/profile.d/init.sh %instroo
403   %instroot/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
404  
405   %post
406 + perl -p -i -e 's|(.*setenv.*)|#$1|' $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.csh
407 + perl -p -i -e 's|(.*export.*)|#$1|' $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.sh
408   ln -sf $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.sh $RPM_INSTALL_PREFIX/%cmsplatf/etc/profile.d/S00cms-cvs-utils.sh
409 < ln -sf $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.sh $RPM_INSTALL_PREFIX/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh
409 > ln -sf $RPM_INSTALL_PREFIX/%pkgrel/etc/profile.d/init.csh $RPM_INSTALL_PREFIX/%cmsplatf/etc/profile.d/S00cms-cvs-utils.csh

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines