From 07a8ec3d84a482a94762d2c8e5ced3c16392cedf Mon Sep 17 00:00:00 2001 From: slakmagik Date: Sat, 19 Feb 2011 21:32:29 +0000 Subject: [PATCH] fix download failure When an http url 301ed to an https and the certificate check failed, sbopkg's certcheck code was not being triggered, causing the download to fail. Thanks to vbatts for raising this issue. --- src/usr/doc/THANKS | 1 + src/usr/sbin/sbopkg | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/usr/doc/THANKS b/src/usr/doc/THANKS index 92eea36..ad18fcd 100644 --- a/src/usr/doc/THANKS +++ b/src/usr/doc/THANKS @@ -70,3 +70,4 @@ apologize. Thank you! 849 chytraeus (bug report) 850 greinze (bug report) 853 Pablo Castano Fernandez (translations) + 863 vbatts (bug report) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 1ae462f..6d9f4e7 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -2880,7 +2880,7 @@ get_source() { local DLDIR=$SBOPKGTMP/sbopkg-download local SBOPKG_PIDLIST=$SBOPKGTMP/sbopkgpidlist local TMPSUMMARYLOG=$SBOPKGTMP/sbopkg-tmp-summarylog - local SRCNAME DL_SRCNAME DL FAILURE MD5CHK i CWD TWGETFLAGS + local SRCNAME DL_SRCNAME DL FAILURE MD5CHK i CWD TWGETFLAGS WGETRC # Don't pollute the environment with the .info content... local PRGNAM VERSION HOMEPAGE DOWNLOAD MD5SUM MAINTAINER EMAIL APPROVED @@ -2928,7 +2928,8 @@ get_source() { if [[ -z $NO_DL_LOOP ]]; then wget $TWGETFLAGS ${DOWNLOAD[$i]} >> $SBOPKGOUTPUT & echo "$!" >> $SBOPKG_PIDLIST 2>> $SBOPKGOUTPUT - wait + wait $! + WGETRC=$? else FAILURE=loop echo " Download failed. Please report this as a bug." >> \ @@ -2944,7 +2945,7 @@ get_source() { NO_DL_LOOP=1 mv "$DL" "$SRCDIR/$DL_SRCNAME" else - if [[ ${DOWNLOAD[$i]} == https://* && + if [[ $WGETRC == 5 && $TWGETFLAGS != *no-check-certificate* ]]; then check_cert_prompt && continue fi