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
13 # - builder -u fetches current version first
14 # - tries to get new version from distfiles without new md5
15 # - after fetching new version doesn't update md5
16 # - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
17 # when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
18 # - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
21 Build package utility from PLD CVS repository
22 V 0.11 (C) 1999-2003 Free Penguins".
23 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
39 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
40 if [ -s CVS/Root ]; then
41 CVSROOT=$(cat CVS/Root)
43 CVSROOT=${CVSROOT:-""}
45 # Example: LOGFILE='../log.$PACKAGE_NAME'
46 # Yes, you can use variable name! Note _single_ quotes!
66 WGET_RETRIES=${MAX_WGET_RETRIES:-0}
67 CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
72 CVS_SERVER="cvs.pld-linux.org"
73 DISTFILES_SERVER="://distfiles.pld-linux.org"
77 FAIL_IF_NO_SOURCES="yes"
79 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES --inet"
80 GETURI2="wget -c -nd -t$WGET_RETRIES --inet"
83 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
91 if [ -f ~/etc/builderrc ]; then
93 elif [ -f ~/.builderrc ]; then
97 #---------------------------------------------
102 if [ -n "$DEBUG" ]; then set -xv; fi
104 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
106 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
107 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
108 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
109 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
110 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
111 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
112 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
113 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
116 - update md5 comments in spec, implies -nd
117 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd
118 -D, --debug - enable script debugging mode,
119 -V, --version - output builder version
120 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
122 --build - get all files from CVS repo or HTTP/FTP and build
123 package from <package>.spec,
125 - get all files from CVS repo or HTTP/FTP and build
126 binary only package from <package>.spec,
128 --build-source - get all files from CVS repo or HTTP/FTP and only
129 pack them into src.rpm,
130 -B, --branch - add branch
131 -c, --clean - clean all temporarily created files (in BUILD,
132 SOURCES, SPECS and \$RPM_BUILD_ROOT),
133 -d <cvsroot>, --cvsroot <cvsroot>
135 --define <macro> <value>
136 - define a macro <macro> with value <value>,
137 -g, --get - get <package>.spec and all related files from
138 CVS repo or HTTP/FTP,
139 -h, --help - this message,
140 --http - use http instead of ftp,
141 -l <logfile>, --logtofile <logfile>
143 -m, --mr-proper - only remove all files related to spec file and
145 -nc, --no-cvs - don't download sources from CVS, if source URL is
148 - don't check specs in CVS
150 - don't download from distfiles
151 -nm, --no-mirrors - don't download from mirror, if source URL is given,
152 -nu, --no-urls - don't try to download from FTP/HTTP location,
153 -ns, --no-srcs - don't download Sources
155 - don't download Source0
157 - additional options for rpm
158 -q, --quiet - be quiet,
160 - build package using resources from specified CVS
162 -r <cvstag>, --cvstag <cvstag>
163 - build package using resources from specified CVS
165 -T <cvstag> , --tag <cvstag>
166 - add cvs tag <cvstag> for files,
167 -Tvs, --tag-version-stable
168 - add cvs tags STABLE and NAME-VERSION-RELESE for files,
169 -Tvn, --tag-version-nest
170 - add cvs tags NEST and NAME-VERSION-RELESE for files,
172 - add cvs tag STABLE for files,
174 - add cvs tag NEST for files,
176 - add cvs tag NAME-VERSION-RELESE for files,
177 -v, --verbose - be verbose,
179 - check version, and try to upgrade package
180 -un, --try-upgrade-with-float-version
181 - as above, but allow float version
183 - refetch sources, don't use distfiles, and update md5
185 --with/--without <feature>
186 - conditional build package depending on
187 %_with_<feature>/%_without_<feature> macro
195 rpm -bp --nodeps --define 'prep %dump' $BCOND $SPECFILE 2>&1
198 rpmbuild --define 'prep %dump' $BCOND $SPECFILE 2>&1
205 if [ -n "$DEBUG" ]; then
211 if [ "$NOSRCS" != "yes" ]; then
212 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
214 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
215 FAIL_IF_NO_SOURCES="no"
218 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
219 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
220 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
221 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -1`"
222 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -1`"
224 if [ -n "$BE_VERBOSE" ]; then
225 echo "- Sources : `nourl $SOURCES`"
226 if [ -n "$PATCHES" ]; then
227 echo "- Patches : `nourl $PATCHES`"
229 echo "- Patches : *no patches needed*"
231 if [ -n "$ICONS" ]; then
232 echo "- Icon : `nourl $ICONS`"
234 echo "- Icon : *no package icon*"
236 echo "- Name : $PACKAGE_NAME"
237 echo "- Version : $PACKAGE_VERSION"
238 echo "- Release : $PACKAGE_RELEASE"
244 if [ -n "$DEBUG" ]; then
252 "err_no_spec_in_cmdl" )
253 echo "ERROR: spec file name not specified.";
255 "err_no_spec_in_repo" )
256 echo "Error: spec file not stored in CVS repo.";
258 "err_no_source_in_repo" )
259 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
262 echo "Error: package build failed. (${2:-no more info})";
269 if [ -n "$DEBUG" ]; then
274 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
275 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
282 if [ -n "$DEBUG" ]; then
287 if [ "$NOCVSSPEC" != "yes" ]; then
292 if [ -n "$CVSROOT" ]; then
293 OPTIONS="-d $CVSROOT $OPTIONS"
295 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
296 echo "warning: No cvs access defined - using local .spec file"
301 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
302 OPTIONS="$OPTIONS -A"
304 if [ -n "$CVSDATE" ]; then
305 OPTIONS="$OPTIONS -D $CVSDATE"
307 if [ -n "$CVSTAG" ]; then
308 OPTIONS="$OPTIONS -r $CVSTAG"
314 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
315 retries_counter=$(( $retries_counter + 1 ))
316 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
318 [ -n "$output" ] && echo "$output"
319 if [ "$result" -ne "0" ]; then
320 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out)") && [ "$retries_counter" -le "$CVS_RETRIES" ]; then
321 echo "Trying again [$SPECFILE]... ($retries_counter)"
325 Exit_error err_no_spec_in_repo;
329 if [ ! -f "$SPECFILE" ]; then
330 Exit_error err_no_spec_in_repo;
333 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
334 chmod $CHMOD_MODE $SPECFILE
337 grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
344 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
345 cvs update mirrors >&2
349 while read origin mirror name rest; do
350 ol=`echo -n "$origin"|wc -c`
351 prefix="`echo -n "$url" | head -c $ol`"
352 if [ "$prefix" = "$origin" ] ; then
353 suffix="`echo "$url"|cut -b $ol-`"
354 echo -n "$mirror$suffix"
365 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
366 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
373 [ -z "$no" ] && return
375 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
376 if [ -z "$spec_rev" ]; then
377 spec_rev="$(head -1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
379 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
380 md5=$(grep -s -v '^#' additional-md5sums | \
381 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
382 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
383 grep -E '^[0-9a-f]{32}$')
384 if [ X"$md5" = X"" ] ; then
385 grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://' | xargs
387 if [ $(echo "$md5" | wc -l) != 1 ] ; then
388 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
390 echo "$md5" | tail -1
396 echo "$PROTOCOL$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
403 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
410 if [ -n "$DEBUG" ]; then
415 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
419 if [ -n "$CVSROOT" ]; then
420 OPTIONS="-d $CVSROOT $OPTIONS"
422 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
423 echo "warning: No cvs access defined for SOURCES"
427 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
428 OPTIONS="$OPTIONS -A"
430 if [ -n "$CVSDATE" ]; then
431 OPTIONS="$OPTIONS -D $CVSDATE"
433 if [ -n "$CVSTAG" ]; then
434 OPTIONS="$OPTIONS -r $CVSTAG"
437 for i in $GET_FILES; do
438 if [ -n "$UPDATE5" ]; then
439 if [ -n "$ADD5" ]; then
440 [ `nourl $i` = "$i" ] && continue
441 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
443 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
447 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
448 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
449 echo "Warning: no URL given for $i"
452 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
453 if good_md5 "$i"; then
454 echo "$(nourl "$i") having proper md5sum already exists"
458 url=$(distfiles_url "$i")
459 if [ `echo $url | grep -E '^(\.|/)'` ]; then
460 ${GETLOCAL} $url $target
463 if [ -z "$NOMIRRORS" ]; then
464 url="`find_mirror "$url"`"
466 ${GETURI} -O "$target" "$url" || \
467 if [ `echo $url | grep -E 'ftp://'` ]; then
468 ${GETURI2} -O "$target" "$url"
470 test -s "$target" || rm -f "$target"
472 elif [ -z "$(src_md5 "$i")" ] && \
473 ( [ -z "$NOCVS" ] || echo $i | grep -qvE '(ftp|http|https)://' ); then
476 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
477 retries_counter=$(( $retries_counter + 1 ))
478 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
480 [ -n "$output" ] && echo "$output"
481 if (echo "$output" | grep -qE "(Cannot connect to|connect to .* failed|Connection reset by peer|Connection timed out)") && [ "$result" -ne "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; then
482 echo "Trying again [`nourl $i`]... ($retries_counter)"
491 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
492 if [ -z "$NOMIRRORS" ]; then
493 im="`find_mirror "$i"`"
498 if [ `echo $im | grep -E 'ftp://'` ]; then ${GETURI2} "$im" ; fi
504 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
505 Exit_error err_no_source_in_repo $i;
506 elif [ -n "$UPDATE5" ] && \
507 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
508 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
509 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
511 echo "Updating source-$srcno md5."
512 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
514 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
515 print "# Source'$srcno'-md5:\t'$md5'\n"
516 if /^Source'$srcno'\s*:\s+/;
521 if good_md5 "$i"; then
523 elif [ "$FROM_DISTFILES" = 1 ]; then
524 # wrong md5 from distfiles: remove the file and try again
526 echo "MD5 sum mismatch. Trying full fetch."
529 ${GETURI} -O "$target" "$url" || \
530 if [ `echo $url | grep -E 'ftp://'` ]; then
531 ${GETURI2} -O "$target" "$url"
533 test -s "$target" || rm -f "$target"
536 if good_md5 "$i"; then
539 echo "MD5 sum mismatch. Use -U to refetch sources,"
540 echo "or -5 to update md5 sums, if you're sure files are correct."
541 Exit_error err_no_source_in_repo $i
545 if [ "$CHMOD" = "yes" ]; then
546 CHMOD_FILES="`nourl $GET_FILES`"
547 if [ -n "$CHMOD_FILES" ]; then
548 chmod $CHMOD_MODE $CHMOD_FILES
559 if [ -n "$DEBUG" ]; then
564 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
565 echo "Version: $PACKAGE_VERSION"
566 echo "Release: $PACKAGE_RELEASE"
567 TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
568 if [ "$TAG_VERSION" = "yes" ]; then
569 echo "CVS tag: $TAGVER"
571 if [ -n "$TAG" ]; then
576 if [ -n "$CVSROOT" ]; then
577 OPTIONS="-d $CVSROOT $OPTIONS"
581 for i in $TAG_FILES; do
582 if [ -f `nourl $i` ]; then
583 if [ "$TAG_VERSION" = "yes" ]; then
584 cvs $OPTIONS $TAGVER `nourl $i`
586 if [ -n "$TAG" ]; then
587 cvs $OPTIONS $TAG `nourl $i`
590 Exit_error err_no_source_in_repo $i
595 if [ "$TAG_VERSION" = "yes" ]; then
596 cvs $OPTIONS $TAGVER $SPECFILE
598 if [ -n "$TAG" ]; then
599 cvs $OPTIONS $TAG $SPECFILE
609 echo "CVS branch tag: $TAG"
614 if [ -n "$DEBUG" ]; then
619 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
622 if [ -n "$CVSROOT" ]; then
623 OPTIONS="-d $CVSROOT $OPTIONS"
626 for i in $TAG_FILES; do
627 if [ -f `nourl $i` ]; then
628 cvs $OPTIONS $TAG `nourl $i`
630 Exit_error err_no_source_in_repo $i
634 cvs $OPTIONS $TAG $SPECFILE
644 if [ -n "$DEBUG" ]; then
651 if [ -n "$TRY_UPGRADE" ]; then
653 if [ -n "FLOAT_VERSION" ]; then
654 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
656 TNOTIFY=`./pldnotify.awk $SPECFILE`
659 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
661 if [ -n "$TNEWVER" ]; then
663 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
665 echo "New version found, updating spec file to version " $TNEWVER
667 cp -f $SPECFILE $SPECFILE.bak
671 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
672 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
676 get_files "$SOURCES $PATCHES";
678 unset TOLDVER TNEWVER TNOTIFY
688 BUILD_SWITCH="-ba" ;;
690 BUILD_SWITCH="-bb" ;;
692 BUILD_SWITCH="-bs --nodeps" ;;
694 if [ -n "$LOGFILE" ]; then
695 if [ -n "$CVSTAG" ]; then
696 LTAG="r_`echo $CVSTAG|sed -e 's/\./_/g'`_"
700 LOG=`eval echo $LOGFILE`
701 if [ -n "$LASTLOG_FILE" ]; then
702 echo "LASTLOG=$LOG" > $LASTLOG_FILE
704 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
705 (nice -n ${DEF_NICE_LEVEL} time $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
706 RETVAL=`cat $RES_FILE`
708 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
709 if [ "$RETVAL" -eq "0" ]; then
716 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $SPECFILE
720 if [ "$RETVAL" -ne "0" ]; then
722 if [ -n "$TRY_UPGRADE" ]; then
723 echo "\n!!! Package with new version cannot be build automagically\n"
724 mv -f $SPECFILE.bak $SPECFILE
727 Exit_error err_build_fail;
735 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
738 #---------------------------------------------
741 if [ "$#" = 0 ]; then
746 while test $# -gt 0 ; do
761 DEBUG="yes"; shift ;;
763 COMMAND="version"; shift ;;
765 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
767 COMMAND="build"; shift ;;
768 -bb | --build-binary )
769 COMMAND="build-binary"; shift ;;
770 -bs | --build-source )
771 COMMAND="build-source"; shift ;;
773 COMMAND="branch"; shift; TAG="${1}"; shift;;
775 CLEAN="--clean --rmspec --rmsource"; shift ;;
777 shift; CVSROOT="${1}"; shift ;;
779 COMMAND="get"; shift ;;
781 COMMAND="usage"; shift ;;
783 PROTOCOL="http"; shift ;;
785 shift; LOGFILE="${1}"; shift ;;
787 shift; DEF_NICE_LEVEL=${1}; shift ;;
789 COMMAND="mr-proper"; shift ;;
791 NOCVS="yes"; shift ;;
792 -ncs | --no-cvs-specs )
793 NOCVSSPEC="yes"; shift ;;
794 -nd | --no-distfiles )
795 NODIST="yes"; shift ;;
797 NOMIRRORS="yes"; shift ;;
799 NOURLS="yes"; shift ;;
801 NOSRCS="yes"; shift ;;
802 -ns0 | --no-source0 )
803 NOSOURCE0="yes"; shift ;;
805 shift; RPMOPTS="${1}"; shift ;;
807 BCOND="$BCOND $1 $2" ; shift 2 ;;
809 QUIET="--quiet"; shift ;;
811 CVSDATE="${2}"; shift 2 ;;
813 shift; CVSTAG="${1}"; shift ;;
814 -Tvs | --tag-version-stable )
819 -Tvn | --tag-version-nest )
834 -Tv | --tag-version )
852 TRY_UPGRADE="1"; shift ;;
853 -un | --try-upgrade-with-float-version )
854 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
856 BE_VERBOSE="1"; shift ;;
862 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
865 SPECFILE="`basename ${1} .spec`.spec"; shift ;;
869 if [ -n "$DEBUG" ]; then
875 "build" | "build-binary" | "build-source" )
877 if [ -n "$SPECFILE" ]; then
881 if [ -n "$FAIL_IF_CHANGED_BUT_NOT_BUMPED" ]; then
882 TAGVER=$PACKAGE_NAME-`echo $PACKAGE_VERSION | sed -e "s/\./\_/g" -e "s/@/#/g"`-`echo $PACKAGE_RELEASE | sed -e "s/\./\_/g" -e "s/@/#/g"`
883 CURTAGREL=$(cvs status $SPECFILE | grep "Working revision:" | awk '{ print $3 }')
884 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
886 if [ -n "$TAGREL" -a "$TAGREL" != "$CURTAGREL" ]; then
887 Exit_error err_build_fail "not bumped ver-rel - was already used in rev $TAGREL"
891 if [ -n "$ICONS" ]; then
895 if [ -n "$NOSOURCE0" ] ; then
896 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
898 get_files "$SOURCES $PATCHES";
901 Exit_error err_no_spec_in_cmdl;
906 if [ -n "$SPECFILE" ]; then
909 if [ -n "$ICONS" ]; then
913 get_files $SOURCES $PATCHES;
914 branch_files $TAG "$SOURCES $PATCHES $ICONS";
916 Exit_error err_no_spec_in_cmdl;
921 if [ -n "$SPECFILE" ]; then
924 if [ -n "$ICONS" ]; then
928 if [ -n "$NOSOURCE0" ] ; then
929 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
931 get_files $SOURCES $PATCHES
933 Exit_error err_no_spec_in_cmdl;
938 if [ -n "$SPECFILE" ]; then
941 if [ -n "$ICONS" ]; then
945 get_files $SOURCES $PATCHES;
946 tag_files "$SOURCES $PATCHES $ICONS";
948 Exit_error err_no_spec_in_cmdl;
952 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE