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'
110 if [ -n "$HOME_ETC" ]; then
111 USER_CFG="$HOME_ETC/.builderrc"
113 USER_CFG=~/.builderrc
116 [ -f "$USER_CFG" ] && . "$USER_CFG"
118 if [ -n "$USE_PROZILLA" ]; then
119 GETURI="proz --no-getch -r -P ./ -t$WGET_RETRIES $PROZILLA_OPTS"
122 elif [ -n "$USE_AXEL" ]; then
123 GETURI="axel -n 4 -a $AXEL_OPTS"
127 wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
128 wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
130 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
131 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
137 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
145 POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
146 POLDEK_CMD="/usr/bin/poldek --noask"
150 RES_FILE=~/tmp/poldek-exit-status.$RANDOM
151 if [ -n "$LOGFILE" ]; then
152 LOG=`eval echo $LOGFILE`
153 if [ -n "$LASTLOG_FILE" ]; then
154 echo "LASTLOG=$LOG" > $LASTLOG_FILE
156 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee $LOG
159 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
160 return `cat ${RES_FILE}`
165 #---------------------------------------------
170 if [ -n "$DEBUG" ]; then set -xv; fi
172 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
174 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
175 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
176 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
177 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
178 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
179 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
180 [{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
181 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
182 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
184 -5, --update-md5 - update md5 comments in spec, implies -nd -ncs
185 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
186 -n5, --no-md5 - ignore md5 comments in spec
187 -D, --debug - enable builder script debugging mode,
188 -debug - produce rpm debug package (same as --opts -debug)
189 -V, --version - output builder version
190 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
191 -b, -ba, --build - get all files from CVS repo or HTTP/FTP and build package
193 -bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
194 only package from <package>.spec,
195 -bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
197 -bp, --build-prep - execute the %prep phase of <package>.spec,
198 -B, --branch - add branch
199 -c, --clean - clean all temporarily created files (in BUILD, SOURCES,
200 SPECS and \$RPM_BUILD_ROOT),
201 -d <cvsroot>, --cvsroot <cvsroot>
203 --define <macro> <value>
204 - define a macro <macro> with value <value>,
205 --nodeps - rpm won't check any dependences
206 -g, --get - get <package>.spec and all related files from CVS repo
208 -h, --help - this message,
209 --http - use http instead of ftp,
210 -l <logfile>, --logtofile <logfile>
212 -m, --mr-proper - only remove all files related to spec file and all work
214 -nc, --no-cvs - don't download sources from CVS, if source URL is given,
216 - don't check specs in CVS
217 -nd, --no-distfiles - don't download from distfiles
218 -nm, --no-mirrors - don't download from mirror, if source URL is given,
219 -nu, --no-urls - don't try to download from FTP/HTTP location,
220 -ns, --no-srcs - don't download Sources
221 -ns0, --no-source0 - don't download Source0
222 -nn, --no-net - don't download anything from the net
223 --opts <rpm opts> - additional options for rpm
224 -q, --quiet - be quiet,
225 --date yyyy-mm-dd - build package using resources from specified CVS date,
226 -r <cvstag>, --cvstag <cvstag>
227 - build package using resources from specified CVS tag,
228 -R, --fetch-build-requires
229 - fetch what is BuildRequired,
230 -RB, --remove-build-requires
231 - remove all you fetched with -R or --fetch-build-requires
232 remember, this option requires confirmation,
233 -FRB, --force-remove-build-requires
234 - remove all you fetched with -R or --fetch-build-requires
235 remember, this option works without confirmation,
236 -sf, --source-files - list sources - bare filenames (intended for offline
237 operations; does not work when Icon field is present
238 but icon file is absent),
239 -sp, --source-paths - list sources - filenames with full local paths (intended for
240 offline operations; does not work when Icon field is present
241 but icon file is absent),
242 -T <cvstag> , --tag <cvstag>
243 - add cvs tag <cvstag> for files,
244 -Tvs, --tag-version-stable
245 - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
246 -Tvn, --tag-version-nest
247 - add cvs tags NEST and NAME-VERSION-RELEASE for files,
249 - add cvs tag STABLE for files,
251 - add cvs tag NEST for files,
253 - add cvs tag NAME-VERSION-RELEASE for files,
254 -Tp, --tag-prefix <prefix>
255 - add <prefix> to NAME-VERSION-RELEASE tags,
256 -tt, --test-tag <prefix>
257 - fail if tag is already present,
258 -ir, --integer-release-only
259 - allow only integer and snapshot releases
260 -v, --verbose - be verbose,
261 -u, --try-upgrade - check version, and try to upgrade package
262 -un, --try-upgrade-with-float-version
263 - as above, but allow float version
264 -U, --update - refetch sources, don't use distfiles, and update md5 comments
265 -Upi, --update-poldek-indexes
266 - refresh or make poldek package index files.
267 --with/--without <feature>
268 - conditional build package depending on %_with_<feature>/
269 %_without_<feature> macro switch. You may now use
270 --with feat1 feat2 feat3 --without feat4 feat5 --with feat6
271 constructions. Set GROUP_BCONDS to yes to make use of it.
272 --target <platform>, --target=<platform>
273 - build for platform <platform>.
278 if [ -n "$DEBUG" ]; then
285 rpm -bp --nodeps --define 'prep %dump' $BCOND $TARGET_SWITCH $SPECFILE 2>&1
288 rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
294 if [ -z "$rpm_dump_cache" ] ; then
295 echo "internal error: cache_rpm_dump not called!" 1>&2
297 echo "$rpm_dump_cache"
302 if [ -n "$DEBUG" ]; then
311 if [ "$NOSRCS" != "yes" ]; then
312 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
314 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
315 FAIL_IF_NO_SOURCES="no"
318 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
319 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
320 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
321 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -n 1`"
322 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
324 # These variables may be unset after first cache_rpm_dump call
325 # (because of not-yet-retrieved icon file)
327 # if [ -z "$PACKAGE_NAME" -o -z "$PACKAGE_VERSION" -o -z "$PACKAGE_RELEASE" ]; then
328 # Exit_error err_no_package_data;
331 if [ -n "$BE_VERBOSE" ]; then
332 echo "- Sources : `nourl $SOURCES`"
333 if [ -n "$PATCHES" ]; then
334 echo "- Patches : `nourl $PATCHES`"
336 echo "- Patches : *no patches needed*"
338 if [ -n "$ICONS" ]; then
339 echo "- Icon : `nourl $ICONS`"
341 echo "- Icon : *no package icon*"
343 echo "- Name : $PACKAGE_NAME"
344 echo "- Version : $PACKAGE_VERSION"
345 echo "- Release : $PACKAGE_RELEASE"
351 if [ -n "$DEBUG" ]; then
359 "err_no_spec_in_cmdl" )
360 remove_build_requires
361 echo "ERROR: spec file name not specified.";
363 "err_no_spec_in_repo" )
364 remove_build_requires
365 echo "Error: spec file not stored in CVS repo.";
367 "err_no_source_in_repo" )
368 remove_build_requires
369 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
372 remove_build_requires
373 echo "Error: package build failed. (${2:-no more info})";
375 "err_no_package_data" )
376 remove_build_requires
377 echo "Error: couldn't get out package name/version/release from spec file."
380 remove_build_requires
381 echo "Tag ${2} already exists (spec release: ${3}).";
384 remove_build_requires
385 echo "Release ${2} not integer and not a snapshot.";
389 echo "Unknown error."
395 if [ -n "$DEBUG" ]; then
400 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
401 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
408 if [ -n "$DEBUG" ]; then
414 if [ \! -f "$SPECFILE" ]; then
415 SPECFILE="`basename $SPECFILE .spec`.spec";
417 if [ "$NOCVSSPEC" != "yes" ]; then
420 if [ -n "$CVSROOT" ]; then
421 OPTIONS="-d $CVSROOT $OPTIONS"
423 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
424 echo "warning: No cvs access defined - using local .spec file"
429 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
430 OPTIONS="$OPTIONS -A"
432 if [ -n "$CVSDATE" ]; then
433 OPTIONS="$OPTIONS -D $CVSDATE"
435 if [ -n "$CVSTAG" ]; then
436 OPTIONS="$OPTIONS -r $CVSTAG"
442 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
444 retries_counter=$(( $retries_counter + 1 ))
445 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
447 [ -n "$output" ] && echo "$output"
448 if [ "$result" -ne "0" ]; then
449 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
450 echo "Trying again [$SPECFILE]... ($retries_counter)"
454 Exit_error err_no_spec_in_repo;
458 if [ ! -f "$SPECFILE" ]; then
459 Exit_error err_no_spec_in_repo;
462 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
463 chmod $CHMOD_MODE $SPECFILE
466 [ -n "$DONT_PRINT_REVISION" ] || grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
473 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
474 cvs update mirrors >&2
478 while read origin mirror name rest
480 ol=`echo -n "$origin"|wc -c`
481 prefix="`echo -n "$url" | head -c $ol`"
482 if [ "$prefix" = "$origin" ] ; then
483 suffix="`echo "$url"|cut -b $ol-`"
484 echo -n "$mirror$suffix"
495 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
496 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
502 [ X"$NO5" = X"yes" ] && return
504 [ -z "$no" ] && return
506 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
507 if [ -z "$spec_rev" ]; then
508 spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
510 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
511 md5=$(grep -s -v '^#' additional-md5sums | \
512 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
513 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
514 grep -E '^[0-9a-f]{32}$')
515 if [ X"$md5" = X"" ] ; then
516 source_md5=`grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
517 if [ ! -z "$source_md5" ] ; then
520 # we have empty SourceX-md5, but it is still possible
521 # that we have NoSourceX-md5 AND NoSource: X
522 nosource_md5=`grep -i "#[ ]*NoSource$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
523 if [ ! -z "$nosource_md5" -a ! X"`grep -i "^NoSource:[ ]*$no$" $SPECFILE`" = X"" ] ; then
528 if [ $(echo "$md5" | wc -l) != 1 ] ; then
529 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
531 echo "$md5" | tail -n 1
537 echo "$PROTOCOL$DISTFILES_SERVER/distfiles/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
540 distfiles_attic_url ()
542 echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
549 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
554 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
555 [ -n "$size" -a "$size" -gt 0 ]
560 if [ "$CVSIGNORE_DF" != "yes" ]; then
563 cvsignore=${SOURCE_DIR}/.cvsignore
564 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
565 echo "$1" >> $cvsignore
573 if [ -n "$DEBUG" ]; then
578 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
582 if [ -n "$CVSROOT" ]; then
583 OPTIONS="-d $CVSROOT $OPTIONS"
585 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
586 echo "warning: No cvs access defined for SOURCES"
590 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
591 OPTIONS="$OPTIONS -A"
593 if [ -n "$CVSDATE" ]; then
594 OPTIONS="$OPTIONS -D $CVSDATE"
596 if [ -n "$CVSTAG" ]; then
597 OPTIONS="$OPTIONS -r $CVSTAG"
602 if [ -n "$UPDATE5" ]; then
603 if [ -n "$ADD5" ]; then
604 [ `nourl $i` = "$i" ] && continue
605 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
607 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
611 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
612 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
613 echo "Warning: no URL given for $i"
616 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
617 if good_md5 "$i" && good_size "$i"; then
618 echo "$(nourl "$i") having proper md5sum already exists"
622 url=$(distfiles_url "$i")
623 url_attic=$(distfiles_attic_url "$i")
625 if [ `echo $url | grep -E '^(\.|/)'` ]; then
626 ${GETLOCAL} $url $target
628 if [ -z "$NOMIRRORS" ]; then
629 url="`find_mirror "$url"`"
631 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
632 if [ `echo $url | grep -E 'ftp://'` ]; then
633 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
636 if ! test -s "$target"; then
638 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
639 ${GETLOCAL} $url_attic $target
641 if [ -z "$NOMIRRORS" ]; then
642 url_attic="`find_mirror "$url_attic"`"
644 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
645 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
646 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
650 if test -s "$target"; then
656 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
657 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
660 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
662 retries_counter=$(( $retries_counter + 1 ))
663 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
665 [ -n "$output" ] && echo "$output"
666 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
667 echo "Trying again [`nourl $i`]... ($retries_counter)"
676 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
677 if [ -z "$NOMIRRORS" ]; then
678 im="`find_mirror "$i"`"
683 if [ `echo $im | grep -E 'ftp://'` ]; then
690 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
691 Exit_error err_no_source_in_repo $i;
692 elif [ -n "$UPDATE5" ] && \
693 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
694 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
695 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
697 echo "Updating source-$srcno md5."
698 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
700 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
701 print "# Source'$srcno'-md5:\t'$md5'\n"
702 if /^Source'$srcno'\s*:\s+/;
707 if good_md5 "$i" && good_size "$i"; then
709 elif [ "$FROM_DISTFILES" = 1 ]; then
710 # wrong md5 from distfiles: remove the file and try again
712 echo "MD5 sum mismatch. Trying full fetch."
715 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
716 if [ `echo $url | grep -E 'ftp://'` ]; then
717 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
719 if ! test -s "$target"; then
721 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
722 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
723 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
726 test -s "$target" || rm -f "$target"
729 if good_md5 "$i" && good_size "$i" ; then
732 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
733 echo "or -5 to update md5 sums, if you're sure files are correct."
734 Exit_error err_no_source_in_repo $i
738 if [ "$CHMOD" = "yes" ]; then
739 CHMOD_FILES="`nourl $GET_FILES`"
740 if [ -n "$CHMOD_FILES" ]; then
741 chmod $CHMOD_MODE $CHMOD_FILES
750 if [ -n "$DEBUG" ]; then
755 # Check whether first character of PACKAGE_NAME is legal for tag name
756 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
759 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"`
760 # Remove #kernel.version_release from TAGVER because tagging sources
761 # could occur with different kernel-headers than kernel-headers used at build time.
762 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
770 if [ -n "$DEBUG" ]; then
775 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
776 echo "Version: $PACKAGE_VERSION"
777 echo "Release: $PACKAGE_RELEASE"
781 if [ "$TAG_VERSION" = "yes" ]; then
782 echo "CVS tag: $TAGVER"
784 if [ -n "$TAG" ]; then
789 if [ -n "$CVSROOT" ]; then
790 OPTIONS="-d $CVSROOT $OPTIONS"
796 # don't tag files stored on distfiles
797 [ -n "`src_md5 $i`" ] && continue
798 if [ -f "`nourl $i`" ]; then
799 if [ "$TAG_VERSION" = "yes" ]; then
800 cvs $OPTIONS $TAGVER `nourl $i`
802 if [ -n "$TAG" ]; then
803 cvs $OPTIONS $TAG `nourl $i`
806 Exit_error err_no_source_in_repo $i
811 if [ "$TAG_VERSION" = "yes" ]; then
812 cvs $OPTIONS $TAGVER $SPECFILE
814 if [ -n "$TAG" ]; then
815 cvs $OPTIONS $TAG $SPECFILE
825 echo "CVS branch tag: $TAG"
830 if [ -n "$DEBUG" ]; then
835 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
838 if [ -n "$CVSROOT" ]; then
839 OPTIONS="-d $CVSROOT $OPTIONS"
844 if [ -f `nourl $i` ]; then
845 cvs $OPTIONS $TAG `nourl $i`
847 Exit_error err_no_source_in_repo $i
851 cvs $OPTIONS $TAG $SPECFILE
861 if [ -n "$DEBUG" ]; then
868 if [ -n "$TRY_UPGRADE" ]; then
869 if [ -n "$FLOAT_VERSION" ]; then
870 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
872 TNOTIFY=`./pldnotify.awk $SPECFILE`
875 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
877 if [ -n "$TNEWVER" ]; then
878 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
879 echo "New version found, updating spec file to version " $TNEWVER
880 cp -f $SPECFILE $SPECFILE.bak
882 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
883 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
885 if [ -n "$ICONS" ]; then
889 get_files "$SOURCES $PATCHES";
890 unset TOLDVER TNEWVER TNOTIFY
897 BUILD_SWITCH="-ba" ;;
899 BUILD_SWITCH="-bb" ;;
901 BUILD_SWITCH="-bs --nodeps" ;;
903 BUILD_SWITCH="-bp --nodeps" ;;
905 if [ -n "$LOGFILE" ]; then
906 LOG=`eval echo $LOGFILE`
907 if [ -d "$LOG" ]; then
908 echo "Log file $LOG is a directory."
909 echo "Parse error in the spec?"
910 Exit_error err_build_fail;
912 if [ -n "$LASTLOG_FILE" ]; then
913 echo "LASTLOG=$LOG" > $LASTLOG_FILE
915 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
916 (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
917 RETVAL=`cat $RES_FILE`
919 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
920 if [ "$RETVAL" -eq "0" ]; then
927 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE
930 if [ "$RETVAL" -ne "0" ]; then
931 if [ -n "$TRY_UPGRADE" ]; then
932 echo "\n!!! Package with new version cannot be build automagically\n"
933 mv -f $SPECFILE.bak $SPECFILE
935 Exit_error err_build_fail;
942 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
945 install_required_packages()
953 AVAIL_BCONDS_WITHOUT=""
955 if `grep -q ^%bcond ${SPECFILE}`; then
957 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
963 # expand bconds from ~/.bcondrc
964 # The file structure is like gentoo's package.use:
967 # samba -mysql -pgsql
968 # w32codec license_agreement
971 if [ "${BCOND_VERSION}" != "NONE" ] && ( [ -f $HOME/.bcondrc ] || ( [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] ) ) ; then
972 # This takes package name, first defined in spec.
973 # so consider that when defining flags for package.
974 PN=`$RPM -q --qf '%{NAME}\n' --specfile $SPECFILE | head -n 1`
975 AVAIL=`$RPMBUILD --bcond $SPECFILE`
977 BCONDRC=$HOME/.bcondrc
978 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && BCONDRC=$HOME_ETC/.bcondrc
980 while read pkg flags; do
982 [[ "$pkg" == \#* ]] && continue
984 # any package or current package?
985 if [ "$pkg" = "*" ] || [ "$pkg" = "$PN" ]; then
986 for flag in $flags; do
989 # use only flags which are in this package.
990 if [[ $AVAIL = *${opt}* ]]; then
991 if [[ $flag = -* ]]; then
992 BCOND="$BCOND --without $opt"
994 BCOND="$BCOND --with $opt"
1002 case "${BCOND_VERSION}" in
1007 echo "Warning: This spec has old style bconds. Fix it || die."
1008 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_without_`
1010 AVAIL_BCOND_WITHOUT=`echo $opt|sed -e "s/^_without_//g"`
1011 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1012 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1014 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1018 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_with_`
1020 AVAIL_BCOND_WITH=`echo $opt|sed -e "s/^_with_//g"`
1021 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1022 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1024 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1029 cond_type="" # with || without
1030 for opt in `$RPMBUILD --bcond $SPECFILE`
1040 case "$cond_type" in
1043 AVAIL_BCOND_WITH="$opt"
1044 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1045 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1047 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1052 AVAIL_BCOND_WITHOUT="$opt"
1053 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1054 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1056 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1070 echo -ne "Package installation failed:\t$package_name\n"
1072 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1073 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1074 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1075 # jakby nie bylo tego kawalka kodu.
1077 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1078 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1085 # Istnieje taki spec? ${package}.spec
1086 if [ -f "${SPECS_DIR}${package}.spec" ]; then
1087 parent_spec_name=${package}.spec
1088 elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1089 parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1091 for provides_line in `grep ^Provides:.*$package ${SPECS_DIR} -R`
1097 if [ "${parent_spec_name}" != "" ]; then
1099 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1100 sub_builder_opts="${sub_builder_opts} -R"
1102 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1103 sub_builder_opts="${sub_builder_opts} -RB"
1104 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1105 sub_builder_opts="${sub_builder_opts} -FRB"
1107 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1108 sub_builder_opts="${sub_builder_opts} -Upi"
1111 ./builder ${sub_builder_opts} ${parent_spec_name}
1113 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1116 remove_build_requires()
1118 if [ "$INSTALLED_PACKAGES" != "" ]; then
1119 case "$REMOVE_BUILD_REQUIRES" in
1121 run_poldek --noask -ve $INSTALLED_PACKAGES
1124 run_poldek --ask -ve $INSTALLED_PACKAGES
1127 echo You may want to manually remove following BuildRequires fetched:
1128 echo $INSTALLED_PACKAGES
1129 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1137 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1138 if [ "$BCOND" != "" ]; then
1139 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1142 echo -ne "\nNo conditional flags passed"
1144 echo -ne "\n\nfrom available:\n"
1145 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1149 fetch_build_requires()
1151 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1152 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1153 CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print "@" $3 } ' | xargs)
1154 DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print "@" $3 } ' | xargs)
1155 if [ -n "$CONF" -o -n "$DEPS" ]; then
1156 /usr/bin/poldek --update; /usr/bin/poldek --upa
1158 if [ -n "$CONF" ]; then
1159 echo "Trying to uninstall conflicting packages ($CONF):"
1160 /usr/bin/poldek --noask --nofollow -ev $CONF
1162 if [ -n "$DEPS" ]; then
1163 echo "Trying to install dependencies ($DEPS):"
1164 /usr/bin/poldek --caplookup -uGv $DEPS
1169 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1170 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1171 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1172 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1173 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1174 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`
1176 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`"
1178 package=`basename "$package_item"|sed -e "s/}$//g"`
1179 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1182 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1183 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1184 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
1189 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1192 if `echo $COND_TST|grep -q 'without_'`; then
1193 COND_NAME=`echo $COND_NAME|sed -e s,^.*_without_,,g`
1194 if `echo $COND_TST|grep -q !`; then
1199 if `echo $AVAIL_BCONDS_WITHOUT|grep -q "<$COND_NAME>"`; then
1205 elif `echo $COND_TST|grep -q 'with_'`; then
1206 COND_NAME=`echo $COND_NAME|sed -e s,^.*_with_,,g`
1207 if `echo $COND_TST|grep -q !`; then
1212 if `echo $AVAIL_BCONDS_WITH|grep -q "<$COND_NAME>"`; then
1218 RESULT="${COND_STATE}-${COND_ARGV}"
1220 "with-wout" | "wout-with" )
1223 "wout-wout" | "with-with" )
1227 echo "Action '$RESULT' was not defined for package '$package_item'"
1233 if [ "$GO" = "yes" ]; then
1234 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1235 echo "Testing if $package has subrequirements..."
1236 run_poldek -t -i $package --dumpn=".$package-req.txt"
1237 if [ -f ".$package-req.txt" ]; then
1238 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1240 if [ "$package_name" = "$package" ]; then
1241 echo -ne "Installing BuildRequired package:\t$package_name\n"
1242 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing BuildRequired package: ${package_name}\007"`
1243 install_required_packages $package;
1245 echo -ne "Installing (sub)Required package:\t$package_name\n"
1246 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing (sub)Required package: ${package_name}\007"`
1247 install_required_packages $package_name;
1251 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1252 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1255 echo "Attempting to run spawn sub - builder..."
1256 run_sub_builder $package_name
1257 if [ $? -eq 0 ]; then
1258 install_required_packages $package_name;
1261 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1262 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1265 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1272 rm -f ".$package-req.txt"
1274 echo "Attempting to run spawn sub - builder..."
1275 run_sub_builder $package
1276 if [ $? -eq 0 ]; then
1277 install_required_packages $package;
1280 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1281 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1284 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1290 echo "Package $package is already installed. BuildRequirement satisfied."
1294 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1295 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1296 echo "Unable to install following packages and their dependencies:"
1297 for pkg in "$NOT_INSTALLED_PACKAGES"
1301 remove_build_requires
1307 #---------------------------------------------
1310 if [ "$#" = 0 ]; then
1336 DEBUG="yes"; shift ;;
1338 COMMAND="version"; shift ;;
1340 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1341 -b | -ba | --build )
1342 COMMAND="build"; shift ;;
1343 -bb | --build-binary )
1344 COMMAND="build-binary"; shift ;;
1345 -bs | --build-source )
1346 COMMAND="build-source"; shift ;;
1347 -bp | --build-prep )
1348 COMMAND="build-prep"; shift ;;
1350 COMMAND="branch"; shift; TAG="${1}"; shift;;
1352 CLEAN="--clean --rmspec --rmsource"; shift ;;
1354 shift; CVSROOT="${1}"; shift ;;
1356 COMMAND="get"; shift ;;
1358 COMMAND="usage"; shift ;;
1360 PROTOCOL="http"; shift ;;
1362 shift; LOGFILE="${1}"; shift ;;
1364 shift; DEF_NICE_LEVEL=${1}; shift ;;
1366 COMMAND="mr-proper"; shift ;;
1368 NOCVS="yes"; shift ;;
1369 -ncs | --no-cvs-specs )
1370 NOCVSSPEC="yes"; shift ;;
1371 -nd | --no-distfiles )
1372 NODIST="yes"; shift ;;
1373 -nm | --no-mirrors )
1374 NOMIRRORS="yes"; shift ;;
1376 NOURLS="yes"; shift ;;
1378 NOSRCS="yes"; shift ;;
1379 -ns0 | --no-source0 )
1380 NOSOURCE0="yes"; shift ;;
1390 shift; RPMOPTS="$RPM_OPTS ${1}"; shift ;;
1391 --with | --without )
1392 case $GROUP_BCONDS in
1396 while ! `echo ${1}|grep -qE '(^-|spec)'`
1398 BCOND="$BCOND $COND $1"
1402 BCOND="$BCOND $1 $2" ; shift 2 ;;
1406 shift; TARGET="${1}"; shift ;;
1408 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
1410 QUIET="--quiet"; shift ;;
1412 CVSDATE="${2}"; shift 2 ;;
1414 shift; CVSTAG="${1}"; shift ;;
1415 -R | --fetch-build-requires)
1416 FETCH_BUILD_REQUIRES="yes"
1417 NOT_INSTALLED_PACKAGES=
1419 -RB | --remove-build-requires)
1420 REMOVE_BUILD_REQUIRES="nice"
1422 -FRB | --force-remove-build-requires)
1423 REMOVE_BUILD_REQUIRES="force"
1425 -sf | --sources-files)
1426 COMMAND="list-sources-files"
1428 -sp | --sources-paths)
1429 COMMAND="list-sources-local-paths"
1431 -Tvs | --tag-version-stable )
1436 -Tvn | --tag-version-nest )
1441 -Ts | --tag-stable )
1451 -Tv | --tag-version )
1456 -Tp | --tag-prefix )
1468 -ir | --integer-release-only )
1469 INTEGER_RELEASE="yes"
1478 -Upi | --update-poldek-indexes )
1479 UPDATE_POLDEK_INDEXES="yes"
1481 -u | --try-upgrade )
1482 TRY_UPGRADE="1"; shift ;;
1483 -un | --try-upgrade-with-float-version )
1484 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
1486 BE_VERBOSE="1"; shift ;;
1492 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
1496 RPMOPTS="${RPMOPTS} --nodeps"
1499 RPMOPTS="${RPMOPTS} -debug"; shift ;;
1502 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1507 if [ -n "$DEBUG" ]; then
1512 if [ -n "$TARGET" ]; then
1515 TARGET_SWITCH="--target $TARGET" ;;
1517 TARGET_SWITCH="--target=$TARGET" ;;
1522 "build" | "build-binary" | "build-source" | "build-prep" )
1524 if [ -n "$SPECFILE" ]; then
1528 fetch_build_requires;
1530 if [ "$INTEGER_RELEASE" = "yes" ]; then
1531 echo "Checking release $PACKAGE_RELEASE..."
1532 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
1533 Exit_error err_fract_rel "$PACKAGE_RELEASE"
1537 if [ -n "$TEST_TAG" ]; then
1538 TAGVER=`make_tagver`
1539 echo "Searching for tag $TAGVER..."
1540 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
1541 if [ -n "$TAGREL" ]; then
1542 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
1546 if [ -n "$ICONS" ]; then
1550 if [ -n "$NOSOURCE0" ] ; then
1551 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1553 get_files "$SOURCES $PATCHES";
1555 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
1556 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
1558 remove_build_requires;
1560 Exit_error err_no_spec_in_cmdl;
1565 if [ -n "$SPECFILE" ]; then
1568 if [ -n "$ICONS" ]; then
1572 get_files $SOURCES $PATCHES;
1573 branch_files $TAG "$SOURCES $PATCHES $ICONS";
1575 Exit_error err_no_spec_in_cmdl;
1580 if [ -n "$SPECFILE" ]; then
1583 if [ -n "$ICONS" ]; then
1584 OLD_UPDATE5=$UPDATE5
1585 UPDATE5= get_files $ICONS
1586 UPDATE5=$OLD_UPDATE5
1589 if [ -n "$NOSOURCE0" ] ; then
1590 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1592 get_files $SOURCES $PATCHES
1594 Exit_error err_no_spec_in_cmdl;
1601 if [ -n "$SPECFILE" ]; then
1604 if [ -n "$ICONS" ]; then
1608 # don't fetch sources from remote locations
1610 for file in $SOURCES
1612 [ -n "`src_md5 $file`" ] && continue
1613 new_SOURCES="$new_SOURCES $file"
1615 SOURCES="$new_SOURCES"
1616 get_files $SOURCES $PATCHES;
1617 tag_files "$SOURCES $PATCHES $ICONS";
1619 Exit_error err_no_spec_in_cmdl;
1623 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
1625 "list-sources-files" )
1628 DONT_PRINT_REVISION="yes"
1631 SAPS="$SOURCES $PATCHES"
1632 for SAP in $SAPS ; do
1633 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
1636 "list-sources-local-paths" )
1639 DONT_PRINT_REVISION="yes"
1642 SAPS="$SOURCES $PATCHES"
1643 for SAP in $SAPS ; do
1644 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
1652 if [ -f `pwd`/.${SPECFILE}_INSTALLED_PACKAGES -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
1653 rm `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1657 # vi:syntax=sh:ts=3:sw=4