Query rpm for topdir location.
authorJakub Skoczen <jakub@indexdata.dk>
Mon, 12 Jul 2010 11:30:51 +0000 (07:30 -0400)
committerJakub Skoczen <jakub@indexdata.dk>
Mon, 12 Jul 2010 11:30:51 +0000 (07:30 -0400)
Instead of assuming /usr/src/redhat as a used may redefined it

id-rpm-build/upload-rpms.sh

index 6cbe525..b535e0d 100755 (executable)
@@ -1,4 +1,3 @@
-BUILD_DIR=${BUILD_DIR:=/usr/src/redhat/}
 PWD=`pwd`
 UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub}
 UPLOAD_HOST=${UPLOAD_HOST:=flurry}
@@ -12,6 +11,8 @@ if test ! -x /bin/rpm; then
         echo "$0: /bin/rpm missing. Install rpm"
         exit 1
 fi
+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`