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
12 # 7 - wrong source in /etc/poldek.conf
13 # 8 - Failed installing buildrequirements and subrequirements
14 # 9 - Requested tag already exist
15 # 10 - Refused to build fractional release
16 # 100 - Unknown error (should not happen)
19 # - builder -u fetches current version first
20 # - tries to get new version from distfiles without new md5
21 # - after fetching new version doesn't update md5
22 # - doesn't get sources for specs with %include /usr/lib/rpm/macros.python
23 # when there's no rpm-pythonprov (rpm's fault, but it's ugly anyway)
24 # - as above with %include /usr/lib/rpm/macros.perl and no rpm-perlprov
25 # - when Icon: field is present, -5 and -a5 doesn't work
28 Build package utility from PLD CVS repository
29 V 0.12 (C) 1999-2005 Free Penguins".
30 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
48 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
51 # It can be used i.e. in log file naming.
52 # See LOGFILE example.
53 DATE=`date +%Y-%m-%d_%H-%M-%S`
55 # Example: LOGFILE='../log.$PACKAGE_NAME'
56 # Example: LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
57 # Yes, you can use variable name! Note _single_ quotes!
79 WGET_RETRIES=${MAX_WGET_RETRIES:-0}
80 CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
85 CVS_SERVER="cvs.pld-linux.org"
86 DISTFILES_SERVER="://distfiles.pld-linux.org"
87 ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org"
91 FAIL_IF_NO_SOURCES="yes"
93 # Here we load saved user environment used to
94 # predefine options set above, or passed to builder
96 # This one reads global system environment settings:
97 if [ -f ~/etc/builderrc ]; then
100 # And this one cascades settings using user personal
102 # Example of ~/.builderrc:
104 #UPDATE_POLDEK_INDEXES="yes"
105 #FETCH_BUILD_REQUIRES="yes"
106 #REMOVE_BUILD_REQUIRES="force"
108 #LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
111 if [ -n "$HOME_ETC" ]; then
112 USER_CFG="$HOME_ETC/.builderrc"
114 USER_CFG=~/.builderrc
117 [ -f "$USER_CFG" ] && . "$USER_CFG"
119 if [ -n "$USE_PROZILLA" ]; then
120 GETURI="proz --no-getch -r -P ./ -t$WGET_RETRIES $PROZILLA_OPTS"
123 elif [ -n "$USE_AXEL" ]; then
124 GETURI="axel -n 4 -a $AXEL_OPTS"
128 wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
129 wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
131 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
132 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
138 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
146 POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
147 POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
151 RES_FILE=~/tmp/poldek-exit-status.$RANDOM
152 if [ -n "$LOGFILE" ]; then
153 LOG=`eval echo $LOGFILE`
154 if [ -n "$LASTLOG_FILE" ]; then
155 echo "LASTLOG=$LOG" > $LASTLOG_FILE
157 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee -a $LOG
160 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
161 return `cat ${RES_FILE}`
166 #---------------------------------------------
171 if [ -n "$DEBUG" ]; then set -xv; fi
173 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
175 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
176 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
177 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
178 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
179 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
180 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
181 [{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
182 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
183 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
185 -5, --update-md5 - update md5 comments in spec, implies -nd -ncs
186 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
187 -n5, --no-md5 - ignore md5 comments in spec
188 -D, --debug - enable builder script debugging mode,
189 -debug - produce rpm debug package (same as --opts -debug)
190 -V, --version - output builder version
191 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
192 -b, -ba, --build - get all files from CVS repo or HTTP/FTP and build package
194 -bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
195 only package from <package>.spec,
196 -bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
198 -bp, --build-prep - execute the %prep phase of <package>.spec,
199 -B, --branch - add branch
200 -c, --clean - clean all temporarily created files (in BUILD, SOURCES,
201 SPECS and \$RPM_BUILD_ROOT),
202 -d <cvsroot>, --cvsroot <cvsroot>
204 --define <macro> <value>
205 - define a macro <macro> with value <value>,
206 --nodeps - rpm won't check any dependences
207 -g, --get - get <package>.spec and all related files from CVS repo
209 -h, --help - this message,
210 --http - use http instead of ftp,
211 -l <logfile>, --logtofile <logfile>
213 -m, --mr-proper - only remove all files related to spec file and all work
215 -nc, --no-cvs - don't download sources from CVS, if source URL is given,
217 - don't check specs in CVS
218 -nd, --no-distfiles - don't download from distfiles
219 -nm, --no-mirrors - don't download from mirror, if source URL is given,
220 -nu, --no-urls - don't try to download from FTP/HTTP location,
221 -ns, --no-srcs - don't download Sources
222 -ns0, --no-source0 - don't download Source0
223 -nn, --no-net - don't download anything from the net
224 --opts <rpm opts> - additional options for rpm
225 -q, --quiet - be quiet,
226 --date yyyy-mm-dd - build package using resources from specified CVS date,
227 -r <cvstag>, --cvstag <cvstag>
228 - build package using resources from specified CVS tag,
229 -R, --fetch-build-requires
230 - fetch what is BuildRequired,
231 -RB, --remove-build-requires
232 - remove all you fetched with -R or --fetch-build-requires
233 remember, this option requires confirmation,
234 -FRB, --force-remove-build-requires
235 - remove all you fetched with -R or --fetch-build-requires
236 remember, this option works without confirmation,
237 -sf, --source-files - list sources - bare filenames (intended for offline
238 operations; does not work when Icon field is present
239 but icon file is absent),
240 -sp, --source-paths - list sources - filenames with full local paths (intended for
241 offline operations; does not work when Icon field is present
242 but icon file is absent),
243 -T <cvstag> , --tag <cvstag>
244 - add cvs tag <cvstag> for files,
245 -Tvs, --tag-version-stable
246 - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
247 -Tvn, --tag-version-nest
248 - add cvs tags NEST and NAME-VERSION-RELEASE for files,
250 - add cvs tag STABLE for files,
252 - add cvs tag NEST for files,
254 - add cvs tag NAME-VERSION-RELEASE for files,
255 -Tp, --tag-prefix <prefix>
256 - add <prefix> to NAME-VERSION-RELEASE tags,
257 -tt, --test-tag <prefix>
258 - fail if tag is already present,
259 -ir, --integer-release-only
260 - allow only integer and snapshot releases
261 -v, --verbose - be verbose,
262 -u, --try-upgrade - check version, and try to upgrade package
263 -un, --try-upgrade-with-float-version
264 - as above, but allow float version
265 -U, --update - refetch sources, don't use distfiles, and update md5 comments
266 -Upi, --update-poldek-indexes
267 - refresh or make poldek package index files.
268 --with/--without <feature>
269 - conditional build package depending on %_with_<feature>/
270 %_without_<feature> macro switch. You may now use
271 --with feat1 feat2 feat3 --without feat4 feat5 --with feat6
272 constructions. Set GROUP_BCONDS to yes to make use of it.
273 --target <platform>, --target=<platform>
274 - build for platform <platform>.
279 if [ -n "$DEBUG" ]; then
286 rpm -bp --nodeps --define 'prep %dump' $BCOND $TARGET_SWITCH $SPECFILE 2>&1
289 rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
295 if [ -z "$rpm_dump_cache" ] ; then
296 echo "internal error: cache_rpm_dump not called!" 1>&2
298 echo "$rpm_dump_cache"
303 if [ -n "$DEBUG" ]; then
312 if [ "$NOSRCS" != "yes" ]; then
313 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
315 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
316 FAIL_IF_NO_SOURCES="no"
319 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
320 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
321 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
322 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -n 1`"
323 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
325 # These variables may be unset after first cache_rpm_dump call
326 # (because of not-yet-retrieved icon file)
328 # if [ -z "$PACKAGE_NAME" -o -z "$PACKAGE_VERSION" -o -z "$PACKAGE_RELEASE" ]; then
329 # Exit_error err_no_package_data;
332 if [ -n "$BE_VERBOSE" ]; then
333 echo "- Sources : `nourl $SOURCES`"
334 if [ -n "$PATCHES" ]; then
335 echo "- Patches : `nourl $PATCHES`"
337 echo "- Patches : *no patches needed*"
339 if [ -n "$ICONS" ]; then
340 echo "- Icon : `nourl $ICONS`"
342 echo "- Icon : *no package icon*"
344 echo "- Name : $PACKAGE_NAME"
345 echo "- Version : $PACKAGE_VERSION"
346 echo "- Release : $PACKAGE_RELEASE"
352 if [ -n "$DEBUG" ]; then
360 "err_no_spec_in_cmdl" )
361 remove_build_requires
362 echo "ERROR: spec file name not specified.";
364 "err_no_spec_in_repo" )
365 remove_build_requires
366 echo "Error: spec file not stored in CVS repo.";
368 "err_no_source_in_repo" )
369 remove_build_requires
370 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
373 remove_build_requires
374 echo "Error: package build failed. (${2:-no more info})";
376 "err_no_package_data" )
377 remove_build_requires
378 echo "Error: couldn't get out package name/version/release from spec file."
381 remove_build_requires
382 echo "Tag ${2} already exists (spec release: ${3}).";
385 remove_build_requires
386 echo "Release ${2} not integer and not a snapshot.";
390 echo "Unknown error."
396 if [ -n "$DEBUG" ]; then
401 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
402 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
409 if [ -n "$DEBUG" ]; then
415 if [ \! -f "$SPECFILE" ]; then
416 SPECFILE="`basename $SPECFILE .spec`.spec";
418 if [ "$NOCVSSPEC" != "yes" ]; then
421 if [ -n "$CVSROOT" ]; then
422 OPTIONS="-d $CVSROOT $OPTIONS"
424 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
425 echo "warning: No cvs access defined - using local .spec file"
430 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
431 OPTIONS="$OPTIONS -A"
433 if [ -n "$CVSDATE" ]; then
434 OPTIONS="$OPTIONS -D $CVSDATE"
436 if [ -n "$CVSTAG" ]; then
437 OPTIONS="$OPTIONS -r $CVSTAG"
443 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
445 retries_counter=$(( $retries_counter + 1 ))
446 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
448 [ -n "$output" ] && echo "$output"
449 if [ "$result" -ne "0" ]; then
450 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
451 echo "Trying again [$SPECFILE]... ($retries_counter)"
455 Exit_error err_no_spec_in_repo;
459 if [ ! -f "$SPECFILE" ]; then
460 Exit_error err_no_spec_in_repo;
463 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
464 chmod $CHMOD_MODE $SPECFILE
467 [ -n "$DONT_PRINT_REVISION" ] || grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
474 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
475 cvs update mirrors >&2
479 while read origin mirror name rest
481 ol=`echo -n "$origin"|wc -c`
482 prefix="`echo -n "$url" | head -c $ol`"
483 if [ "$prefix" = "$origin" ] ; then
484 suffix="`echo "$url"|cut -b $ol-`"
485 echo -n "$mirror$suffix"
496 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
497 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
503 [ X"$NO5" = X"yes" ] && return
505 [ -z "$no" ] && return
507 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
508 if [ -z "$spec_rev" ]; then
509 spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
511 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
512 md5=$(grep -s -v '^#' additional-md5sums | \
513 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
514 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
515 grep -E '^[0-9a-f]{32}$')
516 if [ X"$md5" = X"" ] ; then
517 source_md5=`grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
518 if [ ! -z "$source_md5" ] ; then
521 # we have empty SourceX-md5, but it is still possible
522 # that we have NoSourceX-md5 AND NoSource: X
523 nosource_md5=`grep -i "#[ ]*NoSource$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
524 if [ ! -z "$nosource_md5" -a ! X"`grep -i "^NoSource:[ ]*$no$" $SPECFILE`" = X"" ] ; then
529 if [ $(echo "$md5" | wc -l) != 1 ] ; then
530 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
532 echo "$md5" | tail -n 1
538 echo "$PROTOCOL$DISTFILES_SERVER/distfiles/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
541 distfiles_attic_url ()
543 echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
550 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
555 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
556 [ -n "$size" -a "$size" -gt 0 ]
561 if [ "$CVSIGNORE_DF" != "yes" ]; then
564 cvsignore=${SOURCE_DIR}/.cvsignore
565 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
566 echo "$1" >> $cvsignore
574 if [ -n "$DEBUG" ]; then
579 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
583 if [ -n "$CVSROOT" ]; then
584 OPTIONS="-d $CVSROOT $OPTIONS"
586 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
587 echo "warning: No cvs access defined for SOURCES"
591 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
592 OPTIONS="$OPTIONS -A"
594 if [ -n "$CVSDATE" ]; then
595 OPTIONS="$OPTIONS -D $CVSDATE"
597 if [ -n "$CVSTAG" ]; then
598 OPTIONS="$OPTIONS -r $CVSTAG"
603 if [ -n "$UPDATE5" ]; then
604 if [ -n "$ADD5" ]; then
605 [ `nourl $i` = "$i" ] && continue
606 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
608 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
612 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
613 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
614 echo "Warning: no URL given for $i"
617 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
618 if good_md5 "$i" && good_size "$i"; then
619 echo "$(nourl "$i") having proper md5sum already exists"
623 url=$(distfiles_url "$i")
624 url_attic=$(distfiles_attic_url "$i")
626 if [ `echo $url | grep -E '^(\.|/)'` ]; then
627 ${GETLOCAL} $url $target
629 if [ -z "$NOMIRRORS" ]; then
630 url="`find_mirror "$url"`"
632 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
633 if [ `echo $url | grep -E 'ftp://'` ]; then
634 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
637 if ! test -s "$target"; then
639 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
640 ${GETLOCAL} $url_attic $target
642 if [ -z "$NOMIRRORS" ]; then
643 url_attic="`find_mirror "$url_attic"`"
645 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
646 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
647 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
651 if test -s "$target"; then
657 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
658 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
661 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
663 retries_counter=$(( $retries_counter + 1 ))
664 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
666 [ -n "$output" ] && echo "$output"
667 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
668 echo "Trying again [`nourl $i`]... ($retries_counter)"
677 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
678 if [ -z "$NOMIRRORS" ]; then
679 im="`find_mirror "$i"`"
684 if [ `echo $im | grep -E 'ftp://'` ]; then
691 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
692 Exit_error err_no_source_in_repo $i;
693 elif [ -n "$UPDATE5" ] && \
694 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
695 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
696 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
698 echo "Updating source-$srcno md5."
699 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
701 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
702 print "# Source'$srcno'-md5:\t'$md5'\n"
703 if /^Source'$srcno'\s*:\s+/;
708 if good_md5 "$i" && good_size "$i"; then
710 elif [ "$FROM_DISTFILES" = 1 ]; then
711 # wrong md5 from distfiles: remove the file and try again
713 echo "MD5 sum mismatch. Trying full fetch."
716 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
717 if [ `echo $url | grep -E 'ftp://'` ]; then
718 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
720 if ! test -s "$target"; then
722 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
723 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
724 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
727 test -s "$target" || rm -f "$target"
730 if good_md5 "$i" && good_size "$i" ; then
733 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
734 echo "or -5 to update md5 sums, if you're sure files are correct."
735 Exit_error err_no_source_in_repo $i
739 if [ "$CHMOD" = "yes" ]; then
740 CHMOD_FILES="`nourl $GET_FILES`"
741 if [ -n "$CHMOD_FILES" ]; then
742 chmod $CHMOD_MODE $CHMOD_FILES
751 if [ -n "$DEBUG" ]; then
756 # Check whether first character of PACKAGE_NAME is legal for tag name
757 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
760 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"`
761 # Remove #kernel.version_release from TAGVER because tagging sources
762 # could occur with different kernel-headers than kernel-headers used at build time.
763 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
771 if [ -n "$DEBUG" ]; then
776 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
777 echo "Version: $PACKAGE_VERSION"
778 echo "Release: $PACKAGE_RELEASE"
782 if [ "$TAG_VERSION" = "yes" ]; then
783 echo "CVS tag: $TAGVER"
785 if [ -n "$TAG" ]; then
790 if [ -n "$CVSROOT" ]; then
791 OPTIONS="-d $CVSROOT $OPTIONS"
797 # don't tag files stored on distfiles
798 [ -n "`src_md5 $i`" ] && continue
799 if [ -f "`nourl $i`" ]; then
800 if [ "$TAG_VERSION" = "yes" ]; then
801 cvs $OPTIONS $TAGVER `nourl $i`
803 if [ -n "$TAG" ]; then
804 cvs $OPTIONS $TAG `nourl $i`
807 Exit_error err_no_source_in_repo $i
812 if [ "$TAG_VERSION" = "yes" ]; then
813 cvs $OPTIONS $TAGVER $SPECFILE
815 if [ -n "$TAG" ]; then
816 cvs $OPTIONS $TAG $SPECFILE
826 echo "CVS branch tag: $TAG"
831 if [ -n "$DEBUG" ]; then
836 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
839 if [ -n "$CVSROOT" ]; then
840 OPTIONS="-d $CVSROOT $OPTIONS"
845 if [ -f `nourl $i` ]; then
846 cvs $OPTIONS $TAG `nourl $i`
848 Exit_error err_no_source_in_repo $i
852 cvs $OPTIONS $TAG $SPECFILE
862 if [ -n "$DEBUG" ]; then
869 if [ -n "$TRY_UPGRADE" ]; then
870 if [ -n "$FLOAT_VERSION" ]; then
871 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
873 TNOTIFY=`./pldnotify.awk $SPECFILE`
876 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
878 if [ -n "$TNEWVER" ]; then
879 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
880 echo "New version found, updating spec file to version " $TNEWVER
881 cp -f $SPECFILE $SPECFILE.bak
883 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
884 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
886 if [ -n "$ICONS" ]; then
890 get_files "$SOURCES $PATCHES";
891 unset TOLDVER TNEWVER TNOTIFY
898 BUILD_SWITCH="-ba" ;;
900 BUILD_SWITCH="-bb" ;;
902 BUILD_SWITCH="-bs --nodeps" ;;
904 BUILD_SWITCH="-bp --nodeps" ;;
906 if [ -n "$LOGFILE" ]; then
907 LOG=`eval echo $LOGFILE`
908 if [ -d "$LOG" ]; then
909 echo "Log file $LOG is a directory."
910 echo "Parse error in the spec?"
911 Exit_error err_build_fail;
913 if [ -n "$LASTLOG_FILE" ]; then
914 echo "LASTLOG=$LOG" > $LASTLOG_FILE
916 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
917 (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
918 RETVAL=`cat $RES_FILE`
920 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
921 if [ "$RETVAL" -eq "0" ]; then
928 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE
931 if [ "$RETVAL" -ne "0" ]; then
932 if [ -n "$TRY_UPGRADE" ]; then
933 echo "\n!!! Package with new version cannot be build automagically\n"
934 mv -f $SPECFILE.bak $SPECFILE
936 Exit_error err_build_fail;
943 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
946 install_required_packages()
954 AVAIL_BCONDS_WITHOUT=""
956 if `grep -q ^%bcond ${SPECFILE}`; then
958 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
964 # expand bconds from ~/.bcondrc
965 # The file structure is like gentoo's package.use:
968 # samba -mysql -pgsql
969 # w32codec license_agreement
972 if [ "${BCOND_VERSION}" != "NONE" ] && ( [ -f $HOME/.bcondrc ] || ( [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] ) ) ; then
973 # This takes package name, first defined in spec.
974 # so consider that when defining flags for package.
975 PN=`$RPM -q --qf '%{NAME}\n' --specfile $SPECFILE | head -n 1`
976 AVAIL=`$RPMBUILD --bcond $SPECFILE`
978 BCONDRC=$HOME/.bcondrc
979 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && BCONDRC=$HOME_ETC/.bcondrc
981 while read pkg flags; do
983 [[ "$pkg" == \#* ]] && continue
985 # any package or current package?
986 if [ "$pkg" = "*" ] || [ "$pkg" = "$PN" ]; then
987 for flag in $flags; do
990 # use only flags which are in this package.
991 if [[ $AVAIL = *${opt}* ]]; then
992 if [[ $flag = -* ]]; then
993 BCOND="$BCOND --without $opt"
995 BCOND="$BCOND --with $opt"
1003 case "${BCOND_VERSION}" in
1008 echo "Warning: This spec has old style bconds. Fix it || die."
1009 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_without_`
1011 AVAIL_BCOND_WITHOUT=`echo $opt|sed -e "s/^_without_//g"`
1012 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1013 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1015 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1019 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_with_`
1021 AVAIL_BCOND_WITH=`echo $opt|sed -e "s/^_with_//g"`
1022 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1023 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1025 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1030 cond_type="" # with || without
1031 for opt in `$RPMBUILD --bcond $SPECFILE`
1041 case "$cond_type" in
1044 AVAIL_BCOND_WITH="$opt"
1045 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1046 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1048 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1053 AVAIL_BCOND_WITHOUT="$opt"
1054 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1055 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1057 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1071 echo -ne "Package installation failed:\t$package_name\n"
1073 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1074 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1075 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1076 # jakby nie bylo tego kawalka kodu.
1078 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1079 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1086 # Istnieje taki spec? ${package}.spec
1087 if [ -f "${SPECS_DIR}${package}.spec" ]; then
1088 parent_spec_name=${package}.spec
1089 elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1090 parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1092 for provides_line in `grep ^Provides:.*$package ${SPECS_DIR} -R`
1098 if [ "${parent_spec_name}" != "" ]; then
1100 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1101 sub_builder_opts="${sub_builder_opts} -R"
1103 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1104 sub_builder_opts="${sub_builder_opts} -RB"
1105 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1106 sub_builder_opts="${sub_builder_opts} -FRB"
1108 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1109 sub_builder_opts="${sub_builder_opts} -Upi"
1112 ./builder ${sub_builder_opts} ${parent_spec_name}
1114 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1117 remove_build_requires()
1119 if [ "$INSTALLED_PACKAGES" != "" ]; then
1120 case "$REMOVE_BUILD_REQUIRES" in
1122 run_poldek --noask -ve $INSTALLED_PACKAGES
1125 run_poldek --ask -ve $INSTALLED_PACKAGES
1128 echo You may want to manually remove following BuildRequires fetched:
1129 echo $INSTALLED_PACKAGES
1130 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1138 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1139 if [ "$BCOND" != "" ]; then
1140 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1143 echo -ne "\nNo conditional flags passed"
1145 echo -ne "\n\nfrom available:\n"
1146 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1150 fetch_build_requires()
1152 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1153 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1154 CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print "@" $3 } ' | xargs)
1155 DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print "@" $3 } ' | xargs)
1156 if [ -n "$CONF" -o -n "$DEPS" ]; then
1157 $SU_SUDO /usr/bin/poldek --update; $SU_SUDO /usr/bin/poldek --upa
1159 if [ -n "$CONF" ]; then
1160 echo "Trying to uninstall conflicting packages ($CONF):"
1161 $SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CONF
1163 if [ -n "$DEPS" ]; then
1164 echo "Trying to install dependencies ($DEPS):"
1165 $SU_SUDO /usr/bin/poldek --caplookup -uGv $DEPS
1170 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1171 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1172 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1173 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1174 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1175 for package_item in `cat $SPECFILE|grep -B100000 ^%changelog|grep -v ^#|grep BuildRequires|grep -v ^-|sed -e "s/^.*BuildRequires://g"|awk '{print $1}'|sed -e s,perl\(,perl-,g -e s,::,-,g -e s,\(.*\),,g -e s,%{,,g -e s,},,g|grep -v OpenGL-devel|sed -e s,sh-utils,coreutils,g -e s,fileutils,coreutils,g -e s,textutils,coreutils,g -e s,kgcc_package,gcc,g -e s,\),,g`
1177 package_item="`echo $package_item|sed -e s,rpmbuild,rpm-build,g |sed -e s,__perl,perl,g |sed -e s,gasp,binutils-gasp,g -e s,binutils-binutils,binutils,g -e s,apxs,apache,g|sed -e s,apache\(EAPI\)-devel,apache-devel,g -e s,kernel-headers\(netfilter\),kernel-headers,g -e s,awk,mawk,g -e s,mmawk,mawk,g -e s,motif,openmotif,g -e s,openopenmotif,openmotif,g`"
1179 package=`basename "$package_item"|sed -e "s/}$//g"`
1180 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1183 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1184 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1185 if [ "$COND_ARCH_TST" != "" ] && [ "`echo $COND_ARCH_TST|sed -e "s/i.86/ix86/g"`" != "`echo $mach|sed -e "s/i.86/ix86/g"`" ]; then
1190 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1193 if `echo $COND_TST|grep -q 'without_'`; then
1194 COND_NAME=`echo $COND_NAME|sed -e s,^.*without_,,g`
1195 if `echo $COND_TST|grep -q !`; then
1200 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1201 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1202 if [ -n "$COND_WITHOUT" ] || [ -z "$COND_WITH" ]; then
1208 elif `echo $COND_TST|grep -q 'with_'`; then
1209 COND_NAME=`echo $COND_NAME|sed -e s,^.*with_,,g`
1210 if `echo $COND_TST|grep -q !`; then
1215 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1216 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1217 if [ -n "$COND_WITH" ] || [ -z "$COND_WITHOUT" ]; then
1223 RESULT="${COND_STATE}-${COND_ARGV}"
1225 "with-wout" | "wout-with" )
1228 "wout-wout" | "with-with" )
1232 echo "Action '$RESULT' was not defined for package '$package_item'"
1238 if [ "$GO" = "yes" ]; then
1239 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1240 echo "Testing if $package has subrequirements..."
1241 run_poldek -t -i $package --dumpn=".$package-req.txt"
1242 if [ -f ".$package-req.txt" ]; then
1243 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1245 if [ "$package_name" = "$package" ]; then
1246 echo -ne "Installing BuildRequired package:\t$package_name\n"
1247 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing BuildRequired package: ${package_name}\007"`
1248 install_required_packages $package;
1250 echo -ne "Installing (sub)Required package:\t$package_name\n"
1251 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing (sub)Required package: ${package_name}\007"`
1252 install_required_packages $package_name;
1256 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1257 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1260 echo "Attempting to run spawn sub - builder..."
1261 run_sub_builder $package_name
1262 if [ $? -eq 0 ]; then
1263 install_required_packages $package_name;
1266 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1267 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1270 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1277 rm -f ".$package-req.txt"
1279 echo "Attempting to run spawn sub - builder..."
1280 run_sub_builder $package
1281 if [ $? -eq 0 ]; then
1282 install_required_packages $package;
1285 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1286 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1289 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1295 echo "Package $package is already installed. BuildRequirement satisfied."
1299 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1300 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1301 echo "Unable to install following packages and their dependencies:"
1302 for pkg in "$NOT_INSTALLED_PACKAGES"
1306 remove_build_requires
1312 #---------------------------------------------
1315 if [ "$#" = 0 ]; then
1341 DEBUG="yes"; shift ;;
1343 COMMAND="version"; shift ;;
1345 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1346 -b | -ba | --build )
1347 COMMAND="build"; shift ;;
1348 -bb | --build-binary )
1349 COMMAND="build-binary"; shift ;;
1350 -bs | --build-source )
1351 COMMAND="build-source"; shift ;;
1352 -bp | --build-prep )
1353 COMMAND="build-prep"; shift ;;
1355 COMMAND="branch"; shift; TAG="${1}"; shift;;
1357 CLEAN="--clean --rmspec --rmsource"; shift ;;
1359 shift; CVSROOT="${1}"; shift ;;
1361 COMMAND="get"; shift ;;
1363 COMMAND="usage"; shift ;;
1365 PROTOCOL="http"; shift ;;
1367 shift; LOGFILE="${1}"; shift ;;
1369 shift; DEF_NICE_LEVEL=${1}; shift ;;
1371 COMMAND="mr-proper"; shift ;;
1373 NOCVS="yes"; shift ;;
1374 -ncs | --no-cvs-specs )
1375 NOCVSSPEC="yes"; shift ;;
1376 -nd | --no-distfiles )
1377 NODIST="yes"; shift ;;
1378 -nm | --no-mirrors )
1379 NOMIRRORS="yes"; shift ;;
1381 NOURLS="yes"; shift ;;
1383 NOSRCS="yes"; shift ;;
1384 -ns0 | --no-source0 )
1385 NOSOURCE0="yes"; shift ;;
1395 shift; RPMOPTS="$RPM_OPTS ${1}"; shift ;;
1396 --with | --without )
1397 case $GROUP_BCONDS in
1401 while ! `echo ${1}|grep -qE '(^-|spec)'`
1403 BCOND="$BCOND $COND $1"
1407 BCOND="$BCOND $1 $2" ; shift 2 ;;
1411 shift; TARGET="${1}"; shift ;;
1413 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
1415 QUIET="--quiet"; shift ;;
1417 CVSDATE="${2}"; shift 2 ;;
1419 shift; CVSTAG="${1}"; shift ;;
1420 -R | --fetch-build-requires)
1421 FETCH_BUILD_REQUIRES="yes"
1422 NOT_INSTALLED_PACKAGES=
1424 -RB | --remove-build-requires)
1425 REMOVE_BUILD_REQUIRES="nice"
1427 -FRB | --force-remove-build-requires)
1428 REMOVE_BUILD_REQUIRES="force"
1430 -sf | --sources-files)
1431 COMMAND="list-sources-files"
1433 -sp | --sources-paths)
1434 COMMAND="list-sources-local-paths"
1436 -Tvs | --tag-version-stable )
1441 -Tvn | --tag-version-nest )
1446 -Ts | --tag-stable )
1456 -Tv | --tag-version )
1461 -Tp | --tag-prefix )
1473 -ir | --integer-release-only )
1474 INTEGER_RELEASE="yes"
1483 -Upi | --update-poldek-indexes )
1484 UPDATE_POLDEK_INDEXES="yes"
1486 -u | --try-upgrade )
1487 TRY_UPGRADE="1"; shift ;;
1488 -un | --try-upgrade-with-float-version )
1489 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
1491 BE_VERBOSE="1"; shift ;;
1497 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
1501 RPMOPTS="${RPMOPTS} --nodeps"
1504 RPMOPTS="${RPMOPTS} -debug"; shift ;;
1507 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1512 if [ -n "$DEBUG" ]; then
1517 if [ -n "$TARGET" ]; then
1520 TARGET_SWITCH="--target $TARGET" ;;
1522 TARGET_SWITCH="--target=$TARGET" ;;
1527 "build" | "build-binary" | "build-source" | "build-prep" )
1529 if [ -n "$SPECFILE" ]; then
1533 fetch_build_requires;
1535 if [ "$INTEGER_RELEASE" = "yes" ]; then
1536 echo "Checking release $PACKAGE_RELEASE..."
1537 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
1538 Exit_error err_fract_rel "$PACKAGE_RELEASE"
1542 if [ -n "$TEST_TAG" ]; then
1543 TAGVER=`make_tagver`
1544 echo "Searching for tag $TAGVER..."
1545 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
1546 if [ -n "$TAGREL" ]; then
1547 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
1551 if [ -n "$ICONS" ]; then
1555 if [ -n "$NOSOURCE0" ] ; then
1556 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1558 get_files "$SOURCES $PATCHES";
1560 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
1561 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
1563 remove_build_requires;
1565 Exit_error err_no_spec_in_cmdl;
1570 if [ -n "$SPECFILE" ]; then
1573 if [ -n "$ICONS" ]; then
1577 get_files $SOURCES $PATCHES;
1578 branch_files $TAG "$SOURCES $PATCHES $ICONS";
1580 Exit_error err_no_spec_in_cmdl;
1585 if [ -n "$SPECFILE" ]; then
1588 if [ -n "$ICONS" ]; then
1589 OLD_UPDATE5=$UPDATE5
1590 UPDATE5= get_files $ICONS
1591 UPDATE5=$OLD_UPDATE5
1594 if [ -n "$NOSOURCE0" ] ; then
1595 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1597 get_files $SOURCES $PATCHES
1599 Exit_error err_no_spec_in_cmdl;
1606 if [ -n "$SPECFILE" ]; then
1609 if [ -n "$ICONS" ]; then
1613 # don't fetch sources from remote locations
1615 for file in $SOURCES
1617 [ -n "`src_md5 $file`" ] && continue
1618 new_SOURCES="$new_SOURCES $file"
1620 SOURCES="$new_SOURCES"
1621 get_files $SOURCES $PATCHES;
1622 tag_files "$SOURCES $PATCHES $ICONS";
1624 Exit_error err_no_spec_in_cmdl;
1628 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
1630 "list-sources-files" )
1633 DONT_PRINT_REVISION="yes"
1636 SAPS="$SOURCES $PATCHES"
1637 for SAP in $SAPS ; do
1638 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
1641 "list-sources-local-paths" )
1644 DONT_PRINT_REVISION="yes"
1647 SAPS="$SOURCES $PATCHES"
1648 for SAP in $SAPS ; do
1649 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
1657 if [ -f `pwd`/.${SPECFILE}_INSTALLED_PACKAGES -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
1658 rm `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1662 # vi:syntax=sh:ts=3:sw=4