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.11 (C) 1999-2004 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 wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
119 wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
121 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
122 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
125 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
133 POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
134 POLDEK_CMD="/usr/bin/poldek --noask"
138 RES_FILE=~/tmp/poldek-exit-status.$RANDOM
139 if [ -n "$LOGFILE" ]; then
140 LOG=`eval echo $LOGFILE`
141 if [ -n "$LASTLOG_FILE" ]; then
142 echo "LASTLOG=$LOG" > $LASTLOG_FILE
144 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee $LOG
147 (nice -n ${DEF_NICE_LEVEL} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
148 return `cat ${RES_FILE}`
153 #---------------------------------------------
158 if [ -n "$DEBUG" ]; then set -xv; fi
160 Usage: builder [-D|--debug] [-V|--version] [-a|--as_anon] [-b|-ba|--build]
162 [-bb|--build-binary] [-bs|--build-source] [-u|--try-upgrade]
163 [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>] [-g|--get]
164 [-h|--help] [--http] [{-l,--logtofile} <logfile>] [-m|--mr-proper]
165 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T--tag <cvstag>]
166 [-Tvs|--tag-version-stable] [-Tvn|--tag-version-nest]
167 [-Ts|--tag-stable] [-Tn|--tag-nest] [-Tv|--tag-version]
168 [{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
169 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>]
170 [--with/--without <feature>] [--define <macro> <value>] <package>[.spec]
172 -5, --update-md5 - update md5 comments in spec, implies -nd -ncs
173 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
174 -n5, --no-md5 - ignore md5 comments in spec
175 -D, --debug - enable script debugging mode,
176 -V, --version - output builder version
177 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
178 -b, -ba, --build - get all files from CVS repo or HTTP/FTP and build package
180 -bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
181 only package from <package>.spec,
182 -bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
184 -bp, --build-prep - execute the %prep phase of <package>.spec,
185 -B, --branch - add branch
186 -c, --clean - clean all temporarily created files (in BUILD, SOURCES,
187 SPECS and \$RPM_BUILD_ROOT),
188 -d <cvsroot>, --cvsroot <cvsroot>
190 --define <macro> <value>
191 - define a macro <macro> with value <value>,
192 --nodeps - rpm won't check any dependences
193 -g, --get - get <package>.spec and all related files from CVS repo
195 -h, --help - this message,
196 --http - use http instead of ftp,
197 -l <logfile>, --logtofile <logfile>
199 -m, --mr-proper - only remove all files related to spec file and all work
201 -nc, --no-cvs - don't download sources from CVS, if source URL is given,
203 - don't check specs in CVS
204 -nd, --no-distfiles - don't download from distfiles
205 -nm, --no-mirrors - don't download from mirror, if source URL is given,
206 -nu, --no-urls - don't try to download from FTP/HTTP location,
207 -ns, --no-srcs - don't download Sources
208 -ns0, --no-source0 - don't download Source0
209 -nn, --no-net - don't download anything from the net
210 --opts <rpm opts> - additional options for rpm
211 -q, --quiet - be quiet,
212 --date yyyy-mm-dd - build package using resources from specified CVS date,
213 -r <cvstag>, --cvstag <cvstag>
214 - build package using resources from specified CVS tag,
215 -R, --fetch-build-requires
216 - fetch what is BuildRequired,
217 -RB, --remove-build-requires
218 - remove all you fetched with -R or --fetch-build-requires
219 remember, this option requires confirmation,
220 -FRB, --force-remove-build-requires
221 - remove all you fetched with -R or --fetch-build-requires
222 remember, this option works without confirmation,
223 -sf, --source-files - list sources - bare filenames (intended for offline
224 operations; does not work when Icon field is present
225 but icon file is absent),
226 -sp, --source-paths - list sources - filenames with full local paths (intended for
227 offline operations; does not work when Icon field is present
228 but icon file is absent),
229 -T <cvstag> , --tag <cvstag>
230 - add cvs tag <cvstag> for files,
231 -Tvs, --tag-version-stable
232 - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
233 -Tvn, --tag-version-nest
234 - add cvs tags NEST and NAME-VERSION-RELEASE for files,
236 - add cvs tag STABLE for files,
238 - add cvs tag NEST for files,
240 - add cvs tag NAME-VERSION-RELEASE for files,
241 -Tp, --tag-prefix <prefix>
242 - add <prefix> to NAME-VERSION-RELEASE tags,
243 -tt, --test-tag <prefix>
244 - fail if tag is already present,
245 -ir, --integer-release-only
246 - allow only integer and snapshot releases
247 -v, --verbose - be verbose,
248 -u, --try-upgrade - check version, and try to upgrade package
249 -un, --try-upgrade-with-float-version
250 - as above, but allow float version
251 -U, --update - refetch sources, don't use distfiles, and update md5 comments
252 -Upi, --update-poldek-indexes
253 - refresh or make poldek package index files.
254 --with/--without <feature>
255 - conditional build package depending on %_with_<feature>/
256 %_without_<feature> macro switch. You may now use
257 --with feat1 feat2 feat3 --without feat4 feat5 --with feat6
258 constructions. Set GROUP_BCONDS to yes to make use of it.
259 --target <platform>, --target=<platform>
260 - build for platform <platform>.
265 if [ -n "$DEBUG" ]; then
272 rpm -bp --nodeps --define 'prep %dump' $BCOND $TARGET_SWITCH $SPECFILE 2>&1
275 rpmbuild --nodigest --nosignature --define 'prep %dump' $BCOND $SPECFILE 2>&1
281 if [ -z "$rpm_dump_cache" ] ; then
282 echo "internal error: cache_rpm_dump not called!" 1>&2
284 echo "$rpm_dump_cache"
289 if [ -n "$DEBUG" ]; then
298 if [ "$NOSRCS" != "yes" ]; then
299 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
301 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
302 FAIL_IF_NO_SOURCES="no"
305 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
306 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
307 PACKAGE_NAME="`$RPM -q --qf '%{NAME}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
308 PACKAGE_VERSION="`$RPM -q --qf '%{VERSION}\n' --specfile ${SPECFILE} 2> /dev/null| head -n 1`"
309 PACKAGE_RELEASE="`$RPM -q --qf '%{RELEASE}\n' --specfile ${SPECFILE} 2> /dev/null | head -n 1`"
311 # These variables may be unset after first cache_rpm_dump call
312 # (because of not-yet-retrieved icon file)
314 # if [ -z "$PACKAGE_NAME" -o -z "$PACKAGE_VERSION" -o -z "$PACKAGE_RELEASE" ]; then
315 # Exit_error err_no_package_data;
318 if [ -n "$BE_VERBOSE" ]; then
319 echo "- Sources : `nourl $SOURCES`"
320 if [ -n "$PATCHES" ]; then
321 echo "- Patches : `nourl $PATCHES`"
323 echo "- Patches : *no patches needed*"
325 if [ -n "$ICONS" ]; then
326 echo "- Icon : `nourl $ICONS`"
328 echo "- Icon : *no package icon*"
330 echo "- Name : $PACKAGE_NAME"
331 echo "- Version : $PACKAGE_VERSION"
332 echo "- Release : $PACKAGE_RELEASE"
338 if [ -n "$DEBUG" ]; then
346 "err_no_spec_in_cmdl" )
347 remove_build_requires
348 echo "ERROR: spec file name not specified.";
350 "err_no_spec_in_repo" )
351 remove_build_requires
352 echo "Error: spec file not stored in CVS repo.";
354 "err_no_source_in_repo" )
355 remove_build_requires
356 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)";
359 remove_build_requires
360 echo "Error: package build failed. (${2:-no more info})";
362 "err_no_package_data" )
363 remove_build_requires
364 echo "Error: couldn't get out package name/version/release from spec file."
367 remove_build_requires
368 echo "Tag ${2} already exists (spec release: ${3}).";
371 remove_build_requires
372 echo "Release ${2} not integer and not a snapshot.";
376 echo "Unknown error."
382 if [ -n "$DEBUG" ]; then
387 SOURCE_DIR="`$RPM --eval '%{_sourcedir}'`"
388 SPECS_DIR="`$RPM --eval '%{_specdir}'`"
395 if [ -n "$DEBUG" ]; then
401 if [ \! -f "$SPECFILE" ]; then
402 SPECFILE="`basename $SPECFILE .spec`.spec";
404 if [ "$NOCVSSPEC" != "yes" ]; then
407 if [ -n "$CVSROOT" ]; then
408 OPTIONS="-d $CVSROOT $OPTIONS"
410 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
411 echo "warning: No cvs access defined - using local .spec file"
416 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
417 OPTIONS="$OPTIONS -A"
419 if [ -n "$CVSDATE" ]; then
420 OPTIONS="$OPTIONS -D $CVSDATE"
422 if [ -n "$CVSTAG" ]; then
423 OPTIONS="$OPTIONS -r $CVSTAG"
429 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
431 retries_counter=$(( $retries_counter + 1 ))
432 output=$(LC_ALL=C cvs $OPTIONS $SPECFILE 2>&1)
434 [ -n "$output" ] && echo "$output"
435 if [ "$result" -ne "0" ]; then
436 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
437 echo "Trying again [$SPECFILE]... ($retries_counter)"
441 Exit_error err_no_spec_in_repo;
445 if [ ! -f "$SPECFILE" ]; then
446 Exit_error err_no_spec_in_repo;
449 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
450 chmod $CHMOD_MODE $SPECFILE
453 [ -n "$DONT_PRINT_REVISION" ] || grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
460 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
461 cvs update mirrors >&2
465 while read origin mirror name rest
467 ol=`echo -n "$origin"|wc -c`
468 prefix="`echo -n "$url" | head -c $ol`"
469 if [ "$prefix" = "$origin" ] ; then
470 suffix="`echo "$url"|cut -b $ol-`"
471 echo -n "$mirror$suffix"
482 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
483 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
489 [ X"$NO5" = X"yes" ] && return
491 [ -z "$no" ] && return
493 spec_rev=$(grep $SPECFILE CVS/Entries | sed -e s:/$SPECFILE/:: -e s:/.*::)
494 if [ -z "$spec_rev" ]; then
495 spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
497 spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
498 md5=$(grep -s -v '^#' additional-md5sums | \
499 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
500 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
501 grep -E '^[0-9a-f]{32}$')
502 if [ X"$md5" = X"" ] ; then
503 grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://' | xargs
505 if [ $(echo "$md5" | wc -l) != 1 ] ; then
506 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
508 echo "$md5" | tail -n 1
514 echo "$PROTOCOL$DISTFILES_SERVER/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
517 distfiles_attic_url ()
519 echo "$PROTOCOL$ATTICDISTFILES_SERVER/Attic/by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
526 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
531 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
532 [ -n "$size" -a "$size" -gt 0 ]
537 if [ "$CVSIGNORE_DF" != "yes" ]; then
540 cvsignore=${SOURCE_DIR}/.cvsignore
541 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
542 echo "$1" >> $cvsignore
550 if [ -n "$DEBUG" ]; then
555 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
559 if [ -n "$CVSROOT" ]; then
560 OPTIONS="-d $CVSROOT $OPTIONS"
562 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
563 echo "warning: No cvs access defined for SOURCES"
567 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
568 OPTIONS="$OPTIONS -A"
570 if [ -n "$CVSDATE" ]; then
571 OPTIONS="$OPTIONS -D $CVSDATE"
573 if [ -n "$CVSTAG" ]; then
574 OPTIONS="$OPTIONS -r $CVSTAG"
579 if [ -n "$UPDATE5" ]; then
580 if [ -n "$ADD5" ]; then
581 [ `nourl $i` = "$i" ] && continue
582 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE && continue
584 grep -qiE '^#[ ]*Source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE || continue
588 if [ ! -f `nourl $i` ] || [ $ALWAYS_CVSUP = "yes" ]; then
589 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
590 echo "Warning: no URL given for $i"
593 if [ -n "$(src_md5 "$i")" ] && [ -z "$NODIST" ]; then
594 if good_md5 "$i" && good_size "$i"; then
595 echo "$(nourl "$i") having proper md5sum already exists"
599 url=$(distfiles_url "$i")
600 url_attic=$(distfiles_attic_url "$i")
602 if [ `echo $url | grep -E '^(\.|/)'` ]; then
603 ${GETLOCAL} $url $target
605 if [ -z "$NOMIRRORS" ]; then
606 url="`find_mirror "$url"`"
608 ${GETURI} -O "$target" "$url" || \
609 if [ `echo $url | grep -E 'ftp://'` ]; then
610 ${GETURI2} -O "$target" "$url"
613 if ! test -s "$target"; then
615 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
616 ${GETLOCAL} $url_attic $target
618 if [ -z "$NOMIRRORS" ]; then
619 url_attic="`find_mirror "$url_attic"`"
621 ${GETURI} -O "$target" "$url_attic" || \
622 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
623 ${GETURI2} -O "$target" "$url_attic"
627 if test -s "$target"; then
633 elif [ -z "$(src_md5 "$i")" -a "$NOCVS" != "yes" ]; then
634 # ( echo $i | grep -qvE '(ftp|http|https)://' ); -- if CVS should be used, but URLs preferred
637 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]
639 retries_counter=$(( $retries_counter + 1 ))
640 output=$(LC_ALL=C cvs $OPTIONS `nourl $i` 2>&1)
642 [ -n "$output" ] && echo "$output"
643 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
644 echo "Trying again [`nourl $i`]... ($retries_counter)"
653 if [ -z "$NOURLS" ] && [ ! -f "`nourl $i`" -o -n "$UPDATE" ] && [ `echo $i | grep -E 'ftp://|http://|https://'` ]; then
654 if [ -z "$NOMIRRORS" ]; then
655 im="`find_mirror "$i"`"
660 if [ `echo $im | grep -E 'ftp://'` ]; then
667 if [ ! -f "`nourl $i`" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
668 Exit_error err_no_source_in_repo $i;
669 elif [ -n "$UPDATE5" ] && \
670 ( ( [ -n "$ADD5" ] && echo $i | grep -q -E 'ftp://|http://|https://' && \
671 [ -z "$(grep -E -i '^NoSource[ ]*:[ ]*'$i'([ ]|$)' $SPECS_DIR/$SPECFILE)" ] ) || \
672 grep -q -i -E '^#[ ]*source'$(src_no $i)'-md5[ ]*:' $SPECS_DIR/$SPECFILE )
674 echo "Updating source-$srcno md5."
675 md5=$(md5sum `nourl $i` | cut -f1 -d' ')
677 print unless /^\s*#\s*Source'$srcno'-md5\s*:/i;
678 print "# Source'$srcno'-md5:\t'$md5'\n"
679 if /^Source'$srcno'\s*:\s+/;
684 if good_md5 "$i" && good_size "$i"; then
686 elif [ "$FROM_DISTFILES" = 1 ]; then
687 # wrong md5 from distfiles: remove the file and try again
689 echo "MD5 sum mismatch. Trying full fetch."
692 ${GETURI} -O "$target" "$url" || \
693 if [ `echo $url | grep -E 'ftp://'` ]; then
694 ${GETURI2} -O "$target" "$url"
696 if ! test -s "$target"; then
698 ${GETURI} -O "$target" "$url_attic" || \
699 if [ `echo $url_attic | grep -E 'ftp://'` ]; then
700 ${GETURI2} -O "$target" "$url_attic"
703 test -s "$target" || rm -f "$target"
706 if good_md5 "$i" && good_size "$i" ; then
709 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
710 echo "or -5 to update md5 sums, if you're sure files are correct."
711 Exit_error err_no_source_in_repo $i
715 if [ "$CHMOD" = "yes" ]; then
716 CHMOD_FILES="`nourl $GET_FILES`"
717 if [ -n "$CHMOD_FILES" ]; then
718 chmod $CHMOD_MODE $CHMOD_FILES
727 if [ -n "$DEBUG" ]; then
732 # Check whether first character of PACKAGE_NAME is legal for tag name
733 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
736 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"`
737 # Remove #kernel.version_release from TAGVER because tagging sources
738 # could occur with different kernel-headers than kernel-headers used at build time.
739 TAGVER=$(echo "$TAGVER" | sed -e 's/#.*//g')
747 if [ -n "$DEBUG" ]; then
752 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
753 echo "Version: $PACKAGE_VERSION"
754 echo "Release: $PACKAGE_RELEASE"
758 if [ "$TAG_VERSION" = "yes" ]; then
759 echo "CVS tag: $TAGVER"
761 if [ -n "$TAG" ]; then
766 if [ -n "$CVSROOT" ]; then
767 OPTIONS="-d $CVSROOT $OPTIONS"
773 # don't tag files stored on distfiles
774 [ -n "`src_md5 $i`" ] && continue
775 if [ -f "`nourl $i`" ]; then
776 if [ "$TAG_VERSION" = "yes" ]; then
777 cvs $OPTIONS $TAGVER `nourl $i`
779 if [ -n "$TAG" ]; then
780 cvs $OPTIONS $TAG `nourl $i`
783 Exit_error err_no_source_in_repo $i
788 if [ "$TAG_VERSION" = "yes" ]; then
789 cvs $OPTIONS $TAGVER $SPECFILE
791 if [ -n "$TAG" ]; then
792 cvs $OPTIONS $TAG $SPECFILE
802 echo "CVS branch tag: $TAG"
807 if [ -n "$DEBUG" ]; then
812 if [ -n "$1$2$3$4$5$6$7$8$9${10}" ]; then
815 if [ -n "$CVSROOT" ]; then
816 OPTIONS="-d $CVSROOT $OPTIONS"
821 if [ -f `nourl $i` ]; then
822 cvs $OPTIONS $TAG `nourl $i`
824 Exit_error err_no_source_in_repo $i
828 cvs $OPTIONS $TAG $SPECFILE
838 if [ -n "$DEBUG" ]; then
845 if [ -n "$TRY_UPGRADE" ]; then
846 if [ -n "$FLOAT_VERSION" ]; then
847 TNOTIFY=`./pldnotify.awk $SPECFILE -n`
849 TNOTIFY=`./pldnotify.awk $SPECFILE`
852 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
854 if [ -n "$TNEWVER" ]; then
855 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
856 echo "New version found, updating spec file to version " $TNEWVER
857 cp -f $SPECFILE $SPECFILE.bak
859 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
860 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t1/' $SPECFILE"
862 if [ -n "$ICONS" ]; then
866 get_files "$SOURCES $PATCHES";
867 unset TOLDVER TNEWVER TNOTIFY
874 BUILD_SWITCH="-ba" ;;
876 BUILD_SWITCH="-bb" ;;
878 BUILD_SWITCH="-bs --nodeps" ;;
880 BUILD_SWITCH="-bp --nodeps" ;;
882 if [ -n "$LOGFILE" ]; then
883 LOG=`eval echo $LOGFILE`
884 if [ -d "$LOG" ]; then
885 echo "Log file $LOG is a directory."
886 echo "Parse error in the spec?"
887 Exit_error err_build_fail;
889 if [ -n "$LASTLOG_FILE" ]; then
890 echo "LASTLOG=$LOG" > $LASTLOG_FILE
892 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
893 (time nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
894 RETVAL=`cat $RES_FILE`
896 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
897 if [ "$RETVAL" -eq "0" ]; then
904 eval nice -n ${DEF_NICE_LEVEL} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $BCOND $TARGET_SWITCH $SPECFILE
907 if [ "$RETVAL" -ne "0" ]; then
908 if [ -n "$TRY_UPGRADE" ]; then
909 echo "\n!!! Package with new version cannot be build automagically\n"
910 mv -f $SPECFILE.bak $SPECFILE
912 Exit_error err_build_fail;
919 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
922 install_required_packages()
930 AVAIL_BCONDS_WITHOUT=""
932 if `grep -q ^%bcond ${SPECFILE}`; then
934 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
940 # expand bconds from ~/.bcondrc
941 # The file structure is like gentoo's package.use:
944 # samba -mysql -pgsql
945 # w32codec license_agreement
948 if [ "${BCOND_VERSION}" != "NONE" ] && ( [ -f $HOME/.bcondrc ] || ( [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] ) ) ; then
949 # This takes package name, first defined in spec.
950 # so consider that when defining flags for package.
951 PN=`$RPM -q --qf '%{NAME}\n' --specfile $SPECFILE | head -n 1`
952 AVAIL=`$RPMBUILD --bcond $SPECFILE`
954 BCONDRC=$HOME/.bcondrc
955 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && BCONDRC=$HOME_ETC/.bcondrc
957 while read pkg flags; do
959 [[ "$pkg" == \#* ]] && continue
961 # any package or current package?
962 if [ "$pkg" = "*" ] || [ "$pkg" = "$PN" ]; then
963 for flag in $flags; do
966 # use only flags which are in this package.
967 if [[ $AVAIL = *${opt}* ]]; then
968 if [[ $flag = -* ]]; then
969 BCOND="$BCOND --without $opt"
971 BCOND="$BCOND --with $opt"
979 case "${BCOND_VERSION}" in
984 echo "Warning: This spec has old style bconds. Fix it || die."
985 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_without_`
987 AVAIL_BCOND_WITHOUT=`echo $opt|sed -e "s/^_without_//g"`
988 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
989 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
991 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
995 for opt in `$RPMBUILD --bcond $SPECFILE |grep ^_with_`
997 AVAIL_BCOND_WITH=`echo $opt|sed -e "s/^_with_//g"`
998 if `echo $BCOND|grep -q -- "--with $AVAIL_BCOND_WITH"`;then
999 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1001 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1006 cond_type="" # with || without
1007 for opt in `$RPMBUILD --bcond $SPECFILE`
1017 case "$cond_type" in
1020 AVAIL_BCOND_WITH="$opt"
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 AVAIL_BCOND_WITHOUT="$opt"
1030 if `echo $BCOND|grep -q -- "--without $AVAIL_BCOND_WITHOUT"`;then
1031 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1033 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1047 echo -ne "Package installation failed:\t$package_name\n"
1049 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1050 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1051 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1052 # jakby nie bylo tego kawalka kodu.
1054 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1055 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1062 # Istnieje taki spec? ${package}.spec
1063 if [ -f "${SPECS_DIR}${package}.spec" ]; then
1064 parent_spec_name=${package}.spec
1065 elif [ -f "${SPECS_DIR}`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1066 parent_spec_name="`echo ${package_name}|sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1068 for provides_line in `grep ^Provides:.*$package ${SPECS_DIR} -R`
1074 if [ "${parent_spec_name}" != "" ]; then
1076 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1077 sub_builder_opts="${sub_builder_opts} -R"
1079 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1080 sub_builder_opts="${sub_builder_opts} -RB"
1081 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1082 sub_builder_opts="${sub_builder_opts} -FRB"
1084 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1085 sub_builder_opts="${sub_builder_opts} -Upi"
1088 ./builder ${sub_builder_opts} ${parent_spec_name}
1090 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1093 remove_build_requires()
1095 if [ "$INSTALLED_PACKAGES" != "" ]; then
1096 case "$REMOVE_BUILD_REQUIRES" in
1098 run_poldek --noask -ve $INSTALLED_PACKAGES
1101 run_poldek --ask -ve $INSTALLED_PACKAGES
1104 echo You may want to manually remove following BuildRequires fetched:
1105 echo $INSTALLED_PACKAGES
1106 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1114 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1115 if [ "$BCOND" != "" ]; then
1116 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1119 echo -ne "\nNo conditional flags passed"
1121 echo -ne "\n\nfrom available:\n"
1122 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1126 fetch_build_requires()
1128 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1129 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1130 CONF=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print "@" $3 } ' | xargs)
1131 DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print "@" $3 } ' | xargs)
1132 if [ -n "$CONF" -o -n "$DEPS" ]; then
1133 /usr/bin/poldek --update; /usr/bin/poldek --upa
1135 if [ -n "$CONF" ]; then
1136 echo "Trying to uninstall conflicting packages ($CONF):"
1137 /usr/bin/poldek --noask --nofollow -ev $CONF
1139 if [ -n "$DEPS" ]; then
1140 echo "Trying to install dependencies ($DEPS):"
1141 /usr/bin/poldek --caplookup -uGv $DEPS
1146 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1147 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1148 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1149 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1150 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1151 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,kgcc_package,gcc,g -e s,\),,g`
1153 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`"
1155 package=`basename "$package_item"|sed -e "s/}$//g"`
1156 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1159 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1160 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1161 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
1166 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1169 if `echo $COND_TST|grep -q 'without_'`; then
1170 COND_NAME=`echo $COND_NAME|sed -e s,^.*_without_,,g`
1171 if `echo $COND_TST|grep -q !`; then
1176 if `echo $AVAIL_BCONDS_WITHOUT|grep -q "<$COND_NAME>"`; then
1182 elif `echo $COND_TST|grep -q 'with_'`; then
1183 COND_NAME=`echo $COND_NAME|sed -e s,^.*_with_,,g`
1184 if `echo $COND_TST|grep -q !`; then
1189 if `echo $AVAIL_BCONDS_WITH|grep -q "<$COND_NAME>"`; then
1195 RESULT="${COND_STATE}-${COND_ARGV}"
1197 "with-wout" | "wout-with" )
1200 "wout-wout" | "with-with" )
1204 echo "Action '$RESULT' was not defined for package '$package_item'"
1210 if [ "$GO" = "yes" ]; then
1211 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1212 echo "Testing if $package has subrequirements..."
1213 run_poldek -t -i $package --dumpn=".$package-req.txt"
1214 if [ -f ".$package-req.txt" ]; then
1215 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1217 if [ "$package_name" = "$package" ]; then
1218 echo -ne "Installing BuildRequired package:\t$package_name\n"
1219 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing BuildRequired package: ${package_name}\007"`
1220 install_required_packages $package;
1222 echo -ne "Installing (sub)Required package:\t$package_name\n"
1223 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}: Installing (sub)Required package: ${package_name}\007"`
1224 install_required_packages $package_name;
1228 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1229 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1232 echo "Attempting to run spawn sub - builder..."
1233 run_sub_builder $package_name
1234 if [ $? -eq 0 ]; then
1235 install_required_packages $package_name;
1238 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1239 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1242 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1249 rm -f ".$package-req.txt"
1251 echo "Attempting to run spawn sub - builder..."
1252 run_sub_builder $package
1253 if [ $? -eq 0 ]; then
1254 install_required_packages $package;
1257 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1258 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1261 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1267 echo "Package $package is already installed. BuildRequirement satisfied."
1271 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1272 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1273 echo "Unable to install following packages and their dependencies:"
1274 for pkg in "$NOT_INSTALLED_PACKAGES"
1278 remove_build_requires
1284 #---------------------------------------------
1287 if [ "$#" = 0 ]; then
1313 DEBUG="yes"; shift ;;
1315 COMMAND="version"; shift ;;
1317 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1318 -b | -ba | --build )
1319 COMMAND="build"; shift ;;
1320 -bb | --build-binary )
1321 COMMAND="build-binary"; shift ;;
1322 -bs | --build-source )
1323 COMMAND="build-source"; shift ;;
1324 -bp | --build-prep )
1325 COMMAND="build-prep"; shift ;;
1327 COMMAND="branch"; shift; TAG="${1}"; shift;;
1329 CLEAN="--clean --rmspec --rmsource"; shift ;;
1331 shift; CVSROOT="${1}"; shift ;;
1333 COMMAND="get"; shift ;;
1335 COMMAND="usage"; shift ;;
1337 PROTOCOL="http"; shift ;;
1339 shift; LOGFILE="${1}"; shift ;;
1341 shift; DEF_NICE_LEVEL=${1}; shift ;;
1343 COMMAND="mr-proper"; shift ;;
1345 NOCVS="yes"; shift ;;
1346 -ncs | --no-cvs-specs )
1347 NOCVSSPEC="yes"; shift ;;
1348 -nd | --no-distfiles )
1349 NODIST="yes"; shift ;;
1350 -nm | --no-mirrors )
1351 NOMIRRORS="yes"; shift ;;
1353 NOURLS="yes"; shift ;;
1355 NOSRCS="yes"; shift ;;
1356 -ns0 | --no-source0 )
1357 NOSOURCE0="yes"; shift ;;
1367 shift; RPMOPTS="${1}"; shift ;;
1368 --with | --without )
1369 case $GROUP_BCONDS in
1373 while ! `echo ${1}|grep -qE '(^-|spec)'`
1375 BCOND="$BCOND $COND $1"
1379 BCOND="$BCOND $1 $2" ; shift 2 ;;
1383 shift; TARGET="${1}"; shift ;;
1385 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
1387 QUIET="--quiet"; shift ;;
1389 CVSDATE="${2}"; shift 2 ;;
1391 shift; CVSTAG="${1}"; shift ;;
1392 -R | --fetch-build-requires)
1393 FETCH_BUILD_REQUIRES="yes"
1394 NOT_INSTALLED_PACKAGES=
1396 -RB | --remove-build-requires)
1397 REMOVE_BUILD_REQUIRES="nice"
1399 -FRB | --force-remove-build-requires)
1400 REMOVE_BUILD_REQUIRES="force"
1402 -sf | --sources-files)
1403 COMMAND="list-sources-files"
1405 -sp | --sources-paths)
1406 COMMAND="list-sources-local-paths"
1408 -Tvs | --tag-version-stable )
1413 -Tvn | --tag-version-nest )
1418 -Ts | --tag-stable )
1428 -Tv | --tag-version )
1433 -Tp | --tag-prefix )
1445 -ir | --integer-release-only )
1446 INTEGER_RELEASE="yes"
1455 -Upi | --update-poldek-indexes )
1456 UPDATE_POLDEK_INDEXES="yes"
1458 -u | --try-upgrade )
1459 TRY_UPGRADE="1"; shift ;;
1460 -un | --try-upgrade-with-float-version )
1461 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
1463 BE_VERBOSE="1"; shift ;;
1469 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
1473 RPMOPTS="${RPMOPTS} --nodeps"
1477 export PROMPT_COMMAND=`echo -ne "\033]0;${SPECFILE}\007"`
1482 if [ -n "$DEBUG" ]; then
1487 if [ -n "$TARGET" ]; then
1490 TARGET_SWITCH="--target $TARGET" ;;
1492 TARGET_SWITCH="--target=$TARGET" ;;
1497 "build" | "build-binary" | "build-source" | "build-prep" )
1499 if [ -n "$SPECFILE" ]; then
1503 fetch_build_requires;
1505 if [ "$INTEGER_RELEASE" = "yes" ]; then
1506 echo "Checking release $PACKAGE_RELEASE..."
1507 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
1508 Exit_error err_fract_rel "$PACKAGE_RELEASE"
1512 if [ -n "$TEST_TAG" ]; then
1513 TAGVER=`make_tagver`
1514 echo "Searching for tag $TAGVER..."
1515 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
1516 if [ -n "$TAGREL" ]; then
1517 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
1521 if [ -n "$ICONS" ]; then
1525 if [ -n "$NOSOURCE0" ] ; then
1526 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1528 get_files "$SOURCES $PATCHES";
1530 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
1531 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
1533 remove_build_requires;
1535 Exit_error err_no_spec_in_cmdl;
1540 if [ -n "$SPECFILE" ]; then
1543 if [ -n "$ICONS" ]; then
1547 get_files $SOURCES $PATCHES;
1548 branch_files $TAG "$SOURCES $PATCHES $ICONS";
1550 Exit_error err_no_spec_in_cmdl;
1555 if [ -n "$SPECFILE" ]; then
1558 if [ -n "$ICONS" ]; then
1559 OLD_UPDATE5=$UPDATE5
1560 UPDATE5= get_files $ICONS
1561 UPDATE5=$OLD_UPDATE5
1564 if [ -n "$NOSOURCE0" ] ; then
1565 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
1567 get_files $SOURCES $PATCHES
1569 Exit_error err_no_spec_in_cmdl;
1576 if [ -n "$SPECFILE" ]; then
1579 if [ -n "$ICONS" ]; then
1583 # don't fetch sources from remote locations
1585 for file in $SOURCES
1587 [ -n "`src_md5 $file`" ] && continue
1588 new_SOURCES="$new_SOURCES $file"
1590 SOURCES="$new_SOURCES"
1591 get_files $SOURCES $PATCHES;
1592 tag_files "$SOURCES $PATCHES $ICONS";
1594 Exit_error err_no_spec_in_cmdl;
1598 $RPM --clean --rmsource --rmspec --force --nodeps $SPECFILE
1600 "list-sources-files" )
1603 DONT_PRINT_REVISION="yes"
1606 SAPS="$SOURCES $PATCHES"
1607 for SAP in $SAPS ; do
1608 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
1611 "list-sources-local-paths" )
1614 DONT_PRINT_REVISION="yes"
1617 SAPS="$SOURCES $PATCHES"
1618 for SAP in $SAPS ; do
1619 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
1627 if [ -f `pwd`/.${SPECFILE}_INSTALLED_PACKAGES -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
1628 rm `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1632 # vi:syntax=sh:ts=3:sw=4