From 72744c9274452c13f54e71c8f3a224bdcee3fda8 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Thu, 28 May 2009 13:49:48 +0000 Subject: [PATCH] simplify .src.rpm handling a bit (bnc#500397) --- build | 24 ++++++++++++------------ unrpm | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build b/build index 015577d..2bcfbef 100755 --- a/build +++ b/build @@ -887,26 +887,22 @@ for SPECFILE in "${SPECFILES[@]}" ; do } if test "$SPECFILE" != "${SPECFILE%.src.rpm}" ; then - echo processing src rpm `pwd`/$SPECFILE... - TOPDIR=`rpm --eval '%_topdir'` - rm -rf $BUILD_ROOT$TOPDIR - mkdir -p $BUILD_ROOT$TOPDIR/SOURCES $BUILD_ROOT$TOPDIR/SPECS - rpm -i --nodigest --nosignature --root $BUILD_ROOT $SPECFILE || { + echo processing src rpm $SRCDIR/$SPECFILE ... + MYSRCDIR=$BUILD_ROOT/.build-srcdir + rm -rf $MYSRCDIR + mkdir -p $MYSRCDIR + cd $MYSRCDIR || cleanup_and_exit 1 + $BUILD_DIR/unrpm -q $SRCDIR/$SPECFILE || { echo "could not install $SPECFILE." cleanup_and_exit 1 } - rm -rf $BUILD_ROOT/.build-srcdir - mkdir -p $BUILD_ROOT/.build-srcdir - mv $BUILD_ROOT$TOPDIR/SOURCES/* $BUILD_ROOT/.build-srcdir - mv $BUILD_ROOT$TOPDIR/SPECS/* $BUILD_ROOT/.build-srcdir - MYSRCDIR=$BUILD_ROOT/.build-srcdir - cd $MYSRCDIR || cleanup_and_exit 1 for SPECFILE in *.spec ; do : ; done else - echo processing specfile `pwd`/$SPECFILE... MYSRCDIR="$SRCDIR" fi + echo processing specfile $MYSRCDIR/$SPECFILE ... + ADDITIONAL_PACKS="" test -n "$BUILD_EXTRA_PACKS" && ADDITIONAL_PACKS="$ADDITIONAL_PACKS $BUILD_EXTRA_PACKS" test -n "$CREATE_BASELIBS" && ADDITIONAL_PACKS="$ADDITIONAL_PACKS build" @@ -955,6 +951,10 @@ for SPECFILE in "${SPECFILES[@]}" ; do cp -p "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir fi MYSRCDIR=$BUILD_ROOT/.build-srcdir + else + # cwd is at $BUILD_ROOT/.build-srcdir which we want to + # umount later so step aside + cd "$SRCDIR" fi Q="'\''" echo "SPECFILE='${SPECFILE//"'"/$Q}'" > $BUILD_ROOT/.build/build.data diff --git a/unrpm b/unrpm index 90e8d69..6b51b56 100755 --- a/unrpm +++ b/unrpm @@ -2,7 +2,7 @@ # function Usage () { - echo "Usage: $(basename $0) [-v] rpm-files..."; + echo "Usage: $(basename $0) [-vq] rpm-files..."; echo "Unpack rpm files in current directory."; exit 1 } -- 2.7.4