Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 602467 Details for
Bug 845848
rhts-devel scripts fail when path name contains space character
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Single file patch for rhts scripts
rhts.patch (text/plain), 21.06 KB, created by
David Kaspar (Old account - do not use)
on 2012-08-06 08:44:52 UTC
(
hide
)
Description:
Single file patch for rhts scripts
Filename:
MIME Type:
Creator:
David Kaspar (Old account - do not use)
Created:
2012-08-06 08:44:52 UTC
Size:
21.06 KB
patch
obsolete
>diff -urNp rhts.old/rhts-mk-build-package rhts.new/rhts-mk-build-package >--- rhts.old/rhts-mk-build-package 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-build-package 2012-08-05 17:36:13.705682312 +0200 >@@ -16,9 +16,9 @@ > > # Build an RHTS package from a CVS or Subversion working copy of the test > >-progname=$0 >+progname="$0" > >-function usage () { >+function usage { > cat <<EOF > Usage: $progname [-a] [-d directory] [-b] [-s testserver] > Build an RHTS package of tests from the source tree "directory" >@@ -32,14 +32,14 @@ EOF > exit 0 > } > >-SOURCE_DIR=`pwd` >+SOURCE_DIR="$(pwd)" > ABI_OPTIONS="" > > while getopts "d:s:bah" opt; do > case $opt in > >- d ) SOURCE_DIR=$OPTARG ;; >- s ) TESTSERVER=$OPTARG ;; >+ d ) SOURCE_DIR="$OPTARG" ;; >+ s ) TESTSERVER="$OPTARG" ;; > b ) BEAKER="BEAKER" ;; > a ) ABI_OPTIONS="--strict-abi" ;; > h ) echo "found $opt" ; usage ;; >@@ -50,11 +50,11 @@ done > shift $(($OPTIND - 1)) > > >-NAME=`rhts-mk-get-test-package-name $SOURCE_DIR` >-CURRENT_TAG=`rhts-mk-get-current-tag $SOURCE_DIR` >+NAME="$(rhts-mk-get-test-package-name "$SOURCE_DIR")" >+CURRENT_TAG="$(rhts-mk-get-current-tag "$SOURCE_DIR")" > >-VERSION=`rhts-mk-get-version-info -v $CURRENT_TAG` >-RELEASE=`rhts-mk-get-version-info -r $CURRENT_TAG` >+VERSION="$(rhts-mk-get-version-info -v "$CURRENT_TAG")" >+RELEASE="$(rhts-mk-get-version-info -r "$CURRENT_TAG")" > echo " CURRENT_TAG: $CURRENT_TAG" > echo " NAME: $NAME" > echo " VERSION: $VERSION" >@@ -62,42 +62,42 @@ echo " RELEASE: $RELEASE" > echo " SOURCE_DIR: $SOURCE_DIR" > > # TMP_DIR: do everything for this run under a unique temp directory >-TMP_DIR=`mktemp -d /mnt/testarea/rhts-build-XXXXXXXX` || exit 1 >+TMP_DIR="$(mktemp -d /mnt/testarea/rhts-build-XXXXXXXX)" || exit 1 > echo " TMP_DIR: $TMP_DIR" > > # BUILD_DIR: the build directory for rpmbuild operations (to avoid needing root permission) >-BUILD_DIR=$TMP_DIR/rpm-build >+BUILD_DIR="$TMP_DIR/rpm-build" > echo " BUILD_DIR: $BUILD_DIR" >-mkdir $BUILD_DIR || exit 1 >+mkdir "$BUILD_DIR" || exit 1 > > # GENERATED_SOURCE_DIR: > # this directory will contain the generated specfile and tarball >-GENERATED_SOURCE_DIR=$TMP_DIR/build >+GENERATED_SOURCE_DIR="$TMP_DIR/build" > echo " GENERATED_SOURCE_DIR: $GENERATED_SOURCE_DIR" >-mkdir $GENERATED_SOURCE_DIR || exit 1 >+mkdir "$GENERATED_SOURCE_DIR" || exit 1 > >-# INSTALL_DIR: what is this? >-INSTALL_DIR=$TMP_DIR/install >+# INSTALL_DIR: default installation directory for newly builded package? >+INSTALL_DIR="$TMP_DIR/install" > echo " INSTALL_DIR: $INSTALL_DIR" >-mkdir $INSTALL_DIR || exit 1 >+mkdir "$INSTALL_DIR" || exit 1 > >-BASE_SPECFILE=/usr/share/rhts/lib/rhts-package-tests.spec.in >-GENERATED_SPECFILE=$GENERATED_SOURCE_DIR/$NAME-$VERSION-$RELEASE.spec >-TARBALL=$GENERATED_SOURCE_DIR/$NAME-$VERSION-$RELEASE.tar.gz >-TESTCOVERAGE=$GENERATED_SOURCE_DIR/testcoverage >+BASE_SPECFILE="/usr/share/rhts/lib/rhts-package-tests.spec.in" >+GENERATED_SPECFILE="$GENERATED_SOURCE_DIR/$NAME-$VERSION-$RELEASE.spec" >+TARBALL="$GENERATED_SOURCE_DIR/$NAME-$VERSION-$RELEASE.tar.gz" >+TESTCOVERAGE="$GENERATED_SOURCE_DIR/testcoverage" > > # if we are in git, ensure the tag has been pushed > if git log -1 &>/dev/null ; then > if git config remote.origin.url >/dev/null ; then > echo "Verifying that tag is present in remote: $CURRENT_TAG" >- CURRENT_HASH=$(git show-ref --hash --tags $CURRENT_TAG) >- REMOTE_HASH=$(git ls-remote origin --tags $CURRENT_TAG| awk {'print $1'}) >+ CURRENT_HASH="$(git show-ref --hash --tags "$CURRENT_TAG")" >+ REMOTE_HASH="$(git ls-remote origin --tags "$CURRENT_TAG" | awk {'print $1'})" > if [ "$CURRENT_HASH" != "$REMOTE_HASH" ]; then > if [ -z "$REMOTE_HASH" ]; then >- echo "Error: current tag $CURRENT_TAG is not in remote 'origin'" >- echo "(Hint: git push --tags)" >+ echo "Error: current tag $CURRENT_TAG is not in remote 'origin'" >&2 >+ echo "(Hint: git push --tags)" >&2 > else >- echo "Error: local hash $CURRENT_HASH of tag $CURRENT_TAG is different from remote $REMOTE_HASH" >+ echo "Error: local hash $CURRENT_HASH of tag $CURRENT_TAG is different from remote $REMOTE_HASH" >&2 > fi > exit 1 > fi >@@ -105,42 +105,41 @@ if git log -1 &>/dev/null ; then > fi > > echo "Creating tarball: $TARBALL" >-tar --exclude "CVS" --exclude ".svn" --exclude ".git" --exclude "rhts-.\*\.rpm" -zcvf $TARBALL --directory $SOURCE_DIR . || exit 1 >+tar --exclude "CVS" --exclude ".svn" --exclude ".git" --exclude "rhts-.\*\.rpm" -zcvf "$TARBALL" --directory "$SOURCE_DIR" . || exit 1 > > echo "Gathering testinfo.desc files:" > # Extract tarball to a clean location and run "make testinfo.desc" in each location: >-EXTRACT_DIR=$TMP_DIR/extract-for-metadata >+EXTRACT_DIR="$TMP_DIR/extract-for-metadata" > echo " EXTRACT_DIR: $EXTRACT_DIR" >-mkdir $EXTRACT_DIR || exit $? >-tar -zxvf $TARBALL --directory $EXTRACT_DIR/ || exit $? >-pushd $EXTRACT_DIR >+mkdir "$EXTRACT_DIR" || exit $? >+tar -zxvf "$TARBALL" --directory "$EXTRACT_DIR/" || exit $? >+pushd "$EXTRACT_DIR" > make testinfo.desc || exit $? > popd > > echo "Generating specfile: $GENERATED_SPECFILE" >-find $EXTRACT_DIR -name testinfo.desc | rhts-mk-generate-specfile $ABI_OPTIONS $NAME $VERSION $RELEASE > $GENERATED_SPECFILE || exit $? >+find "$EXTRACT_DIR" -name testinfo.desc | rhts-mk-generate-specfile $ABI_OPTIONS "$NAME" "$VERSION" "$RELEASE" > "$GENERATED_SPECFILE" || exit $? > > echo "Building package:" >-rpmbuild -bb --define "_builddir $BUILD_DIR" --define "_sourcedir $GENERATED_SOURCE_DIR" --define "_rpmdir $INSTALL_DIR" $GENERATED_SPECFILE || exit 1 >+rpmbuild -bb --define "_builddir $BUILD_DIR" --define "_sourcedir $GENERATED_SOURCE_DIR" --define "_rpmdir $INSTALL_DIR" "$GENERATED_SPECFILE" || exit 1 > > #bpeck: if $(TESTSERVER) passed in then submit rpm. > if [ -n "$TESTSERVER" ]; then >- pushd $INSTALL_DIR >+ pushd "$INSTALL_DIR" > for RPM in $(find . -name \*.rpm); do >- rhts-mk-test-import $TESTSERVER $RPM $VERSION-$RELEASE || exit 1 >+ rhts-mk-test-import "$TESTSERVER" "$RPM" "$VERSION-$RELEASE" || exit 1 > done > popd > elif [ -n "$BEAKER" ]; then >- pushd $INSTALL_DIR >+ pushd "$INSTALL_DIR" > for RPM in $(find . -name \*.rpm); do >- bkr task-add $RPM >+ bkr task-add "$RPM" > done > popd > else > #GBN: copy rpm to cwd >- cp $INSTALL_DIR/*/*.rpm . >+ cp "$INSTALL_DIR"/*/*.rpm . > fi > > #rm -rf $TMP_DIR > echo "Finished building test package" >- >diff -urNp rhts.old/rhts-mk-diff-since-last-tag rhts.new/rhts-mk-diff-since-last-tag >--- rhts.old/rhts-mk-diff-since-last-tag 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-diff-since-last-tag 2012-08-05 17:45:11.987681950 +0200 >@@ -16,28 +16,32 @@ > # > # Show differences since the last tag > >+function usage { >+ echo "Usage: rhts-mk-diff-since-last-tag [directory]" >+} >+ > if [ $# -gt 1 ]; then >- usage >+ usage >&2 > exit 1 > fi > > if [ $# == 1 ]; then >- pushd $1 > /dev/null >+ pushd "$1" > /dev/null > fi > >-CURRENT_TAG=`rhts-mk-get-current-tag` >+CURRENT_TAG="$(rhts-mk-get-current-tag)" > > if [ -d "CVS" ]; then >- cvs diff -r $CURRENT_TAG >+ cvs diff -r "$CURRENT_TAG" > fi > > if [ -d ".svn" ]; then >- echo "SVN not supported yet!" >+ echo "Error: SVN not supported yet!" >&2 > exit 1 > fi > > if git log -1 &>/dev/null; then >- git diff $CURRENT_TAG . >+ git diff "$CURRENT_TAG" . > fi > > if [ $# == 1 ]; then >diff -urNp rhts.old/rhts-mk-get-current-tag rhts.new/rhts-mk-get-current-tag >--- rhts.old/rhts-mk-get-current-tag 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-get-current-tag 2012-08-05 18:08:36.871682508 +0200 >@@ -21,33 +21,33 @@ function usage { > } > > if [ $# -gt 1 ]; then >- usage >+ usage >&2 > exit 1 > fi > > if [ $# == 1 ]; then >- pushd $1 > /dev/null >+ pushd "$1" > /dev/null > fi > >-PACKAGE_NAME=`rhts-mk-get-test-package-name` >-CURRENT_VERSION=$(echo $TESTVERSION | sed -e 's/\./_/g') # from the make file. >+PACKAGE_NAME="$(rhts-mk-get-test-package-name)" >+CURRENT_VERSION="$(echo "$TESTVERSION" | sed -e 's/\./_/g')" # from the make file. > CURRENT_TAG="$PACKAGE_NAME-$CURRENT_VERSION-1" > > # for CVS, find the tag with the package name > if [ -d "CVS" ]; then >- CURRENT_TAG=`cvs -Q status -lv | grep -v '^?' | grep -F "${PACKAGE_NAME}" | head -n 1 | awk '{print $1}'` >+ CURRENT_TAG="$(cvs -Q status -lv | grep -v '^?' | grep -F "${PACKAGE_NAME}" | head -n 1 | awk '{print $1}')" > fi > > # for svn, just use the svn repo revision number for the package revision number > if [ -d ".svn" ]; then >- CURRENT_REVISION=`svn info | fgrep "Revision:" | awk '{print $2}'` >+ CURRENT_REVISION="$(svn info | fgrep "Revision:" | awk '{print $2}')" > CURRENT_TAG="$PACKAGE_NAME-$CURRENT_VERSION-$CURRENT_REVISION" > fi > > # for git, do the same thing we do for cvs > if git log -1 &>/dev/null; then >- CURRENT_TAG=$(git for-each-ref --count=1 --sort=-taggerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11-) >- if [ -n "$CURRENT_TAG" -a "$(git cat-file -t refs/tags/${CURRENT_TAG})" != "tag" ] ; then >+ CURRENT_TAG="$(git for-each-ref --count=1 --sort=-taggerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11-)" >+ if [ -n "$CURRENT_TAG" -a "$(git cat-file -t "refs/tags/${CURRENT_TAG}")" != "tag" ] ; then > # As of version 4.33, we create "annotated"/"heavyweight" tags > # so that we can reliably sort by taggerdate above. But if we get > # here, it means we have only found lightweight tags created by >@@ -55,10 +55,10 @@ if git log -1 &>/dev/null; then > # right tag... > if sort --version-sort /dev/null 2>/dev/null >/dev/null ; then > # If we have `sort --version-sort` that works best >- CURRENT_TAG=$(git for-each-ref --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11- | sort --version-sort | tail -n1) >+ CURRENT_TAG="$(git for-each-ref --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11- | sort --version-sort | tail -n1)" > else > # All we can do is sort by commiterdate and hope for the best... >- CURRENT_TAG=$(git for-each-ref --count=1 --sort=-committerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11-) >+ CURRENT_TAG="$(git for-each-ref --count=1 --sort=-committerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11-)" > fi > fi > fi >@@ -67,4 +67,4 @@ if [ $# == 1 ]; then > popd > /dev/null > fi > >-echo $CURRENT_TAG >+echo "$CURRENT_TAG" >diff -urNp rhts.old/rhts-mk-get-next-tag rhts.new/rhts-mk-get-next-tag >--- rhts.old/rhts-mk-get-next-tag 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-get-next-tag 2012-08-05 17:15:12.973682387 +0200 >@@ -16,21 +16,21 @@ > # > # determine the next available package tag for test package > >-PACKAGE_NAME=`rhts-mk-get-test-package-name` >+PACKAGE_NAME="$(rhts-mk-get-test-package-name)" > >-CURRENT_TAG=`rhts-mk-get-current-tag` >+CURRENT_TAG="$(rhts-mk-get-current-tag)" > > # Note: the current version according to the CVS tag can be had via: > # CURRENT_TAG_VERSION=`rhts-mk-get-version-info -v $CURRENT_TAG` > > # Get the current version specified in Makefile, default to 1.0 : >-CURRENT_VERSION=$(echo $TESTVERSION | sed -e 's/\./_/g') >+CURRENT_VERSION="$(echo $TESTVERSION | sed -e 's/\./_/g')" > if [ -z "$CURRENT_VERSION" ]; then > CURRENT_VERSION="1_0" > fi > >-CURRENT_RELEASE=`rhts-mk-get-version-info -r $CURRENT_TAG` >+CURRENT_RELEASE="$(rhts-mk-get-version-info -r $CURRENT_TAG)" > > let "NEXT_RELEASE = CURRENT_RELEASE + 1" > >-echo $PACKAGE_NAME-$CURRENT_VERSION-$NEXT_RELEASE >+echo "$PACKAGE_NAME-$CURRENT_VERSION-$NEXT_RELEASE" >diff -urNp rhts.old/rhts-mk-get-test-package-name rhts.new/rhts-mk-get-test-package-name >--- rhts.old/rhts-mk-get-test-package-name 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-get-test-package-name 2012-08-05 17:46:09.311341067 +0200 >@@ -20,38 +20,38 @@ function usage { > echo "Usage: rhts-mk-get-test-package-name [directory]" > } > if [ $# -gt 1 ]; then >- usage >+ usage >&2 > exit 1 > fi > > if [ $# == 1 ]; then > SOURCE_DIR="$1" > else >- SOURCE_DIR=`pwd` >+ SOURCE_DIR="$(pwd)" > fi > > # are we under cvs? >-if [ -d $SOURCE_DIR/CVS ]; then >- REPO_PATH=`cat $SOURCE_DIR/CVS/Repository | sed -e "s/\//-/g" | sed -e "s/[\.\,\$\:\;\@]/_/g"` >+if [ -d "$SOURCE_DIR"/CVS ]; then >+ REPO_PATH="$(cat "$SOURCE_DIR"/CVS/Repository | sed -e "s/\//-/g" | sed -e "s/[\.\,\$\:\;\@]/_/g")" > REPO_NAME="rh" > PACKAGE_NAME="$REPO_NAME-$REPO_PATH" > fi > > if [ -d "$SOURCE_DIR/.svn" ]; then >- REPO_ROOT=`svn info $SOURCE_DIR | fgrep "Repository Root:" | awk '{print $3}'` >- REPO_NAME=`echo $REPO_ROOT | sed -e "s'svn+ssh://[^@]*@''" | sed -e "s/http[s]\?:\/\///" | sed -e "s/[\.\/]/-/g"` >- PACKAGE_NAME=`svn info $SOURCE_DIR | fgrep "URL:" | awk '{print $2}' | sed -e "s'svn+ssh://[^@]*@''" | sed -e "s/http[s]\?:\/\///" | sed -e "s/[\.\/]/-/g"` >+ REPO_ROOT="$(svn info "$SOURCE_DIR" | fgrep "Repository Root:" | awk '{print $3}')" >+ REPO_NAME="$(echo "$REPO_ROOT" | sed -e "s'svn+ssh://[^@]*@''" | sed -e "s/http[s]\?:\/\///" | sed -e "s/[\.\/]/-/g")" >+ PACKAGE_NAME="$(svn info "$SOURCE_DIR" | fgrep "URL:" | awk '{print $2}' | sed -e "s'svn+ssh://[^@]*@''" | sed -e "s/http[s]\?:\/\///" | sed -e "s/[\.\/]/-/g")" > # Shorten package names for the 108 repo: >- PACKAGE_NAME=`echo $PACKAGE_NAME | sed -e "s/testing-108-redhat-com-svn-testing-trunk-rhts-tests-promoted/tc/"` >- PACKAGE_NAME=`echo $PACKAGE_NAME | sed -e "s/testing-108-redhat-com-svn-testing-trunk-rhts-tests-sandbox/tc-sandbox/"` >+ PACKAGE_NAME="$(echo "$PACKAGE_NAME" | sed -e "s/testing-108-redhat-com-svn-testing-trunk-rhts-tests-promoted/tc/")" >+ PACKAGE_NAME="$(echo "$PACKAGE_NAME" | sed -e "s/testing-107-redhat-com-svn-testing-trunk-rhts-tests-sandbox/tc-sandbox/")" > fi > > if hg root &> /dev/null; then > # Use the directory name (module name) of the original source of this cloned hg repo >- REPO_PATH=`echo $TEST | sed -e "s|/|-|g"` >- REPO_ROOT=`hg root` >- REPO_URL=`sed -rn 's|^default *=||p' $REPO_ROOT/.hg/hgrc` >- REPO_NAME=`basename $REPO_URL` >+ REPO_PATH="$(echo "$TEST" | sed -e "s|/|-|g")" >+ REPO_ROOT="$(hg root)" >+ REPO_URL="$(sed -rn 's|^default *=||p' "$REPO_ROOT"/.hg/hgrc)" >+ REPO_NAME="$(basename "$REPO_URL")" > if [ -n "$REPO_NAME" ]; then > # ignore local repos > PACKAGE_NAME="$REPO_NAME$REPO_PATH" >@@ -59,10 +59,10 @@ if hg root &> /dev/null; then > fi > > if git log -1 &> /dev/null; then >- REPO_PATH=`echo $TEST | sed -e "s|/|-|g"` >- REPO_REMOTE=`git config --get branch.master.remote` >- REPO_URL=`git config --get remote.$REPO_REMOTE.url` >- REPO_NAME=`basename $REPO_URL | sed -e 's/\.git$//'` >+ REPO_PATH="$(echo "$TEST" | sed -e "s|/|-|g")" >+ REPO_REMOTE="$(git config --get branch.master.remote)" >+ REPO_URL="$(git config --get remote."$REPO_REMOTE".url)" >+ REPO_NAME="$(basename "$REPO_URL" | sed -e 's/\.git$//')" > if [ -n "$REPO_NAME" ]; then > # ignore local repos > PACKAGE_NAME="$REPO_NAME$REPO_PATH" >@@ -74,7 +74,7 @@ if [ -z "$PACKAGE_NAME" ]; then > # use the TEST variable name to create a path. > # This is really intended to be used from "make rpm", rather that > # called independently >- REPO_PATH=`echo $TEST | sed -e "s/\//-/g"` >+ REPO_PATH="$(echo "$TEST" | sed -e "s/\//-/g")" > REPO_NAME="tmp" > PACKAGE_NAME="$REPO_NAME$REPO_PATH" > fi >diff -urNp rhts.old/rhts-mk-get-version-info rhts.new/rhts-mk-get-version-info >--- rhts.old/rhts-mk-get-version-info 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-get-version-info 2012-08-05 17:49:39.863192540 +0200 >@@ -18,6 +18,10 @@ > > # usage: get_version_info [-v | -r] [<rcs tag>] > >+function usage { >+ echo "Usage: rhts-mk-get-version-info [-v | -r] [<rcs tag>]" >+} >+ > OPTION="$1" > TAG="$2" > >@@ -27,19 +31,20 @@ if [ -n "$TESTVERSION" ]; then > else > VERSION="1.0" > fi >+ > RELEASE="0" > > if [ -n "$TAG" ]; then >- VERSION=`echo $TAG | sed -e "s/.*-\([0-9_\.]*\)-\([0-9]*\)$/\1/" | sed -e 's/_/\./g'` >- RELEASE=`echo $TAG | sed -e "s/.*-\([0-9]*\)$/\1/"` >+ VERSION="$(echo "$TAG" | sed -e "s/.*-\([0-9_\.]*\)-\([0-9]*\)$/\1/" | sed -e 's/_/\./g')" >+ RELEASE="$(echo "$TAG" | sed -e "s/.*-\([0-9]*\)$/\1/")" > fi > > > if [ "$OPTION" = "-v" ]; then >- echo $VERSION >+ echo "$VERSION" >+elif [ "$OPTION" = "-r" ]; then >+ echo "$RELEASE" >+else >+ usage >&2 >+ exit 1 > fi >- >-if [ "$OPTION" = "-r" ]; then >- echo $RELEASE >-fi >- >diff -urNp rhts.old/rhts-mk-snake-template rhts.new/rhts-mk-snake-template >--- rhts.old/rhts-mk-snake-template 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-snake-template 2012-08-05 17:58:30.868682577 +0200 >@@ -2,66 +2,64 @@ > > METADATA="testinfo.desc" > VERBOSE=0 >-SNAKE_SERVER=${SNAKE_SERVER:-} >-progname=$0 >+SNAKE_SERVER="${SNAKE_SERVER:-}" >+progname="$0" > >-function usage () { >+function usage { > cat <<EOF > Usage: $progname [-v] [-s snakeserver] > Submit a SNAKE template to a snake server. The SNAKE template is indicated > by use of the 'Kickstart' keyword in your $METADATA. The server can be >- specified by using setting the \$SNAKE_SERVER environment variable, or by using >- the -s command-line switch. >+ specified by using setting the \$SNAKE_SERVER environment variable, or by >+ using the -s command-line switch. > EOF >- exit 0 > } > > while getopts "v:s:h" opt; do >- case $opt in >- >- v ) VERBOSE=1 ;; >- s ) SNAKE_SERVER=$OPTARG ;; >- h ) usage ;; >- \?) usage ;; >- esac >+ case $opt in >+ v) VERBOSE=1 ;; >+ s) SNAKE_SERVER="$OPTARG" ;; >+ h) usage; exit 0 ;; >+ ?) usage >&2; exit 1 ;; >+ esac > done > > shift $(($OPTIND - 1)) > > # If needed, build the metadata file >-if [ ! -f $METADATA ]; then >- echo "Buildign $METADATA file" >- make $METADATA || exit $? >+if [ ! -f "$METADATA" ]; then >+ echo "Building $METADATA file" >+ make "$METADATA" || exit $? > fi > > # Does the $METADATA file exist? > if [ -f "$METADATA" ]; then > # Is a kickstart specified in the $METADATA file? >- TEMPLATE=$(grep "^Kickstart:" $METADATA | gawk '{print $2}') >+ TEMPLATE="$(grep "^Kickstart:" $METADATA | gawk '{print $2}')" > if [ -n "$TEMPLATE" ]; then > > echo "Kickstart template '$TEMPLATE' specified" > > # SNAKE_SERVER provided? > if [ -z "$SNAKE_SERVER" ]; then >- echo "No snake server provided." >+ echo "Error: No snake server provided." >&2 > exit -1 > fi > > # snake-ks utility in PATH? >- SNAKEKS=$(which snake-ks) >+ SNAKEKS="$(which snake-ks)" > if [ $? -ne 0 ]; then >- echo "Could not find the 'snake-ks' command in \$PATH" >+ echo "Error: Could not find the 'snake-ks' command in \$PATH" >&2 > exit -1 > fi > > # Does the provided $TEMPLATE file exist? > if [ -f "$TEMPLATE" ]; then > echo "Uploading SNAKE template '$TEMPLATE' to '$SNAKE_SERVER' ..." >- $SNAKEKS -s $SNAKE_SERVER add $TEMPLATE >+ $SNAKEKS -s "$SNAKE_SERVER" add "$TEMPLATE" > exit $? > else >- echo "SNAKE template '$TEMPLATE' not found" >+ echo "Error: SNAKE template '$TEMPLATE' not found" >&2 > echo -1 > fi > else >diff -urNp rhts.old/rhts-mk-tag-release rhts.new/rhts-mk-tag-release >--- rhts.old/rhts-mk-tag-release 2012-06-26 07:55:10.000000000 +0200 >+++ rhts.new/rhts-mk-tag-release 2012-08-05 17:59:47.241683592 +0200 >@@ -18,34 +18,39 @@ > > # only tag the release for CVS and git, since svn uses repo versions for tags > if [ -d CVS ]; then >- NEXT_TAG=`rhts-mk-get-next-tag` >+ NEXT_TAG="$(rhts-mk-get-next-tag)" > > if [ -n "$NEXT_TAG" ]; then >- echo Tagging release as $NEXT_TAG >- cvs tag $NEXT_TAG >+ echo "Tagging release as $NEXT_TAG" >+ cvs tag "$NEXT_TAG" > else >- echo Error: could not determine the next tag >+ echo "Error: could not determine the next tag" >&2 >+ exit 1 > fi > fi > > > if git log -1 &>/dev/null; then >- CURRENT_TAG=`rhts-mk-get-current-tag` >- NEXT_TAG=`rhts-mk-get-next-tag` >+ CURRENT_TAG="$(rhts-mk-get-current-tag)" >+ NEXT_TAG="$(rhts-mk-get-next-tag)" > > if [ -n "$NEXT_TAG" ]; then >+ > if [ -n "$CURRENT_TAG" ]; then >- # Sanity check: is the current tag merged into this branch? >+ # Sanity check: is the current tag merged into this branch? > # Only do this if $CURRENT_TAG is defined. >- if ! git rev-list HEAD | grep -q $(git show-ref --dereference --hash --tags "$CURRENT_TAG" | tail -n 1 | awk {'print $1'}) ; then >- echo "Error: current tag $CURRENT_TAG is not an ancestor of HEAD" >- echo "(Hint: make sure it is merged into this branch)" >- exit 1 >- fi >- fi >- echo Tagging release as $NEXT_TAG >- git tag -m "$NEXT_TAG" $NEXT_TAG >+ if ! git rev-list HEAD | grep -q $(git show-ref --dereference --hash --tags "$CURRENT_TAG" | tail -n 1 | awk {'print $1'}) ; then >+ echo "Error: current tag $CURRENT_TAG is not an ancestor of HEAD" >&2 >+ echo "(Hint: make sure it is merged into this branch)" >&2 >+ exit 1 >+ fi >+ fi >+ >+ echo "Tagging release as $NEXT_TAG" >+ git tag -m "$NEXT_TAG" "$NEXT_TAG" >+ > else >- echo Error: could not determine the next tag >+ echo "Error: could not determine the next tag" >&2 >+ exit 1 > fi > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 845848
:
602386
| 602467 |
733280