# 9 - Requested tag already exist
# 10 - Refused to build fractional release
# 100 - Unknown error (should not happen)
+# 110 - Functions not yet implemented
# Notes (todo/bugs):
# - when Icon: field is present, -5 and -a5 doesn't work
PROGRAM=${0##*/}
APPDIR=$(d=$0; [ -L "$d" ] && d=$(readlink -f "$d"); dirname "$d")
-RCSID='$Id$' r=${RCSID#* * } rev=${r%% *}
+RCSID='$Id: builder,v 1.645 2011/02/13 17:54:10 glen Exp $' r=${RCSID#* * } rev=${r%% *}
VERSION="v0.35/$rev"
VERSIONSTRING="\
-Build package utility from PLD Linux CVS repository
-$VERSION (C) 1999-2010 Free Penguins".
+Build package utility from PLD Linux Packages repository
+$VERSION (C) 1999-2011 Free Penguins".
PATH="/bin:/usr/bin:/usr/sbin:/sbin:/usr/X11R6/bin"
CLEAN=""
DEBUG=""
NOURLS=""
-NOCVS=""
NOCVSSPEC=""
NODIST=""
NOINIT=""
ADD5=""
NO5=""
ALWAYS_CVSUP=${ALWAYS_CVSUP:-"yes"}
-CVSROOT=""
-GREEDSRC=""
# use rpm 4.4.6+ digest format instead of comments if non-zero
USEDIGEST=
PACKAGE_VERSION=""
PACKAGE_NAME=""
ASSUMED_NAME=""
-PROTOCOL="ftp"
+PROTOCOL="http"
WGET_RETRIES=${MAX_WGET_RETRIES:-0}
-CVS_COMMAND=${CVS_COMMAND:-cvs}
CVS_FORCE=""
CVSIGNORE_DF="yes"
-CVS_RETRIES=${MAX_CVS_RETRIES:-1000}
-CVS_SERVER="cvs.pld-linux.org"
CVSTAG=""
+GIT_SERVER="git://github.com/draenog"
+HEAD_DETACHED=""
+DEPTH=""
+REMOTE_PLD="origin"
+NEW_REPO=""
RES_FILE=""
[ -f "$USER_CFG" ] && . "$USER_CFG"
+if [ -n "$GIT_LOGINNAME" ]; then
+ GIT_SERVER="git@github.com:${GIT_LOGINNAME}"
+fi
+
if [ "$SCHEDTOOL" = "auto" ]; then
if [ -x /usr/bin/schedtool ] && schedtool -B -e echo >/dev/null; then
SCHEDTOOL="schedtool -B -e"
exit 1
fi
-#
-# are we using cvs-nserver ?
-#
-CVS_NSERVER=0
-$CVS_COMMAND --version 2>&1 | grep -q 'CVS-nserver'
-[ $? -eq 0 ] && CVS_NSERVER=1
-
POLDEK_INDEX_DIR="$($RPM --eval %_rpmdir)/"
POLDEK_CMD="$SU_SUDO /usr/bin/poldek --noask"
run_poldek() {
- RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
+ RES_FILE=$(tempfile)
if [ -n "$LOGFILE" ]; then
LOG=`eval echo $LOGFILE`
if [ -n "$LASTLOG_FILE" ]; then
usage() {
if [ -n "$DEBUG" ]; then set -xv; fi
echo "\
-Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--as_anon] [-b|-ba|--build]
+Usage: builder [-D|--debug] [-V|--version] [--short-version] [-a|--add_cvs] [-b|-ba|--build]
[-bb|--build-binary] [-bs|--build-source] [-bc] [-bi] [-bl] [-u|--try-upgrade]
-[{-cf|--cvs-force}] [{-B|--branch} <branch>] [{-d|--cvsroot} <cvsroot>]
-[-g|--get] [-h|--help] [--http] [{-l|--logtofile} <logfile>] [-m|--mr-proper]
-[-q|--quiet] [--date <yyyy-mm-dd> [-r <cvstag>] [{-T|--tag <cvstag>]
+[{-cf|--cvs-force}] [{-B|--branch} <branch>] [--depth <number>]
+[-g|--get] [-h|--help] [--ftp] [--http] [{-l|--logtofile} <logfile>] [-m|--mr-proper]
+[-q|--quiet] [--date <yyyy-mm-dd> [-r <tag>] [{-T|--tag <tag>]
[-Tvs|--tag-version-stable] [-Ts|--tag-stable] [-Tv|--tag-version]
-[{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}] [--use-greed-sources]
+[{-Tp|--tag-prefix} <prefix>] [{-tt|--test-tag}]
[-nu|--no-urls] [-v|--verbose] [--opts <rpm opts>] [--short-circuit]
[--show-bconds] [--with/--without <feature>] [--define <macro> <value>]
-<package>[.spec][:cvstag]
+<package>[.spec][:tag]
-5, --update-md5 - update md5 comments in spec, implies -nd -ncs
-a5, --add-md5 - add md5 comments to URL sources, implies -nc -nd -ncs
-debug - produce rpm debug package (same as --opts -debug)
-V, --version - output builder version string
--short-version - output builder short version
--a, --as_anon - get files via pserver as cvs@$CVS_SERVER,
--b, -ba, --build - get all files from CVS repo or HTTP/FTP and build package
+-a, --add_vcs - try add new package to PLD repo.
+-b, -ba, --build - get all files from PLD repo or HTTP/FTP and build package
from <package>.spec,
--bb, --build-binary - get all files from CVS repo or HTTP/FTP and build binary
+-bb, --build-binary - get all files from PLD repo or HTTP/FTP and build binary
only package from <package>.spec,
-bp, --build-prep - execute the %prep phase of <package>.spec,
-bc - execute the %build phase of <package>.spec,
-bi - execute the %install phase of <package>.spec
-bl - execute the %files phase of <package>.spec
--bs, --build-source - get all files from CVS repo or HTTP/FTP and only pack
+-bs, --build-source - get all files from PLD repo or HTTP/FTP and only pack
them into src.rpm,
--short-circuit - short-circuit build
-B, --branch - add branch
-c, --clean - clean all temporarily created files (in BUILD\$RPM_BUILD_ROOT) after rpmbuild commands.
may be used with building process.
-m, --mr-proper - clean all temporarily created files (in BUILD, SOURCES,
- SPECS and \$RPM_BUILD_ROOT and CVS/Entries). Doesn't run
+ SPECS and \$RPM_BUILD_ROOT). Doesn't run
any rpm building.
--cf, --cvs-force - use -F when tagging (useful when moving branches)
--d <cvsroot>, --cvsroot <cvsroot>
- - setup \$CVSROOT,
+-cf, --cvs-force - use -f when tagging
--define <macro> <value>
- define a macro <macro> with value <value>,
+--depth <number>
+ - make shallow fetch
--alt_kernel <kernel>
- same as --define 'alt_kernel <kernel>'
--nodeps - rpm won't check any dependences
--g, --get - get <package>.spec and all related files from CVS repo
+-g, --get - get <package>.spec and all related files from PLD repo
or HTTP/FTP,
-h, --help - this message,
---http - use http instead of ftp,
+-jN, -j N - set %_smp_mflags to propagate concurrent jobs
+--ftp, --http - use ftp or http protocol to access distfiles server
-l <logfile>, --logtofile <logfile>
- log all to file,
--nc, --no-cvs - don't download sources from CVS, if source URL is given,
-ncs, --no-cvs-specs
- - don't check specs in CVS
+ - don't pull from PLD repo
-nd, --no-distfiles - don't download from distfiles
-nm, --no-mirrors - don't download from mirror, if source URL is given,
-nu, --no-urls - don't try to download from FTP/HTTP location,
--skip-existing-files - skip existing files in get_files
--opts <rpm opts> - additional options for rpm
-q, --quiet - be quiet,
---date yyyy-mm-dd - build package using resources from specified CVS date,
--r <cvstag>, --cvstag <cvstag>
- - build package using resources from specified CVS tag,
--A - build package using CVS resources as any sticky tags/date/kopts being reset.
+--date yyyy-mm-dd - build package using resources from specified date,
+-r <tag>, --cvstag <ref>
+ - build package using resources from specified branch/tag,
+-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
-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),
--sc, --source-cvs - list sources available from CVS
+-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
-sf, --source-files - list sources - bare filenames (intended for offline
operations; does not work when Icon field is present
but icon file is absent),
--sp, --source-paths - list sources - filenames with full local paths (intended for
+-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),
-su, --source-urls - list urls - urls to sources and patches
intended for copying urls with spec with lots of macros in urls
--T <cvstag> , --tag <cvstag>
- - add cvs tag <cvstag> for files,
+-T <tag> , --tag <tag>
+ - add git tag <tag> for files,
-Tvs, --tag-version-stable
- - add cvs tags STABLE and NAME-VERSION-RELEASE for files,
+ - add git tags STABLE and NAME-VERSION-RELEASE for files,
-Ts, --tag-stable
- - add cvs tag STABLE for files,
+ - add git tag STABLE for files,
-Tv, --tag-version
- - add cvs tag NAME-VERSION-RELEASE for files,
+ - add git tag NAME-VERSION-RELEASE for files,
-Tp, --tag-prefix <prefix>
- add <prefix> to NAME-VERSION-RELEASE tags,
-tt, --test-tag <prefix>
- as above, but allow float version
php-pear-Services_Digg/
--upgrade-version - upgrade to specified version in try-upgrade
---use-greed-sources
- - try download source from tag head if don't find it in
- current tag
-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 <patchnumber>
+ - don't apply <patchnumber>. may be repeated.
-np, --nopatch <patchnumber>
- - don't apply <patchnumber>
+ - abort instead of applying patch <patchnumber>
--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
"
}
+# create tempfile. as secure as possible
+tempfile() {
+ mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM.$$
+}
+
+# inserts git log instead of %changelog
+# outputs name of modified file created by tempfile
+insert_gitlog() {
+ local SPECFILE=$1 specfile=$(tempfile) gitlog=$(tempfile) speclog=$(tempfile)
+
+ # allow this being customized
+ local log_entries=$(rpm -E '%{?_buildchangelogtruncate}')
+
+ # rpm5.org/rpm.org do not parse any other date format than 'Wed Jan 1 1997'
+ # otherwise i'd use --date=iso here
+ # http://rpm5.org/cvs/fileview?f=rpm/build/parseChangelog.c&v=2.44.2.1
+ # http://rpm.org/gitweb?p=rpm.git;a=blob;f=build/parseChangelog.c#l31
+ # NOTE: changelog date is always in UTC for rpmbuild
+ # * 1265749244 +0000 Random Hacker <nikt@pld-linux.org> 9370900
+ git log -${log_entries:-20} --format=format:"* %ad %an <%ae> %h%n%s%n" --date=raw > $gitlog
+ gawk '/^\* /{printf("* %s %s\n", strftime("%a %b %d %Y", $2), substr($0, length($1)+length($2)+length($3)+4)); next}{print}' $gitlog > $speclog
+ sed '/^%changelog/,$d' $SPECFILE | sed -e "\${
+ a%changelog
+ r $speclog
+ }
+ " > $specfile
+ rm -f $gitlog $speclog
+ echo $specfile
+}
+
# change dependency to specname
# common changes:
# - perl(Package::Name) -> perl-Package-Name
exit 2 ;;
"err_no_spec_in_repo" )
remove_build_requires
- echo >&2 "Error: spec file not stored in CVS repo."
+ echo >&2 "Error: spec file not stored in PLD repo."
exit 3 ;;
"err_no_source_in_repo" )
remove_build_requires
- echo >&2 "Error: some source, patch or icon files not stored in CVS repo. ($2)"
+ echo >&2 "Error: some source, patch or icon files not stored in PLD repo. ($2)"
+ exit 4 ;;
+ "err_cvs_add_failed" )
+ echo >&2 "Error: failed to add package to PLD repo."
exit 4 ;;
"err_build_fail" )
remove_build_requires
remove_build_requires
echo >&2 "Error: conditions reject building this spec (${2})."
exit 12 ;;
+ "err_remote_problem" )
+ remove_build_requires
+ echo >&2 "Error: problem with remote (${2})"
+ exit 13 ;;
+ "err_not_implemented" )
+ remove_build_requires
+ echo >&2 "Error: functionality not yet imlemented"
+ exit 110 ;;
esac
echo >&2 "Unknown error."
exit 100
REPO_DIR="."
PACKAGE_DIR="."
fi
+ export GIT_WORK_TREE=$PACKAGE_DIR
+ export GIT_DIR=$PACKAGE_DIR/.git
__PWD=$(pwd)
}
+create_git_repo() {
+ update_shell_title "add_package"
+
+ if [ -n "$DEBUG" ]; then
+ set -x
+ set -v
+ fi
+
+ cd "$REPO_DIR"
+ SPECFILE=$(basename $SPECFILE)
+ if [ ! -f "$ASSUMED_NAME/$SPECFILE" ]; then
+ echo "ERROR: No package to add ($ASSUMED_NAME/$SPECFILE)" >&2
+ exit 101
+ fi
+ [ -d "$ASSUMED_NAME/.git" ] || NEW_REPO=yes
+ pldpkg.py add ${ASSUMED_NAME} || Exit_error err_cvs_add_failed
+ git init
+ git remote add $REMOTE_PLD ${GIT_SERVER}/${ASSUMED_NAME}.git || Exit_error err_remote_problem $REMOTE_PLD
+}
+
get_spec() {
update_shell_title "get_spec"
fi
if [ "$NOCVSSPEC" != "yes" ]; then
- if [ ! -s CVS/Root -a "$NOCVSSPEC" != "yes" ]; then
- echo "Warning: No CVS access defined - using local .spec file"
- NOCVSSPEC="yes"
- fi
-
- if [ -d "$ASSUMED_NAME" -a -s "$ASSUMED_NAME/CVS/Root" ]; then
- cvsup "$ASSUMED_NAME/$SPECFILE" || Exit_error err_no_spec_in_repo
+ if [ -z "$DEPTH" ]; then
+ if [ -d "$ASSUMED_NAME/.git" ]; then
+ git fetch $REMOTE_PLD || Exit_error err_no_spec_in_repo
+ elif [ "$ADD_PACKAGE_CVS" = "yes" ]; then
+ if [ ! -r "$ASSUMED_NAME/$SPECFILE" ]; then
+ echo "ERROR: No package to add ($ASSUMED_NAME/$SPECFILE)" >&2
+ exit 101
+ fi
+ Exit_error err_not_implemented
+ else
+ (
+ unset GIT_WORK_TREE
+ git clone -o $REMOTE_PLD ${GIT_SERVER}/${ASSUMED_NAME}.git || {
+ # softfail if new package, i.e not yet added to PLD rep
+ [ ! -f "$ASSUMED_NAME/$SPECFILE" ] && Exit_error err_no_spec_in_repo
+ echo "Warning: package not in CVS - assuming new package"
+ NOCVSSPEC="yes"
+ }
+ )
+ fi
else
- cvsup -c -d $ASSUMED_NAME "packages/$ASSUMED_NAME/$SPECFILE" || {
- # softfail if new package, i.e not yet added to cvs
- [ ! -f "$ASSUMED_NAME/$SPECFILE" ] && Exit_error err_no_spec_in_repo
- echo "Warning: package not in CVS - assuming new package"
- NOCVSSPEC="yes"
- NOCVS="yes"
+ if [ ! -d "$ASSUMED_NAME/.git" ]; then
+ if [ ! -d "$ASSUMED_NAME" ]; then
+ mkdir $ASSUMED_NAME
+ fi
+ git init
+ git remote add $REMOTE_PLD ${GIT_SERVER}/${ASSUMED_NAME}.git
+ CVSTAG=${CVSTAG:-"master"}
+ fi
+ git fetch $DEPTH $REMOTE_PLD ${CVSTAG}:remotes/${REMOTE_PLD}/${CVSTAG} || {
+ echo >&2 "Error: branch $CVSTAG does not exist"
+ exit 3
}
+ fi
- # remove Entries.Static -- so 'cvs up' would update all files in a repo
- rm -f "$ASSUMED_NAME/CVS/Entries.Static"
- cvsignore_df .cvsignore
+ cvsignore_df .gitignore
- # add default log format to .cvsignore if it is relative to package dir
- if [ -n "$LOGFILE" -a "$LOGFILE" = "${LOGFILE##*/}" ]; then
- # substitute known "macros" to glob
- local logfile=$(echo "$LOGFILE" | sed -e 's,\$\(PACKAGE_NAME\|DATE\),*,g')
- if [ "$logfile" ]; then
- cvsignore_df "$logfile"
- fi
+ # add default log format to .gitignore if it is relative to package dir
+ if [ -n "$LOGFILE" -a "$LOGFILE" = "${LOGFILE##*/}" ]; then
+ # substitute known "macros" to glob
+ local logfile=$(echo "$LOGFILE" | sed -e 's,\$\(PACKAGE_NAME\|DATE\),*,g')
+ if [ "$logfile" ]; then
+ cvsignore_df "$logfile"
fi
+ fi
- # create symlinks for tools
- if [ "$SYMLINK_TOOLS" != "no" ]; then
- for a in dropin md5 adapter builder {relup,compile,repackage,rsync,pearize}.sh pldnotify.awk; do
- [ -f $a ] || continue
- ln -sf ../$a $ASSUMED_NAME
- cvsignore_df $a
- done
- fi
+ # create symlinks for tools
+ if [ "$SYMLINK_TOOLS" != "no" ]; then
+ for a in dropin md5 adapter builder {relup,compile,repackage,pearize}.sh pldnotify.awk; do
+ [ -f $a ] || continue
+ ln -sf ../$a $ASSUMED_NAME
+ cvsignore_df $a
+ done
+ fi
+ fi
+
+ if [ -n "$CVSTAG" ]; then
+ git checkout "$CVSTAG" -- 2>/dev/null || git checkout -t "${REMOTE_PLD}/$CVSTAG" > /dev/null || exit
+ git symbolic-ref -q HEAD > /dev/null &&
+ git merge '@{u}'
+ if [ -n "$CVSDATE" ]; then
+ git checkout $(git rev-list -n1 --before="'$CVSDATE'" $CVSTAG) || exit 1
fi
fi
find_mirror() {
cd "$REPO_DIR"
local url="$1"
- if [ ! -f "mirrors" -a "$NOCVSSPEC" != "yes" ] ; then
- $CVS_COMMAND update mirrors >&2
+ if [ ! -f "mirrors" ] ; then
+ ln -s rpm-build-tools/mirrors .
fi
IFS="|"
local md5
if [ -f additional-md5sums ]; then
- local spec_rev=$(grep $SPECFILE CVS/Entries 2>/dev/null | sed -e s:/$SPECFILE/:: -e s:/.*::)
- if [ -z "$spec_rev" ]; then
- spec_rev=$(head -n 1 $SPECFILE | sed -e 's/.*\$Revision: \([0-9.]*\).*/\1/')
- fi
- local spec="$SPECFILE[0-9.,]*,$(echo $spec_rev | sed 's/\./\\./g')"
md5=$(grep -s -v '^#' additional-md5sums | \
- grep -E "[ ]$(basename "$1")[ ]+${spec}([ ,]|\$)" | \
+ grep -E "[ ]$(basename "$1")([ ,]|\$)" | \
sed -e 's/^\([0-9a-f]\{32\}\).*/\1/' | \
grep -E '^[0-9a-f]{32}$')
if [ "$CVSIGNORE_DF" != "yes" ]; then
return
fi
- cvsignore=${PACKAGE_DIR}/.cvsignore
+ cvsignore=${PACKAGE_DIR}/.gitignore
# add only if not yet there
if ! awk -vf="$1" -vc=1 '$0 == f { c = 0 } END { exit c }' $cvsignore 2>/dev/null; then
fi
}
-cvsup() {
- update_shell_title "cvsup"
- local OPTIONS="up "
-
- if [ "$1" = "-c" ]; then
- OPTIONS="co "
- shift
- fi
- if [ -n "$CVSROOT" ]; then
- OPTIONS="-d $CVSROOT $OPTIONS"
- fi
-
- if [ -z "$CVSDATE" -a -z "$CVSTAG" ]; then
- OPTIONS="$OPTIONS -A"
- else
- if [ -n "$CVSDATE" ]; then
- OPTIONS="$OPTIONS -D $CVSDATE"
- fi
- if [ -n "$CVSTAG" ]; then
- OPTIONS="$OPTIONS -r $CVSTAG"
- fi
- fi
-
- local result=1
- local retries_counter=0
- if [ $# = 1 ]; then
- update_shell_title "cvsup: $*"
- else
- update_shell_title "cvsup: $# files"
- fi
- while [ "$result" != "0" -a "$retries_counter" -le "$CVS_RETRIES" ]; do
- retries_counter=$(( $retries_counter + 1 ))
- output=$(LC_ALL=C $CVS_COMMAND $OPTIONS "$@" 2>&1)
- result=$?
- [ -n "$output" ] && echo "$output"
- 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
- echo "Trying again [$*]... ($retries_counter)"
- update_shell_title "cvsup: retry #$retries_counter"
- sleep 2
- continue
- else
- break
- fi
- done
- update_shell_title "cvsup: done!"
- return $result
-}
-
# returns true if "$1" is ftp, http or https protocol url
is_url() {
case "$1" in
if [ $# -gt 0 ]; then
cd "$PACKAGE_DIR"
- if [ ! -s CVS/Root -a "$NOCVS" != "yes" ]; then
- echo "Warning: No CVS access defined for SOURCES"
- NOCVS="yes"
- fi
-
local nc=0
local get_files_cvs=""
for i in "$@"; do
rm -f "$target"
FROM_DISTFILES=0
fi
- elif [ "$NOCVS" != "yes" -a -z "$srcmd5" ]; then
- if [ $# -gt 1 ]; then
- get_files_cvs="$get_files_cvs $fp"
- update_shell_title "$fp (will cvs up later)"
- cvsup=1
- else
- cvsup $fp
- fi
fi
if [ -z "$NOURLS" ] && [ ! -f "$fp" -o -n "$UPDATE" ] && [ "`echo $i | grep -E 'ftp://|http://|https://'`" ]; then
# the md5 check must be moved elsewhere as if we've called from update_md5 the md5 is wrong.
if [ ! -f "$fp" -a "$FAIL_IF_NO_SOURCES" != "no" ]; then
- if [ -n "GREEDSRC" ]; then
- get_greed_sources $i
- else
- Exit_error err_no_source_in_repo $i
- fi
+ Exit_error err_no_source_in_repo $i
fi
# we check md5 here just only to refetch immediately
done
SHELL_TITLE_PREFIX=""
- if [ "$get_files_cvs" ]; then
- cvsup $get_files_cvs
- fi
if [ "$CHMOD" = "yes" ]; then
CHMOD_FILES=$(nourl "$@")
echo -n "$TAGVER"
}
-# bool is_tag_a_branch(tag)
-#
-# returns 1 if a tag is a branch set on SPECFILE
-is_tag_a_branch() {
- if [ -n "$DEBUG" ]; then
- set -x
- set -v
- fi
-
- if [ $# -ne 1 ]; then
- return 0;
- fi
-
- TAG=$1
-
- cd "$PACKAGE_DIR"
- $CVS_COMMAND status -v $SPECFILE | grep -Eiq "${TAG}.+(branch: [0-9.]+)"
- return $?
-}
-
tag_files() {
TAG_FILES="$@"
local TAGVER
if [ "$TAG_VERSION" = "yes" ]; then
TAGVER=`make_tagver`
- echo "CVS tag: $TAGVER"
+ echo "tag: $TAGVER"
fi
if [ -n "$TAG" ]; then
- echo "CVS tag: $TAG"
+ echo "tag: $TAG"
fi
local OPTIONS="tag $CVS_FORCE"
- if [ -n "$CVSROOT" ]; then
- OPTIONS="-d $CVSROOT $OPTIONS"
- fi
- # if a tagname we are about to set already exists
- # and happens to be a branch (common case with AC-branch)
- # pass -B (allows -F to disturb branch tag)
local _tag=$TAG
if [ "$TAG_VERSION" = "yes" ]; then
_tag=$TAGVER
fi;
- is_tag_a_branch $_tag
- if [ $? -eq 0 -a $CVS_NSERVER -eq 0 ]; then
- OPTIONS="$OPTIONS -B"
- fi;
cd "$PACKAGE_DIR"
- local tag_files
- for i in $TAG_FILES; do
- # don't tag files stored on distfiles
- [ -n "`src_md5 $i`" ] && continue
- local fp=`nourl "$i"`
- if [ -f "$fp" ]; then
- tag_files="$tag_files $fp"
- elif [ -n "GREEDSRC" ]; then
- get_greed_sources $i
- else
- Exit_error err_no_source_in_repo $i
- fi
- done
-
- if [ "$tag_files" ]; then
- if [ "$TAG_VERSION" = "yes" ]; then
- update_shell_title "tag sources: $TAGVER"
- printf "Tagging %d files\n" $(echo $tag_files | wc -w)
- $CVS_COMMAND $OPTIONS $TAGVER $tag_files || exit
- fi
- if [ -n "$TAG" ]; then
- update_shell_title "tag sources: $TAG"
-
- while [ "$tag_files" ]; do
- local chunk=$(echo $tag_files | tr ' ' '\n' | head -n 100)
- printf "Tagging %d files\n" $(echo $chunk | wc -w)
- $CVS_COMMAND $OPTIONS $TAG $chunk || exit
- tag_files=$(echo $tag_files | tr ' ' '\n' | tail +101)
- done
- fi
- fi
- cd "$PACKAGE_DIR"
if [ "$TAG_VERSION" = "yes" ]; then
- update_shell_title "tag spec: $TAGVER"
- $CVS_COMMAND $OPTIONS $TAGVER $SPECFILE || exit
+ update_shell_title "tag sources: $TAGVER"
+ git $OPTIONS $TAGVER || exit
+ git push $CVS_FORCE $REMOTE_PLD tag $TAGVER || Exit_error err_remote_problem $REMOTE_PLD
fi
if [ -n "$TAG" ]; then
- update_shell_title "tag spec: $TAG"
- $CVS_COMMAND $OPTIONS $TAG $SPECFILE || exit
+ update_shell_title "tag sources: $TAG"
+ git $OPTIONS $TAG $chunk || exit
+ git push $CVS_FORCE $REMOTE_PLD tag $TAG || Exit_error err_remote_problem $REMOTE_PLD
fi
}
branch_files() {
TAG=$1
- echo "CVS branch tag: $TAG"
+ echo "Git branch: $TAG"
shift
- TAG_FILES="$@"
-
if [ -n "$DEBUG" ]; then
set -x
set -v
fi
- local OPTIONS="tag $CVS_FORCE -b"
+ local OPTIONS="branch $CVS_FORCE"
- # branch exists?
- is_tag_a_branch $TAG
- if [ $? -eq 1 ]; then
- OPTIONS="$OPTIONS -B"
- fi
-
- if [ -n "$CVSROOT" ]; then
- OPTIONS="-d $CVSROOT $OPTIONS"
- fi
cd "$PACKAGE_DIR"
- local tag_files
- for i in $TAG_FILES; do
- local fp=`nourl "$i"`
- if [ -f "$fp" ]; then
- tag_files="$tag_files $fp"
- elif [ -n "GREEDSRC" ]; then
- get_greed_sources $i
- else
- Exit_error err_no_source_in_repo $i
- fi
- done
- if [ "$tag_files" ]; then
- $CVS_COMMAND $OPTIONS $TAG $tag_files || exit
- fi
-
- cd "$PACKAGE_DIR"
- $CVS_COMMAND $OPTIONS $TAG $SPECFILE || exit
+ git $OPTIONS $TAG || exit
}
if [ -n "$LASTLOG_FILE" ]; then
echo "LASTLOG=$LOG" > $LASTLOG_FILE
fi
- RES_FILE=$(mktemp -t builder.XXXXXX || ${TMPDIR:-/tmp}/builder.$RANDOM)
+ RES_FILE=$(tempfile)
+ local specfile=$(insert_gitlog $SPECFILE)
- (time eval ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $SPECFILE; echo $? > $RES_FILE) 2>&1 |tee $LOG
+ (time eval ${NICE_COMMAND} $RPMBUILD $TARGET_SWITCH $BUILD_SWITCH -v $QUIET $CLEAN $RPMOPTS $RPMBUILDOPTS $BCOND --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $specfile; echo $? > $RES_FILE) 2>&1 |tee $LOG
RETVAL=`cat $RES_FILE`
- rm $RES_FILE
+ rm $RES_FILE $specfile
if [ -n "$LOGDIROK" ] && [ -n "$LOGDIRFAIL" ]; then
if [ "$RETVAL" -eq "0" ]; then
mv $LOG $LOGDIROK
}
display_branches() {
- if [ "$NOCVSSPEC" != "yes" ]; then
- echo -n "Available branches: "
- $CVS_COMMAND status -v "${SPECFILE}" | awk '!/Sticky Tag:/ && /\(branch:/ { print $1 } ' | xargs
- fi
+ echo -n "Available branches: "
+ git branch -r | grep "^ ${REMOTE_PLD}" | grep -v ${REMOTE_PLD}/HEAD | sed "s#^ *${REMOTE_PLD}/##" | xargs
}
# checks a given list of packages/files/provides agains current rpmdb.
}
init_rpm_dir() {
- local CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
local TOP_DIR=$(eval $RPM $RPMOPTS --eval '%{_topdir}')
local rpmdir=$(eval $RPM $RPMOPTS --eval '%{_rpmdir}')
local buildir=$(eval $RPM $RPMOPTS --eval '%{_builddir}')
local srpmdir=$(eval $RPM $RPMOPTS --eval '%{_srcrpmdir}')
local tmp
- echo "Initializing rpm directories to $TOP_DIR from $CVSROOT"
+ echo "Initializing rpm directories to $TOP_DIR from $GIT_SERVER"
mkdir -p $TOP_DIR $rpmdir $buildir $srpmdir
- # need to checkout to tmp dir or we can't name our topdir
- tmp=$(TMPDIR= TEMPDIR= mktemp -p $TOP_DIR -d) || exit 1
- cd $tmp
- $CVS_COMMAND -d $CVSROOT co packages/{.cvsignore,rpm.groups,dropin,mirrors,md5,adapter{,.awk},fetchsrc_request,builder,{relup,compile,repackage}.sh,ci,civim}
- cd -
- mv $tmp/packages/* $TOP_DIR
- rm -rf $tmp
-
- init_builder
-
- echo "To checkout *all* .spec files (read-only):"
- echo "- run cvs co SPECS"
-
- echo "To checkout *all* packages:"
- echo "- run cvs up -dP in $TOP_DIR dir"
-
- echo ""
- echo "To commit with your developer account:"
- echo "- edit $TOP_DIR/CVS/Root"
-}
-
-get_greed_sources() {
- CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"
- if [ -n "BE_VERBOSE" ]; then
- echo "Try greed download: $1 from: $CVSROOT"
- fi
- $CVS_COMMAND -d $CVSROOT get SOURCES/$1
- if [ $? != 0 ]; then
- Exit_error err_no_source_in_repo $1
- fi
-
-}
-
-# remove entries from CVS/Entries
-cvs_entry_remove() {
- local cvsdir="$1"; shift
- if [ ! -d "$cvsdir" ]; then
- echo >&2 "cvs_entry_remove: $cvsdir is not a directory"
- exit 1
- fi
-
- for file in "$@"; do
- rm -f $cvsdir/CVS/Entries.new || return 1
- awk -ve="${file##*/}" -F/ '$2 != e {print}' $cvsdir/CVS/Entries > $cvsdir/CVS/Entries.new || return 1
- mv -f $cvsdir/CVS/Entries.new $cvsdir/CVS/Entries || return 1
+ cd "$TOP_DIR"
+ git clone ${GIT_SERVER}/rpm-build-tools.git ${TOP_DIR}/rpm-build-tools
+ for a in dropin md5 adapter builder mirrors {relup,compile,repackage,pearize}.sh pldnotify.awk; do
+ ln -s rpm-build-tools/$a .
done
- return 0
+ init_builder
}
mr_proper() {
init_builder
NOCVSSPEC="yes"
DONT_PRINT_REVISION="yes"
- get_spec
- parse_spec
-
- # remove from CVS/Entries
- cvs_entry_remove $PACKAGE_DIR $SPECFILE $SOURCES $PATCHES
# remove spec and sources
- $RPMBUILD --clean --rmsource --rmspec --nodeps --define \'_specdir $PACKAGE_DIR\' --define \'_sourcedir $PACKAGE_DIR\' $SPECFILE
+ $RPMBUILD --clean --rmsource --rmspec --nodeps --define "_specdir $PACKAGE_DIR" --define "_sourcedir $PACKAGE_DIR" $PACKAGE_DIR/$SPECFILE
+ rm -rf $PACKAGE_DIR/.git .gitignore
+ rmdir --ignore-fail-on-non-empty $PACKAGE_DIR
}
#---------------------------------------------
-a5 | --add-md5 )
COMMAND="update_md5"
NODIST="yes"
- NOCVS="yes"
NOCVSSPEC="yes"
ADD5="yes"
shift ;;
COMMAND="version"; shift ;;
--short-version )
COMMAND="short-version"; shift ;;
- -a | --as_anon )
- CVSROOT=":pserver:cvs@$CVS_SERVER:/cvsroot"; shift ;;
+ -a | --add_cvs)
+ COMMAND="add_cvs";
+ shift ;;
-b | -ba | --build )
COMMAND="build"; shift ;;
-bb | --build-binary )
-c | --clean )
CLEAN="--clean"; shift ;;
-cf | --cvs-force )
- CVS_FORCE="-F"; shift;;
- -d | --cvsroot )
- shift; CVSROOT="${1}"; shift ;;
+ CVS_FORCE="-f"; shift;;
+ --depth )
+ DEPTH="--depth=$2"
+ shift 2
+ ;;
-g | --get )
COMMAND="get"; shift ;;
-h | --help )
COMMAND="usage"; shift ;;
+ --ftp )
+ PROTOCOL="ftp"; shift ;;
--http )
PROTOCOL="http"; shift ;;
+ -j)
+ RPMOPTS="${RPMOPTS} --define \"_smp_mflags -j$2\""
+ shift 2
+ ;;
+ -j[0-9]*)
+ RPMOPTS="${RPMOPTS} --define \"_smp_mflags $1\""
+ shift
+ ;;
-l | --logtofile )
shift; LOGFILE="${1}"; shift ;;
-ni| --nice )
SKIP_EXISTING_FILES="yes"; shift ;;
-m | --mr-proper )
COMMAND="mr-proper"; shift ;;
- -nc | --no-cvs )
- NOCVS="yes"; shift ;;
-ncs | --no-cvs-specs )
NOCVSSPEC="yes"; shift ;;
-nd | --no-distfiles )
-ns0 | --no-source0 )
NOSOURCE0="yes"; shift ;;
-nn | --no-net )
- NOCVS="yes"
NOCVSSPEC="yes"
NODIST="yes"
NOMIRRORS="yes"
shift; RPMOPTS="${RPMOPTS} ${1}"; shift ;;
--nopatch | -np )
shift; RPMOPTS="${RPMOPTS} --define \"patch${1} : ignoring patch${1}; exit 1; \""; shift ;;
+ --skip-patch | -sp )
+ shift; RPMOPTS="${RPMOPTS} --define \"patch${1} : skiping patch${1}\""; shift ;;
--topdir)
RPMOPTS="${RPMOPTS} --define \"_topdir $2\""
shift 2
-q | --quiet )
QUIET="--quiet"; shift ;;
--date )
- CVSDATE="${2}"; shift 2 ;;
+ CVSDATE="${2}"; shift 2
+ date -d "$CVSDATE" > /dev/null 2>&1 || { echo >&2 "No valid date specified"; exit 3; }
+ ;;
-r | --cvstag )
CVSTAG="$2"
shift 2
;;
-A)
shift
- CVSTAG="HEAD"
+ CVSTAG="master"
;;
-R | --fetch-build-requires)
FETCH_BUILD_REQUIRES="yes"
-sc | --sources-cvs)
COMMAND="list-sources-cvs"
shift ;;
- -sd | --sources-distfiles)
+ -sd | --source-distfiles)
COMMAND="list-sources-distfiles"
shift ;;
- -sdp | --sources-distfiles-paths)
+ -sdp | --source-distfiles-paths)
COMMAND="list-sources-distfiles-paths"
shift ;;
- -sf | --sources-files)
+ -sf | --source-files)
COMMAND="list-sources-files"
shift ;;
- -sp | --sources-paths)
+ -lsp | --source-paths)
COMMAND="list-sources-local-paths"
shift ;;
- -su | --sources-urls)
+ -su | --source-urls)
COMMAND="list-sources-urls"
shift ;;
-Tvs | --tag-version-stable )
--init-rpm-dir)
COMMAND="init_rpm_dir"
shift ;;
- --use-greed-sources )
- GREEDSRC="1"
- shift;;
-u | --try-upgrade )
TRY_UPGRADE="1"; shift ;;
--upgrade-version )
esac
done
-[ -d "$ASSUMED_NAME" ] && CVS_ENTRIES="$ASSUMED_NAME/CVS/Entries" || CVS_ENTRIES="CVS/Entries"
-if [ -f "$CVS_ENTRIES" ] && [ -z "$CVSTAG" ]; then
- CVSTAG=$(awk -vSPECFILE=$(basename $SPECFILE) -F/ '$2 == SPECFILE && $6 ~ /^T/{print substr($6, 2)}' ${CVS_ENTRIES})
- if [ "$CVSTAG" ]; then
- echo >&2 "builder: Sticky tag $CVSTAG active. Use -r TAGNAME to override."
+[ -d "$ASSUMED_NAME" ] && GIT_DIR="$ASSUMED_NAME/.git" || GIT_DIR=.git
+if [ -d "$GIT_DIR" ] && [ -z "$CVSTAG" ]; then
+ if CVSTAG=$(GIT_DIR=$GIT_DIR git symbolic-ref HEAD) 2>/dev/null; then
+ CVSTAG=${CVSTAG#refs/heads/}
+ if [ "$CVSTAG" != "master" ]; then
+ echo >&2 "builder: Active branch $CVSTAG. Use -r BRANCHNAME to override"
+ fi
+ else
+ echo >&2 "On detached HEAD. Use -r BRANCHNAME to override"
+ HEAD_DETACHED="yes"
fi
elif [ "$CVSTAG" = "HEAD" ]; then
# assume -r HEAD is same as -A
- CVSTAG=""
+ CVSTAG="master"
fi
if [ "$CVSTAG" ]; then
case "$COMMAND" in
"show_bconds")
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec > /dev/null
- parse_spec
- set_bconds_values
- display_bconds
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
fi
+ get_spec > /dev/null
+ parse_spec
+ set_bconds_values
+ display_bconds
;;
"show_bcond_args")
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec > /dev/null
- parse_spec
- set_bconds_values
- echo "$BCOND"
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
fi
+ get_spec > /dev/null
+ parse_spec
+ set_bconds_values
+ echo "$BCOND"
;;
"show_avail_bconds")
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec > /dev/null
- parse_spec
- local bcond_avail=$(find_spec_bcond $SPECFILE)
- local opt bcond bconds
- for opt in $bcond_avail; do
- case "$opt" in
- without_*)
- bcond=${opt#without_}
- bconds="$bconds $bcond"
- ;;
- with_*)
- bcond=${opt#with_}
- bconds="$bconds $bcond"
- ;;
- *)
- echo >&2 "ERROR: unexpected '$opt' in show_avail_bconds"
- exit 1
- ;;
- esac
- done
- echo $bconds
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
fi
+ get_spec > /dev/null
+ parse_spec
+ local bcond_avail=$(find_spec_bcond $SPECFILE)
+ local opt bcond bconds
+ for opt in $bcond_avail; do
+ case "$opt" in
+ without_*)
+ bcond=${opt#without_}
+ bconds="$bconds $bcond"
+ ;;
+ with_*)
+ bcond=${opt#with_}
+ bconds="$bconds $bcond"
+ ;;
+ *)
+ echo >&2 "ERROR: unexpected '$opt' in show_avail_bconds"
+ exit 1
+ ;;
+ esac
+ done
+ echo $bconds
+
;;
"build" | "build-binary" | "build-source" | "build-prep" | "build-build" | "build-install" | "build-list")
init_builder
- if [ -n "$SPECFILE" ]; then
- # display SMP make flags if set
- smp_mflags=$(rpm -E %{?_smp_mflags})
- if [ "$smp_mflags" ]; then
- echo "builder: SMP make flags are set to $smp_mflags"
- fi
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
+ fi
- get_spec
- parse_spec
- set_bconds_values
- display_bconds
- display_branches
- if [ "$COMMAND" != "build-source" ]; then
- check_buildarch
- fi
- fetch_build_requires
- if [ "$INTEGER_RELEASE" = "yes" ]; then
- echo "Checking release $PACKAGE_RELEASE..."
- if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
- Exit_error err_fract_rel "$PACKAGE_RELEASE"
- fi
- fi
+ # display SMP make flags if set
+ smp_mflags=$(rpm -E %{?_smp_mflags})
+ if [ "$smp_mflags" ]; then
+ echo "builder: SMP make flags are set to $smp_mflags"
+ fi
- # ./builder -bs test.spec -r AC-branch -Tp auto-ac- -tt
- if [ -n "$TEST_TAG" ]; then
- local TAGVER=`make_tagver`
- echo "Searching for tag $TAGVER..."
- TAGREL=$($CVS_COMMAND status -v $SPECFILE | grep -E "^[[:space:]]*${TAGVER}[[[:space:]]" | sed -e 's#.*(revision: ##g' -e 's#).*##g')
- if [ -n "$TAGREL" ]; then
- Exit_error err_tag_exists "$TAGVER" "$TAGREL"
- fi
+ get_spec
+ parse_spec
+ set_bconds_values
+ display_bconds
+ display_branches
+ if [ "$COMMAND" != "build-source" ]; then
+ check_buildarch
+ fi
+ fetch_build_requires
+ if [ "$INTEGER_RELEASE" = "yes" ]; then
+ echo "Checking release $PACKAGE_RELEASE..."
+ if echo $PACKAGE_RELEASE | grep -q '^[^.]*\.[^.]*$' 2>/dev/null ; then
+ Exit_error err_fract_rel "$PACKAGE_RELEASE"
+ fi
+ fi
- # - do not allow to build from HEAD when XX-branch exists
- TREE_PREFIX=$(echo "$TAG_PREFIX" | sed -e 's#^auto-\([a-zA-Z]\+\)-.*#\1#g')
- if [ "$TREE_PREFIX" != "$TAG_PREFIX" ]; then
- TAG_BRANCH="${TREE_PREFIX}-branch"
- TAG_STATUS=$($CVS_COMMAND status -v $SPECFILE | grep -Ei "${TAG_BRANCH}.+(branch: [0-9.]+)")
- if [ -n "$TAG_STATUS" -a "$CVSTAG" = "HEAD" ]; then
- Exit_error err_branch_exists "$TAG_STATUS"
- fi
+ # ./builder -bs test.spec -r AC-branch -Tp auto-ac- -tt
+ if [ -n "$TEST_TAG" ]; then
+ local TAGVER=`make_tagver`
+ echo "Searching for tag $TAGVER..."
+ git show-ref --quiet --verify "refs/tags/$TAGVER" && Exit_error err_tag_exists "$TAGVER"
+
+ # - do not allow to build from HEAD when XX-branch exists
+ TREE_PREFIX=$(echo "$TAG_PREFIX" | sed -e 's#^auto-\([a-zA-Z]\+\)-.*#\1#g')
+ if [ "$TREE_PREFIX" != "$TAG_PREFIX" ]; then
+ TAG_BRANCH="${TREE_PREFIX}-branch"
+ TAG_STATUS=$(git branch -r | grep -i "${REMOTE_PLD}/$TAG_BRANCH$" | sed "s# *${REMOTE_PLD}/##")
+ if [ -n "$TAG_STATUS" -a "$TAG_STATUS" != "$CVSTAG" ]; then
+ Exit_error err_branch_exists "$TAG_STATUS"
fi
-
fi
- if [ -n "$NOSOURCE0" ] ; then
- SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
- fi
- try_upgrade
- case $? in
- 0)
- get_files $SOURCES $PATCHES
- check_md5 $SOURCES
- ;;
- *)
- NODIST="yes" get_files $SOURCES $PATCHES
- update_md5 $SOURCES
- ;;
- esac
- build_package
- if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
- run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
- fi
- remove_build_requires
- else
- Exit_error err_no_spec_in_cmdl
fi
+
+ if [ -n "$NOSOURCE0" ] ; then
+ SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
+ fi
+ try_upgrade
+ case $? in
+ 0)
+ get_files $SOURCES $PATCHES
+ check_md5 $SOURCES
+ ;;
+ *)
+ NODIST="yes" get_files $SOURCES $PATCHES
+ update_md5 $SOURCES
+ ;;
+ esac
+ build_package
+ if [ "$UPDATE_POLDEK_INDEXES" = "yes" -a "$COMMAND" != "build-prep" ]; then
+ run_poldek --sdir="${POLDEK_INDEX_DIR}" --mkidxz
+ fi
+ remove_build_requires
;;
"branch" )
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
+ fi
+
+ get_spec
+ parse_spec
+ branch_files $TAG
+ ;;
+ "add_cvs" )
+ init_builder
+ if [ -z "$SPECFILE" ]; then
+ Exit_error err_no_spec_in_cmdl
+ fi
+
+ create_git_repo
+ if [ -n "$NEW_REPO" ]; then
parse_spec
- # don't fetch sources from remote locations
- new_SOURCES=""
- for file in $SOURCES; do
- [ -n "`src_md5 $file`" ] && continue
- new_SOURCES="$new_SOURCES $file"
+ local file
+ for file in $SOURCES $PATCHES; do
+ if [ -z $(src_md5 "$file") ]; then
+ git add $file || Exit_error err_no_source_in_repo $file
+ else
+ cvsignore_df `nourl $file`
+ fi
done
- SOURCES="$new_SOURCES"
- get_files $SOURCES $PATCHES
- check_md5 $SOURCES
- branch_files $TAG $SOURCES $PATCHES $ICONS
+ git add $SPECFILE
+ git commit -m 'Initial commit'
+ git push --dry-run $REMOTE_PLD master || Exit_error err_cvs_add_failed
else
- Exit_error err_no_spec_in_cmdl
+ echo "You had already git repository. Push chosen branches to remote: ${REMOTE_PLD}"
fi
;;
"get" )
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec
- parse_spec
-
- if [ -n "$NOSOURCE0" ] ; then
- SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
- fi
- get_files $SOURCES $PATCHES
- check_md5 $SOURCES
- else
+ if [ -z "$SPECFILE" ]; then
Exit_error err_no_spec_in_cmdl
fi
+
+ get_spec
+ parse_spec
+
+ if [ -n "$NOSOURCE0" ] ; then
+ SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
+ fi
+ get_files $SOURCES $PATCHES
+ check_md5 $SOURCES
;;
"update_md5" )
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec
- parse_spec
-
- if [ -n "$NOSOURCE0" ] ; then
- SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
- fi
- update_md5 $SOURCES
- else
+ if [ -z "$SPECFILE" ]; then
Exit_error err_no_spec_in_cmdl
fi
+
+ get_spec
+ parse_spec
+
+ if [ -n "$NOSOURCE0" ] ; then
+ SOURCES=`echo $SOURCES | xargs | sed -e 's/[^ ]*//'`
+ fi
+ update_md5 $SOURCES
;;
"tag" )
NOURLS=1
NODIST="yes"
init_builder
- if [ -n "$SPECFILE" ]; then
- get_spec
- parse_spec
-
- # don't fetch sources from remote locations
- new_SOURCES=""
- for file in $SOURCES; do
- [ -n "`src_md5 $file`" ] && continue
- new_SOURCES="$new_SOURCES $file"
- done
- SOURCES="$new_SOURCES"
- get_files $SOURCES $PATCHES
- check_md5 $SOURCES
- tag_files $SOURCES $PATCHES $ICONS
- else
+ if [ -z "$SPECFILE" ]; then
Exit_error err_no_spec_in_cmdl
fi
+
+ get_spec
+ parse_spec
+ tag_files
;;
"mr-proper" )
mr_proper