From be493b06c00d31898b17d3949a5e34def1fb6e6a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] LOCALREPO and ARCHES are now specified externally. Also fix exit bug. --- smock/README | 2 -- smock/smock.sh | 11 ++++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/smock/README b/smock/README index 6a4a235..54e923d 100644 --- a/smock/README +++ b/smock/README @@ -14,8 +14,6 @@ set of dependant RPMs against an external distro. - Insert smock.mock.extra to all your repos in /etc/mock/ changing the USERNAME, arch and distro name to match - - Copy smock.sh to smock and edit which arch(es) you want to build on - - Disable SELinux (/usr/sbin/setenforce Permissive) and you may need to do 'chmod 0755 ~' to allow the web server to access your home directory. diff --git a/smock/smock.sh b/smock/smock.sh index 278a85d..013aa3e 100755 --- a/smock/smock.sh +++ b/smock/smock.sh @@ -1,9 +1,10 @@ #!/bin/sh - -LOCALREPO=$HOME/public_html/smock/yum -ARCHES="i386 x86_64" -#ARCHES="i386" +if [ -z "$LOCALREPO" -o -z "$ARCHES" ]; then + echo '$LOCALREPO must point to local repository' + echo '$ARCHES must contain list of architectures to build' + exit 1 +fi help() { echo "syntax: $0 DIST SRPM" @@ -57,7 +58,7 @@ do if [ $? != 0 ]; then echo "Build failed, leaving logs in $LOCALREPO/scratch" - exit $? + exit 1 fi mv $LOCALREPO/scratch/*.src.rpm $LOCALREPO/$DIST/src/SRPMS mv $LOCALREPO/scratch/*.rpm $LOCALREPO/$DIST/$ARCH/RPMS -- 1.8.3.1