7 # 2 - no spec file name in cmdl parameters
8 # 3 - spec file not stored in repo
9 # 4 - some source, patch or icon files not stored in repo
10 # 5 - package build failed
11 # 6 - spec file with errors
14 # - builder -u fetches current version first
15 # - tries to get new version from distfiles without new md5
16 # - after fetching new version doesn't update md5
17 # - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
18 # when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
19 # - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
20 # - when Icon: field is present, -5 and -a5 doesn't work
23 Build package utility from PLD CVS repository
24 V 0.11 (C) 1999-2003 Free Penguins".
25 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
41 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
42 if [ -s CVS/Root ]; then
43 CVSROOT=$(cat CVS/Root)
45 CVSROOT=${CVSROOT:-""}
47 # Example: LOGFILE='../log.$PACKAGE_NAME'
48 # Yes, you can use variable name! Note _single_ quotes!
67 WGET_RETRIES=${MAX_WGET_RETRIES:-0}
68 CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
73 CVS_SERVER="cvs.pld-linux.org"
74 DISTFILES_SERVER="://distfiles.pld-linux.org"
78 FAIL_IF_NO_SOURCES="yes"
80 wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
81 wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
83 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
84 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
87 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
95 if [ -f ~/etc/builderrc ]; then
97 elif [ -f ~/.builderrc ]; then
101 #---------------------------------------------
106 if [ -n "$DEBUG" ]; then set -xv; fi
108 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
110 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
111 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
112 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
113 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
114 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
115 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
116 [{-Tp|--tag-prefix} <prefix>]
117 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
118 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
121 - update md5 comments in spec, implies -nd -ncs
122 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
123 -D, --debug - enable script debugging mode,
124 -V, --version - output builder version
125 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
127 --build - get all files from CVS repo or HTTP/FTP and build
128 package from <package>.spec,
130 - get all files from CVS repo or HTTP/FTP and build
131 binary only package from <package>.spec,
133 --build-source - get all files from CVS repo or HTTP/FTP and only
134 pack them into src.rpm,
135 -B, --branch - add branch
136 -c, --clean - clean all temporarily created files (in BUILD,
137 SOURCES, SPECS and \$RPM_BUILD_ROOT),
138 -d <cvsroot>, --cvsroot <cvsroot>
140 --define <macro> <value>
141 - define a macro <macro> with value <value>,
142 -g, --get - get <package>.spec and all related files from
143 CVS repo or HTTP/FTP,
144 -h, --help - this message,
145 --http - use http instead of ftp,
146 -l <logfile>, --logtofile <logfile>
148 -m, --mr-proper - only remove all files related to spec file and
150 -nc, --no-cvs - don't download sources from CVS, if source URL is
153 - don't check specs in CVS
155 - don't download from distfiles
156 -nm, --no-mirrors - don't download from mirror, if source URL is given,
157 -nu, --no-urls - don't try to download from FTP/HTTP location,
158 -ns, --no-srcs - don't download Sources
160 - don't download Source0
162 - additional options for rpm
163 -q, --quiet - be quiet,
165 - build package using resources from specified CVS
167 -r <cvstag>, --cvstag <cvstag>
168 - build package using resources from specified CVS
170 -T <cvstag> , --tag <cvstag>
171 - add cvs tag <cvstag> for files,
172 -Tvs, --tag-version-stable
173 - add cvs tags STABLE and NAME-VERSION-RELESE for files,
174 -Tvn, --tag-version-nest
175 - add cvs tags NEST and NAME-VERSION-RELESE for files,
177 - add cvs tag STABLE for files,
179 - add cvs tag NEST for files,
181 - add cvs tag NAME-VERSION-RELESE for files,
182 -Tp, --tag-prefix <prefix>
183 - add <prefix> to NAME-VERSION-RELEASE tags,
184 -v, --verbose - be verbose,
186 - check version, and try to upgrade package
187 -un, --try-upgrade-with-float-version
188 - as above, but allow float version
190 - refetch sources, don't use distfiles, and update md5
192 --with/--without <feature>
193 - conditional build package depending on
194 %_with_<feature>/%_without_<feature> macro
203 rpm -bp --nodeps --define 'prep %dump' $BCOND $SPECFILE 2>&1
206 rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
212 if [ -z "$rpm_dump_cache" ] ; then
213 echo "internal error: cache_rpm_dump not called!" 1>&2
215 echo "$rpm_dump_cache"
220 if [ -n "$DEBUG" ]; then
229 if [ "$NOSRCS" != "yes" ]; then
230 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
232 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
233 FAIL_IF_NO_SOURCES="no"
236 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
237 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
238 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
239 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -1`"
240 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
242 if [ -n "$BE_VERBOSE" ]; then
243 echo "- Sources : `nourl $SOURCES`"
244 if [ -n "$PATCHES" ]; then
245 echo "- Patches : `nourl $PATCHES`"
247 echo "- Patches : *no patches needed*"
249 if [ -n "$ICONS" ]; then
250 echo "- Icon : `nourl $ICONS`"
252 echo "- Icon : *no package icon*"
254 echo "- Name : $PACKAGE_NAME"
255 echo "- Version : $PACKAGE_VERSION"
256 echo "- Release : $PACKAGE_RELEASE"
262 if [ -n "$DEBUG" ]; then
270 "err_no_spec_in_cmdl" )
271 echo "ERROR: spec file name not specified.";
273 "err_no_spec_in_repo" )
274 echo "Error: spec file not stored in CVS repo.";
276 "err_no_source_in_repo" )
277 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
280 echo "Error: package build failed. (${2:-no more info})";
287 if [ -n "$DEBUG" ]; then
292 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
293 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
300 if [ -n "$DEBUG" ]; then
305 if [ "$NOCVSSPEC" != "yes" ]; then
310 if [ -n "$CVSROOT" ]; then
311 OPTIONS="-d $CVSROOT $OPTIONS"
313 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
314 echo "warning: No cvs access defined - using local .spec file"
319 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
320 OPTIONS="$OPTIONS -A"
322 if [ -n "$CVSDATE" ]; then
323 OPTIONS="$OPTIONS -D $CVSDATE"
325 if [ -n "$CVSTAG" ]; then
326 OPTIONS="$OPTIONS -r $CVSTAG"
332 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
333 retries_counter=$(( $retries_counter + 1 ))
334 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
336 [ -n "$output" ] && echo "$output"
337 if [ "$result" -ne "0" ]; then
338 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then
339 echo "Trying again [$SPECFILE]... ($retries_counter)"
343 Exit_error err_no_spec_in_repo;
347 if [ ! -f "$SPECFILE" ]; then
348 Exit_error err_no_spec_in_repo;
351 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
352 chmod $CHMOD_MODE $SPECFILE
355 grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
362 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
363 cvs update mirrors >&2
367 while read origin mirror name rest; do
368 ol=`echo -n "$origin"|wc -c`
369 prefix="`echo -n "$url" | head -c $ol`"
370 if [ "$prefix" = "$origin" ] ; then
371 suffix="`echo "$url"|cut -b $ol-`"
372 echo -n "$mirror$suffix"
383 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
384 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
391 [ -z "$no" ] && return
393 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
394 if [ -z "$spec_rev" ]; then
395 spec_rev="$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
397 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
398 md5=$(grep -s -v '^#' additional-md5sums | \
399 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
400 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
401 grep -E '^[0-9a-f]{32}$')
402 if [ X"$md5" = X"" ] ; then
403 grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://' | xargs
405 if [ $(echo "$md5" | wc -l) != 1 ] ; then
406 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
408 echo "$md5" | tail -1
414 echo "$PROTOCOL$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
421 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
428 if [ -n "$DEBUG" ]; then
433 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
437 if [ -n "$CVSROOT" ]; then
438 OPTIONS="-d $CVSROOT $OPTIONS"
440 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
441 echo "warning: No cvs access defined for SOURCES"
445 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
446 OPTIONS="$OPTIONS -A"
448 if [ -n "$CVSDATE" ]; then
449 OPTIONS="$OPTIONS -D $CVSDATE"
451 if [ -n "$CVSTAG" ]; then
452 OPTIONS="$OPTIONS -r $CVSTAG"
455 for i in $GET_FILES; do
456 if [ -n "$UPDATE5" ]; then
457 if [ -n "$ADD5" ]; then
458 [ `nourl $i` = "$i" ] && continue
459 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
461 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
465 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
466 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
467 echo "Warning: no URL given for $i"
470 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
471 if good_md5 "$i"; then
472 echo "$(nourl "$i") having proper md5sum already exists"
476 url=$(distfiles_url "$i")
477 if [ `echo $url | grep -E '^(\.|/)'` ]; then
478 ${GETLOCAL} $url $target
481 if [ -z "$NOMIRRORS" ]; then
482 url="`find_mirror "$url"`"
484 ${GETURI} -O "$target" "$url" || \
485 if [ `echo $url | grep -E 'ftp://'` ]; then
486 ${GETURI2} -O "$target" "$url"
488 if ! test -s "$target"; then
493 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
494 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
497 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
498 retries_counter=$(( $retries_counter + 1 ))
499 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
501 [ -n "$output" ] && echo "$output"
502 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out|Unknown host)") && [ "$result" -ne "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; then
503 echo "Trying again [`nourl $i`]... ($retries_counter)"
512 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
513 if [ -z "$NOMIRRORS" ]; then
514 im="`find_mirror "$i"`"
519 if [ `echo $im | grep -E 'ftp://'` ]; then ${GETURI2} "$im" ; fi
525 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
526 Exit_error err_no_source_in_repo $i;
527 elif [ -n "$UPDATE5" ] && \
528 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
529 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
530 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
532 echo "Updating source-$srcno md5."
533 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
535 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
536 print "# Source'$srcno'-md5:\t'$md5'\n"
537 if /^Source'$srcno'\s*:\s+/;
542 if good_md5 "$i"; then
544 elif [ "$FROM_DISTFILES" = 1 ]; then
545 # wrong md5 from distfiles: remove the file and try again
547 echo "MD5 sum mismatch. Trying full fetch."
550 ${GETURI} -O "$target" "$url" || \
551 if [ `echo $url | grep -E 'ftp://'` ]; then
552 ${GETURI2} -O "$target" "$url"
554 test -s "$target" || rm -f "$target"
557 if good_md5 "$i"; then
560 echo "MD5 sum mismatch. Use -U to refetch sources,"
561 echo "or -5 to update md5 sums, if you're sure files are correct."
562 Exit_error err_no_source_in_repo $i
566 if [ "$CHMOD" = "yes" ]; then
567 CHMOD_FILES="`nourl $GET_FILES`"
568 if [ -n "$CHMOD_FILES" ]; then
569 chmod $CHMOD_MODE $CHMOD_FILES
580 if [ -n "$DEBUG" ]; then
585 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
586 echo "Version: $PACKAGE_VERSION"
587 echo "Release: $PACKAGE_RELEASE"
588 TAGVER=$TAG_PREFIX$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
589 # Remove #kernel.version_release from TAGVER because tagging sources
590 # could occur with different kernel-headers than kernel-headers used at build time.
591 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
592 if [ "$TAG_VERSION" = "yes" ]; then
593 echo "CVS tag: $TAGVER"
595 if [ -n "$TAG" ]; then
600 if [ -n "$CVSROOT" ]; then
601 OPTIONS="-d $CVSROOT $OPTIONS"
605 for i in $TAG_FILES; do
606 if [ -f `nourl $i` ]; then
607 if [ "$TAG_VERSION" = "yes" ]; then
608 cvs $OPTIONS $TAGVER `nourl $i`
610 if [ -n "$TAG" ]; then
611 cvs $OPTIONS $TAG `nourl $i`
614 Exit_error err_no_source_in_repo $i
619 if [ "$TAG_VERSION" = "yes" ]; then
620 cvs $OPTIONS $TAGVER $SPECFILE
622 if [ -n "$TAG" ]; then
623 cvs $OPTIONS $TAG $SPECFILE
633 echo "CVS branch tag: $TAG"
638 if [ -n "$DEBUG" ]; then
643 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
646 if [ -n "$CVSROOT" ]; then
647 OPTIONS="-d $CVSROOT $OPTIONS"
650 for i in $TAG_FILES; do
651 if [ -f `nourl $i` ]; then
652 cvs $OPTIONS $TAG `nourl $i`
654 Exit_error err_no_source_in_repo $i
658 cvs $OPTIONS $TAG $SPECFILE
668 if [ -n "$DEBUG" ]; then
675 if [ -n "$TRY_UPGRADE" ]; then
677 if [ -n "FLOAT_VERSION" ]; then
678 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
680 TNOTIFY=`./pldnotify.awk $SPECFILE`
683 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
685 if [ -n "$TNEWVER" ]; then
687 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
689 echo "New version found, updating spec file to version " $TNEWVER
691 cp -f $SPECFILE $SPECFILE.bak
695 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
696 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
700 get_files "$SOURCES $PATCHES";
702 unset TOLDVER TNEWVER TNOTIFY
712 BUILD_SWITCH="-ba" ;;
714 BUILD_SWITCH="-bb" ;;
716 BUILD_SWITCH="-bs --nodeps" ;;
718 if [ -n "$LOGFILE" ]; then
719 LOG=`eval echo $LOGFILE`
720 if [ -n "$LASTLOG_FILE" ]; then
721 echo "LASTLOG=$LOG" > $LASTLOG_FILE
723 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
724 (nice -n ${DEF_NICE_LEVEL} time $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
725 RETVAL=`cat $RES_FILE`
727 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
728 if [ "$RETVAL" -eq "0" ]; then
735 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE
739 if [ "$RETVAL" -ne "0" ]; then
741 if [ -n "$TRY_UPGRADE" ]; then
742 echo "\n!!! Package with new version cannot be build automagically\n"
743 mv -f $SPECFILE.bak $SPECFILE
746 Exit_error err_build_fail;
754 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
757 #---------------------------------------------
760 if [ "$#" = 0 ]; then
765 while test $# -gt 0 ; do
782 DEBUG="yes"; shift ;;
784 COMMAND="version"; shift ;;
786 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
788 COMMAND="build"; shift ;;
789 -bb | --build-binary )
790 COMMAND="build-binary"; shift ;;
791 -bs | --build-source )
792 COMMAND="build-source"; shift ;;
794 COMMAND="branch"; shift; TAG="${1}"; shift;;
796 CLEAN="--clean --rmspec --rmsource"; shift ;;
798 shift; CVSROOT="${1}"; shift ;;
800 COMMAND="get"; shift ;;
802 COMMAND="usage"; shift ;;
804 PROTOCOL="http"; shift ;;
806 shift; LOGFILE="${1}"; shift ;;
808 shift; DEF_NICE_LEVEL=${1}; shift ;;
810 COMMAND="mr-proper"; shift ;;
812 NOCVS="yes"; shift ;;
813 -ncs | --no-cvs-specs )
814 NOCVSSPEC="yes"; shift ;;
815 -nd | --no-distfiles )
816 NODIST="yes"; shift ;;
818 NOMIRRORS="yes"; shift ;;
820 NOURLS="yes"; shift ;;
822 NOSRCS="yes"; shift ;;
823 -ns0 | --no-source0 )
824 NOSOURCE0="yes"; shift ;;
826 shift; RPMOPTS="${1}"; shift ;;
828 BCOND="$BCOND $1 $2" ; shift 2 ;;
830 QUIET="--quiet"; shift ;;
832 CVSDATE="${2}"; shift 2 ;;
834 shift; CVSTAG="${1}"; shift ;;
835 -Tvs | --tag-version-stable )
840 -Tvn | --tag-version-nest )
855 -Tv | --tag-version )
877 TRY_UPGRADE="1"; shift ;;
878 -un | --try-upgrade-with-float-version )
879 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
881 BE_VERBOSE="1"; shift ;;
887 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
890 SPECFILE="`basename ${1} .spec`.spec"; shift ;;
894 if [ -n "$DEBUG" ]; then
900 "build" | "build-binary" | "build-source" )
902 if [ -n "$SPECFILE" ]; then
906 if [ -n "$FAIL_IF_CHANGED_BUT_NOT_BUMPED" ]; then
907 TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
908 CURTAGREL=$(cvs status $SPECFILE | grep "Working revision:" | awk '{ print $3 }')
909 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
911 if [ -n "$TAGREL" -a "$TAGREL" != "$CURTAGREL" ]; then
912 Exit_error err_build_fail "not bumped ver-rel - was already used in rev $TAGREL"
916 if [ -n "$ICONS" ]; then
920 if [ -n "$NOSOURCE0" ] ; then
921 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
923 get_files "$SOURCES $PATCHES";
926 Exit_error err_no_spec_in_cmdl;
931 if [ -n "$SPECFILE" ]; then
934 if [ -n "$ICONS" ]; then
938 get_files $SOURCES $PATCHES;
939 branch_files $TAG "$SOURCES $PATCHES $ICONS";
941 Exit_error err_no_spec_in_cmdl;
946 if [ -n "$SPECFILE" ]; then
949 if [ -n "$ICONS" ]; then
953 if [ -n "$NOSOURCE0" ] ; then
954 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
956 get_files $SOURCES $PATCHES
958 Exit_error err_no_spec_in_cmdl;
963 if [ -n "$SPECFILE" ]; then
966 if [ -n "$ICONS" ]; then
970 get_files $SOURCES $PATCHES;
971 tag_files "$SOURCES $PATCHES $ICONS";
973 Exit_error err_no_spec_in_cmdl;
977 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE