projects
/
git-tools-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix check for whether RPM was uploaded correctly
[git-tools-moved-to-github.git]
/
id-rpm-build
/
upload-rpms.sh
diff --git
a/id-rpm-build/upload-rpms.sh
b/id-rpm-build/upload-rpms.sh
index
7b6c209
..
2585586
100755
(executable)
--- a/
id-rpm-build/upload-rpms.sh
+++ b/
id-rpm-build/upload-rpms.sh
@@
-1,9
+1,9
@@
+#!/bin/sh
PWD=`pwd`
UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub}
PWD=`pwd`
UPLOAD_PATH=${UPLOAD_PATH:=/home/ftp/pub}
-UPLOAD_HOST=${UPLOAD_HOST:=kebab}
-DISTRO=${DISTRO:="centos/5.5"}
+UPLOAD_HOST=${UPLOAD_HOST:=ftp.indexdata.dk}
specfile=$1
specfile=$1
-if test ! -f ${specfile}; then
+if test ! -f "${specfile}"; then
echo "Missing .spec file argument."
exit 1
fi
echo "Missing .spec file argument."
exit 1
fi
@@
-11,9
+11,20
@@
if test ! -x /bin/rpm; then
echo "$0: /bin/rpm missing. Install rpm"
exit 1
fi
echo "$0: /bin/rpm missing. Install rpm"
exit 1
fi
+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}}
topdir=`rpm --eval "%{_topdir}"`
BUILD_DIR=${BUILD_DIR:=${topdir}}
-pkg_names=`rpm -q --specfile ${specfile}`
+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}}
pkg_short=`rpm -q --specfile ${specfile} --queryformat "%{NAME};" | cut -d ";" -f1`
UPLOAD_DIR=${UPLOAD_DIR:=${pkg_short}}
@@
-31,21
+42,24
@@
if test ! -d ${BUILD_DIR}/RPMS; then
fi
for pkg in ${pkg_names}; do
fi
for pkg in ${pkg_names}; do
+ copy=false
if $inc_src; then
if $inc_src; then
- if test ! -f ${BUILD_DIR}/SRPMS/${pkg}.src.rpm; then
- echo "No SRPM for ${pkg}"
- else
+ if test -f ${BUILD_DIR}/SRPMS/${pkg}.src.rpm; then
scp ${BUILD_DIR}/SRPMS/${pkg}.src.rpm ${UPLOAD_URI}/redhat/${DISTRO}/SRPMS/
scp ${BUILD_DIR}/SRPMS/${pkg}.src.rpm ${UPLOAD_URI}/redhat/${DISTRO}/SRPMS/
- fi
- fi
+ copy=true
+ fi
+ fi
if $inc_bin; then
for dir in ${BUILD_DIR}/RPMS/*; do
arch=`basename ${dir}`
if test -f ${dir}/${pkg}.${arch}.rpm; then
if $inc_bin; then
for dir in ${BUILD_DIR}/RPMS/*; do
arch=`basename ${dir}`
if test -f ${dir}/${pkg}.${arch}.rpm; then
+ copy=true
scp ${dir}/${pkg}.${arch}.rpm ${UPLOAD_URI}/redhat/${DISTRO}/RPMS/${arch}/
scp ${dir}/${pkg}.${arch}.rpm ${UPLOAD_URI}/redhat/${DISTRO}/RPMS/${arch}/
- else
- echo "No ${pkg} in arch ${arch}"
fi
done
fi
done
+ if ! $copy; then
+ echo "FAILED: No RPM copied for: ${pkg}"
+ exit 1
+ fi
fi
done
fi
done