From 0e5c8d165f908859733bd146d193b5c6125e7e7c Mon Sep 17 00:00:00 2001 From: Jakub Skoczen Date: Thu, 8 Jul 2010 10:51:31 -0400 Subject: [PATCH] Take the spec file as a parameter instead of looking for it in the pwd --- id-rpm-build/upload-rpms.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/id-rpm-build/upload-rpms.sh b/id-rpm-build/upload-rpms.sh index 4f952f1..6cbe525 100755 --- a/id-rpm-build/upload-rpms.sh +++ b/id-rpm-build/upload-rpms.sh @@ -2,19 +2,22 @@ BUILD_DIR=${BUILD_DIR:=/usr/src/redhat/} PWD=`pwd` UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub} UPLOAD_HOST=${UPLOAD_HOST:=flurry} -UPLOAD_DIR=${UPLOAD_DIR:=`basename $PWD`} -UPLOAD_URI=${UPLOAD_HOST}:${UPLOAD_PATH}/${UPLOAD_DIR} DISTRO=${DISTRO:="centos/5.5"} -project=`basename $PWD` -if test ! -f ${project}.spec; then - echo "Missing ${project}.spec file. Are you in the project directory?" +specfile=$1 +if test ! -f ${specfile}; then + echo "Missing .spec file argument." exit 1 fi if test ! -x /bin/rpm; then echo "$0: /bin/rpm missing. Install rpm" exit 1 fi -pkg_names=`rpm -q --specfile ${project}.spec` +pkg_names=`rpm -q --specfile ${specfile}` +pkg_short=`rpm -q --specfile ${specfile} --queryformat "%{NAME};" | cut -d ";" -f1` + +UPLOAD_DIR=${UPLOAD_DIR:=${pkg_short}} +UPLOAD_URI=${UPLOAD_HOST}:${UPLOAD_PATH}/${UPLOAD_DIR} +echo "Uploading to ${UPLOAD_URI}..." inc_src=true if test ! -d ${BUILD_DIR}/SRPMS; then echo "No SRPMS dir under ${BUILD_DIR}" -- 1.7.10.4