X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=builder;h=073f4125d07f14811801e2f458c1e229503ad4ef;hb=a64787663ab0b62d746362ffbe9ba01dbf3c3050;hp=f634e610db43a24a848f2983a10728aa5252b113;hpb=b72f89c54737bd975560080bdb4d1b48c404c1c2;p=packages%2Frpm-build-tools.git diff --git a/builder b/builder index f634e61..073f412 100755 --- a/builder +++ b/builder @@ -97,7 +97,7 @@ BCOND="" GROUP_BCONDS="no" # create symlinks for tools in PACKAGE_DIR, see get_spec() -SYMLINK_TOOLS="no" +SYMLINK_TOOLS="yes" PATCHES="" SOURCES="" @@ -115,12 +115,26 @@ PARALLEL_DOWNLOADS=10 WGET_RETRIES=${MAX_WGET_RETRIES:-0} +# TLD git/df config +TLD_GIT_SERVER="git://git.tld-linux.org" +TLD_GIT_PUSH="git@git.tld-linux.org" +TLD_PACKAGES_DIR="packages" +TLD_DISTFILES_SERVER="://df.tld-linux.org" +TLD_ATTICDISTFILES_SERVER="" + +# PLD git/df config +PLD_GIT_SERVER="git://git.pld-linux.org" +PLD_GIT_PUSH="git@git.pld-linux.org" +PLD_PACKAGES_DIR="packages" +PLD_DISTFILES_SERVER="://distfiles.pld-linux.org" +PLD_ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org" + CVS_FORCE="" CVSIGNORE_DF="yes" CVSTAG="" -GIT_SERVER="git://git.pld-linux.org" -GIT_PUSH="git@git.pld-linux.org" -PACKAGES_DIR="packages" +GIT_SERVER=${TLD_GIT_SERVER} +GIT_PUSH=${TLD_GIT_PUSH} +PACKAGES_DIR=${TLD_PACKAGES_DIR} HEAD_DETACHED="" DEPTH="" ALL_BRANCHES="" @@ -129,8 +143,8 @@ NEW_REPO="" RES_FILE="" -DISTFILES_SERVER="://distfiles.pld-linux.org" -ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org" +DISTFILES_SERVER=${TLD_DISTFILES_SERVER} +ATTICDISTFILES_SERVER=${TLD_ATTICDISTFILES_SERVER} DEF_NICE_LEVEL=19 SCHEDTOOL="auto" @@ -356,7 +370,8 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version] [ --date yyyy-mm-dd - build package using resources from specified date, -r , --cvstag - build package using resources from specified branch/tag, --A - build package using master branch as any sticky tags/branch/date being reset. +-A - build package using master branch as any sticky + tags/branch/date being reset. -R, --fetch-build-requires - fetch what is BuildRequired, -RB, --remove-build-requires @@ -366,24 +381,25 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version] [ - remove all you fetched with -R or --fetch-build-requires remember, this option works without confirmation, -sd, --source-distfiles - - list sources available from distfiles (intended for offline - operations; does not work when Icon field is present - but icon file is absent), + - list sources available from distfiles (intended for + offline operations; does not work when Icon field is + present but icon file is absent), -sc, --source-cvs - list sources available from PLD repo -sdp, --source-distfiles-paths - list sources available from distfiles - - paths relative to distfiles directory (intended for offline - operations; does not work when Icon field is present - but icon file is absent), + paths relative to distfiles directory (intended for + offline operations; does not work when Icon field is + present but icon file is absent), -sf, --source-files - list sources - bare filenames (intended for offline operations; does not work when Icon field is present but icon file is absent), -lsp, --source-paths - - list sources - filenames with full local paths (intended for - offline operations; does not work when Icon field is present - but icon file is absent), + - list sources - filenames with full local paths (intended + for offline operations; does not work when Icon field is + present but icon file is absent), -su, --source-urls - list urls - urls to sources and patches - intended for copying urls with spec with lots of macros in urls + intended for copying urls with spec with lots of macros + in urls -T , --tag - add git tag for files, -Tvs, --tag-version-stable @@ -404,7 +420,8 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version] [ - as above, but allow float version php-pear-Services_Digg/ --upgrade-version - upgrade to specified version in try-upgrade --U, --update - refetch sources, don't use distfiles, and update md5 comments +-U, --update - refetch sources, don't use distfiles, and update md5 + comments -Upi, --update-poldek-indexes - refresh or make poldek package index files. -sp, --skip-patch @@ -413,17 +430,21 @@ Usage: builder [--all-branches] [-D|--debug] [-V|--version] [--short-version] [ - abort instead of applying patch --show-bconds - show available conditional builds, which can be used - with --with and/or --without switches. ---show-bcond-args - show active bconds, from ~/.bcondrc. this is used by ./repackage.sh script. - In other words, the output is parseable by scripts. +--show-bcond-args - show active bconds, from ~/.bcondrc. this is used by + ./repackage.sh script. In other words, the output is + parseable by scripts. --show-avail-bconds - show available bconds --with/--without - conditional build package depending on %_with_/ %_without_ macro switch. You may now use - --with feat1 feat2 feat3 --without feat4 feat5 --with feat6 + --with feat1 feat2 --without feat3 feat4 --with feat5 constructions. Set GROUP_BCONDS to yes to make use of it. --target , --target= - build for platform . --init-rpm-dir - initialize ~/rpm directory structure +--git-pld - force use of PLD git and distfiles +--git-tld - force use of TLD git and distfiles (note: it will fall + back to PLD git/df if package doesn't exist in TLD git) " } @@ -452,7 +473,7 @@ insert_gitlog() { # * 1265749244 +0000 Random Hacker 9370900 git rev-list -${log_entries:-20} HEAD | while read sha1; do local logfmt='%B%n' - git notes list $sha1 &> /dev/null && logfmt=%N + git notes list $sha1 1>/dev/null 2>&1 && logfmt=%N git log -n 1 $sha1 --format=format:"* %ad %an <%ae> %h%n${logfmt}%n" --date=raw | sed '/^$/q' done > $gitlog LC_ALL=C gawk '/^\* /{printf("* %s %s\n", strftime("%a %b %d %Y", $2), substr($0, length($1)+length($2)+length($3)+4)); next}{print}' $gitlog > $speclog @@ -943,7 +964,7 @@ find_mirror() { cd "$REPO_DIR" local url="$1" if [ ! -f "mirrors" ] ; then - ln -s rpm-build-tools/mirrors . + ln -s scripts/mirrors . fi IFS="|" @@ -2037,11 +2058,11 @@ init_rpm_dir() { mkdir -p $TOP_DIR $rpmdir $buildir $srpmdir cd "$TOP_DIR" - if [ ! -e ../rpm-build-tools ]; then - git clone ${GIT_SERVER}/${PACKAGES_DIR}/rpm-build-tools.git ../rpm-build-tools + if [ ! -e ../scripts ]; then + git clone ${GIT_SERVER}/${PACKAGES_DIR}/scripts.git ../scripts fi for a in adapter builder; do - ln -s ../rpm-build-tools/${a}.sh $a + ln -s ../scripts/${a}.sh $a done init_builder } @@ -2349,6 +2370,22 @@ while [ $# -gt 0 ]; do -debug) RPMBUILDOPTS="${RPMBUILDOPTS} -debug"; shift ;; + --git-pld) + shift + GIT_SERVER=${PLD_GIT_SERVER} + GIT_PUSH=${PLD_GIT_PUSH} + PACKAGES_DIR=${PLD_PACKAGES_DIR} + DISTFILES_SERVER=${PLD_DISTFILES_SERVER} + ATTICDISTFILES_SERVER=${PLD_ATTICDISTFILES_SERVER} + ;; + --git-tld) + shift + GIT_SERVER=${TLD_GIT_SERVER} + GIT_PUSH=${TLD_GIT_PUSH} + PACKAGES_DIR=${TLD_PACKAGES_DIR} + DISTFILES_SERVER=${TLD_DISTFILES_SERVER} + ATTICDISTFILES_SERVER=${TLD_ATTICDISTFILES_SERVER} + ;; -*) Exit_error err_invalid_cmdline "$1" ;; @@ -2365,6 +2402,16 @@ while [ $# -gt 0 ]; do esac done +# Check if given package exists in TLD git +if ! git ls-remote --heads ${GIT_SERVER}/${PACKAGES_DIR}/${ASSUMED_NAME} 1>/dev/null 2>&1; then + # Nope, we don't have it in TLD, switch for PLD repositories + GIT_SERVER=${PLD_GIT_SERVER} + GIT_PUSH=${PLD_GIT_PUSH} + PACKAGES_DIR=${PLD_PACKAGES_DIR} + DISTFILES_SERVER=${PLD_DISTFILES_SERVER} + ATTICDISTFILES_SERVER=${PLD_ATTICDISTFILES_SERVER} +fi + if [ "$CVSTAG" ]; then # pass $CVSTAG used by builder to rpmbuild too, so specs could use it RPMOPTS="$RPMOPTS --define \"_cvstag $CVSTAG\""