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
518 echo "nie mam source$no-md5" >> /tmp/blog2
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 echo "nosource-d5 $nosource_md5" >> /tmp/blog2
525 if [ ! -z "$nosource_md5" -a ! X"`grep -i "^NoSource:[ ]*$no$" $SPECFILE`" = X"" ] ; then
530 if [ $(echo "$md5" | wc -l) != 1 ] ; then
531 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
533 echo "$md5" | tail -n 1
539 echo "$PROTOCOL$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
542 distfiles_attic_url ()
544 echo "$PROTOCOL$ATTICDISTFILES_SERVER/Attic/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
551 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
556 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
557 [ -n "$size" -a "$size" -gt 0 ]
562 if [ "$CVSIGNORE_DF" != "yes" ]; then
565 cvsignore=${SOURCE_DIR}/.cvsignore
566 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
567 echo "$1" >> $cvsignore
575 if [ -n "$DEBUG" ]; then
580 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
584 if [ -n "$CVSROOT" ]; then
585 OPTIONS="-d $CVSROOT $OPTIONS"
587 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
588 echo "warning: No cvs access defined for SOURCES"
592 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
593 OPTIONS="$OPTIONS -A"
595 if [ -n "$CVSDATE" ]; then
596 OPTIONS="$OPTIONS -D $CVSDATE"
598 if [ -n "$CVSTAG" ]; then
599 OPTIONS="$OPTIONS -r $CVSTAG"
604 if [ -n "$UPDATE5" ]; then
605 if [ -n "$ADD5" ]; then
606 [ `nourl $i` = "$i" ] && continue
607 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
609 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
613 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
614 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
615 echo "Warning: no URL given for $i"
618 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
619 if good_md5 "$i" && good_size "$i"; then
620 echo "$(nourl "$i") having proper md5sum already exists"
624 url=$(distfiles_url "$i")
625 url_attic=$(distfiles_attic_url "$i")
627 if [ `echo $url | grep -E '^(\.|/)'` ]; then
628 ${GETLOCAL} $url $target
630 if [ -z "$NOMIRRORS" ]; then
631 url="`find_mirror "$url"`"
633 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
634 if [ `echo $url | grep -E 'ftp://'` ]; then
635 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
638 if ! test -s "$target"; then
640 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
641 ${GETLOCAL} $url_attic $target
643 if [ -z "$NOMIRRORS" ]; then
644 url_attic="`find_mirror "$url_attic"`"
646 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
647 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
648 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
652 if test -s "$target"; then
658 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
659 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
662 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
664 retries_counter=$(( $retries_counter + 1 ))
665 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
667 [ -n "$output" ] && echo "$output"
668 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
669 echo "Trying again [`nourl $i`]... ($retries_counter)"
678 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
679 if [ -z "$NOMIRRORS" ]; then
680 im="`find_mirror "$i"`"
685 if [ `echo $im | grep -E 'ftp://'` ]; then
692 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
693 Exit_error err_no_source_in_repo $i;
694 elif [ -n "$UPDATE5" ] && \
695 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
696 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
697 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
699 echo "Updating source-$srcno md5."
700 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
702 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
703 print "# Source'$srcno'-md5:\t'$md5'\n"
704 if /^Source'$srcno'\s*:\s+/;
709 if good_md5 "$i" && good_size "$i"; then
711 elif [ "$FROM_DISTFILES" = 1 ]; then
712 # wrong md5 from distfiles: remove the file and try again
714 echo "MD5 sum mismatch. Trying full fetch."
717 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
718 if [ `echo $url | grep -E 'ftp://'` ]; then
719 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
721 if ! test -s "$target"; then
723 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
724 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
725 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
728 test -s "$target" || rm -f "$target"
731 if good_md5 "$i" && good_size "$i" ; then
734 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
735 echo "or -5 to update md5 sums, if you're sure files are correct."
736 Exit_error err_no_source_in_repo $i
740 if [ "$CHMOD" = "yes" ]; then
741 CHMOD_FILES="`nourl $GET_FILES`"
742 if [ -n "$CHMOD_FILES" ]; then
743 chmod $CHMOD_MODE $CHMOD_FILES
752 if [ -n "$DEBUG" ]; then
757 # Check whether first character of PACKAGE_NAME is legal for tag name
758 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
761 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"`
762 # Remove #kernel.version_release from TAGVER because tagging sources
763 # could occur with different kernel-headers than kernel-headers used at build time.
764 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
772 if [ -n "$DEBUG" ]; then
777 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
778 echo "Version: $PACKAGE_VERSION"
779 echo "Release: $PACKAGE_RELEASE"
783 if [ "$TAG_VERSION" = "yes" ]; then
784 echo "CVS tag: $TAGVER"
786 if [ -n "$TAG" ]; then
791 if [ -n "$CVSROOT" ]; then
792 OPTIONS="-d $CVSROOT $OPTIONS"
798 # don't tag files stored on distfiles
799 [ -n "`src_md5 $i`" ] && continue
800 if [ -f "`nourl $i`" ]; then
801 if [ "$TAG_VERSION" = "yes" ]; then
802 cvs $OPTIONS $TAGVER `nourl $i`
804 if [ -n "$TAG" ]; then
805 cvs $OPTIONS $TAG `nourl $i`
808 Exit_error err_no_source_in_repo $i
813 if [ "$TAG_VERSION" = "yes" ]; then
814 cvs $OPTIONS $TAGVER $SPECFILE
816 if [ -n "$TAG" ]; then
817 cvs $OPTIONS $TAG $SPECFILE
827 echo "CVS branch tag: $TAG"
832 if [ -n "$DEBUG" ]; then
837 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
840 if [ -n "$CVSROOT" ]; then
841 OPTIONS="-d $CVSROOT $OPTIONS"
846 if [ -f `nourl $i` ]; then
847 cvs $OPTIONS $TAG `nourl $i`
849 Exit_error err_no_source_in_repo $i
853 cvs $OPTIONS $TAG $SPECFILE
863 if [ -n "$DEBUG" ]; then
870 if [ -n "$TRY_UPGRADE" ]; then
871 if [ -n "$FLOAT_VERSION" ]; then
872 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
874 TNOTIFY=`./pldnotify.awk $SPECFILE`
877 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
879 if [ -n "$TNEWVER" ]; then
880 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
881 echo "New version found, updating spec file to version " $TNEWVER
882 cp -f $SPECFILE $SPECFILE.bak
884 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
885 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
887 if [ -n "$ICONS" ]; then
891 get_files "$SOURCES $PATCHES";
892 unset TOLDVER TNEWVER TNOTIFY
899 BUILD_SWITCH="-ba" ;;
901 BUILD_SWITCH="-bb" ;;
903 BUILD_SWITCH="-bs --nodeps" ;;
905 BUILD_SWITCH="-bp --nodeps" ;;
907 if [ -n "$LOGFILE" ]; then
908 LOG=`eval echo $LOGFILE`
909 if [ -d "$LOG" ]; then
910 echo "Log file $LOG is a directory."
911 echo "Parse error in the spec?"
912 Exit_error err_build_fail;
914 if [ -n "$LASTLOG_FILE" ]; then
915 echo "LASTLOG=$LOG" > $LASTLOG_FILE
917 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
918 (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
919 RETVAL=`cat $RES_FILE`
921 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
922 if [ "$RETVAL" -eq "0" ]; then
929 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE
932 if [ "$RETVAL" -ne "0" ]; then
933 if [ -n "$TRY_UPGRADE" ]; then
934 echo "\n!!! Package with new version cannot be build automagically\n"
935 mv -f $SPECFILE.bak $SPECFILE
937 Exit_error err_build_fail;
944 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
947 install_required_packages()
955 AVAIL_BCONDS_WITHOUT=""
957 if `grep -q ^%bcond ${SPECFILE}`; then
959 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
965 # expand bconds from ~/.bcondrc
966 # The file structure is like gentoo's package.use:
969 # samba -mysql -pgsql
970 # w32codec license_agreement
973 if [ "${BCOND_VERSION}" != "NONE" ] && ( [ -f $HOME/.bcondrc ] || ( [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] ) ) ; then
974 # This takes package name, first defined in spec.
975 # so consider that when defining flags for package.
976 PN=`$RPM -q --qf '%{NAME}\n' --specfile $SPECFILE | head -n 1`
977 AVAIL=`$RPMBUILD --bcond $SPECFILE`
979 BCONDRC=$HOME/.bcondrc
980 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && BCONDRC=$HOME_ETC/.bcondrc
982 while read pkg flags; do
984 [[ "$pkg" == \#* ]] && continue
986 # any package or current package?
987 if [ "$pkg" = "*" ] || [ "$pkg" = "$PN" ]; then
988 for flag in $flags; do
991 # use only flags which are in this package.
992 if [[ $AVAIL = *${opt}* ]]; then
993 if [[ $flag = -* ]]; then
994 BCOND="$BCOND --without $opt"
996 BCOND="$BCOND --with $opt"
1004 case "${BCOND_VERSION}" in
1009 echo "Warning: This spec has old style bconds. Fix it || die."
1010 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_without_`
1012 AVAIL_BCOND_WITHOUT=`echo $opt|sed -e "s/^_without_//g"`
1013 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1014 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1016 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1020 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_with_`
1022 AVAIL_BCOND_WITH=`echo $opt|sed -e "s/^_with_//g"`
1023 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1024 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1026 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1031 cond_type="" # with || without
1032 for opt in `$RPMBUILD --bcond $SPECFILE`
1042 case "$cond_type" in
1045 AVAIL_BCOND_WITH="$opt"
1046 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
1047 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1049 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1054 AVAIL_BCOND_WITHOUT="$opt"
1055 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1056 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1058 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1072 echo -ne "Package installation failed:\t$package_name\n"
1074 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1075 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1076 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1077 # jakby nie bylo tego kawalka kodu.
1079 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1080 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1087 # Istnieje taki spec? ${package}.spec
1088 if [ -f "${SPECS_DIR}${package}.spec" ]; then
1089 parent_spec_name=${package}.spec
1090 elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1091 parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1093 for provides_line in `grep ^Provides:.*$package ${SPECS_DIR} -R`
1099 if [ "${parent_spec_name}" != "" ]; then
1101 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1102 sub_builder_opts="${sub_builder_opts} -R"
1104 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1105 sub_builder_opts="${sub_builder_opts} -RB"
1106 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1107 sub_builder_opts="${sub_builder_opts} -FRB"
1109 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1110 sub_builder_opts="${sub_builder_opts} -Upi"
1113 ./builder ${sub_builder_opts} ${parent_spec_name}
1115 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1118 remove_build_requires()
1120 if [ "$INSTALLED_PACKAGES" != "" ]; then
1121 case "$REMOVE_BUILD_REQUIRES" in
1123 run_poldek --noask -ve $INSTALLED_PACKAGES
1126 run_poldek --ask -ve $INSTALLED_PACKAGES
1129 echo You may want to manually remove following BuildRequires fetched:
1130 echo $INSTALLED_PACKAGES
1131 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1139 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1140 if [ "$BCOND" != "" ]; then
1141 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1144 echo -ne "\nNo conditional flags passed"
1146 echo -ne "\n\nfrom available:\n"
1147 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1151 fetch_build_requires()
1153 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1154 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1155 CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print "@" $3 } ' | xargs)
1156 DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print "@" $3 } ' | xargs)
1157 if [ -n "$CONF" -o -n "$DEPS" ]; then
1158 /usr/bin/poldek --update; /usr/bin/poldek --upa
1160 if [ -n "$CONF" ]; then
1161 echo "Trying to uninstall conflicting packages ($CONF):"
1162 /usr/bin/poldek --noask --nofollow -ev $CONF
1164 if [ -n "$DEPS" ]; then
1165 echo "Trying to install dependencies ($DEPS):"
1166 /usr/bin/poldek --caplookup -uGv $DEPS
1171 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1172 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1173 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1174 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1175 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1176 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`
1178 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`"
1180 package=`basename "$package_item"|sed -e "s/}$//g"`
1181 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1184 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1185 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1186 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
1191 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1194 if `echo $COND_TST|grep -q 'without_'`; then
1195 COND_NAME=`echo $COND_NAME|sed -e s,^.*_without_,,g`
1196 if `echo $COND_TST|grep -q !`; then
1201 if `echo $AVAIL_BCONDS_WITHOUT|grep -q "<$COND_NAME>"`; then
1207 elif `echo $COND_TST|grep -q 'with_'`; then
1208 COND_NAME=`echo $COND_NAME|sed -e s,^.*_with_,,g`
1209 if `echo $COND_TST|grep -q !`; then
1214 if `echo $AVAIL_BCONDS_WITH|grep -q "<$COND_NAME>"`; then
1220 RESULT="${COND_STATE}-${COND_ARGV}"
1222 "with-wout" | "wout-with" )
1225 "wout-wout" | "with-with" )
1229 echo "Action '$RESULT' was not defined for package '$package_item'"
1235 if [ "$GO" = "yes" ]; then
1236 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1237 echo "Testing if $package has subrequirements..."
1238 run_poldek -t -i $package --dumpn=".$package-req.txt"
1239 if [ -f ".$package-req.txt" ]; then
1240 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1242 if [ "$package_name" = "$package" ]; then
1243 echo -ne "Installing BuildRequired package:\t$package_name\n"
1244 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing BuildRequired package: ${package_name}\007"`
1245 install_required_packages $package;
1247 echo -ne "Installing (sub)Required package:\t$package_name\n"
1248 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing (sub)Required package: ${package_name}\007"`
1249 install_required_packages $package_name;
1253 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1254 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1257 echo "Attempting to run spawn sub - builder..."
1258 run_sub_builder $package_name
1259 if [ $? -eq 0 ]; then
1260 install_required_packages $package_name;
1263 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1264 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1267 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1274 rm -f ".$package-req.txt"
1276 echo "Attempting to run spawn sub - builder..."
1277 run_sub_builder $package
1278 if [ $? -eq 0 ]; then
1279 install_required_packages $package;
1282 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1283 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1286 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1292 echo "Package $package is already installed. BuildRequirement satisfied."
1296 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1297 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1298 echo "Unable to install following packages and their dependencies:"
1299 for pkg in "$NOT_INSTALLED_PACKAGES"
1303 remove_build_requires
1309 #---------------------------------------------
1312 if [ "$#" = 0 ]; then
1338 DEBUG="yes"; shift ;;
1340 COMMAND="version"; shift ;;
1342 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1343 -b | -ba | --build )
1344 COMMAND="build"; shift ;;
1345 -bb | --build-binary )
1346 COMMAND="build-binary"; shift ;;
1347 -bs | --build-source )
1348 COMMAND="build-source"; shift ;;
1349 -bp | --build-prep )
1350 COMMAND="build-prep"; shift ;;
1352 COMMAND="branch"; shift; TAG="${1}"; shift;;
1354 CLEAN="--clean --rmspec --rmsource"; shift ;;
1356 shift; CVSROOT="${1}"; shift ;;
1358 COMMAND="get"; shift ;;
1360 COMMAND="usage"; shift ;;
1362 PROTOCOL="http"; shift ;;
1364 shift; LOGFILE="${1}"; shift ;;
1366 shift; DEF_NICE_LEVEL=${1}; shift ;;
1368 COMMAND="mr-proper"; shift ;;
1370 NOCVS="yes"; shift ;;
1371 -ncs | --no-cvs-specs )
1372 NOCVSSPEC="yes"; shift ;;
1373 -nd | --no-distfiles )
1374 NODIST="yes"; shift ;;
1375 -nm | --no-mirrors )
1376 NOMIRRORS="yes"; shift ;;
1378 NOURLS="yes"; shift ;;
1380 NOSRCS="yes"; shift ;;
1381 -ns0 | --no-source0 )
1382 NOSOURCE0="yes"; shift ;;
1392 shift; RPMOPTS="$RPM_OPTS ${1}"; shift ;;
1393 --with | --without )
1394 case $GROUP_BCONDS in
1398 while ! `echo ${1}|grep -qE '(^-|spec)'`
1400 BCOND="$BCOND $COND $1"
1404 BCOND="$BCOND $1 $2" ; shift 2 ;;
1408 shift; TARGET="${1}"; shift ;;
1410 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
1412 QUIET="--quiet"; shift ;;
1414 CVSDATE="${2}"; shift 2 ;;
1416 shift; CVSTAG="${1}"; shift ;;
1417 -R | --fetch-build-requires)
1418 FETCH_BUILD_REQUIRES="yes"
1419 NOT_INSTALLED_PACKAGES=
1421 -RB | --remove-build-requires)
1422 REMOVE_BUILD_REQUIRES="nice"
1424 -FRB | --force-remove-build-requires)
1425 REMOVE_BUILD_REQUIRES="force"
1427 -sf | --sources-files)
1428 COMMAND="list-sources-files"
1430 -sp | --sources-paths)
1431 COMMAND="list-sources-local-paths"
1433 -Tvs | --tag-version-stable )
1438 -Tvn | --tag-version-nest )
1443 -Ts | --tag-stable )
1453 -Tv | --tag-version )
1458 -Tp | --tag-prefix )
1470 -ir | --integer-release-only )
1471 INTEGER_RELEASE="yes"
1480 -Upi | --update-poldek-indexes )
1481 UPDATE_POLDEK_INDEXES="yes"
1483 -u | --try-upgrade )
1484 TRY_UPGRADE="1"; shift ;;
1485 -un | --try-upgrade-with-float-version )
1486 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
1488 BE_VERBOSE="1"; shift ;;
1494 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
1498 RPMOPTS="${RPMOPTS} --nodeps"
1501 RPMOPTS="${RPMOPTS} -debug"; shift ;;
1504 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1509 if [ -n "$DEBUG" ]; then
1514 if [ -n "$TARGET" ]; then
1517 TARGET_SWITCH="--target $TARGET" ;;
1519 TARGET_SWITCH="--target=$TARGET" ;;
1524 "build" | "build-binary" | "build-source" | "build-prep" )
1526 if [ -n "$SPECFILE" ]; then
1530 fetch_build_requires;
1532 if [ "$INTEGER_RELEASE" = "yes" ]; then
1533 echo "Checking release $PACKAGE_RELEASE..."
1534 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
1535 Exit_error err_fract_rel "$PACKAGE_RELEASE"
1539 if [ -n "$TEST_TAG" ]; then
1540 TAGVER=`make_tagver`
1541 echo "Searching for tag $TAGVER..."
1542 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
1543 if [ -n "$TAGREL" ]; then
1544 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
1548 if [ -n "$ICONS" ]; then
1552 if [ -n "$NOSOURCE0" ] ; then
1553 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1555 get_files "$SOURCES $PATCHES";
1557 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
1558 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
1560 remove_build_requires;
1562 Exit_error err_no_spec_in_cmdl;
1567 if [ -n "$SPECFILE" ]; then
1570 if [ -n "$ICONS" ]; then
1574 get_files $SOURCES $PATCHES;
1575 branch_files $TAG "$SOURCES $PATCHES $ICONS";
1577 Exit_error err_no_spec_in_cmdl;
1582 if [ -n "$SPECFILE" ]; then
1585 if [ -n "$ICONS" ]; then
1586 OLD_UPDATE5=$UPDATE5
1587 UPDATE5= get_files $ICONS
1588 UPDATE5=$OLD_UPDATE5
1591 if [ -n "$NOSOURCE0" ] ; then
1592 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1594 get_files $SOURCES $PATCHES
1596 Exit_error err_no_spec_in_cmdl;
1603 if [ -n "$SPECFILE" ]; then
1606 if [ -n "$ICONS" ]; then
1610 # don't fetch sources from remote locations
1612 for file in $SOURCES
1614 [ -n "`src_md5 $file`" ] && continue
1615 new_SOURCES="$new_SOURCES $file"
1617 SOURCES="$new_SOURCES"
1618 get_files $SOURCES $PATCHES;
1619 tag_files "$SOURCES $PATCHES $ICONS";
1621 Exit_error err_no_spec_in_cmdl;
1625 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
1627 "list-sources-files" )
1630 DONT_PRINT_REVISION="yes"
1633 SAPS="$SOURCES $PATCHES"
1634 for SAP in $SAPS ; do
1635 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
1638 "list-sources-local-paths" )
1641 DONT_PRINT_REVISION="yes"
1644 SAPS="$SOURCES $PATCHES"
1645 for SAP in $SAPS ; do
1646 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
1654 if [ -f `pwd`/.${SPECFILE}_INSTALLED_PACKAGES -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
1655 rm `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1659 # vi:syntax=sh:ts=3:sw=4