X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;ds=sidebyside;f=id-deb-build%2Fid-pbuild.sh;h=a8206a1068835c06e35d3273f62a5e6131482536;hb=29173ecea568654e0e1318687126203b21b1f24f;hp=78a9d5d64c92c5c2b3b61eee69212c70d4b98a31;hpb=4d54dad68634d1710a8f32b0c3a11026968eeb33;p=git-tools-moved-to-github.git diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh index 78a9d5d..a8206a1 100755 --- a/id-deb-build/id-pbuild.sh +++ b/id-deb-build/id-pbuild.sh @@ -32,16 +32,15 @@ while test $# -gt 0; do -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac - case $1 in --debian=*) - DEBIAN_DIST=$optarg + DEBIAN_DIST_A=$optarg ;; --ubuntu=*) - UBUNTU_DIST=$optarg + UBUNTU_DIST_A=$optarg ;; --centos=*) - CENTOS_DIST=$optarg + CENTOS_DIST_A=$optarg ;; --upload) upload=true @@ -55,10 +54,16 @@ while test $# -gt 0; do -*) do_help=yes ;; - esac + esac shift done +if test "$DEBIAN_DIST_A" -o "$UBUNTU_DIST_A" -o "$CENTOS_DIST_A"; then + DEBIAN_DIST=$DEBIAN_DIST_A + UBUNTU_DIST=$UBUNTU_DIST_A + CENTOS_DIST=$CENTOS_DIST_A +fi + if test "$do_help" = "yes"; then usage 1 1>&2 fi @@ -83,9 +88,7 @@ if test ! -x $MKDEBSRC; then exit 1 fi -if $upload; then - : -else +if ! $upload; then if $debian; then if test "${SUDO_USER}"; then if test ! -d deb-src; then @@ -164,9 +167,7 @@ if $upload; then for dist in ${CENTOS_DIST}; do arch=amd64 prodver=${PRODUCT}-${VERSION} - if scp ${ID_DEB_BUILD}/../id-rpm-build/upload-rpms.sh ${dist}:rpmbuild/SOURCES/${prodver}/; then - : - else + if ! scp ${ID_DEB_BUILD}/../id-rpm-build/upload-rpms.sh ${dist}:rpmbuild/SOURCES/${prodver}/; then echo "Copy of upload-rpms.sh to $dist failed" exit 1 fi @@ -178,17 +179,32 @@ if $upload; then fi done for dist in ${UBUNTU_DIST}; do - scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist} + ssh ftp.indexdata.dk "mkdir -p /home/ftp/pub/${PRODUCT}/ubuntu/${dist}" + if ! scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist}; then + echo "Upload failed for $dist" + exit 1 + fi done for dist in ${DEBIAN_DIST}; do - scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/debian/${dist} + ssh ftp.indexdata.dk "mkdir -p /home/ftp/pub/${PRODUCT}/debian/${dist}" + if ! scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/debian/${dist}; then + echo "Upload failed for $dist" + exit 1 + fi done - echo "" - echo "====================================================" - echo "APT/YUM should be updated via cron every 15 minutes " - echo " from July 11 2013 and later." - echo "No need to call update archive on kebab" - echo "====================================================" + if test "${CENTOS_DIST}"; then + if ! ssh ftp.indexdata.dk "sudo -n /home/indexdata/proj/git-tools/update-archive/update-yum-archive.sh"; then + echo "update-yum-archive.sh failed" + exit 1 + fi + fi + if test "${UBUNTU_DIST}" -o "${DEBIAN_DIST}"; then + if ! ssh ftp.indexdata.dk "sudo -n /home/indexdata/proj/git-tools/update-archive/update-archive.sh --ubuntu=\"${UBUNTU_DIST}\" --debian=\"${DEBIAN_DIST}\""; then + echo "update-archive.sh failed" + exit 1 + fi + fi + echo "Upload successful - we hope" exit 0 fi