3 # This program is free software, distributed under the terms of
4 # the GNU General Public License Version 2.
10 # 2 - no spec file name in cmdl parameters
11 # 3 - spec file not stored in repo
12 # 4 - some source, patch or icon files not stored in repo
13 # 5 - package build failed
14 # 6 - spec file with errors
15 # 7 - wrong source in /etc/poldek.conf
16 # 8 - Failed installing buildrequirements and subrequirements
17 # 9 - Requested tag already exist
18 # 10 - Refused to build fractional release
19 # 100 - Unknown error (should not happen)
22 # - builder -u fetches current version first (well that's okay, how you compare versions if you have no old spec?)
23 # - when Icon: field is present, -5 and -a5 doesn't work
24 # - builder -R skips installing BR if spec is not present before builder invocation (need to run builder twice)
31 Build package utility from PLD Linux CVS repository
32 $VERSION (C) 1999-2007 Free Penguins".
34 PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
53 ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
57 # user agent when fetching files
58 USER_AGENT="PLD/Builder($VERSION)"
60 # It can be used i.e. in log file naming.
61 # See LOGFILE example.
62 DATE=`date +%Y-%m-%d_%H-%M-%S`
64 # Example: LOGFILE='../log.$PACKAGE_NAME'
65 # Example: LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
66 # Yes, you can use variable name! Note _single_ quotes!
90 WGET_RETRIES=${MAX_WGET_RETRIES:-0}
91 CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
97 CVS_SERVER="cvs.pld-linux.org"
98 DISTFILES_SERVER="://distfiles.pld-linux.org"
99 ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org"
104 FAIL_IF_NO_SOURCES="yes"
106 # let get_files skip over files which are present to get those damn files fetched
107 SKIP_EXISTING_FILES="no"
110 # should the specfile be restored if upgrade failed?
111 REVERT_BROKEN_UPGRADE="yes"
113 if [ -x /usr/bin/rpm-getdeps ]; then
114 FETCH_BUILD_REQUIRES_RPMGETDEPS="yes"
116 FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
119 # Here we load saved user environment used to
120 # predefine options set above, or passed to builder
122 # This one reads global system environment settings:
123 if [ -f ~/etc/builderrc ]; then
126 # And this one cascades settings using user personal
128 # Example of ~/.builderrc:
130 #UPDATE_POLDEK_INDEXES="yes"
131 #FETCH_BUILD_REQUIRES="yes"
132 #REMOVE_BUILD_REQUIRES="force"
134 #LOGFILE='../LOGS/log.$PACKAGE_NAME.$DATE'
138 if [ -n "$HOME_ETC" ]; then
139 USER_CFG="$HOME_ETC/.builderrc"
140 BUILDER_MACROS="$HOME_ETC/.builder-rpmmacros"
142 USER_CFG=~/.builderrc
143 BUILDER_MACROS=~/.builder-rpmmacros
146 [ -f "$USER_CFG" ] && . "$USER_CFG"
148 if [ "$SCHEDTOOL" = "auto" ]; then
149 if [ -x /usr/bin/schedtool ] && schedtool -B -e echo >/dev/null; then
150 SCHEDTOOL="schedtool -B -e"
156 if [ -n "$USE_PROZILLA" ]; then
157 GETURI="proz --no-getch -r -P ./ -t$WGET_RETRIES $PROZILLA_OPTS"
160 elif [ -n "$USE_AXEL" ]; then
161 GETURI="axel -a $AXEL_OPTS"
165 wget --help 2>&1 | grep -q -- ' --no-check-certificate ' && WGET_OPTS="$WGET_OPTS --no-check-certificate"
166 wget --help 2>&1 | grep -q -- ' --inet ' && WGET_OPTS="$WGET_OPTS --inet"
167 wget --help 2>&1 | grep -q -- ' --retry-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
168 WGET_OPTS="$WGET_OPTS --user-agent=$USER_AGENT"
170 GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
171 GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
177 if (rpm --version 2>&1 | grep -q '4.0.[0-2]'); then
185 POLDEK_INDEX_DIR="`$RPM --eval %_rpmdir`/"
186 POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
190 RES_FILE=~/tmp/poldek-exit-status.$RANDOM
191 if [ -n "$LOGFILE" ]; then
192 LOG=`eval echo $LOGFILE`
193 if [ -n "$LASTLOG_FILE" ]; then
194 echo "LASTLOG=$LOG" > $LASTLOG_FILE
196 (${NICE_COMMAND} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE})|tee -a $LOG
199 (${NICE_COMMAND} ${POLDEK_CMD} `while test $# -gt 0; do echo "$1 ";shift;done` ; echo $? > ${RES_FILE}) 1>&2 >/dev/null
200 return `cat ${RES_FILE}`
205 #---------------------------------------------
210 if [ -n "$DEBUG" ]; then set -xv; fi
212 Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|-ba|--build]
213 [-bb|--build-binary] [-bs|--build-source] [-bc] [-bi] [-bl] [-u|--try-upgrade]
214 [{-cf|--cvs-force}] [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>]
215 [-g|--get] [-h|--help] [--http] [{-l|--logtofile} <logfile>] [-m|--mr-proper]
216 [-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T|--tag <cvstag>]
217 [-Tvs|--tag-version-stable] [-Ts|--tag-stable] [-Tv|--tag-version]
218 [{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}] [--use-greed-sources]
219 [-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>] [--short-circuit]
220 [--show-bconds] [--with/--without <feature>] [--define <macro> <value>]
221 <package>[.spec][:cvstag]
223 -5, --update-md5 - update md5 comments in spec, implies -nd -ncs
224 -a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
225 -n5, --no-md5 - ignore md5 comments in spec
226 -D, --debug - enable builder script debugging mode,
227 -debug - produce rpm debug package (same as --opts -debug)
228 -V, --version - output builder version string
229 --short-version - output builder short version
230 -a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
231 -b, -ba, --build - get all files from CVS repo or HTTP/FTP and build package
233 -bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
234 only package from <package>.spec,
235 -bp, --build-prep - execute the %prep phase of <package>.spec,
236 -bc - execute the %build phase of <package>.spec,
237 -bi - execute the %install phase of <package>.spec
238 -bl - execute the %files phase of <package>.spec
239 -bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
241 --short-circuit - short-circuit build
242 -B, --branch - add branch
243 -c, --clean - clean all temporarily created files (in BUILD, SOURCES,
244 SPECS and \$RPM_BUILD_ROOT and CVS/Entries) after rpmbuild commands.
245 -m, --mr-proper - clean all temporarily created files (in BUILD, SOURCES,
246 SPECS and \$RPM_BUILD_ROOT and CVS/Entries). Doesn't run
248 -cf, --cvs-force - use -F when tagging (useful when moving branches)
249 -d <cvsroot>, --cvsroot <cvsroot>
251 --define <macro> <value>
252 - define a macro <macro> with value <value>,
253 --alt_kernel <kernel>
254 - same as --define 'alt_kernel <kernel>'
255 --nodeps - rpm won't check any dependences
256 -g, --get - get <package>.spec and all related files from CVS repo
258 -h, --help - this message,
259 --http - use http instead of ftp,
260 -l <logfile>, --logtofile <logfile>
262 -nc, --no-cvs - don't download sources from CVS, if source URL is given,
264 - don't check specs in CVS
265 -nd, --no-distfiles - don't download from distfiles
266 -nm, --no-mirrors - don't download from mirror, if source URL is given,
267 -nu, --no-urls - don't try to download from FTP/HTTP location,
268 -ns, --no-srcs - don't download Sources
269 -ns0, --no-source0 - don't download Source0
270 -nn, --no-net - don't download anything from the net
271 -pm, --prefer-mirrors - prefer mirrors (if any) over distfiles for SOURCES
272 --no-init - don't initialize builder paths (SPECS and SOURCES)
274 --skip-existing-files - skip existing files in get_files
275 --opts <rpm opts> - additional options for rpm
276 -q, --quiet - be quiet,
277 --date yyyy-mm-dd - build package using resources from specified CVS date,
278 -r <cvstag>, --cvstag <cvstag>
279 - build package using resources from specified CVS tag,
280 -A - build package using CVS resources as any sticky tags/date/kopts being reset.
281 -R, --fetch-build-requires
282 - fetch what is BuildRequired,
283 -RB, --remove-build-requires
284 - remove all you fetched with -R or --fetch-build-requires
285 remember, this option requires confirmation,
286 -FRB, --force-remove-build-requires
287 - remove all you fetched with -R or --fetch-build-requires
288 remember, this option works without confirmation,
289 -sd, --source-distfiles - list sources available from distfiles (intended for offline
290 operations; does not work when Icon field is present
291 but icon file is absent),
292 -sc, --source-cvs - list sources available from CVS
293 -sdp, --source-distfiles-paths - list sources available from distfiles -
294 paths relative to distfiles directory (intended for offline
295 operations; does not work when Icon field is present
296 but icon file is absent),
297 -sf, --source-files - list sources - bare filenames (intended for offline
298 operations; does not work when Icon field is present
299 but icon file is absent),
300 -sp, --source-paths - list sources - filenames with full local paths (intended for
301 offline operations; does not work when Icon field is present
302 but icon file is absent),
303 -su, --source-urls - list urls - urls to sources and patches
304 intended for copying urls with spec with lots of macros in urls
305 -T <cvstag> , --tag <cvstag>
306 - add cvs tag <cvstag> for files,
307 -Tvs, --tag-version-stable
308 - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
310 - add cvs tag STABLE for files,
312 - add cvs tag NAME-VERSION-RELEASE for files,
313 -Tp, --tag-prefix <prefix>
314 - add <prefix> to NAME-VERSION-RELEASE tags,
315 -tt, --test-tag <prefix>
316 - fail if tag is already present,
317 -ir, --integer-release-only
318 - allow only integer and snapshot releases
319 -v, --verbose - be verbose,
320 -u, --try-upgrade - check version, and try to upgrade package
321 -un, --try-upgrade-with-float-version
322 - as above, but allow float version
324 - try download source from tag head if don't find it in
326 -U, --update - refetch sources, don't use distfiles, and update md5 comments
327 -Upi, --update-poldek-indexes
328 - refresh or make poldek package index files.
329 -np, --nopatch <patchnumber>
330 - don't apply <patchnumber>
331 --show-bconds - show available conditional builds, which can be used
332 - with --with and/or --without switches.
333 --show-bcond-args - show active bconds, from ~/.bcondrc. this is used by
334 ./repackage.sh script. in other words, the output is
335 parseable by scripts.
336 --with/--without <feature>
337 - conditional build package depending on %_with_<feature>/
338 %_without_<feature> macro switch. You may now use
339 --with feat1 feat2 feat3 --without feat4 feat5 --with feat6
340 constructions. Set GROUP_BCONDS to yes to make use of it.
341 --target <platform>, --target=<platform>
342 - build for platform <platform>.
343 --init-rpm-dir - initialize ~/rpm directory structure
347 update_shell_title() {
349 local len=${COLUMNS:-80}
350 local msg=$(echo "$*" | cut -c-$len)
352 if [ -n "$BE_VERBOSE" ]; then
353 echo >&2 "$(date +%s.%N) $*"
356 if [ "x$TITLECHANGE" == "xyes" -o "x$TITLECHANGE" == "x" ]; then
358 if [ -n "$PACKAGE_NAME" ]; then
359 pkg=${PACKAGE_NAME}-${PACKAGE_VERSION}-${PACKAGE_RELEASE}
364 msg="$pkg: ${SHELL_TITLE_PREFIX:+$SHELL_TITLE_PREFIX }$msg"
365 msg="$(echo $msg | tr -d '\n\r')"
368 echo >&2 -ne "\033]1;$msg\007\033]2;$msg\007"
371 echo >&2 -ne "\033]0;$msg\007"
377 # set TARGET from BuildArch: from SPECFILE
379 if [ -n "$SPECFILE" ] && [ -z "$TARGET" ]; then
380 tmp=$(awk '/^BuildArch:/ { print $NF}' $SPECFILE)
382 target_platform=$(rpm -E '%{_target_vendor}-%{_target_os}%{?_gnu}')
386 TARGET_SWITCH="--target ${TARGET}-${target_platform}" ;;
388 TARGET_SWITCH="--target=$TARGET" ;;
394 # runs rpm with minimal macroset
396 # we reset macros not to contain macros.build as all the %() macros are
397 # executed here, while none of them are actually needed.
398 # at the time of this writing macros.build + macros contained 70 "%(...)" macros.
399 safe_macrofiles=$(rpm --showrc | awk -F: '/^macrofiles/ { gsub(/^macrofiles[ \t]+:/, "", $0); gsub(/:.*macros.build:/, ":", $0); print $0 } ')
401 # TODO: move these to /usr/lib/rpm/macros
402 cat > $BUILDER_MACROS <<'EOF'
403 %x8664 x86_64 amd64 ia32e
406 %requires_releq_kernel_up %{nil}
407 %requires_releq_kernel_smp %{nil}
408 %requires_releq_kernel %{nil}
409 %requires_releq() %{nil}
410 %pyrequires_eq() %{nil}
411 %requires_eq() %{nil}
412 %requires_eq_to() %{nil}
413 %releq_kernel_up ERROR
414 %releq_kernel_smp ERROR
419 %ruby_ver_requires_eq() %{nil}
420 %ruby_mod_ver_requires_eq() %{nil}
421 %__php_api_requires() %{nil}
422 %php_major_version ERROR
423 %php_api_version ERROR
424 %requires_xorg_xserver_extension %{nil}
425 %requires_xorg_xserver_xinput %{nil}
426 %requires_xorg_xserver_font %{nil}
427 %requires_xorg_xserver_videodrv %{nil}
429 %perl_vendorarch ERROR
430 %perl_vendorlib ERROR
431 # damn. need it here! - copied from /usr/lib/rpm/macros.build
432 %tmpdir %(echo "${TMPDIR:-/tmp}")
433 %patchset_source(f:b:) %(
434 base=%{-b*}%{!-b*:10000};
435 start=$(expr $base + %1);
436 end=$(expr $base + %{?2}%{!?2:%{1}});
437 # we need to call seq twice as it doesn't allow two formats
438 seq -f 'Patch%g:' $start $end > %{tmpdir}/__ps1;
439 seq -f '%{-f*}' %1 %{?2}%{!?2:%{1}} > %{tmpdir}/__ps2;
440 paste %{tmpdir}/__ps{1,2};
441 rm -f %{tmpdir}/__ps{1,2};
445 if [ "$NOINIT" = "yes" ] ; then
446 cat >> $BUILDER_MACROS <<'EOF'
451 eval $RPMBUILD --macros "$safe_macrofiles:$BUILDER_MACROS" $QUIET $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $* 2>&1
455 if [ -n "$DEBUG" ]; then
460 update_shell_title "cache_rpm_dump"
463 # what we need from dump is NAME, VERSION, RELEASE and PATCHES/SOURCES.
464 dump='%{echo:dummy: PACKAGE_NAME %{name} }%dump'
470 ARGS='--nodigest --nosignature --nobuild'
473 minirpm $ARGS --define "'prep $dump'" --nodeps $SPECFILE
475 if [ $? -gt 0 ]; then
476 error=$(echo "$rpm_dump" | sed -ne '/^error:/,$p')
478 Exit_error err_build_fail
481 # make small dump cache
482 rpm_dump_cache=`echo "$rpm_dump" | awk '
483 $2 ~ /^SOURCEURL/ {print}
484 $2 ~ /^PATCHURL/ {print}
485 $2 ~ /^nosource/ {print}
486 $2 ~ /^PACKAGE_/ {print}
489 update_shell_title "cache_rpm_dump: OK!"
493 if [ -z "$rpm_dump_cache" ] ; then
494 echo "internal error: cache_rpm_dump not called! (missing %prep?)" 1>&2
496 echo "$rpm_dump_cache"
501 update_shell_title "get icons"
502 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
503 if [ -z "$ICONS" ]; then
507 rpm_dump_cache="kalasaba" NODIST="yes" get_files $ICONS
512 update_shell_title "parsing specfile"
513 if [ -n "$DEBUG" ]; then
518 # icons are needed for successful spec parse
524 if [ "$NOSRCS" != "yes" ]; then
525 SOURCES="`rpm_dump | awk '/SOURCEURL[0-9]+/ {print $3}'`"
528 if (rpm_dump | grep -qEi ":.*nosource.*1"); then
529 FAIL_IF_NO_SOURCES="no"
532 PATCHES="`rpm_dump | awk '/PATCHURL[0-9]+/ {print $3}'`"
533 ICONS="`awk '/^Icon:/ {print $2}' ${SPECFILE}`"
534 PACKAGE_NAME=$(rpm_dump | awk '$2 == "PACKAGE_NAME" { print $3; exit}')
535 PACKAGE_VERSION=$(rpm_dump | awk '$2 == "PACKAGE_VERSION" { print $3; exit}')
536 PACKAGE_RELEASE=$(rpm_dump | awk '$2 == "PACKAGE_RELEASE" { print $3; exit}')
538 if [ "$PACKAGE_NAME" != "$ASSUMED_NAME" ]; then
539 echo >&2 "WARNING! Spec name ($ASSUMED_NAME) does not agree with package name ($PACKAGE_NAME)"
542 if [ -n "$BE_VERBOSE" ]; then
543 echo "- Sources : `nourl $SOURCES`"
544 if [ -n "$PATCHES" ]; then
545 echo "- Patches : `nourl $PATCHES`"
547 echo "- Patches : *no patches needed*"
549 if [ -n "$ICONS" ]; then
550 echo "- Icon : `nourl $ICONS`"
552 echo "- Icon : *no package icon*"
554 echo "- Name : $PACKAGE_NAME"
555 echo "- Version : $PACKAGE_VERSION"
556 echo "- Release : $PACKAGE_RELEASE"
559 update_shell_title "parse_spec: OK!"
564 if [ -n "$DEBUG" ]; then
572 "err_no_spec_in_cmdl" )
573 remove_build_requires
574 echo "ERROR: spec file name not specified."
576 "err_invalid_cmdline" )
577 echo "ERROR: invalid command line arg ($2)."
579 "err_no_spec_in_repo" )
580 remove_build_requires
581 echo "Error: spec file not stored in CVS repo."
583 "err_no_source_in_repo" )
584 remove_build_requires
585 echo "Error: some source, patch or icon files not stored in CVS repo. ($2)"
588 remove_build_requires
589 echo "Error: package build failed. (${2:-no more info})"
591 "err_no_package_data" )
592 remove_build_requires
593 echo "Error: couldn't get out package name/version/release from spec file."
596 remove_build_requires
597 echo "Tag ${2} already exists (spec release: ${3})."
600 remove_build_requires
601 echo "Release ${2} not integer and not a snapshot."
603 "err_branch_exists" )
604 remove_build_requires
605 echo "Tree branch already exists (${2})."
608 remove_build_requires
609 echo "Error: conditions reject building this spec (${2})."
612 echo "Unknown error."
618 if [ -n "$DEBUG" ]; then
623 if [ "$NOINIT" != "yes" ] ; then
625 if [ "$ASSUMED_NAME" ]; then
626 extra="--define 'name $ASSUMED_NAME'"
628 SOURCE_DIR="`eval $RPM $RPMOPTS $extra --eval '%{_sourcedir}'`"
629 SPEC_DIR="`eval $RPM $RPMOPTS $extra --eval '%{_specdir}'`"
641 update_shell_title "get_spec"
643 if [ -n "$DEBUG" ]; then
649 if [ ! -f "$SPECFILE" ]; then
650 SPECFILE="`basename $SPECFILE .spec`.spec"
652 if [ "$NOCVSSPEC" != "yes" ]; then
654 if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
655 echo "Warning: No CVS access defined - using local .spec file"
659 cvsup "$SPECFILE" || Exit_error err_no_spec_in_repo
662 if [ ! -f "$SPECFILE" ]; then
663 Exit_error err_no_spec_in_repo
666 if [ "$CHMOD" = "yes" -a -n "$SPECFILE" ]; then
667 chmod $CHMOD_MODE $SPECFILE
670 [ -n "$DONT_PRINT_REVISION" ] || grep -E -m 1 "^#.*Revision:.*Date" $SPECFILE
679 if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
680 cvs update mirrors >&2
684 local origin mirror name rest ol prefix
685 while read origin mirror name rest; do
686 # skip comments and empty lines
687 if [ -z "$origin" ] || [[ $origin == \#* ]]; then
690 ol=`echo -n "$origin"|wc -c`
691 prefix="`echo -n "$url" | head -c $ol`"
692 if [ "$prefix" = "$origin" ] ; then
693 suffix="`echo "$url"|cut -b $((ol+1))-`"
694 echo -n "$mirror$suffix"
701 # Warning: unpredictable results if same URL used twice
706 grep "SOURCEURL[0-9]*[ ]*$1""[ ]*$" | \
707 sed -e 's/.*SOURCEURL\([0-9][0-9]*\).*/\1/' | \
713 [ "$NO5" = "yes" ] && return
715 [ -z "$no" ] && return
719 if [ -f additional-md5sums ]; then
720 local spec_rev=$(grep $SPECFILE CVS/Entries 2>/dev/null | sed -e s:/$SPECFILE/:: -e s:/.*::)
721 if [ -z "$spec_rev" ]; then
722 spec_rev="$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')"
724 local spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
725 md5=$(grep -s -v '^#' additional-md5sums | \
726 grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
727 sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
728 grep -E '^[0-9a-f]{32}$')
731 if [ $(echo "$md5" | wc -l) != 1 ] ; then
732 echo "$SPECFILE: more then one entry in additional-md5sums for $1" 1>&2
734 echo "$md5" | tail -n 1
739 source_md5=`grep -i "#[ ]*Source$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
740 if [ -n "$source_md5" ]; then
743 source_md5=`grep -i "BuildRequires:[ ]*digest(%SOURCE$no)[ ]*=" $SPECFILE | sed -e 's/.*=//'`
744 if [ -n "$source_md5" ]; then
747 # we have empty SourceX-md5, but it is still possible
748 # that we have NoSourceX-md5 AND NoSource: X
749 nosource_md5=`grep -i "#[ ]*NoSource$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
750 if [ -n "$nosource_md5" -a -n "`grep -i "^NoSource:[ ]*$no$" $SPECFILE`" ] ; then
759 echo "by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
764 echo "$PROTOCOL$DISTFILES_SERVER/distfiles/$(distfiles_path "$1")"
767 distfiles_attic_url ()
769 echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/$(distfiles_path "$1")"
776 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
781 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
782 [ -n "$size" -a "$size" -gt 0 ]
787 if [ "$CVSIGNORE_DF" != "yes" ]; then
790 cvsignore=${SOURCE_DIR}/.cvsignore
791 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
792 echo "$1" >> $cvsignore
798 update_shell_title "cvsup"
800 if [ -n "$CVSROOT" ]; then
801 OPTIONS="-d $CVSROOT $OPTIONS"
804 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
805 OPTIONS="$OPTIONS -A"
807 if [ -n "$CVSDATE" ]; then
808 OPTIONS="$OPTIONS -D $CVSDATE"
810 if [ -n "$CVSTAG" ]; then
811 OPTIONS="$OPTIONS -r $CVSTAG"
816 local retries_counter=0
818 update_shell_title "cvsup: $*"
820 update_shell_title "cvsup: $# files"
822 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
823 retries_counter=$(( $retries_counter + 1 ))
824 output=$(LC_ALL=C cvs $OPTIONS "$@" 2>&1)
826 [ -n "$output" ] && echo "$output"
827 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
828 echo "Trying again [$*]... ($retries_counter)"
829 update_shell_title "cvsup: retry #$retries_counter"
836 update_shell_title "cvsup: done!"
840 # returns true if "$1" is ftp, http or https protocol url
844 ftp://*|http://*|https://*)
853 if [ $# -eq 0 ]; then
857 update_shell_title "update md5"
858 if [ -n "$DEBUG" ]; then
865 # pass 1: check files to be fetched
869 local fp=$(nourl "$i")
870 local srcno=$(src_no "$i")
871 if [ -n "$ADD5" ]; then
872 [ "$fp" = "$i" ] && continue # FIXME what is this check doing?
873 grep -qiE '^#[ ]*Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE && continue
875 grep -qiE '^#[ ]*Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE || continue
877 if [ ! -f "$fp" ] || [ $ALWAYS_CVSUP = "yes" ]; then
878 need_files="$need_files $i"
882 # pass 1a: get needed files
883 if [ "$need_files" ]; then
884 get_files $need_files
887 # pass 2: proceed with md5 adding or updating
889 local fp=$(nourl "$i")
890 local srcno=$(src_no "$i")
891 local md5=$(grep -iE '^#[ ]*(No)?Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE )
892 if [ -n "$ADD5" ] && is_url $i || [ -n "$md5" ]; then
893 local tag="Source$srcno-md5"
894 if [[ "$md5" == *NoSource* ]]; then
895 tag="NoSource$srcno-md5"
897 md5=$(md5sum "$fp" | cut -f1 -d' ')
898 echo "Updating $tag ($md5: $fp)."
900 print unless /^\s*#\s*(No)?Source'$srcno'-md5\s*:/i;
901 print "# '$tag':\t'$md5'\n" if /^Source'$srcno'\s*:\s+/;
910 update_shell_title "check md5"
913 if good_md5 "$i" && good_size "$i"; then
917 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
918 echo "or -5 to update md5 sums, if you're sure files are correct."
919 Exit_error err_no_source_in_repo $i
925 update_shell_title "get_files"
927 if [ -n "$DEBUG" ]; then
932 if [ $# -gt 0 ]; then
935 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
936 echo "Warning: No CVS access defined for SOURCES"
941 local get_files_cvs=""
945 SHELL_TITLE_PREFIX="get_files[$nc/$#]"
946 update_shell_title "$i"
947 local fp=`nourl "$i"`
948 if [ "$SKIP_EXISTING_FILES" = "yes" ] && [ -f "$fp" ]; then
953 local srcmd5=$(src_md5 "$i")
955 # we know if source/patch is present in cvs/distfiles
956 # - has md5 (in distfiles)
959 # CHECK: local file didn't exist or always cvs up (first) requested.
960 if [ ! -f "$fp" ] || [ $ALWAYS_CVSUP = "yes" ]; then
961 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
962 echo "Warning: no URL given for $i"
965 if [ -z "$NODIST" ] && [ -n "$srcmd5" ]; then
966 if good_md5 "$i" && good_size "$i"; then
967 echo "$fp having proper md5sum already exists"
972 # optionally prefer mirror over distfiles if there's mirror
973 # TODO: build url list and then try each url from the list
974 if [ -n "$PREFMIRRORS" ] && [ -z "$NOMIRRORS" ] && im=$(find_mirror "$i") && [ "$im" != "$i" ]; then
977 url=$(distfiles_url "$i")
980 url_attic=$(distfiles_attic_url "$i")
982 # is $url local file?
983 if [[ "$url" = [./]* ]]; then
984 update_shell_title "${GETLOCAL%% *}: $url"
985 ${GETLOCAL} $url $target
987 if [ -z "$NOMIRRORS" ]; then
988 url=$(find_mirror "$url")
992 # make shorter message for distfiles urls
993 if [[ "$uri" = ${PROTOCOL}${DISTFILES_SERVER}* ]] || [[ "$uri" = ${PROTOCOL}${ATTICDISTFILES_SERVER}* ]]; then
994 uri=${uri#${PROTOCOL}${DISTFILES_SERVER}/distfiles/by-md5/?/?/*/}
995 uri=${uri#${PROTOCOL}${ATTICDISTFILES_SERVER}/distfiles/by-md5/?/?/*/}
998 update_shell_title "${GETURI%% *}: $uri"
999 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
1000 if [ "`echo $url | grep -E 'ftp://'`" ]; then
1001 update_shell_title "${GETURI2%% *}: $url"
1002 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
1007 if [ ! -s "$target" ]; then
1009 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
1010 update_shell_title "${GETLOCAL%% *}: $url_attic"
1011 ${GETLOCAL} $url_attic $target
1013 if [ -z "$NOMIRRORS" ]; then
1014 url_attic="`find_mirror "$url_attic"`"
1016 update_shell_title "${GETURI%% *}: $url_attic"
1017 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
1018 if [ "`echo $url_attic | grep -E 'ftp://'`" ]; then
1019 update_shell_title "${GETURI2%% *}: $url_attic"
1020 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
1025 if [ -s "$target" ]; then
1026 cvsignore_df $target
1031 elif [ "$NOCVS" != "yes" -a -z "$srcmd5" ]; then
1032 if [ $# -gt 1 ]; then
1033 get_files_cvs="$get_files_cvs $fp"
1034 update_shell_title "$fp (will cvs up later)"
1041 if [ -z "$NOURLS" ] && [ ! -f "$fp" -o -n "$UPDATE" ] && [ "`echo $i | grep -E 'ftp://|http://|https://'`" ]; then
1042 if [ -z "$NOMIRRORS" ]; then
1043 im="`find_mirror "$i"`"
1047 update_shell_title "${GETURI%% *}: $im"
1048 ${GETURI} "$im" || \
1049 if [ "`echo $im | grep -E 'ftp://'`" ]; then
1050 update_shell_title "${GETURI2%% *}: $im"
1055 if [ "$cvsup" = 1 ]; then
1061 # the md5 check must be moved elsewhere as if we've called from update_md5 the md5 is wrong.
1062 if [ ! -f "$fp" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
1063 if [ -n "GREEDSRC" ]; then
1064 get_greed_sources $i
1066 Exit_error err_no_source_in_repo $i
1070 # we check md5 here just only to refetch immediately
1071 if good_md5 "$i" && good_size "$i"; then
1073 elif [ "$FROM_DISTFILES" = 1 ]; then
1074 # wrong md5 from distfiles: remove the file and try again
1076 echo "MD5 sum mismatch. Trying full fetch."
1079 update_shell_title "${GETURI%% *}: $url"
1080 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
1081 if [ "`echo $url | grep -E 'ftp://'`" ]; then
1082 update_shell_title "${GETURI2%% *}: $url"
1083 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
1085 if [ ! -s "$target" ]; then
1087 update_shell_title "${GETURI%% *}: $url_attic"
1088 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
1089 if [ "`echo $url_attic | grep -E 'ftp://'`" ]; then
1090 update_shell_title "${GETURI2%% *}: $url_attic"
1091 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
1094 test -s "$target" || rm -f "$target"
1097 SHELL_TITLE_PREFIX=""
1099 if [ "$get_files_cvs" ]; then
1100 cvsup $get_files_cvs
1103 if [ "$CHMOD" = "yes" ]; then
1104 CHMOD_FILES="`nourl "$@"`"
1105 if [ -n "$CHMOD_FILES" ]; then
1106 chmod $CHMOD_MODE $CHMOD_FILES
1113 if [ -n "$DEBUG" ]; then
1118 # Check whether first character of PACKAGE_NAME is legal for tag name
1119 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
1123 # NOTE: CVS tags may must not contain the characters `$,.:;@'
1124 TAGVER=$(echo $TAG_PREFIX$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_RELEASE | tr '[.@]' '[_#]')
1126 # Remove #kernel.version_release from TAGVER because tagging sources
1127 # could occur with different kernel-headers than kernel-headers used at build time.
1128 # besides, %{_kernel_ver_str} is not expanded.
1130 # TAGVER=auto-ac-madwifi-ng-0-0_20070225_1#%{_kernel_ver_str}
1131 # TAGVER=auto-ac-madwifi-ng-0-0_20070225_1
1141 if [ -n "$DEBUG" ]; then
1146 echo "Version: $PACKAGE_VERSION"
1147 echo "Release: $PACKAGE_RELEASE"
1150 if [ "$TAG_VERSION" = "yes" ]; then
1151 TAGVER=`make_tagver`
1152 echo "CVS tag: $TAGVER"
1154 if [ -n "$TAG" ]; then
1155 echo "CVS tag: $TAG"
1158 local OPTIONS="tag $CVS_FORCE"
1159 if [ -n "$CVSROOT" ]; then
1160 OPTIONS="-d $CVSROOT $OPTIONS"
1165 for i in $TAG_FILES; do
1166 # don't tag files stored on distfiles
1167 [ -n "`src_md5 $i`" ] && continue
1168 local fp=`nourl "$i"`
1169 if [ -f "$fp" ]; then
1170 tag_files="$tag_files $fp"
1171 elif [ -n "GREEDSRC" ]; then
1172 get_greed_sources $i
1174 Exit_error err_no_source_in_repo $i
1178 if [ "$tag_files" ]; then
1179 if [ "$TAG_VERSION" = "yes" ]; then
1180 update_shell_title "tag sources: $TAGVER"
1181 printf "Tagging %d files\n" $(echo $tag_files | wc -w)
1182 cvs $OPTIONS $TAGVER $tag_files || exit
1184 if [ -n "$TAG" ]; then
1185 update_shell_title "tag sources: $TAG"
1187 while [ "$tag_files" ]; do
1188 local chunk=$(echo $tag_files | tr ' ' '\n' | head -n 100)
1189 printf "Tagging %d files\n" $(echo $chunk | wc -w)
1190 cvs $OPTIONS $TAG $chunk || exit
1191 tag_files=$(echo $tag_files | tr ' ' '\n' | tail +101)
1197 if [ "$TAG_VERSION" = "yes" ]; then
1198 update_shell_title "tag spec: $TAGVER"
1199 cvs $OPTIONS $TAGVER $SPECFILE || exit
1201 if [ -n "$TAG" ]; then
1202 update_shell_title "tag spec: $TAG"
1203 cvs $OPTIONS $TAG $SPECFILE || exit
1210 echo "CVS branch tag: $TAG"
1215 if [ -n "$DEBUG" ]; then
1220 local OPTIONS="tag $CVS_FORCE -b"
1221 if [ -n "$CVSROOT" ]; then
1222 OPTIONS="-d $CVSROOT $OPTIONS"
1226 for i in $TAG_FILES; do
1227 local fp=`nourl "$i"`
1228 if [ -f "$fp" ]; then
1229 tag_files="$tag_files $fp"
1230 elif [ -n "GREEDSRC" ]; then
1231 get_greed_sources $i
1233 Exit_error err_no_source_in_repo $i
1236 if [ "$tag_files" ]; then
1237 cvs $OPTIONS $TAG $tag_files || exit
1241 cvs $OPTIONS $TAG $SPECFILE || exit
1245 # this function should exit early if package can't be built for this arch
1246 # this avoids unneccessary BR filling.
1249 out=$(minirpm --short-circuit -bp --define "'prep exit 0'" --nodeps $SPECFILE 2>&1)
1251 if [ $ret -ne 0 ]; then
1260 update_shell_title "build_package"
1261 if [ -n "$DEBUG" ]; then
1268 if [ -n "$TRY_UPGRADE" ]; then
1269 update_shell_title "build_package: try_upgrade"
1270 if [ -n "$FLOAT_VERSION" ]; then
1271 TNOTIFY=`./pldnotify.awk $SPECFILE -n` || exit 1
1273 TNOTIFY=`./pldnotify.awk $SPECFILE` || exit 1
1276 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
1278 if [ -n "$TNEWVER" ]; then
1279 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
1280 echo "New version found, updating spec file to version " $TNEWVER
1281 if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
1282 cp -f $SPECFILE $SPECFILE.bak
1285 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
1286 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t0.1/' $SPECFILE"
1288 NODIST="yes" get_files $SOURCES $PATCHES
1291 unset TOLDVER TNEWVER TNOTIFY
1298 BUILD_SWITCH="-ba" ;;
1300 BUILD_SWITCH="-bb" ;;
1302 BUILD_SWITCH="-bs --nodeps" ;;
1304 BUILD_SWITCH="-bp --nodeps" ;;
1306 BUILD_SWITCH="-bc" ;;
1308 BUILD_SWITCH="-bi" ;;
1310 BUILD_SWITCH="-bl" ;;
1314 update_shell_title "build_package: $COMMAND"
1315 if [ -n "$LOGFILE" ]; then
1316 LOG=`eval echo $LOGFILE`
1317 if [ -d "$LOG" ]; then
1318 echo "Log file $LOG is a directory."
1319 echo "Parse error in the spec?"
1320 Exit_error err_build_fail
1322 if [ -n "$LASTLOG_FILE" ]; then
1323 echo "LASTLOG=$LOG" > $LASTLOG_FILE
1325 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
1326 (time eval ${NICE_COMMAND} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
1327 RETVAL=`cat $RES_FILE`
1329 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
1330 if [ "$RETVAL" -eq "0" ]; then
1337 eval ${NICE_COMMAND} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $SPECFILE
1340 if [ "$RETVAL" -ne "0" ]; then
1341 if [ -n "$TRY_UPGRADE" ]; then
1342 echo "\n!!! Package with new version cannot be built automagically\n"
1343 if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
1344 mv -f $SPECFILE.bak $SPECFILE
1347 Exit_error err_build_fail
1354 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
1357 install_required_packages()
1364 # taken from find-spec-bcond, but with just getting the list
1366 # quick revert hint: '$RPMBUILD --bcond $SPEC'
1368 /^%changelog/ { exit }
1369 /_with(out)?_[_a-zA-Z0-9]+/{
1370 match($0, /_with(out)?_[_a-zA-Z0-9]+/);
1371 print substr($0, RSTART, RLENGTH);
1374 match($0, /bcond_with(out)?[ \t]+[_a-zA-Z0-9]+/);
1375 bcond = substr($0, RSTART +5 , RLENGTH -5);
1376 gsub(/[ \t]+/,"_",bcond);
1378 }' $SPEC | LC_ALL=C sort -u
1382 # expand bconds from ~/.bcondrc
1383 # The file structure is like gentoo's package.use:
1386 # samba -mysql -pgsql
1387 # w32codec-installer license_agreement
1390 if ([ -f $HOME/.bcondrc ] || ([ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ])); then
1396 SN=${SPECFILE%%\.spec}
1398 local bcondrc=$HOME/.bcondrc
1399 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && bcondrc=$HOME_ETC/.bcondrc
1401 local bcond_avail=$(find_spec_bcond $SPECFILE)
1403 while read pkg flags; do
1405 [[ "$pkg" == \#* ]] && continue
1407 # any package or current package?
1408 if [ "$pkg" = "*" ] || [ "$pkg" = "$PACKAGE_NAME" ] || [ "$pkg" = "$SN" ]; then
1409 for flag in $flags; do
1410 local opt=${flag#[+-]}
1412 # use only flags which are in this package.
1413 if [[ $bcond_avail = *${opt}* ]]; then
1414 if [[ $flag = -* ]]; then
1415 if [[ $BCOND != *--with?${opt}* ]]; then
1416 BCOND="$BCOND --without $opt"
1419 if [[ $BCOND != *--without?${opt}* ]]; then
1420 BCOND="$BCOND --with $opt"
1427 update_shell_title "parse ~/.bcondrc: DONE!"
1432 update_shell_title "set bcond values"
1434 AVAIL_BCONDS_WITHOUT=""
1435 AVAIL_BCONDS_WITH=""
1436 if `grep -q ^%bcond ${SPECFILE}`; then
1438 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
1444 local bcond_avail=$(find_spec_bcond $SPECFILE)
1445 process_bcondrc "$SPECFILE"
1447 update_shell_title "parse bconds"
1448 case "${BCOND_VERSION}" in
1453 echo "Warning: This spec has old style bconds. Fix it || die."
1454 for opt in `echo "$bcond_avail" | grep ^_without_`
1456 AVAIL_BCOND_WITHOUT=${opt#_without_}
1457 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1458 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1460 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1464 for opt in `echo "$bcond_avail" | grep ^_with_`
1466 AVAIL_BCOND_WITH=${opt#_with_}
1467 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1468 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1470 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1475 local cond_type="" # with || without
1476 for opt in $bcond_avail; do
1485 AVAIL_BCOND_WITHOUT=${opt#_without_}
1486 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1487 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1489 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1493 AVAIL_BCOND_WITH=${opt#_with_}
1494 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1495 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1497 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1501 case "$cond_type" in
1504 AVAIL_BCOND_WITH="$opt"
1505 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1506 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1508 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1513 AVAIL_BCOND_WITHOUT="$opt"
1514 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1515 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1517 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1531 update_shell_title "run_sub_builder $package_name"
1533 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1534 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1535 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1536 # jakby nie bylo tego kawalka kodu.
1538 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1539 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1546 # Istnieje taki spec? ${package}.spec
1547 if [ -f "${SPEC_DIR}/${package}.spec" ]; then
1548 parent_spec_name=${package}.spec
1549 elif [ -f "${SPEC_DIR}/`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1550 parent_spec_name="`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1552 for provides_line in `grep ^Provides:.*$package ${SPEC_DIR} -R`
1558 if [ "${parent_spec_name}" != "" ]; then
1559 spawn_sub_builder $parent_spec_name
1561 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1567 update_shell_title "spawn_sub_builder $package_name"
1570 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1571 sub_builder_opts="${sub_builder_opts} -R"
1573 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1574 sub_builder_opts="${sub_builder_opts} -RB"
1575 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1576 sub_builder_opts="${sub_builder_opts} -FRB"
1578 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1579 sub_builder_opts="${sub_builder_opts} -Upi"
1583 ./builder ${sub_builder_opts} "$@"
1586 remove_build_requires()
1588 if [ "$INSTALLED_PACKAGES" != "" ]; then
1589 case "$REMOVE_BUILD_REQUIRES" in
1591 run_poldek --noask -ve $INSTALLED_PACKAGES
1594 run_poldek --ask -ve $INSTALLED_PACKAGES
1597 echo You may want to manually remove following BuildRequires fetched:
1598 echo $INSTALLED_PACKAGES
1599 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1607 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1608 if [ "$BCOND" != "" ]; then
1609 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1612 echo -ne "\nNo conditional flags passed"
1614 echo -ne "\n\nfrom available:\n"
1615 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1621 if [ "$NOCVSSPEC" != "yes" ]; then
1622 echo -ne "Available branches: "
1623 cvs status -v "${SPECFILE}" | awk '!/Sticky Tag:/ && /\(branch:/ { print $1 } ' | xargs
1627 # checks a given list of packages/files/provides agains current rpmdb.
1628 # outputs all dependencies whcih current rpmdb doesn't satisfy.
1629 # input can be either STDIN or parameters
1634 if [ "$#" -gt 0 ]; then
1640 DEPS=$(rpm -q --whatprovides $DEPS 2>&1 | awk '/^(error:|no package provides)/ { print }')
1643 echo "$DEPS" | awk '/^no package provides/ { print $NF }'
1645 # other deps (files)
1646 echo "$DEPS" | awk -F: '/^error:.*No such file/{o = $2; gsub("^ file ", "", o); print o}'
1649 # checks if given package/files/provides exists in rpmdb.
1650 # inout can be either stdin or parameters
1651 # returns packages wchi hare present in the rpmdb
1656 if [ "$#" -gt 0 ]; then
1662 rpm -q --whatprovides $DEPS 2>/dev/null | awk '!/no package provides/ { print }'
1665 fetch_build_requires()
1667 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1668 update_shell_title "fetch build requires"
1669 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1670 # TODO: Conflicts list doesn't check versions
1671 local CNFL=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
1672 local DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
1674 if [ -n "$CNFL" ] || [ -n "$DEPS" ]; then
1675 echo "fetch builderequires: install [$DEPS]; remove [$CNFL]"
1676 update_shell_title "poldek: install [$DEPS]; remove [$CNFL]"
1677 $SU_SUDO /usr/bin/poldek -q --update || $SU_SUDO /usr/bin/poldek -q --upa
1679 if [ -n "$CNFL" ]; then
1680 update_shell_title "uninstall conflicting packages: $CNFL"
1681 echo "Trying to uninstall conflicting packages ($CNFL):"
1682 $SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CNFL
1685 while [ "$DEPS" ]; do
1686 update_shell_title "install deps: $DEPS"
1687 echo "Trying to install dependencies ($DEPS):"
1688 local log=.${SPECFILE}_poldek.log
1689 $SU_SUDO /usr/bin/poldek --caplookup -uGq $DEPS | tee $log
1690 failed=$(awk -F: '/^error:/{print $2}' $log)
1693 if [ -n "$failed" ]; then
1694 for package in $failed; do
1695 # FIXME: sanitise, deps could be not .spec files
1696 spawn_sub_builder -bb $package && ok="$ok $package"
1706 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1707 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1708 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1709 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1710 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1711 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`
1713 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`"
1715 package=`basename "$package_item"|sed -e "s/}$//g"`
1716 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1719 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1720 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1721 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
1726 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1729 if `echo $COND_TST|grep -q 'without_'`; then
1730 COND_NAME=`echo $COND_NAME|sed -e s,^.*without_,,g`
1731 if `echo $COND_TST|grep -q !`; then
1736 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1737 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1738 if [ -n "$COND_WITHOUT" ] || [ -z "$COND_WITH" ]; then
1744 elif `echo $COND_TST|grep -q 'with_'`; then
1745 COND_NAME=`echo $COND_NAME|sed -e s,^.*with_,,g`
1746 if `echo $COND_TST|grep -q !`; then
1751 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1752 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1753 if [ -n "$COND_WITH" ] || [ -z "$COND_WITHOUT" ]; then
1759 RESULT="${COND_STATE}-${COND_ARGV}"
1761 "with-wout" | "wout-with" )
1764 "wout-wout" | "with-with" )
1768 echo "Action '$RESULT' was not defined for package '$package_item'"
1774 if [ "$GO" = "yes" ]; then
1775 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1776 echo "Testing if $package has subrequirements..."
1777 run_poldek -t -i $package --dumpn=".$package-req.txt"
1778 if [ -f ".$package-req.txt" ]; then
1779 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1781 if [ "$package_name" = "$package" ]; then
1782 echo -ne "Installing BuildRequired package:\t$package_name\n"
1783 update_shell_title "Installing BuildRequired package: ${package_name}"
1784 install_required_packages $package
1786 echo -ne "Installing (sub)Required package:\t$package_name\n"
1787 update_shell_title "Installing (sub)Required package: ${package_name}"
1788 install_required_packages $package_name
1792 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1793 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1796 echo "Attempting to run spawn sub - builder..."
1797 echo -ne "Package installation failed:\t$package_name\n"
1798 run_sub_builder $package_name
1799 if [ $? -eq 0 ]; then
1800 install_required_packages $package_name
1803 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1804 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1807 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1814 rm -f ".$package-req.txt"
1816 echo "Attempting to run spawn sub - builder..."
1817 echo -ne "Package installation failed:\t$package\n"
1818 run_sub_builder $package
1819 if [ $? -eq 0 ]; then
1820 install_required_packages $package
1823 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1824 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1827 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1833 echo "Package $package is already installed. BuildRequirement satisfied."
1837 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1838 echo "Unable to install following packages and their dependencies:"
1839 for pkg in "$NOT_INSTALLED_PACKAGES"
1843 remove_build_requires
1851 TOP_DIR="`eval $RPM $RPMOPTS --eval '%{_topdir}'`"
1852 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
1854 mkdir -p $TOP_DIR/{RPMS,BUILD,SRPMS}
1856 cvs -d $CVSROOT co SOURCES/.cvsignore SPECS/{mirrors,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
1860 echo "To checkout *all* .spec files:"
1861 echo "- remove $SPEC_DIR/CVS/Entries.Static"
1862 echo "- run cvs up in $SPEC_DIR dir"
1865 echo "To commit with your developer account:"
1866 echo "- edit $SPEC_DIR/CVS/Root"
1867 echo "- edit $SOURCE_DIR/CVS/Root"
1870 get_greed_sources() {
1871 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
1872 if [ -n "BE_VERBOSE" ]; then
1873 echo "Try greed download: $1 from: $CVSROOT"
1875 cvs -d $CVSROOT get SOURCES/$1
1876 if [ $? != 0 ]; then
1877 Exit_error err_no_source_in_repo $1
1882 # remove entries from CVS/Entries
1883 cvs_entry_remove() {
1884 local cvsdir="$1"; shift
1885 if [ ! -d "$cvsdir" ]; then
1886 echo >&2 "cvs_entry_remove: $cvsdir is not a directory"
1890 for file in "$@"; do
1891 rm -f $cvsdir/CVS/Entries.new || return 1
1892 awk -ve="${file##*/}" -F/ '$2 != e {print}' $cvsdir/CVS/Entries > $cvsdir/CVS/Entries.new || return 1
1893 mv -f $cvsdir/CVS/Entries.new $cvsdir/CVS/Entries || return 1
1901 DONT_PRINT_REVISION="yes"
1905 # remove from CVS/Entries
1906 cvs_entry_remove $SPEC_DIR $SPECFILE
1907 cvs_entry_remove $SOURCE_DIR $SOURCES $PATCHES
1909 # remove spec and sources
1910 $RPMBUILD --clean --rmsource --rmspec --nodeps $SPECFILE
1913 #---------------------------------------------
1921 while [ $# -gt 0 ]; do
1924 COMMAND="update_md5"
1929 COMMAND="update_md5"
1939 DEBUG="yes"; shift ;;
1941 COMMAND="version"; shift ;;
1943 COMMAND="short-version"; shift ;;
1945 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1946 -b | -ba | --build )
1947 COMMAND="build"; shift ;;
1948 -bb | --build-binary )
1949 COMMAND="build-binary"; shift ;;
1951 COMMAND="build-build"; shift ;;
1953 COMMAND="build-install"; shift ;;
1955 COMMAND="build-list"; shift ;;
1956 -bp | --build-prep )
1957 COMMAND="build-prep"; shift ;;
1958 -bs | --build-source )
1959 COMMAND="build-source"; shift ;;
1961 COMMAND="branch"; shift; TAG="${1}"; shift;;
1963 CLEAN="--clean --rmspec --rmsource"; shift ;;
1965 CVS_FORCE="-F"; shift;;
1967 shift; CVSROOT="${1}"; shift ;;
1969 COMMAND="get"; shift ;;
1971 COMMAND="usage"; shift ;;
1973 PROTOCOL="http"; shift ;;
1975 shift; LOGFILE="${1}"; shift ;;
1977 shift; DEF_NICE_LEVEL=${1}; shift ;;
1978 -ske | --skip-existing-files)
1979 SKIP_EXISTING_FILES="yes"; shift ;;
1981 COMMAND="mr-proper"; shift ;;
1983 NOCVS="yes"; shift ;;
1984 -ncs | --no-cvs-specs )
1985 NOCVSSPEC="yes"; shift ;;
1986 -nd | --no-distfiles )
1987 NODIST="yes"; shift ;;
1988 -nm | --no-mirrors )
1989 NOMIRRORS="yes"; shift ;;
1991 NOURLS="yes"; shift ;;
1993 NOSRCS="yes"; shift ;;
1994 -ns0 | --no-source0 )
1995 NOSOURCE0="yes"; shift ;;
2005 -pm | --prefer-mirrors )
2012 shift; RPMOPTS="${RPMOPTS} ${1}"; shift ;;
2014 shift; RPMOPTS="${RPMOPTS} --define \"patch${1} : ignoring patch${1}; exit 1; \""; shift ;;
2015 --with | --without )
2016 case $GROUP_BCONDS in
2020 while ! `echo ${1}|grep -qE '(^-|spec)'`
2022 BCOND="$BCOND $COND $1"
2026 if [[ "$2" = *,* ]]; then
2027 for a in $(echo "$2" | tr , ' '); do
2028 BCOND="$BCOND $1 $a"
2031 BCOND="$BCOND $1 $2"
2037 shift; TARGET="${1}"; shift ;;
2039 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
2041 QUIET="--quiet"; shift ;;
2043 CVSDATE="${2}"; shift 2 ;;
2045 shift; CVSTAG="${1}"; shift ;;
2047 shift; CVSTAG="HEAD"; ;;
2048 -R | --fetch-build-requires)
2049 FETCH_BUILD_REQUIRES="yes"
2050 NOT_INSTALLED_PACKAGES=
2052 -RB | --remove-build-requires)
2053 REMOVE_BUILD_REQUIRES="nice"
2055 -FRB | --force-remove-build-requires)
2056 REMOVE_BUILD_REQUIRES="force"
2058 -sc | --sources-cvs)
2059 COMMAND="list-sources-cvs"
2061 -sd | --sources-distfiles)
2062 COMMAND="list-sources-distfiles"
2064 -sdp | --sources-distfiles-paths)
2065 COMMAND="list-sources-distfiles-paths"
2067 -sf | --sources-files)
2068 COMMAND="list-sources-files"
2070 -sp | --sources-paths)
2071 COMMAND="list-sources-local-paths"
2073 -su | --sources-urls)
2074 COMMAND="list-sources-urls"
2076 -Tvs | --tag-version-stable )
2081 -Ts | --tag-stable )
2086 -Tv | --tag-version )
2091 -Tp | --tag-prefix )
2103 -ir | --integer-release-only )
2104 INTEGER_RELEASE="yes"
2107 COMMAND="update_md5"
2112 -Upi | --update-poldek-indexes )
2113 UPDATE_POLDEK_INDEXES="yes"
2116 COMMAND="init_rpm_dir"
2118 --use-greed-sources )
2121 -u | --try-upgrade )
2122 TRY_UPGRADE="1"; shift ;;
2123 -un | --try-upgrade-with-float-version )
2124 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
2126 BE_VERBOSE="1"; shift ;;
2131 if echo "${MACRO}" | grep -q '\W'; then
2132 RPMOPTS="${RPMOPTS} --define \"${MACRO}\""
2136 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
2141 RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\""
2145 RPMBUILDOPTS="${RPMBUILDOPTS} --short-circuit"
2148 --show-bconds | -show-bconds | -print-bconds | --print-bconds | -display-bconds | --display-bconds )
2149 COMMAND="show_bconds"
2153 COMMAND="show_bcond_args"
2158 RPMOPTS="${RPMOPTS} --nodeps"
2161 RPMBUILDOPTS="${RPMBUILDOPTS} -debug"; shift
2164 Exit_error err_invalid_cmdline "$1"
2168 # check if specname was passed as specname:cvstag
2169 if [ "${SPECFILE##*:}" != "${SPECFILE}" ]; then
2170 CVSTAG="${SPECFILE##*:}"
2171 SPECFILE="${SPECFILE%%:*}"
2173 ASSUMED_NAME="$(basename ${SPECFILE%%.spec})"
2178 if [ -f CVS/Entries ] && [ -z "$CVSTAG" ]; then
2179 CVSTAG=$(awk -vSPECFILE="${SPECFILE%.spec}.spec" -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' CVS/Entries)
2180 if [ "$CVSTAG" ]; then
2181 echo >&2 "builder: Stick tag $CVSTAG active. Use -r TAGNAME to override."
2183 elif [ "$CVSTAG" = "HEAD" ]; then
2184 # assume -r HEAD is same as -A
2188 if [ -n "$DEBUG" ]; then
2193 if [ -n "$TARGET" ]; then
2196 TARGET_SWITCH="--target $TARGET" ;;
2198 TARGET_SWITCH="--target=$TARGET" ;;
2202 if [ "$SCHEDTOOL" != "no" ]; then
2203 NICE_COMMAND="$SCHEDTOOL"
2205 NICE_COMMAND="nice -n ${DEF_NICE_LEVEL}"
2208 update_shell_title "$COMMAND"
2212 if [ -n "$SPECFILE" ]; then
2213 get_spec > /dev/null
2221 if [ -n "$SPECFILE" ]; then
2222 get_spec > /dev/null
2228 "build" | "build-binary" | "build-source" | "build-prep" | "build-build" | "build-install" | "build-list")
2230 if [ -n "$SPECFILE" ]; then
2236 if [ "$COMMAND" != "build-source" ]; then
2239 fetch_build_requires
2240 if [ "$INTEGER_RELEASE" = "yes" ]; then
2241 echo "Checking release $PACKAGE_RELEASE..."
2242 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
2243 Exit_error err_fract_rel "$PACKAGE_RELEASE"
2247 # ./builder -bs test.spec -r AC-branch -Tp auto-ac- -tt
2248 if [ -n "$TEST_TAG" ]; then
2249 # - do not allow utf8 encoded specs on AC-branch
2250 if [ "$CVSTAG" = "AC-branch-disabled" ]; then
2252 t=$(grep '^Summary(.*\.UTF-8):' $SPECFILE)
2254 Exit_error err_acl_deny "UTF-8 .specs not allowed on $CVSTAG"
2258 local TAGVER=`make_tagver`
2259 echo "Searching for tag $TAGVER..."
2260 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
2261 if [ -n "$TAGREL" ]; then
2262 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
2265 # - do not allow to build from HEAD when XX-branch exists
2266 TREE_PREFIX=$(echo "$TAG_PREFIX" | sed -e 's#^auto-\([a-zA-Z]\+\)-.*#\1#g')
2267 if [ "$TREE_PREFIX" != "$TAG_PREFIX" ]; then
2268 TAG_BRANCH="${TREE_PREFIX}-branch"
2269 TAG_STATUS=$(cvs status -v $SPECFILE | grep -Ei "${TAG_BRANCH}.+(branch: [0-9.]+)")
2270 if [ -n "$TAG_STATUS" -a "$CVSTAG" = "HEAD" ]; then
2271 Exit_error err_branch_exists "$TAG_STATUS"
2277 if [ -n "$NOSOURCE0" ] ; then
2278 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2280 get_files $SOURCES $PATCHES
2283 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
2284 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
2286 remove_build_requires
2288 Exit_error err_no_spec_in_cmdl
2293 if [ -n "$SPECFILE" ]; then
2296 # don't fetch sources from remote locations
2298 for file in $SOURCES; do
2299 [ -n "`src_md5 $file`" ] && continue
2300 new_SOURCES="$new_SOURCES $file"
2302 SOURCES="$new_SOURCES"
2303 get_files $SOURCES $PATCHES
2305 branch_files $TAG $SOURCES $PATCHES $ICONS
2307 Exit_error err_no_spec_in_cmdl
2312 if [ -n "$SPECFILE" ]; then
2316 if [ -n "$NOSOURCE0" ] ; then
2317 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2319 get_files $SOURCES $PATCHES
2322 Exit_error err_no_spec_in_cmdl
2327 if [ -n "$SPECFILE" ]; then
2331 if [ -n "$NOSOURCE0" ] ; then
2332 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2336 Exit_error err_no_spec_in_cmdl
2343 if [ -n "$SPECFILE" ]; then
2347 # don't fetch sources from remote locations
2349 for file in $SOURCES; do
2350 [ -n "`src_md5 $file`" ] && continue
2351 new_SOURCES="$new_SOURCES $file"
2353 SOURCES="$new_SOURCES"
2354 get_files $SOURCES $PATCHES
2356 tag_files $SOURCES $PATCHES $ICONS
2358 Exit_error err_no_spec_in_cmdl
2364 "list-sources-files" )
2367 DONT_PRINT_REVISION="yes"
2370 for SAP in $SOURCES $PATCHES; do
2371 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
2374 "list-sources-urls" )
2377 DONT_PRINT_REVISION="yes"
2380 SAPS="$SOURCES $PATCHES"
2381 for SAP in $SAPS ; do
2385 "list-sources-local-paths" )
2388 DONT_PRINT_REVISION="yes"
2391 for SAP in $SOURCES $PATCHES; do
2392 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
2395 "list-sources-distfiles-paths" )
2398 DONT_PRINT_REVISION="yes"
2401 for SAP in $SOURCES $PATCHES; do
2402 if [ -n "$(src_md5 "$SAP")" ]; then
2403 distfiles_path "$SAP"
2407 "list-sources-distfiles" )
2410 DONT_PRINT_REVISION="yes"
2413 for SAP in $SOURCES $PATCHES; do
2414 if [ -n "$(src_md5 "$SAP")" ]; then
2415 distfiles_url "$SAP"
2419 "list-sources-cvs" )
2422 DONT_PRINT_REVISION="yes"
2425 for SAP in $SOURCES $PATCHES; do
2426 if [ -z "$(src_md5 "$SAP")" ]; then
2427 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
2441 echo "$VERSIONSTRING"
2444 if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
2445 rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES"
2449 # vi:syntax=sh:ts=4:sw=4:noet