skip unnecessary steps for product building which costs lot of time and IO.
authorAdrian Schröter <adrian@suse.de>
Tue, 8 Dec 2009 09:35:41 +0000 (10:35 +0100)
committerAdrian Schröter <adrian@suse.de>
Tue, 8 Dec 2009 09:35:41 +0000 (10:35 +0100)
build

diff --git a/build b/build
index 1e0693d..0988b87 100755 (executable)
--- a/build
+++ b/build
@@ -1544,7 +1544,10 @@ for SPECFILE in "${SPECFILES[@]}" ; do
     fi
 
     if test "$BUILDTYPE" = kiwi ; then
-        # run createrepo on the repositories
+        imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE imagetype)
+        imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE filename)
+        imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE version)
+        # prepare rpms as source and createrepo on the repositories
         if test -d $BUILD_ROOT/$TOPDIR/SOURCES/repos ; then
             (
             ln -sf $TOPDIR/SOURCES/repos $BUILD_ROOT/repos
@@ -1562,8 +1565,10 @@ for SPECFILE in "${SPECFILES[@]}" ; do
                     ln -s $rl$r "${rc%/*}/${rc##*/}"
                     repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
                 fi
-                echo "creating repodata for $repo"
-                chroot $BUILD_ROOT createrepo "$repo"
+                if test "$imagetype" != product ; then
+                    echo "creating repodata for $repo"
+                    chroot $BUILD_ROOT createrepo "$repo"
+                fi
             done
             )
         fi
@@ -1602,9 +1607,6 @@ for SPECFILE in "${SPECFILES[@]}" ; do
         fi
         rm -f $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
         ln -s $SPECFILE $BUILD_ROOT/$TOPDIR/SOURCES/config.xml
-        imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE imagetype)
-        imagename=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE filename)
-        imageversion=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show $BUILD_ROOT/$TOPDIR/SOURCES/$SPECFILE version)
         chroot $BUILD_ROOT su -c "kiwi --version" -
         if test "$imagetype" = product ; then
             echo "running kiwi --create-instsource..."