diff options
author | Viktor Hercinger <vhercing@redhat.com> | 2013-02-21 10:23:37 +0100 |
---|---|---|
committer | Viktor Hercinger <vhercing@redhat.com> | 2013-02-21 10:23:37 +0100 |
commit | 9291f990a06a1d31b69938590871fdb75374d182 (patch) | |
tree | cefa2bf971f5ac2b9a18be02e23e48650387fe6a | |
parent | 9982026d375ff7fd94011f61adfab685c8b493e4 (diff) | |
download | rpm-tools-9291f990a06a1d31b69938590871fdb75374d182.tar.gz rpm-tools-9291f990a06a1d31b69938590871fdb75374d182.tar.xz rpm-tools-9291f990a06a1d31b69938590871fdb75374d182.zip |
minor fixes added to rpmdev-build-devspec
-rwxr-xr-x | scripts/rpmdev-build-devspec | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/scripts/rpmdev-build-devspec b/scripts/rpmdev-build-devspec index 5418a9b..8226e90 100755 --- a/scripts/rpmdev-build-devspec +++ b/scripts/rpmdev-build-devspec @@ -4,6 +4,7 @@ DESTDIR=.build CLEAN=0 DIST=fedora-18-local-x86_64 PACKAGE_PATH_BASE=$HOME/devel/specs +VERBOSE=0 MOCKDIR=/var/lib/mock MOCKCONF=/etc/mock @@ -59,6 +60,10 @@ do exit 0 ;; + -v|--verbose) + VERBOSE=1 + ;; + -h|--help) echo "Build SPEC file from a package in $PACKAGE_PATH_BASE @@ -70,6 +75,7 @@ options: -d --dist Specify distribution (mock profile name) (default: $DIST) --list-pkgs List packages that can be built --list-dists List available distributions + -v --verbose Enable verbose run -h --help Show this help file" exit 1 @@ -93,19 +99,24 @@ done [ "x$PACKAGES" = "x" ] && die Missing package name -#set -x +[ $VERBOSE -ne 0 ] && set -x if [ $CLEAN -eq 1 ] then rm -rf $DESTDIR/* fi -if [ ! -d $DESTDIR ] +if [ -e $DESTDIR ] then - mkdir -p $REPODIR -elif [ ! -w $REPODIR ] -then - die "You don't have access to $REPODIR" + if [ ! -d $DESTDIR ] + then + die "$DESTDIR not a directory" + fi + + if [ ! -w $DESTDIR ] + then + die "You don't have access to $DESTDIR" + fi fi mkdir -p $DESTDIR/srpm |