diff options
author | Zhang Qiang <qiang.z.zhang@intel.com> | 2012-08-11 07:51:17 +0800 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-09-27 18:52:21 +0200 |
commit | 86740a80d979bf731e27b6c478f2463115e5360f (patch) | |
tree | a140e0624f151d86e403d039030236e6da74ca13 | |
parent | edc2384729f2d3acf156f582409d5915ccae0861 (diff) | |
download | obs-build-86740a80d979bf731e27b6c478f2463115e5360f.tar.gz obs-build-86740a80d979bf731e27b6c478f2463115e5360f.tar.bz2 obs-build-86740a80d979bf731e27b6c478f2463115e5360f.zip |
Refine download progress info
-rwxr-xr-x | init_buildsystem | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/init_buildsystem b/init_buildsystem index d4a87ff..8238f60 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -770,7 +770,18 @@ else url="$SRC" case "$url" in zypp://* | http://* | https://* | ftp://* | ftps://*) - downloadpkg "$url" + cachedir="$(getcachedir "$url")" + pkgname="$(basename "$url")" + pkgname=${pkgname/%.pkg.tar.?z/.arch} + rpmpkg="$cachedir/$pkgname" + if [ -e $rpmpkg ] + then + rpm -K --nosignature "$rpmpkg" > $rpmpkg.v || echo "$PKG $SRC" >>${RPMLIST}.download + rpm -K --nosignature "$rpmpkg" > $rpmpkg.v && downloadpkg "$url" + rm -f $rpmpkg.v + else + echo "$PKG $SRC" >>${RPMLIST}.download + fi ;; *) echo "unsupported url for '$PKG': $url" >&2 @@ -783,6 +794,19 @@ else ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PKG" done < $RPMLIST + if [ -e ${RPMLIST}.download ] + then + PACKAGES_TO_DOWNLOAD=`cat ${RPMLIST}.download|awk '{print $2}'` + progress_setup PACKAGES_TO_DOWNLOAD + while read PKG SRC ; do + progress_step PACKAGES_TO_DOWNLOAD + downloadpkg "$SRC" + rm -f "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRC##*.}" + ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRC##*.}" + done < ${RPMLIST}.download + rm ${RPMLIST}.download -f + printf "\n" + fi test -n "$PACKAGES_TO_CBPREINSTALL" && echo "cbpreinstall: $PACKAGES_TO_CBPREINSTALL" test -n "$PACKAGES_TO_CBINSTALL" && echo "cbinstall : $PACKAGES_TO_CBINSTALL" @@ -852,6 +876,7 @@ if test ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rp progress_step PACKAGES_TO_PREINSTALL_FILTERED preinstall ${PKG##*/} done + printf "\n" if test -n "$PREPARE_VM" ; then PACKAGES_TO_VMINSTALL_FILTERED=`reorder $PACKAGES_TO_VMINSTALL_FILTERED` progress_setup PACKAGES_TO_VMINSTALL_FILTERED |