X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=id-rpm-build%2Fupload-rpms.sh;h=7b6c2092674af56c6bfdc7b3a8b476a46a22c416;hb=61ccccd556208dab55c8031de69887d8c00ac31c;hp=471d249427dc343577a53f6582647086c110bb59;hpb=4daa435a1c71f35a6ee193895c92bb975ac326be;p=git-tools-moved-to-github.git diff --git a/id-rpm-build/upload-rpms.sh b/id-rpm-build/upload-rpms.sh index 471d249..7b6c209 100755 --- a/id-rpm-build/upload-rpms.sh +++ b/id-rpm-build/upload-rpms.sh @@ -1,20 +1,24 @@ -BUILD_DIR=/usr/src/redhat/ PWD=`pwd` -UPLOAD_PATH=/home/ftp/pub -UPLOAD_HOST=flurry -UPLOAD_DIR=`basename $PWD` -UPLOAD_URI=${UPLOAD_HOST}:${UPLOAD_PATH}/${UPLOAD_DIR} -DISTRO="centos/5.5" -project=`basename $PWD` -if test ! -f ${project}.spec; then - echo "Missing ${project}.spec file. Are you in the project directory?" +UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub} +UPLOAD_HOST=${UPLOAD_HOST:=kebab} +DISTRO=${DISTRO:="centos/5.5"} +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` +topdir=`rpm --eval "%{_topdir}"` +BUILD_DIR=${BUILD_DIR:=${topdir}} +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}"