From c8d4d84702cb9adc0f8cc1f7abff70ea0ce85f08 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Mon, 9 Jul 2012 22:41:16 +0000 Subject: [PATCH] - allow manually specifying if PLD or TLD git/df should be used - visual cosmetics (keep 80 columns word wrap in help) --- builder | 91 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 64 insertions(+), 27 deletions(-) diff --git a/builder b/builder index 1050850..073f412 100755 --- a/builder +++ b/builder @@ -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.tld-linux.org" -GIT_PUSH="git@git.tld-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="://df.tld-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) " } @@ -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,14 +2402,14 @@ while [ $# -gt 0 ]; do esac done -# Check if given package is available in TLD git +# 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="git://git.pld-linux.org" - GIT_PUSH="git@git.pld-linux.org" - PACKAGES_DIR="packages" - DISTFILES_SERVER="://distfiles.pld-linux.org" - ATTICDISTFILES_SERVER="://attic-distfiles.pld-linux.org" + # 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 -- 2.46.0