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 # we have empty SourceX-md5, but it is still possible
744 # that we have NoSourceX-md5 AND NoSource: X
745 nosource_md5=`grep -i "#[ ]*NoSource$no-md5[ ]*:" $SPECFILE | sed -e 's/.*://'`
746 if [ -n "$nosource_md5" -a -n "`grep -i "^NoSource:[ ]*$no$" $SPECFILE`" ] ; then
754 echo "by-md5/$(src_md5 "$1" | sed -e 's|^\(.\)\(.\)|\1/\2/&|')/$(basename "$1")"
759 echo "$PROTOCOL$DISTFILES_SERVER/distfiles/$(distfiles_path "$1")"
762 distfiles_attic_url ()
764 echo "$PROTOCOL$ATTICDISTFILES_SERVER/distfiles/Attic/$(distfiles_path "$1")"
771 [ "$md5" = "$(md5sum $(nourl "$1") 2> /dev/null | sed -e 's/ .*//')" ]
776 size="$(find $(nourl "$1") -printf "%s" 2>/dev/null)"
777 [ -n "$size" -a "$size" -gt 0 ]
782 if [ "$CVSIGNORE_DF" != "yes" ]; then
785 cvsignore=${SOURCE_DIR}/.cvsignore
786 if ! grep -q "^$1\$" $cvsignore 2> /dev/null; then
787 echo "$1" >> $cvsignore
793 update_shell_title "cvsup"
795 if [ -n "$CVSROOT" ]; then
796 OPTIONS="-d $CVSROOT $OPTIONS"
799 if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
800 OPTIONS="$OPTIONS -A"
802 if [ -n "$CVSDATE" ]; then
803 OPTIONS="$OPTIONS -D $CVSDATE"
805 if [ -n "$CVSTAG" ]; then
806 OPTIONS="$OPTIONS -r $CVSTAG"
811 local retries_counter=0
813 update_shell_title "cvsup: $*"
815 update_shell_title "cvsup: $# files"
817 while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
818 retries_counter=$(( $retries_counter + 1 ))
819 output=$(LC_ALL=C cvs $OPTIONS "$@" 2>&1)
821 [ -n "$output" ] && echo "$output"
822 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
823 echo "Trying again [$*]... ($retries_counter)"
824 update_shell_title "cvsup: retry #$retries_counter"
831 update_shell_title "cvsup: done!"
835 # returns true if "$1" is ftp, http or https protocol url
839 ftp://*|http://*|https://*)
848 if [ $# -eq 0 ]; then
852 update_shell_title "update md5"
853 if [ -n "$DEBUG" ]; then
860 # pass 1: check files to be fetched
864 local fp=$(nourl "$i")
865 local srcno=$(src_no "$i")
866 if [ -n "$ADD5" ]; then
867 [ "$fp" = "$i" ] && continue # FIXME what is this check doing?
868 grep -qiE '^#[ ]*Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE && continue
870 grep -qiE '^#[ ]*Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE || continue
872 if [ ! -f "$fp" ] || [ $ALWAYS_CVSUP = "yes" ]; then
873 need_files="$need_files $i"
877 # pass 1a: get needed files
878 if [ "$need_files" ]; then
879 get_files $need_files
882 # pass 2: proceed with md5 adding or updating
884 local fp=$(nourl "$i")
885 local srcno=$(src_no "$i")
886 local md5=$(grep -iE '^#[ ]*(No)?Source'$srcno'-md5[ ]*:' $SPEC_DIR/$SPECFILE )
887 if [ -n "$ADD5" ] && is_url $i || [ -n "$md5" ]; then
888 local tag="Source$srcno-md5"
889 if [[ "$md5" == *NoSource* ]]; then
890 tag="NoSource$srcno-md5"
892 md5=$(md5sum "$fp" | cut -f1 -d' ')
893 echo "Updating $tag ($md5: $fp)."
895 print unless /^\s*#\s*(No)?Source'$srcno'-md5\s*:/i;
896 print "# '$tag':\t'$md5'\n" if /^Source'$srcno'\s*:\s+/;
905 update_shell_title "check md5"
908 if good_md5 "$i" && good_size "$i"; then
912 echo "MD5 sum mismatch or 0 size. Use -U to refetch sources,"
913 echo "or -5 to update md5 sums, if you're sure files are correct."
914 Exit_error err_no_source_in_repo $i
920 update_shell_title "get_files"
922 if [ -n "$DEBUG" ]; then
927 if [ $# -gt 0 ]; then
930 if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
931 echo "Warning: No CVS access defined for SOURCES"
936 local get_files_cvs=""
940 SHELL_TITLE_PREFIX="get_files[$nc/$#]"
941 update_shell_title "$i"
942 local fp=`nourl "$i"`
943 if [ "$SKIP_EXISTING_FILES" = "yes" ] && [ -f "$fp" ]; then
948 local srcmd5=$(src_md5 "$i")
950 # we know if source/patch is present in cvs/distfiles
951 # - has md5 (in distfiles)
954 # CHECK: local file didn't exist or always cvs up (first) requested.
955 if [ ! -f "$fp" ] || [ $ALWAYS_CVSUP = "yes" ]; then
956 if echo $i | grep -vE '(http|ftp|https|cvs|svn)://' | grep -qE '\.(gz|bz2)$']; then
957 echo "Warning: no URL given for $i"
960 if [ -z "$NODIST" ] && [ -n "$srcmd5" ]; then
961 if good_md5 "$i" && good_size "$i"; then
962 echo "$fp having proper md5sum already exists"
967 # optionally prefer mirror over distfiles if there's mirror
968 # TODO: build url list and then try each url from the list
969 if [ -n "$PREFMIRRORS" ] && [ -z "$NOMIRRORS" ] && im=$(find_mirror "$i") && [ "$im" != "$i" ]; then
972 url=$(distfiles_url "$i")
975 url_attic=$(distfiles_attic_url "$i")
977 # is $url local file?
978 if [[ "$url" = [./]* ]]; then
979 update_shell_title "${GETLOCAL%% *}: $url"
980 ${GETLOCAL} $url $target
982 if [ -z "$NOMIRRORS" ]; then
983 url=$(find_mirror "$url")
987 # make shorter message for distfiles urls
988 if [[ "$uri" = ${PROTOCOL}${DISTFILES_SERVER}* ]] || [[ "$uri" = ${PROTOCOL}${ATTICDISTFILES_SERVER}* ]]; then
989 uri=${uri#${PROTOCOL}${DISTFILES_SERVER}/distfiles/by-md5/?/?/*/}
990 uri=${uri#${PROTOCOL}${ATTICDISTFILES_SERVER}/distfiles/by-md5/?/?/*/}
993 update_shell_title "${GETURI%% *}: $uri"
994 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
995 if [ "`echo $url | grep -E 'ftp://'`" ]; then
996 update_shell_title "${GETURI2%% *}: $url"
997 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
1002 if [ ! -s "$target" ]; then
1004 if [ `echo $url_attic | grep -E '^(\.|/)'` ]; then
1005 update_shell_title "${GETLOCAL%% *}: $url_attic"
1006 ${GETLOCAL} $url_attic $target
1008 if [ -z "$NOMIRRORS" ]; then
1009 url_attic="`find_mirror "$url_attic"`"
1011 update_shell_title "${GETURI%% *}: $url_attic"
1012 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
1013 if [ "`echo $url_attic | grep -E 'ftp://'`" ]; then
1014 update_shell_title "${GETURI2%% *}: $url_attic"
1015 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
1020 if [ -s "$target" ]; then
1021 cvsignore_df $target
1026 elif [ "$NOCVS" != "yes" -a -z "$srcmd5" ]; then
1027 if [ $# -gt 1 ]; then
1028 get_files_cvs="$get_files_cvs $fp"
1029 update_shell_title "$fp (will cvs up later)"
1036 if [ -z "$NOURLS" ] && [ ! -f "$fp" -o -n "$UPDATE" ] && [ "`echo $i | grep -E 'ftp://|http://|https://'`" ]; then
1037 if [ -z "$NOMIRRORS" ]; then
1038 im="`find_mirror "$i"`"
1042 update_shell_title "${GETURI%% *}: $im"
1043 ${GETURI} "$im" || \
1044 if [ "`echo $im | grep -E 'ftp://'`" ]; then
1045 update_shell_title "${GETURI2%% *}: $im"
1050 if [ "$cvsup" = 1 ]; then
1056 # the md5 check must be moved elsewhere as if we've called from update_md5 the md5 is wrong.
1057 if [ ! -f "$fp" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
1058 if [ -n "GREEDSRC" ]; then
1059 get_greed_sources $i
1061 Exit_error err_no_source_in_repo $i
1065 # we check md5 here just only to refetch immediately
1066 if good_md5 "$i" && good_size "$i"; then
1068 elif [ "$FROM_DISTFILES" = 1 ]; then
1069 # wrong md5 from distfiles: remove the file and try again
1071 echo "MD5 sum mismatch. Trying full fetch."
1074 update_shell_title "${GETURI%% *}: $url"
1075 ${GETURI} ${OUTFILEOPT} "$target" "$url" || \
1076 if [ "`echo $url | grep -E 'ftp://'`" ]; then
1077 update_shell_title "${GETURI2%% *}: $url"
1078 ${GETURI2} ${OUTFILEOPT} "$target" "$url"
1080 if [ ! -s "$target" ]; then
1082 update_shell_title "${GETURI%% *}: $url_attic"
1083 ${GETURI} ${OUTFILEOPT} "$target" "$url_attic" || \
1084 if [ "`echo $url_attic | grep -E 'ftp://'`" ]; then
1085 update_shell_title "${GETURI2%% *}: $url_attic"
1086 ${GETURI2} ${OUTFILEOPT} "$target" "$url_attic"
1089 test -s "$target" || rm -f "$target"
1092 SHELL_TITLE_PREFIX=""
1094 if [ "$get_files_cvs" ]; then
1095 cvsup $get_files_cvs
1098 if [ "$CHMOD" = "yes" ]; then
1099 CHMOD_FILES="`nourl "$@"`"
1100 if [ -n "$CHMOD_FILES" ]; then
1101 chmod $CHMOD_MODE $CHMOD_FILES
1108 if [ -n "$DEBUG" ]; then
1113 # Check whether first character of PACKAGE_NAME is legal for tag name
1114 if [ -z "${PACKAGE_NAME##[_0-9]*}" -a -z "$TAG_PREFIX" ]; then
1118 # NOTE: CVS tags may must not contain the characters `$,.:;@'
1119 TAGVER=$(echo $TAG_PREFIX$PACKAGE_NAME-$PACKAGE_VERSION-$PACKAGE_RELEASE | tr '[.@]' '[_#]')
1121 # Remove #kernel.version_release from TAGVER because tagging sources
1122 # could occur with different kernel-headers than kernel-headers used at build time.
1123 # besides, %{_kernel_ver_str} is not expanded.
1125 # TAGVER=auto-ac-madwifi-ng-0-0_20070225_1#%{_kernel_ver_str}
1126 # TAGVER=auto-ac-madwifi-ng-0-0_20070225_1
1136 if [ -n "$DEBUG" ]; then
1141 echo "Version: $PACKAGE_VERSION"
1142 echo "Release: $PACKAGE_RELEASE"
1145 if [ "$TAG_VERSION" = "yes" ]; then
1146 TAGVER=`make_tagver`
1147 echo "CVS tag: $TAGVER"
1149 if [ -n "$TAG" ]; then
1150 echo "CVS tag: $TAG"
1153 local OPTIONS="tag $CVS_FORCE"
1154 if [ -n "$CVSROOT" ]; then
1155 OPTIONS="-d $CVSROOT $OPTIONS"
1160 for i in $TAG_FILES; do
1161 # don't tag files stored on distfiles
1162 [ -n "`src_md5 $i`" ] && continue
1163 local fp=`nourl "$i"`
1164 if [ -f "$fp" ]; then
1165 tag_files="$tag_files $fp"
1166 elif [ -n "GREEDSRC" ]; then
1167 get_greed_sources $i
1169 Exit_error err_no_source_in_repo $i
1173 if [ "$tag_files" ]; then
1174 if [ "$TAG_VERSION" = "yes" ]; then
1175 update_shell_title "tag sources: $TAGVER"
1176 printf "Tagging %d files\n" $(echo $tag_files | wc -w)
1177 cvs $OPTIONS $TAGVER $tag_files || exit
1179 if [ -n "$TAG" ]; then
1180 update_shell_title "tag sources: $TAG"
1182 while [ "$tag_files" ]; do
1183 local chunk=$(echo $tag_files | tr ' ' '\n' | head -n 100)
1184 printf "Tagging %d files\n" $(echo $chunk | wc -w)
1185 cvs $OPTIONS $TAG $chunk || exit
1186 tag_files=$(echo $tag_files | tr ' ' '\n' | tail +101)
1192 if [ "$TAG_VERSION" = "yes" ]; then
1193 update_shell_title "tag spec: $TAGVER"
1194 cvs $OPTIONS $TAGVER $SPECFILE || exit
1196 if [ -n "$TAG" ]; then
1197 update_shell_title "tag spec: $TAG"
1198 cvs $OPTIONS $TAG $SPECFILE || exit
1205 echo "CVS branch tag: $TAG"
1210 if [ -n "$DEBUG" ]; then
1215 local OPTIONS="tag $CVS_FORCE -b"
1216 if [ -n "$CVSROOT" ]; then
1217 OPTIONS="-d $CVSROOT $OPTIONS"
1221 for i in $TAG_FILES; do
1222 local fp=`nourl "$i"`
1223 if [ -f "$fp" ]; then
1224 tag_files="$tag_files $fp"
1225 elif [ -n "GREEDSRC" ]; then
1226 get_greed_sources $i
1228 Exit_error err_no_source_in_repo $i
1231 if [ "$tag_files" ]; then
1232 cvs $OPTIONS $TAG $tag_files || exit
1236 cvs $OPTIONS $TAG $SPECFILE || exit
1240 # this function should exit early if package can't be built for this arch
1241 # this avoids unneccessary BR filling.
1244 out=$(minirpm --short-circuit -bp --define "'prep exit 0'" --nodeps $SPECFILE 2>&1)
1246 if [ $ret -ne 0 ]; then
1255 update_shell_title "build_package"
1256 if [ -n "$DEBUG" ]; then
1263 if [ -n "$TRY_UPGRADE" ]; then
1264 update_shell_title "build_package: try_upgrade"
1265 if [ -n "$FLOAT_VERSION" ]; then
1266 TNOTIFY=`./pldnotify.awk $SPECFILE -n` || exit 1
1268 TNOTIFY=`./pldnotify.awk $SPECFILE` || exit 1
1271 TNEWVER=`echo $TNOTIFY | awk '{ match($4,/\[NEW\]/); print $5 }'`
1273 if [ -n "$TNEWVER" ]; then
1274 TOLDVER=`echo $TNOTIFY | awk '{ print $3; }'`
1275 echo "New version found, updating spec file to version " $TNEWVER
1276 if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
1277 cp -f $SPECFILE $SPECFILE.bak
1280 eval "perl -pi -e 's/Version:\t"$TOLDVER"/Version:\t"$TNEWVER"/gs' $SPECFILE"
1281 eval "perl -pi -e 's/Release:\t[1-9]{0,4}/Release:\t0.1/' $SPECFILE"
1283 NODIST="yes" get_files $SOURCES $PATCHES
1286 unset TOLDVER TNEWVER TNOTIFY
1293 BUILD_SWITCH="-ba" ;;
1295 BUILD_SWITCH="-bb" ;;
1297 BUILD_SWITCH="-bs --nodeps" ;;
1299 BUILD_SWITCH="-bp --nodeps" ;;
1301 BUILD_SWITCH="-bc" ;;
1303 BUILD_SWITCH="-bi" ;;
1305 BUILD_SWITCH="-bl" ;;
1309 update_shell_title "build_package: $COMMAND"
1310 if [ -n "$LOGFILE" ]; then
1311 LOG=`eval echo $LOGFILE`
1312 if [ -d "$LOG" ]; then
1313 echo "Log file $LOG is a directory."
1314 echo "Parse error in the spec?"
1315 Exit_error err_build_fail
1317 if [ -n "$LASTLOG_FILE" ]; then
1318 echo "LASTLOG=$LOG" > $LASTLOG_FILE
1320 RES_FILE=~/tmp/$RPMBUILD-exit-status.$RANDOM
1321 (time eval ${NICE_COMMAND} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
1322 RETVAL=`cat $RES_FILE`
1324 if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
1325 if [ "$RETVAL" -eq "0" ]; then
1332 eval ${NICE_COMMAND} $RPMBUILD $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND $TARGET_SWITCH $SPECFILE
1335 if [ "$RETVAL" -ne "0" ]; then
1336 if [ -n "$TRY_UPGRADE" ]; then
1337 echo "\n!!! Package with new version cannot be built automagically\n"
1338 if [ "$REVERT_BROKEN_UPGRADE" = "yes" ]; then
1339 mv -f $SPECFILE.bak $SPECFILE
1342 Exit_error err_build_fail
1349 echo "$@" | sed 's#\<\(ftp\|http\|https\|cvs\|svn\)://[^ ]*/##g'
1352 install_required_packages()
1359 # taken from find-spec-bcond, but with just getting the list
1361 # quick revert hint: '$RPMBUILD --bcond $SPEC'
1363 /^%changelog/ { exit }
1364 /_with(out)?_[_a-zA-Z0-9]+/{
1365 match($0, /_with(out)?_[_a-zA-Z0-9]+/);
1366 print substr($0, RSTART, RLENGTH);
1369 match($0, /bcond_with(out)?[ \t]+[_a-zA-Z0-9]+/);
1370 bcond = substr($0, RSTART +5 , RLENGTH -5);
1371 gsub(/[ \t]+/,"_",bcond);
1373 }' $SPEC | LC_ALL=C sort -u
1377 # expand bconds from ~/.bcondrc
1378 # The file structure is like gentoo's package.use:
1381 # samba -mysql -pgsql
1382 # w32codec-installer license_agreement
1385 if ([ -f $HOME/.bcondrc ] || ([ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ])); then
1391 SN=${SPECFILE%%\.spec}
1393 local bcondrc=$HOME/.bcondrc
1394 [ -n $HOME_ETC ] && [ -f $HOME_ETC/.bcondrc ] && bcondrc=$HOME_ETC/.bcondrc
1396 local bcond_avail=$(find_spec_bcond $SPECFILE)
1398 while read pkg flags; do
1400 [[ "$pkg" == \#* ]] && continue
1402 # any package or current package?
1403 if [ "$pkg" = "*" ] || [ "$pkg" = "$PACKAGE_NAME" ] || [ "$pkg" = "$SN" ]; then
1404 for flag in $flags; do
1405 local opt=${flag#[+-]}
1407 # use only flags which are in this package.
1408 if [[ $bcond_avail = *${opt}* ]]; then
1409 if [[ $flag = -* ]]; then
1410 if [[ $BCOND != *--with?${opt}* ]]; then
1411 BCOND="$BCOND --without $opt"
1414 if [[ $BCOND != *--without?${opt}* ]]; then
1415 BCOND="$BCOND --with $opt"
1422 update_shell_title "parse ~/.bcondrc: DONE!"
1427 update_shell_title "set bcond values"
1429 AVAIL_BCONDS_WITHOUT=""
1430 AVAIL_BCONDS_WITH=""
1431 if `grep -q ^%bcond ${SPECFILE}`; then
1433 elif `egrep -q ^#\ *_with ${SPECFILE}`; then
1439 local bcond_avail=$(find_spec_bcond $SPECFILE)
1440 process_bcondrc "$SPECFILE"
1442 update_shell_title "parse bconds"
1443 case "${BCOND_VERSION}" in
1448 echo "Warning: This spec has old style bconds. Fix it || die."
1449 for opt in `echo "$bcond_avail" | grep ^_without_`
1451 AVAIL_BCOND_WITHOUT=${opt#_without_}
1452 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1453 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1455 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1459 for opt in `echo "$bcond_avail" | grep ^_with_`
1461 AVAIL_BCOND_WITH=${opt#_with_}
1462 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1463 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1465 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1470 local cond_type="" # with || without
1471 for opt in $bcond_avail; do
1480 AVAIL_BCOND_WITHOUT=${opt#_without_}
1481 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1482 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1484 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1488 AVAIL_BCOND_WITH=${opt#_with_}
1489 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1490 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1492 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1496 case "$cond_type" in
1499 AVAIL_BCOND_WITH="$opt"
1500 if [[ "$BCOND" = *--with?${AVAIL_BCOND_WITH}* ]]; then
1501 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH <$AVAIL_BCOND_WITH>"
1503 AVAIL_BCONDS_WITH="$AVAIL_BCONDS_WITH $AVAIL_BCOND_WITH"
1508 AVAIL_BCOND_WITHOUT="$opt"
1509 if [[ "$BCOND" = *--without?${AVAIL_BCOND_WITHOUT}* ]]; then
1510 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT <$AVAIL_BCOND_WITHOUT>"
1512 AVAIL_BCONDS_WITHOUT="$AVAIL_BCONDS_WITHOUT $AVAIL_BCOND_WITHOUT"
1526 update_shell_title "run_sub_builder $package_name"
1528 # No i tutaj bym chcia³ zrobiæ sztuczn± inteligencjê, która spróbuje tego
1529 # pakieta zbudowaæ. Aktualnie niewiele dziala, bo generalnie nie widze do
1530 # konca algorytmu... Ale damy rade. :) Na razie po prostu sie wyjebie tak samo
1531 # jakby nie bylo tego kawalka kodu.
1533 # Update: Poprawi³em parê rzeczy i zaczê³o generowaæ pakiety spoza zadanej listy.
1534 # Jednym s³owem budowanie niespoldkowanych zale¿no¶ci dzia³a w paru przypadkach.
1541 # Istnieje taki spec? ${package}.spec
1542 if [ -f "${SPEC_DIR}/${package}.spec" ]; then
1543 parent_spec_name=${package}.spec
1544 elif [ -f "${SPEC_DIR}/`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec" ]; then
1545 parent_spec_name="`echo ${package_name} | sed -e s,-devel.*,,g -e s,-static,,g`.spec"
1547 for provides_line in `grep ^Provides:.*$package ${SPEC_DIR} -R`
1553 if [ "${parent_spec_name}" != "" ]; then
1554 spawn_sub_builder $parent_spec_name
1556 NOT_INSTALLED_PACKAGES="$NOT_INSTALLED_PACKAGES $package_name"
1562 update_shell_title "spawn_sub_builder $package_name"
1565 if [ "${FETCH_BUILD_REQUIRES}" == "yes" ]; then
1566 sub_builder_opts="${sub_builder_opts} -R"
1568 if [ "${REMOVE_BUILD_REQUIRES}" == "nice" ]; then
1569 sub_builder_opts="${sub_builder_opts} -RB"
1570 elif [ "${REMOVE_BUILD_REQUIRES}" == "force" ]; then
1571 sub_builder_opts="${sub_builder_opts} -FRB"
1573 if [ "${UPDATE_POLDEK_INDEXES}" == "yes" ]; then
1574 sub_builder_opts="${sub_builder_opts} -Upi"
1578 ./builder ${sub_builder_opts} "$@"
1581 remove_build_requires()
1583 if [ "$INSTALLED_PACKAGES" != "" ]; then
1584 case "$REMOVE_BUILD_REQUIRES" in
1586 run_poldek --noask -ve $INSTALLED_PACKAGES
1589 run_poldek --ask -ve $INSTALLED_PACKAGES
1592 echo You may want to manually remove following BuildRequires fetched:
1593 echo $INSTALLED_PACKAGES
1594 echo Try poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`
1602 if [ "$AVAIL_BCONDS_WITH" != "" ] || [ "$AVAIL_BCONDS_WITHOUT" != "" ]; then
1603 if [ "$BCOND" != "" ]; then
1604 echo -ne "\nBuilding $SPECFILE with the following conditional flags:\n"
1607 echo -ne "\nNo conditional flags passed"
1609 echo -ne "\n\nfrom available:\n"
1610 echo -ne "--with :\t$AVAIL_BCONDS_WITH\n--without:\t$AVAIL_BCONDS_WITHOUT\n\n"
1616 if [ "$NOCVSSPEC" != "yes" ]; then
1617 echo -ne "Available branches: "
1618 cvs status -v "${SPECFILE}" | awk '!/Sticky Tag:/ && /\(branch:/ { print $1 } ' | xargs
1622 # checks a given list of packages/files/provides agains current rpmdb.
1623 # outputs all dependencies whcih current rpmdb doesn't satisfy.
1624 # input can be either STDIN or parameters
1629 if [ "$#" -gt 0 ]; then
1635 DEPS=$(rpm -q --whatprovides $DEPS 2>&1 | awk '/^(error:|no package provides)/ { print }')
1638 echo "$DEPS" | awk '/^no package provides/ { print $NF }'
1640 # other deps (files)
1641 echo "$DEPS" | awk -F: '/^error:.*No such file/{o = $2; gsub("^ file ", "", o); print o}'
1644 # checks if given package/files/provides exists in rpmdb.
1645 # inout can be either stdin or parameters
1646 # returns packages wchi hare present in the rpmdb
1651 if [ "$#" -gt 0 ]; then
1657 rpm -q --whatprovides $DEPS 2>/dev/null | awk '!/no package provides/ { print }'
1660 fetch_build_requires()
1662 if [ "${FETCH_BUILD_REQUIRES}" = "yes" ]; then
1663 update_shell_title "fetch build requires"
1664 if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ]; then
1665 # TODO: Conflicts list doesn't check versions
1666 local CNFL=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs)
1667 local DEPS=$(rpm-getdeps $BCOND $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs)
1669 if [ -n "$CNFL" ] || [ -n "$DEPS" ]; then
1670 echo "fetch builderequires: install [$DEPS]; remove [$CNFL]"
1671 update_shell_title "poldek: install [$DEPS]; remove [$CNFL]"
1672 $SU_SUDO /usr/bin/poldek -q --update || $SU_SUDO /usr/bin/poldek -q --upa
1674 if [ -n "$CNFL" ]; then
1675 update_shell_title "uninstall conflicting packages: $CNFL"
1676 echo "Trying to uninstall conflicting packages ($CNFL):"
1677 $SU_SUDO /usr/bin/poldek --noask --nofollow -ev $CNFL
1680 while [ "$DEPS" ]; do
1681 update_shell_title "install deps: $DEPS"
1682 echo "Trying to install dependencies ($DEPS):"
1683 local log=.${SPECFILE}_poldek.log
1684 $SU_SUDO /usr/bin/poldek --caplookup -uGq $DEPS | tee $log
1685 failed=$(awk -F: '/^error:/{print $2}' $log)
1688 if [ -n "$failed" ]; then
1689 for package in $failed; do
1690 # FIXME: sanitise, deps could be not .spec files
1691 spawn_sub_builder -bb $package && ok="$ok $package"
1701 echo -ne "\nAll packages installed by fetch_build_requires() are written to:\n"
1702 echo -ne "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES\n"
1703 echo -ne "\nIf anything fails, you may get rid of them by executing:\n"
1704 echo "poldek -e \`cat `pwd`/.${SPECFILE}_INSTALLED_PACKAGES\`\n\n"
1705 echo > `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1706 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`
1708 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`"
1710 package=`basename "$package_item"|sed -e "s/}$//g"`
1711 COND_ARCH_TST="`cat $SPECFILE|grep -B1 BuildRequires|grep -B1 $package|grep ifarch|sed -e "s/^.*ifarch//g"`"
1714 COND_TST=`cat $SPECFILE|grep BuildRequires|grep "$package"`
1715 if `echo $COND_TST|grep -q '^BuildRequires:'`; then
1716 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
1721 COND_NAME=`echo $COND_TST|sed -e s,:BuildRequires:.*$,,g`
1724 if `echo $COND_TST|grep -q 'without_'`; then
1725 COND_NAME=`echo $COND_NAME|sed -e s,^.*without_,,g`
1726 if `echo $COND_TST|grep -q !`; then
1731 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1732 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1733 if [ -n "$COND_WITHOUT" ] || [ -z "$COND_WITH" ]; then
1739 elif `echo $COND_TST|grep -q 'with_'`; then
1740 COND_NAME=`echo $COND_NAME|sed -e s,^.*with_,,g`
1741 if `echo $COND_TST|grep -q !`; then
1746 COND_WITH=`echo $AVAIL_BCONDS_WITH|grep "<$COND_NAME>"`
1747 COND_WITHOUT=`echo $AVAIL_BCONDS_WITHOUT|grep "<$COND_NAME>"`
1748 if [ -n "$COND_WITH" ] || [ -z "$COND_WITHOUT" ]; then
1754 RESULT="${COND_STATE}-${COND_ARGV}"
1756 "with-wout" | "wout-with" )
1759 "wout-wout" | "with-with" )
1763 echo "Action '$RESULT' was not defined for package '$package_item'"
1769 if [ "$GO" = "yes" ]; then
1770 if [ "`rpm -q $package|sed -e "s/$package.*/$package/g"`" != "$package" ]; then
1771 echo "Testing if $package has subrequirements..."
1772 run_poldek -t -i $package --dumpn=".$package-req.txt"
1773 if [ -f ".$package-req.txt" ]; then
1774 for package_name in `cat ".$package-req.txt"|grep -v ^#`
1776 if [ "$package_name" = "$package" ]; then
1777 echo -ne "Installing BuildRequired package:\t$package_name\n"
1778 update_shell_title "Installing BuildRequired package: ${package_name}"
1779 install_required_packages $package
1781 echo -ne "Installing (sub)Required package:\t$package_name\n"
1782 update_shell_title "Installing (sub)Required package: ${package_name}"
1783 install_required_packages $package_name
1787 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1788 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1791 echo "Attempting to run spawn sub - builder..."
1792 echo -ne "Package installation failed:\t$package_name\n"
1793 run_sub_builder $package_name
1794 if [ $? -eq 0 ]; then
1795 install_required_packages $package_name
1798 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1799 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1802 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1809 rm -f ".$package-req.txt"
1811 echo "Attempting to run spawn sub - builder..."
1812 echo -ne "Package installation failed:\t$package\n"
1813 run_sub_builder $package
1814 if [ $? -eq 0 ]; then
1815 install_required_packages $package
1818 INSTALLED_PACKAGES="$package_name $INSTALLED_PACKAGES"
1819 echo $package_name >> `pwd`/.${SPECFILE}_INSTALLED_PACKAGES
1822 NOT_INSTALLED_PACKAGES="$package_name $NOT_INSTALLED_PACKAGES"
1828 echo "Package $package is already installed. BuildRequirement satisfied."
1832 if [ "$NOT_INSTALLED_PACKAGES" != "" ]; then
1833 echo "Unable to install following packages and their dependencies:"
1834 for pkg in "$NOT_INSTALLED_PACKAGES"
1838 remove_build_requires
1846 TOP_DIR="`eval $RPM $RPMOPTS --eval '%{_topdir}'`"
1847 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
1849 mkdir -p $TOP_DIR/{RPMS,BUILD,SRPMS}
1851 cvs -d $CVSROOT co SOURCES/.cvsignore SPECS/{mirrors,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh}
1855 echo "To checkout *all* .spec files:"
1856 echo "- remove $SPEC_DIR/CVS/Entries.Static"
1857 echo "- run cvs up in $SPEC_DIR dir"
1860 echo "To commit with your developer account:"
1861 echo "- edit $SPEC_DIR/CVS/Root"
1862 echo "- edit $SOURCE_DIR/CVS/Root"
1865 get_greed_sources() {
1866 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
1867 if [ -n "BE_VERBOSE" ]; then
1868 echo "Try greed download: $1 from: $CVSROOT"
1870 cvs -d $CVSROOT get SOURCES/$1
1871 if [ $? != 0 ]; then
1872 Exit_error err_no_source_in_repo $1
1877 # remove entries from CVS/Entries
1878 cvs_entry_remove() {
1879 local cvsdir="$1"; shift
1880 if [ ! -d "$cvsdir" ]; then
1881 echo >&2 "cvs_entry_remove: $cvsdir is not a directory"
1885 for file in "$@"; do
1886 rm -f $cvsdir/CVS/Entries.new || return 1
1887 awk -ve="${file##*/}" -F/ '$2 != e {print}' $cvsdir/CVS/Entries > $cvsdir/CVS/Entries.new || return 1
1888 mv -f $cvsdir/CVS/Entries.new $cvsdir/CVS/Entries || return 1
1896 DONT_PRINT_REVISION="yes"
1900 # remove from CVS/Entries
1901 cvs_entry_remove $SPEC_DIR $SPECFILE
1902 cvs_entry_remove $SOURCE_DIR $SOURCES $PATCHES
1904 # remove spec and sources
1905 $RPMBUILD --clean --rmsource --rmspec --nodeps $SPECFILE
1908 #---------------------------------------------
1916 while [ $# -gt 0 ]; do
1919 COMMAND="update_md5"
1924 COMMAND="update_md5"
1934 DEBUG="yes"; shift ;;
1936 COMMAND="version"; shift ;;
1938 COMMAND="short-version"; shift ;;
1940 CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
1941 -b | -ba | --build )
1942 COMMAND="build"; shift ;;
1943 -bb | --build-binary )
1944 COMMAND="build-binary"; shift ;;
1946 COMMAND="build-build"; shift ;;
1948 COMMAND="build-install"; shift ;;
1950 COMMAND="build-list"; shift ;;
1951 -bp | --build-prep )
1952 COMMAND="build-prep"; shift ;;
1953 -bs | --build-source )
1954 COMMAND="build-source"; shift ;;
1956 COMMAND="branch"; shift; TAG="${1}"; shift;;
1958 CLEAN="--clean --rmspec --rmsource"; shift ;;
1960 CVS_FORCE="-F"; shift;;
1962 shift; CVSROOT="${1}"; shift ;;
1964 COMMAND="get"; shift ;;
1966 COMMAND="usage"; shift ;;
1968 PROTOCOL="http"; shift ;;
1970 shift; LOGFILE="${1}"; shift ;;
1972 shift; DEF_NICE_LEVEL=${1}; shift ;;
1973 -ske | --skip-existing-files)
1974 SKIP_EXISTING_FILES="yes"; shift ;;
1976 COMMAND="mr-proper"; shift ;;
1978 NOCVS="yes"; shift ;;
1979 -ncs | --no-cvs-specs )
1980 NOCVSSPEC="yes"; shift ;;
1981 -nd | --no-distfiles )
1982 NODIST="yes"; shift ;;
1983 -nm | --no-mirrors )
1984 NOMIRRORS="yes"; shift ;;
1986 NOURLS="yes"; shift ;;
1988 NOSRCS="yes"; shift ;;
1989 -ns0 | --no-source0 )
1990 NOSOURCE0="yes"; shift ;;
2000 -pm | --prefer-mirrors )
2007 shift; RPMOPTS="${RPMOPTS} ${1}"; shift ;;
2009 shift; RPMOPTS="${RPMOPTS} --define \"patch${1} : ignoring patch${1}; exit 1; \""; shift ;;
2010 --with | --without )
2011 case $GROUP_BCONDS in
2015 while ! `echo ${1}|grep -qE '(^-|spec)'`
2017 BCOND="$BCOND $COND $1"
2021 if [[ "$2" = *,* ]]; then
2022 for a in $(echo "$2" | tr , ' '); do
2023 BCOND="$BCOND $1 $a"
2026 BCOND="$BCOND $1 $2"
2032 shift; TARGET="${1}"; shift ;;
2034 TARGET=$(echo "${1}" | sed 's/^--target=//'); shift ;;
2036 QUIET="--quiet"; shift ;;
2038 CVSDATE="${2}"; shift 2 ;;
2040 shift; CVSTAG="${1}"; shift ;;
2042 shift; CVSTAG="HEAD"; ;;
2043 -R | --fetch-build-requires)
2044 FETCH_BUILD_REQUIRES="yes"
2045 NOT_INSTALLED_PACKAGES=
2047 -RB | --remove-build-requires)
2048 REMOVE_BUILD_REQUIRES="nice"
2050 -FRB | --force-remove-build-requires)
2051 REMOVE_BUILD_REQUIRES="force"
2053 -sc | --sources-cvs)
2054 COMMAND="list-sources-cvs"
2056 -sd | --sources-distfiles)
2057 COMMAND="list-sources-distfiles"
2059 -sdp | --sources-distfiles-paths)
2060 COMMAND="list-sources-distfiles-paths"
2062 -sf | --sources-files)
2063 COMMAND="list-sources-files"
2065 -sp | --sources-paths)
2066 COMMAND="list-sources-local-paths"
2068 -su | --sources-urls)
2069 COMMAND="list-sources-urls"
2071 -Tvs | --tag-version-stable )
2076 -Ts | --tag-stable )
2081 -Tv | --tag-version )
2086 -Tp | --tag-prefix )
2098 -ir | --integer-release-only )
2099 INTEGER_RELEASE="yes"
2102 COMMAND="update_md5"
2107 -Upi | --update-poldek-indexes )
2108 UPDATE_POLDEK_INDEXES="yes"
2111 COMMAND="init_rpm_dir"
2113 --use-greed-sources )
2116 -u | --try-upgrade )
2117 TRY_UPGRADE="1"; shift ;;
2118 -un | --try-upgrade-with-float-version )
2119 TRY_UPGRADE="1"; FLOAT_VERSION="1"; shift ;;
2121 BE_VERBOSE="1"; shift ;;
2126 if echo "${MACRO}" | grep -q '\W'; then
2127 RPMOPTS="${RPMOPTS} --define \"${MACRO}\""
2131 RPMOPTS="${RPMOPTS} --define \"${MACRO} ${VALUE}\""
2136 RPMOPTS="${RPMOPTS} --define \"alt_kernel $1\""
2140 RPMBUILDOPTS="${RPMBUILDOPTS} --short-circuit"
2143 --show-bconds | -show-bconds | -print-bconds | --print-bconds | -display-bconds | --display-bconds )
2144 COMMAND="show_bconds"
2148 COMMAND="show_bcond_args"
2153 RPMOPTS="${RPMOPTS} --nodeps"
2156 RPMBUILDOPTS="${RPMBUILDOPTS} -debug"; shift
2159 Exit_error err_invalid_cmdline "$1"
2163 # check if specname was passed as specname:cvstag
2164 if [ "${SPECFILE##*:}" != "${SPECFILE}" ]; then
2165 CVSTAG="${SPECFILE##*:}"
2166 SPECFILE="${SPECFILE%%:*}"
2168 ASSUMED_NAME="$(basename ${SPECFILE%%.spec})"
2173 if [ -f CVS/Entries ] && [ -z "$CVSTAG" ]; then
2174 CVSTAG=$(awk -vSPECFILE="${SPECFILE%.spec}.spec" -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' CVS/Entries)
2175 if [ "$CVSTAG" ]; then
2176 echo >&2 "builder: Stick tag $CVSTAG active. Use -r TAGNAME to override."
2178 elif [ "$CVSTAG" = "HEAD" ]; then
2179 # assume -r HEAD is same as -A
2183 if [ -n "$DEBUG" ]; then
2188 if [ -n "$TARGET" ]; then
2191 TARGET_SWITCH="--target $TARGET" ;;
2193 TARGET_SWITCH="--target=$TARGET" ;;
2197 if [ "$SCHEDTOOL" != "no" ]; then
2198 NICE_COMMAND="$SCHEDTOOL"
2200 NICE_COMMAND="nice -n ${DEF_NICE_LEVEL}"
2203 update_shell_title "$COMMAND"
2207 if [ -n "$SPECFILE" ]; then
2208 get_spec > /dev/null
2216 if [ -n "$SPECFILE" ]; then
2217 get_spec > /dev/null
2223 "build" | "build-binary" | "build-source" | "build-prep" | "build-build" | "build-install" | "build-list")
2225 if [ -n "$SPECFILE" ]; then
2231 if [ "$COMMAND" != "build-source" ]; then
2234 fetch_build_requires
2235 if [ "$INTEGER_RELEASE" = "yes" ]; then
2236 echo "Checking release $PACKAGE_RELEASE..."
2237 if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
2238 Exit_error err_fract_rel "$PACKAGE_RELEASE"
2242 # ./builder -bs test.spec -r AC-branch -Tp auto-ac- -tt
2243 if [ -n "$TEST_TAG" ]; then
2244 # - do not allow utf8 encoded specs on AC-branch
2245 if [ "$CVSTAG" = "AC-branch-disabled" ]; then
2247 t=$(grep '^Summary(.*\.UTF-8):' $SPECFILE)
2249 Exit_error err_acl_deny "UTF-8 .specs not allowed on $CVSTAG"
2253 local TAGVER=`make_tagver`
2254 echo "Searching for tag $TAGVER..."
2255 TAGREL=$(cvs status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
2256 if [ -n "$TAGREL" ]; then
2257 Exit_error err_tag_exists "$TAGVER" "$TAGREL"
2260 # - do not allow to build from HEAD when XX-branch exists
2261 TREE_PREFIX=$(echo "$TAG_PREFIX" | sed -e 's#^auto-\([a-zA-Z]\+\)-.*#\1#g')
2262 if [ "$TREE_PREFIX" != "$TAG_PREFIX" ]; then
2263 TAG_BRANCH="${TREE_PREFIX}-branch"
2264 TAG_STATUS=$(cvs status -v $SPECFILE | grep -Ei "${TAG_BRANCH}.+(branch: [0-9.]+)")
2265 if [ -n "$TAG_STATUS" -a "$CVSTAG" = "HEAD" ]; then
2266 Exit_error err_branch_exists "$TAG_STATUS"
2272 if [ -n "$NOSOURCE0" ] ; then
2273 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2275 get_files $SOURCES $PATCHES
2278 if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
2279 run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
2281 remove_build_requires
2283 Exit_error err_no_spec_in_cmdl
2288 if [ -n "$SPECFILE" ]; then
2291 # don't fetch sources from remote locations
2293 for file in $SOURCES; do
2294 [ -n "`src_md5 $file`" ] && continue
2295 new_SOURCES="$new_SOURCES $file"
2297 SOURCES="$new_SOURCES"
2298 get_files $SOURCES $PATCHES
2300 branch_files $TAG $SOURCES $PATCHES $ICONS
2302 Exit_error err_no_spec_in_cmdl
2307 if [ -n "$SPECFILE" ]; then
2311 if [ -n "$NOSOURCE0" ] ; then
2312 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2314 get_files $SOURCES $PATCHES
2317 Exit_error err_no_spec_in_cmdl
2322 if [ -n "$SPECFILE" ]; then
2326 if [ -n "$NOSOURCE0" ] ; then
2327 SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
2331 Exit_error err_no_spec_in_cmdl
2338 if [ -n "$SPECFILE" ]; then
2342 # don't fetch sources from remote locations
2344 for file in $SOURCES; do
2345 [ -n "`src_md5 $file`" ] && continue
2346 new_SOURCES="$new_SOURCES $file"
2348 SOURCES="$new_SOURCES"
2349 get_files $SOURCES $PATCHES
2351 tag_files $SOURCES $PATCHES $ICONS
2353 Exit_error err_no_spec_in_cmdl
2359 "list-sources-files" )
2362 DONT_PRINT_REVISION="yes"
2365 for SAP in $SOURCES $PATCHES; do
2366 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
2369 "list-sources-urls" )
2372 DONT_PRINT_REVISION="yes"
2375 SAPS="$SOURCES $PATCHES"
2376 for SAP in $SAPS ; do
2380 "list-sources-local-paths" )
2383 DONT_PRINT_REVISION="yes"
2386 for SAP in $SOURCES $PATCHES; do
2387 echo $SOURCE_DIR/$(echo $SAP | awk '{gsub(/.*\//,"") ; print }')
2390 "list-sources-distfiles-paths" )
2393 DONT_PRINT_REVISION="yes"
2396 for SAP in $SOURCES $PATCHES; do
2397 if [ -n "$(src_md5 "$SAP")" ]; then
2398 distfiles_path "$SAP"
2402 "list-sources-distfiles" )
2405 DONT_PRINT_REVISION="yes"
2408 for SAP in $SOURCES $PATCHES; do
2409 if [ -n "$(src_md5 "$SAP")" ]; then
2410 distfiles_url "$SAP"
2414 "list-sources-cvs" )
2417 DONT_PRINT_REVISION="yes"
2420 for SAP in $SOURCES $PATCHES; do
2421 if [ -z "$(src_md5 "$SAP")" ]; then
2422 echo $SAP | awk '{gsub(/.*\//,"") ; print}'
2436 echo "$VERSIONSTRING"
2439 if [ -f "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES" -a "$REMOVE_BUILD_REQUIRES" != "" ]; then
2440 rm "`pwd`/.${SPECFILE}_INSTALLED_PACKAGES"
2444 # vi:syntax=sh:ts=4:sw=4:noet