diff options
author | Viktor Hercinger <vhercing@redhat.com> | 2013-03-15 17:22:42 +0100 |
---|---|---|
committer | Viktor Hercinger <vhercing@redhat.com> | 2013-03-15 17:22:42 +0100 |
commit | c31dfb018f97616ff2e7124803627c0ddecead89 (patch) | |
tree | d86316cba754f7e37126ece91fda1ef9980fa371 | |
parent | dcbf2cafd820b21fd40310280abc6988ce9e621a (diff) | |
download | rpm-tools-c31dfb018f97616ff2e7124803627c0ddecead89.tar.gz rpm-tools-c31dfb018f97616ff2e7124803627c0ddecead89.tar.xz rpm-tools-c31dfb018f97616ff2e7124803627c0ddecead89.zip |
branch changing option added to rpmdev-build-devspec
-rw-r--r-- | rpmtools.spec | 5 | ||||
-rwxr-xr-x | scripts/rpmdev-build-devspec | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/rpmtools.spec b/rpmtools.spec index 377886d..2e8b3d7 100644 --- a/rpmtools.spec +++ b/rpmtools.spec @@ -1,6 +1,6 @@ Name: rpmtools Version: 1.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Local RPM toolkit BuildArch: noarch @@ -29,6 +29,9 @@ install -m 755 * %{buildroot}/%{_bindir} %{_bindir}/* %changelog +* Fri Mar 15 2013 Hercinger Viktor <hercinger.viktor@gmail.com> - 1.0-3 +- added branch change option to rpmdev-build-devspec + * Wed Mar 13 2013 Hercinger Viktor <hercinger.viktor@gmail.com> - 1.0-2 - added notification to rpmdev-build-devspec - added proxy call to rpmdev-make-repo in rpmdev-build-devspec diff --git a/scripts/rpmdev-build-devspec b/scripts/rpmdev-build-devspec index a5a86bc..d237fcc 100755 --- a/scripts/rpmdev-build-devspec +++ b/scripts/rpmdev-build-devspec @@ -8,6 +8,7 @@ VERBOSE=0 MAKEREPO= NOTIFY=0 ARGS="$0 $@" +BRANCH= MOCKDIR=/var/lib/mock MOCKCONF=/etc/mock @@ -104,6 +105,11 @@ do NOTIFY=1 ;; + --branch) + BRANCH=$1 + shift + ;; + -h|--help) echo "Build SPEC file from a package in $PACKAGE_PATH_BASE @@ -111,6 +117,7 @@ usage: $0 [ options ] < package name > options: -b --build Specify output for source/built RPMs (default: $DESTDIR) + --branch Change branch before building -c --clean Clean build directory before building -d --dist Specify distribution (mock profile name) (default: $DIST) --list-pkgs List packages that can be built @@ -188,6 +195,20 @@ do continue fi + if [ "x$BRANCH" = "x" ] + then + cd $PACKAGE_PATH + git checkout $BRANCH + CODE=$? + cd - + + if [ $CODE -ne 0 ] + then + echo "$PACKAGE_PATH has no branch $BRANCH; skipping" >&2 + continue + fi + fi + mock --buildsrpm --spec $SPECFILE --sources $PACKAGE_PATH -r $DIST if [ $? -ne 0 ] then |