X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=id-rpm-build%2Fupload-rpms.sh;h=bc4e6c7b55be33a89328b05e314dde06584b0e96;hb=9177e0d92f8b36d347bf89ec638f0c2c7787daf9;hp=6cbe525d757e24b297ccd955ed0d9efa26d15e9a;hpb=0e5c8d165f908859733bd146d193b5c6125e7e7c;p=git-tools-moved-to-github.git diff --git a/id-rpm-build/upload-rpms.sh b/id-rpm-build/upload-rpms.sh index 6cbe525..bc4e6c7 100755 --- a/id-rpm-build/upload-rpms.sh +++ b/id-rpm-build/upload-rpms.sh @@ -1,10 +1,9 @@ -BUILD_DIR=${BUILD_DIR:=/usr/src/redhat/} +#!/bin/sh PWD=`pwd` UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub} -UPLOAD_HOST=${UPLOAD_HOST:=flurry} -DISTRO=${DISTRO:="centos/5.5"} +UPLOAD_HOST=${UPLOAD_HOST:=ftp.indexdata.dk} specfile=$1 -if test ! -f ${specfile}; then +if test ! -f "${specfile}"; then echo "Missing .spec file argument." exit 1 fi @@ -12,7 +11,20 @@ if test ! -x /bin/rpm; then echo "$0: /bin/rpm missing. Install rpm" exit 1 fi -pkg_names=`rpm -q --specfile ${specfile}` +if test ! -f /etc/redhat-release; then + echo "/etc/redhat-release missing" + exit 1 +fi +if test -z "$DISTRO"; then + if grep 'release 6' /etc/redhat-release >/dev/null; then + DISTRO="centos/6" + else + DISTRO="centos/5.5" + fi +fi +topdir=`rpm --eval "%{_topdir}"` +BUILD_DIR=${BUILD_DIR:=${topdir}} +pkg_names=`rpm -q --specfile ${specfile} --queryformat "%{NAME}-%{VERSION}-%{RELEASE}\n"` pkg_short=`rpm -q --specfile ${specfile} --queryformat "%{NAME};" | cut -d ";" -f1` UPLOAD_DIR=${UPLOAD_DIR:=${pkg_short}}