From 749c6ddd5bd33e3c9e7117f67155f866576e4ace Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Thu, 27 Sep 2012 19:10:28 +0200 Subject: - rework progress info patch a bit, disable reuse of cached packages for now (have to check for the correct package somehow) --- init_buildsystem | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/init_buildsystem b/init_buildsystem index 8238f60..9b39588 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -712,6 +712,7 @@ else PACKAGES_FROM_PREINSTALLIMAGE= GUESSED_DIST=unknown mkdir -p $BUILD_ROOT/.init_b_cache/rpms + rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download while read PKG SRC ; do if test "$PKG" = "preinstall:" ; then PACKAGES_TO_PREINSTALL=$SRC @@ -766,45 +767,34 @@ else PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PKG" continue fi + PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PKG" if [ "${SRC#/}" = "$SRC" ]; then - url="$SRC" - case "$url" in + case "$SRC" in zypp://* | http://* | https://* | ftp://* | ftps://*) - 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 "$PKG $SRC" >>$BUILD_ROOT/.init_b_cache/rpmlist.download + continue ;; *) - echo "unsupported url for '$PKG': $url" >&2 + echo "unsupported url for '$PKG': $SRC" >&2 cleanup_and_exit 1 ;; esac - # downloadpkg modified $SRC, so it has a right name for use fi SRCSUF=${SRC/%.pkg.tar.?z/.arch} 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 + # now do the download of missing packages + if test -s $BUILD_ROOT/.init_b_cache/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 + # downloadpkg modified $SRC, so it has a right name for use + SRCSUF=${SRC/%.pkg.tar.?z/.arch} + ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/$PKG.${SRCSUF##*.}" + done < $BUILD_ROOT/.init_b_cache/rpmlist.download + rm -f $BUILD_ROOT/.init_b_cache/rpmlist.download printf "\n" fi -- cgit v1.2.3