Hello community,

here is the log from the commit of package build for openSUSE:12.2 checked in 
at 2012-07-02 11:50:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2/build (Old)
 and      /work/SRC/openSUSE:12.2/.build.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "build", Maintainer is "[email protected]"

Changes:
--------
build-mkbaselibs-sle.changes: same change
--- /work/SRC/openSUSE:12.2/build/build.changes 2012-06-25 15:16:10.000000000 
+0200
+++ /work/SRC/openSUSE:12.2/.build.new/build.changes    2012-07-02 
11:50:07.000000000 +0200
@@ -1,0 +2,11 @@
+Mon Jul  2 08:40:26 UTC 2012 - [email protected]
+
+- preinstallimage support added
+
+-------------------------------------------------------------------
+Thu Jun 14 13:54:42 UTC 2012 - [email protected]
+
+- build fixes for Fedora 17
+- syntax error fix for kiwi vmx builds
+
+-------------------------------------------------------------------

Old:
----
  obs-build-2012.06.05.tar.gz

New:
----
  obs-build-2012.07.02.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ build-initvm.spec ++++++
--- /var/tmp/diff_new_pack.l5YXkJ/_old  2012-07-02 11:50:07.000000000 +0200
+++ /var/tmp/diff_new_pack.l5YXkJ/_new  2012-07-02 11:50:07.000000000 +0200
@@ -20,7 +20,7 @@
 Summary:        A Script to Build SUSE Linux RPMs
 License:        GPL-2.0+
 Group:          Development/Tools/Building
-Version:        2012.06.05
+Version:        2012.07.02
 Release:        0
 Source:         obs-build-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ build-mkbaselibs-sle.spec ++++++
--- /var/tmp/diff_new_pack.l5YXkJ/_old  2012-07-02 11:50:07.000000000 +0200
+++ /var/tmp/diff_new_pack.l5YXkJ/_new  2012-07-02 11:50:07.000000000 +0200
@@ -20,7 +20,7 @@
 Summary:        Tools to generate base lib packages
 License:        GPL-2.0+
 Group:          Development/Tools/Building
-Version:        2012.06.05
+Version:        2012.07.02
 Release:        0
 #!BuildIgnore:  build-mkbaselibs
 Provides:       build-mkbaselibs

++++++ build.spec ++++++
--- /var/tmp/diff_new_pack.l5YXkJ/_old  2012-07-02 11:50:07.000000000 +0200
+++ /var/tmp/diff_new_pack.l5YXkJ/_new  2012-07-02 11:50:07.000000000 +0200
@@ -20,7 +20,7 @@
 Summary:        A Script to Build SUSE Linux RPMs
 License:        GPL-2.0+ and GPL-2.0
 Group:          Development/Tools/Building
-Version:        2012.06.05
+Version:        2012.07.02
 Release:        0
 #!BuildIgnore:  build-mkbaselibs
 Source:         obs-build-%{version}.tar.gz

++++++ _service ++++++
--- /var/tmp/diff_new_pack.l5YXkJ/_old  2012-07-02 11:50:07.000000000 +0200
+++ /var/tmp/diff_new_pack.l5YXkJ/_new  2012-07-02 11:50:07.000000000 +0200
@@ -1,6 +1,6 @@
 <services>
   <service name="tar_scm" mode="disabled">
-    <param name="version">2012.06.05</param>
+    <param name="version">2012.07.02</param>
     <param name="url">git://github.com/openSUSE/obs-build.git</param>
     <param name="scm">git</param>
   </service>

++++++ build.dsc ++++++
--- /var/tmp/diff_new_pack.l5YXkJ/_old  2012-07-02 11:50:07.000000000 +0200
+++ /var/tmp/diff_new_pack.l5YXkJ/_new  2012-07-02 11:50:07.000000000 +0200
@@ -1,6 +1,6 @@
 Format: 1.0
 Source: build
-Version: 2012.06.05
+Version: 2012.07.02
 Binary: build
 Maintainer: Adrian Schroeter <[email protected]>
 Architecture: all

++++++ obs-build-2012.06.05.tar.gz -> obs-build-2012.07.02.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/Build/Rpm.pm 
new/obs-build-2012.07.02/Build/Rpm.pm
--- old/obs-build-2012.06.05/Build/Rpm.pm       2012-06-05 16:24:36.000000000 
+0200
+++ new/obs-build-2012.07.02/Build/Rpm.pm       2012-07-02 10:41:12.000000000 
+0200
@@ -539,7 +539,7 @@
       $$nfbline = [$$nfbline, undef ];
     }
   }
-  unshift @subpacks, $ret->{'name'};
+  unshift @subpacks, $ret->{'name'} if defined $ret->{'name'};
   $ret->{'subpacks'} = \@subpacks;
   $ret->{'exclarch'} = $exclarch if defined $exclarch;
   $ret->{'badarch'} = $badarch if defined $badarch;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/Build.pm 
new/obs-build-2012.07.02/Build.pm
--- old/obs-build-2012.06.05/Build.pm   2012-06-05 16:24:36.000000000 +0200
+++ new/obs-build-2012.07.02/Build.pm   2012-07-02 10:41:12.000000000 +0200
@@ -31,6 +31,10 @@
   }
 }
 
+package Build::Features;
+our $preinstallimage = 1;      # on sale now
+package Build;
+
 my $std_macros = q{
 %define nil
 %define ix86 i386 i486 i586 i686 athlon
@@ -267,8 +271,10 @@
       }
     } elsif ($l0 eq 'repotype:') { #type of generated repository data
       $config->{'repotype'} = [ @l ];
-    } elsif ($l0 eq 'type:') { #kind of packaging system (spec, dsc or kiwi)
+    } elsif ($l0 eq 'type:') { #kind of packaging system 
(spec,dsc,arch,kiwi,...)
       $config->{'type'} = $l[0];
+    } elsif ($l0 eq 'binarytype:') { #rpm,deb,arch,...
+      $config->{'binarytype'} = $l[0];
     } elsif ($l0 eq 'patterntype:') { #kind of generated patterns in repository
       $config->{'patterntype'} = [ @l ];
     } elsif ($l0 eq 'release:') {
@@ -307,6 +313,12 @@
       $config->{'type'} = 'UNDEFINED';
     }
   }
+  if (!$config->{'binarytype'}) {
+    $config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec' || 
$config->{'type'} eq 'kiwi';
+    $config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc';
+    $config->{'binarytype'} = 'arch' if $config->{'type'} eq 'arch';
+    $config->{'binarytype'} ||= 'UNDEFINED';
+  }
   # add rawmacros to our macro list
   if ($config->{'rawmacros'} ne '') {
     for my $rm (split("\n", $config->{'rawmacros'})) {
@@ -576,7 +588,7 @@
       if ($pp eq $rn) {
        # debian: unversioned provides do not match
        # kiwi: supports only rpm, so we need to hand it like it
-       next if $config->{'type'} eq 'dsc';
+       next if $config->{'binarytype'} eq 'deb';
        push @p, $rp;
        last;
       }
@@ -597,7 +609,7 @@
       $rr &= 5 unless $pf & 2;
       # verscmp for spec and kiwi types
       my $vv;
-      if ($config->{'type'} eq 'dsc') {
+      if ($config->{'binarytype'} eq 'deb') {
        $vv = Build::Deb::verscmp($pv, $rv, 1);
       } else {
        $vv = Build::Rpm::verscmp($pv, $rv, 1);
@@ -858,13 +870,21 @@
   print "$_\n" for @$x;
 }
 
+sub parse_preinstallimage {
+  return undef unless $do_rpm;
+  my $d = Build::Rpm::parse(@_);
+  $d->{'name'} ||= 'preinstallimage';
+  return $d;
+}
+
 sub parse {
   my ($cf, $fn, @args) = @_;
   return Build::Rpm::parse($cf, $fn, @args) if $do_rpm && $fn =~ /\.spec$/;
   return Build::Deb::parse($cf, $fn, @args) if $do_deb && $fn =~ /\.dsc$/;
   return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ 
/config\.xml$/;
   return Build::Kiwi::parse($cf, $fn, @args) if $do_kiwi && $fn =~ /\.kiwi$/;
-  return Build::Arch::parse($cf, $fn, @args) if $do_arch && $fn =~ /PKGBUILD$/;
+  return Build::Arch::parse($cf, $fn, @args) if $do_arch && $fn =~ 
/(^|\/|-)PKGBUILD$/;
+  return parse_preinstallimage($cf, $fn, @args) if $fn =~ 
/(^|\/|-)_preinstallimage$/;
   return undef;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/build 
new/obs-build-2012.07.02/build
--- old/obs-build-2012.06.05/build      2012-06-05 16:24:36.000000000 +0200
+++ new/obs-build-2012.07.02/build      2012-07-02 10:41:12.000000000 +0200
@@ -72,6 +72,7 @@
 VMDISK_FILESYSTEM=ext3
 # settings are for speed and not data safety, we format anyway on next run
 VMDISK_MOUNT_OPTIONS=__default
+HUGETLBFSPATH=
 MEMSIZE=
 RUNNING_IN_VM=
 RPMLIST=
@@ -281,6 +282,9 @@
   --vm-memory SIZEINMB
               Set amount of RAM for VMs
 
+  --hugetlbfs HUGETLBFSPATH
+              Use hugetlb for memory management, path to mounted hugetlbfs.
+
   --vm-kernel FILE
   --vm-initrd FILE
               Kernel and initrd to use for VM (kvm and qemu only)
@@ -406,8 +410,8 @@
 setupicecream()
 {
     if [ "$icecream" -eq 0 ]; then
-       rm -rf "$BUILD_ROOT"/var/run/icecream
-       rm -f "$BUILD_ROOT"/etc/profile.d/build_icecream.sh
+       rm -rf "$BUILD_ROOT/var/run/icecream"
+       rm -f "$BUILD_ROOT/etc/profile.d/build_icecream.sh"
        return
     fi
 
@@ -437,8 +441,8 @@
        -o "$BUILD_ROOT/usr/bin/as" -nt "$BUILD_ROOT/$icecc_vers" \
        -o "$BUILD_ROOT/lib/libc.so.6" -nt "$BUILD_ROOT/$icecc_vers" ]
     then
-       rm -rf $BUILD_ROOT/var/run/icecream
-       mkdir -p $BUILD_ROOT/var/run/icecream
+       rm -rf "$BUILD_ROOT/var/run/icecream"
+       mkdir -p "$BUILD_ROOT/var/run/icecream"
        if [ -e "$BUILD_ROOT"/usr/bin/create-env ]; then
          createenv=/usr/bin/create-env
        elif [ -e "$BUILD_ROOT"/usr/lib/icecc/icecc-create-env ]; then
@@ -528,8 +532,8 @@
        # use external version
        whichone=" (external)"
        mkbaselibs="/.mkbaselibs/mkbaselibs"
-       rm -rf $BUILD_ROOT/.mkbaselibs
-       mkdir -p $BUILD_ROOT/.mkbaselibs
+       rm -rf "$BUILD_ROOT/.mkbaselibs"
+       mkdir -p "$BUILD_ROOT/.mkbaselibs"
        cp -f $BUILD_DIR/mkbaselibs $BUILD_ROOT/.mkbaselibs/
        if test "$BUILDTYPE" == "dsc" ; then
            cp -f $BUILD_DIR/baselibs_global-deb.conf 
$BUILD_ROOT/.mkbaselibs/baselibs_g.conf
@@ -551,7 +555,7 @@
     do
        chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG 
$line" - $BUILD_USER || cleanup_and_exit 1
     done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
-    rm -rf $BUILD_ROOT/.mkbaselibs
+    rm -rf "$BUILD_ROOT/.mkbaselibs"
 }
 
 copy_oldpackages()
@@ -720,11 +724,11 @@
        cleanup_and_exit 3
     fi
 
-    rm -rf "$BUILD_ROOT"/.build.packages
+    rm -rf "$BUILD_ROOT/.build.packages"
     if [ -z "$VM_TYPE" -a -z "$RUNNING_IN_VM" ]; then
        # don't touch this in VM
-       rm -rf "$BUILD_ROOT"/.build
-       mkdir -p "$BUILD_ROOT"/.build
+       rm -rf "$BUILD_ROOT/.build"
+       mkdir -p "$BUILD_ROOT/.build"
     fi
 }
 
@@ -979,6 +983,10 @@
        BUILD_RPMS=
        shift
       ;;
+      *-hugetlbfs)
+        HUGETLBFSPATH="$ARG"
+       shift
+      ;;
       *-release)
        needarg
        RELEASE="$ARG"
@@ -1266,18 +1274,18 @@
     test -d "$BUILD_ROOT" || cleanup_and_exit 3
     SPECFILE=$SPECFILES # only one specified anyways
     if test "$SPECFILE" != "${SPECFILE%.src.rpm}" ; then
-       rm -rf $BUILD_ROOT/usr/src/packages
+       rm -rf "$BUILD_ROOT/usr/src/packages"
        mkdir -p $BUILD_ROOT/usr/src/packages/SOURCES 
$BUILD_ROOT/usr/src/packages/SPECS
        rpm -i --nodigest --nosignature --root $BUILD_ROOT $SPECFILE || {
           echo "could not install $SPECFILE." 2>&1
-          rm -rf $BUILD_ROOT
+          rm -rf "$BUILD_ROOT"
           cleanup_and_exit 3
        }
        for SPECFILE in $BUILD_ROOT/usr/src/packages/SPECS/*.spec ; do : ; done
     fi
     init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" 
--list-state "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $SPECFILE 
$BUILD_EXTRA_PACKS
     ERR=$?
-    rm -rf $BUILD_ROOT
+    rm -rf "$BUILD_ROOT"
     cleanup_and_exit $ERR
 fi
 
@@ -1405,6 +1413,7 @@
       *.dsc) BUILDTYPE=dsc ;;
       *.kiwi) BUILDTYPE=kiwi ;;
       PKGBUILD) BUILDTYPE=arch ;;
+      _preinstallimage) BUILDTYPE=preinstallimage ;;
     esac
     if test -z "$BUILDTYPE" ; then
        echo "don't know how to build $SPECFILE"
@@ -1432,8 +1441,8 @@
     if test "$SPECFILE" != "${SPECFILE%.src.rpm}" ; then
        echo processing src rpm $SRCDIR/$SPECFILE ...
        MYSRCDIR=$BUILD_ROOT/.build-srcdir
-       rm -rf $MYSRCDIR
-       mkdir -p $MYSRCDIR
+       rm -rf "$MYSRCDIR"
+       mkdir -p "$MYSRCDIR"
        cd $MYSRCDIR || cleanup_and_exit 1
        $BUILD_DIR/unrpm -q $SRCDIR/$SPECFILE || {
            echo "could not install $SPECFILE."
@@ -1483,8 +1492,8 @@
     fi
 
     if test -n "$VM_TYPE" -a -z "$RUNNING_IN_VM"; then
-       rm -rf $BUILD_ROOT/.build
-       mkdir -p $BUILD_ROOT/.build
+       rm -rf "$BUILD_ROOT/.build"
+       mkdir -p "$BUILD_ROOT/.build"
        if test "$DO_INIT" = true ; then
            # do fist stage of init_buildsystem
            rm -f $BUILD_ROOT/.build.success
@@ -1501,8 +1510,8 @@
        # start up xen, rerun ourself
        cp -a $BUILD_DIR/. $BUILD_ROOT/.build
        if ! test "$MYSRCDIR" = $BUILD_ROOT/.build-srcdir ; then
-           rm -rf $BUILD_ROOT/.build-srcdir
-           mkdir $BUILD_ROOT/.build-srcdir
+           rm -rf "$BUILD_ROOT/.build-srcdir"
+           mkdir "$BUILD_ROOT/.build-srcdir"
            if test "$BUILDTYPE" = kiwi ; then
                cp -pRL "$MYSRCDIR"/* $BUILD_ROOT/.build-srcdir
            else
@@ -1668,6 +1677,9 @@
                fi
                if [ "$VM_TYPE" = 'kvm' ]; then
                        KVM_OPTIONS="$KVM_OPTIONS -cpu host"
+                       if [ -n "$HUGETLBFSPATH" ]; then
+                             KVM_OPTIONS="$KVM_OPTIONS -mem-path 
$HUGETLBFSPATH"
+                       fi
                fi
 
                set -- $qemu_bin -no-reboot -nographic -net none $KVM_OPTIONS \
@@ -1707,7 +1719,7 @@
              BUILDSTATUS[02])
                mkdir -p $BUILD_ROOT/.build.packages
                cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
-               echo "build_ extracting built packages..."
+               echo "build: extracting built packages..."
                extractbuild --disk "$VM_IMAGE" --input "$VM_SWAP" --skip 512 
-v || cleanup_and_exit 3
                # create same layout as with plain chroot
                if test "$BUILDTYPE" = spec ; then
@@ -1730,7 +1742,7 @@
                elif test "$BUILDTYPE" = arch ; then
                    mkdir -p ARCHPKGS
                    find . -type f | while read i; do mv "$i" ARCHPKGS/; done
-               else
+               elif test "$BUILDTYPE" = kiwi ; then
                    mkdir -p KIWI
                    find . -type f | while read i; do mv "$i" KIWI/; done
                fi
@@ -1764,6 +1776,7 @@
        test -z "$INCARNATION" && INCARNATION=0
        echo "BUILD_INCARNATION=$INCARNATION" > $BUILD_ROOT/.buildenv
        CREATE_BUILD_BINARIES=
+       test "$BUILDTYPE" = preinstallimage && mkdir -p 
$BUILD_ROOT/.preinstall_image
        egrep '^#[       ]*needsbinariesforbuild[       ]*$' >/dev/null 
<$MYSRCDIR/$SPECFILE && CREATE_BUILD_BINARIES=--create-build-binaries
        set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir 
"$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USE_SYSTEM_QEMU 
$USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$SPECFILE" 
$ADDITIONAL_PACKS
        echo "$* ..."
@@ -1771,9 +1784,12 @@
        check_exit
        # arbitrary limit of 10MB
        if test $((`stat -f -c "%a*%S/1024/1024" $BUILD_ROOT`)) -lt 10; then
-           df -h $BUILD_ROOT
-           echo "build does not work on a completely full filesystem"
-           cleanup_and_exit 1
+            # ensure that old stat is not failing (RHEL4)
+            if df $BUILD_ROOT 2>/dev/null | grep -q "100%"; then
+               df -h $BUILD_ROOT
+               echo "build does not work on a completely full filesystem"
+               cleanup_and_exit 1
+           fi
        fi
        mount -n -tproc none $BUILD_ROOT/proc || true
        mount -n -tdevpts none $BUILD_ROOT/dev/pts
@@ -1781,6 +1797,47 @@
        copy_oldpackages
     fi
 
+    if test "$BUILDTYPE" = preinstallimage ; then
+       echo "creating preinstall image..."
+       test -d "$BUILD_ROOT/.preinstall_image" || cleanup_and_exit 1
+       cd $BUILD_ROOT || cleanup_and_exit 1
+       TAR="tar"
+       if test -x /usr/bin/bsdtar; then
+           TAR="/usr/bin/bsdtar --chroot"
+       fi
+       TOPDIRS=
+       for DIR  in .* * ; do
+         case "$DIR" in
+           .|..) continue ;;
+           .build*) continue ;;
+           .preinstallimage*) continue ;;
+           .srcfiles*) continue ;;
+           .pkgs) continue ;;
+           installed-pkg) continue ;;
+           proc|sys) continue ;;
+         esac
+         TOPDIRS="$TOPDIRS $DIR"
+        done
+       if ! $TAR -czf .preinstallimage.$$.tar.gz --one-file-system $TOPDIRS ; 
then
+           cleanup_and_exit 1
+       fi
+       echo "image created."
+       TOPDIR=/usr/src/packages
+       mkdir -p $BUILD_ROOT$TOPDIR/OTHER
+       rm -f $BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info
+       for PKG in $BUILD_ROOT/.preinstall_image/* ; do
+           PKG=${PKG##*/}
+           read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG
+           test -n "$PKG_HDRMD5" || cleanup_and_exit 1
+           echo "$PKG_HDRMD5  $PKG" >> 
$BUILD_ROOT$TOPDIR/OTHER/preinstallimage.info
+       done
+       mv $BUILD_ROOT/.preinstallimage.$$.tar.gz 
$BUILD_ROOT$TOPDIR/OTHER/preinstallimage.tar.gz
+       rm -f $BUILD_ROOT/.build.packages
+       ln -s ${TOPDIR#/} $BUILD_ROOT/.build.packages
+       test -d "$SRCDIR" && cd "$SRCDIR"
+       continue
+    fi
+
     if test -z "$BUILD_DIST" -a -e "$BUILD_ROOT/.guessed_dist" ; then
        read BUILD_DIST < $BUILD_ROOT/.guessed_dist
     fi
@@ -1821,6 +1878,12 @@
     fi
     test -n "$NOROOTFORBUILD" && BUILD_USER=abuild
 
+    # appliance builds must run as root
+    if test "$BUILDTYPE" = kiwi; then
+      imagetype=$(perl -I$BUILD_DIR -MBuild::Kiwi -e Build::Kiwi::show 
$SPECFILE imagetype)
+      test "$imagetype" = 'product' || BUILD_USER=root
+    fi
+
     if test $BUILD_USER = abuild ; then
        if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
            echo 
"abuild:x:${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash" 
>>$BUILD_ROOT/etc/passwd
@@ -1852,7 +1915,7 @@
        ABUILD_UID=0
        ABUILD_GID=0
        if egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
-           rm -rf $BUILD_ROOT/home/abuild
+           rm -rf "$BUILD_ROOT/home/abuild"
            egrep -v '^abuild:' <$BUILD_ROOT/etc/passwd 
>$BUILD_ROOT/etc/passwd.new
            mv $BUILD_ROOT/etc/passwd.new $BUILD_ROOT/etc/passwd
            egrep -v '^abuild:' <$BUILD_ROOT/etc/group 
>$BUILD_ROOT/etc/group.new
@@ -1898,7 +1961,7 @@
     #
     # now clean up RPM building directories
     #
-    rm -rf $BUILD_ROOT$TOPDIR
+    rm -rf "$BUILD_ROOT$TOPDIR"
     for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS 
BUILDROOT OTHER ; do
        mkdir -p $BUILD_ROOT$TOPDIR/$i
     done
@@ -1945,10 +2008,11 @@
        getmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir 
"$CONFIG_DIR" > $BUILD_ROOT/root/.rpmmacros
        if test -n "$BUILD_DEBUG" ; then
            echo '
-%prep %{?!_suse_insert_debug_package_seen:%?_suse_insert_debug_package}%%prep
-%package 
%{?!_suse_insert_debug_package_seen:%?_suse_insert_debug_package}%%package
+%prep %{?!__debug_package:%?_suse_insert_debug_package}%%prep
+%package %{?!__debug_package:%?_suse_insert_debug_package}%%package
 %_suse_insert_debug_package \
-  %global _suse_insert_debug_package_seen 1 \
+  %global __debug_package 1 \
+  %undefine _enable_debug_packages \
   %debug_package
 
 ' >> $BUILD_ROOT/root/.rpmmacros
@@ -1972,7 +2036,7 @@
     if test -f $BUILD_ROOT/.spec.new ; then
        if ! cmp -s $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE $BUILD_ROOT/.spec.new 
; then
            echo 
-----------------------------------------------------------------
-           echo I have the following modifications for $SPECFILE:
+           echo "I have the following modifications for $SPECFILE:"
            sed -e "/^%changelog/q" $BUILD_ROOT$TOPDIR/SOURCES/$SPECFILE > 
$BUILD_ROOT/.spec.t1
            sed -e "/^%changelog/q" $BUILD_ROOT/.spec.new > $BUILD_ROOT/.spec.t2
            diff $BUILD_ROOT/.spec.t1 $BUILD_ROOT/.spec.t2
@@ -1984,7 +2048,7 @@
     fi
 
     if test "$BUILDTYPE" = dsc ; then
-       rm -rf $BUILD_ROOT$TOPDIR/BUILD
+       rm -rf "$BUILD_ROOT$TOPDIR/BUILD"
        mkdir -p $BUILD_ROOT$TOPDIR/SOURCES.DEB
        chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
        DEB_TRANSFORM=
@@ -2087,10 +2151,6 @@
                rpmbopts[${#rpmbopts[@]}]='--define'
                rpmbopts[${#rpmbopts[@]}]="disturl $DISTURL"
        fi
-       if test -s "$BUILD_ROOT/usr/lib/rpm/mandriva/macros" ; then
-               rpmbopts[${#rpmbopts[@]}]='--eval'
-               rpmbopts[${#rpmbopts[@]}]="%undefine _enable_debug_packages"
-       fi
        if [ -n "$RSYNCDONE" ] ; then
                rpmbopts[${#rpmbopts[@]}]='--define'
                rpmbopts[${#rpmbopts[@]}]="RSYNCDONE 1"
@@ -2266,6 +2326,12 @@
        arch)
            computeblocklists $args $TOPDIR/ARCHPKGS/* $TOPDIR/OTHER/* > 
"$VM_SWAP"
            ;;
+       preinstallimage)
+           computeblocklists $args $TOPDIR/OTHER/* > "$VM_SWAP"
+           ;;
+       *)
+            cleanup_and_exit 1
+           ;;
     esac || cleanup_and_exit 1
 fi
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/build_kiwi.sh 
new/obs-build-2012.07.02/build_kiwi.sh
--- old/obs-build-2012.06.05/build_kiwi.sh      2012-06-05 16:24:36.000000000 
+0200
+++ new/obs-build-2012.07.02/build_kiwi.sh      2012-07-02 10:41:12.000000000 
+0200
@@ -20,7 +20,7 @@
        ln -s $rl$r "${rc%/*}/${rc##*/}"
        repo="$TOPDIR/SOURCES/repos/${rc%/*}/${rc##*/}/"
         fi
-        if test "$imagetype" != product ; then
+        if test "$imagetype" != product -a "$DO_INIT" != "false" ; then
            echo "creating repodata for $repo"
            if chroot $BUILD_ROOT createrepo --simple-md-filenames --help 
>/dev/null 2>&1 ; then
                chroot $BUILD_ROOT createrepo --simple-md-filenames "$repo"
@@ -184,7 +184,7 @@
 done
 # take raw files as fallback
 if [ -z "\$VMXFILES" ]; then
-       ls "$imageout.raw" >& /dev/null && VMXFILES=""$imageout.raw"
+       ls "$imageout.raw" >& /dev/null && VMXFILES="$imageout.raw"
 fi
 if [ -n "\$VMXFILES" ]; then
        tar cvjfS "/$TOPDIR/KIWI/$imageout$buildnum-vmx.tar.bz2" \$VMXFILES
@@ -268,7 +268,7 @@
        done
     fi
     # Hook for running post kiwi build scripts like QA scripts if installed
-    if [ -x /usr/lib/build/kiwi_post_run ]; then
+    if [ -x $BUILD_ROOT/usr/lib/build/kiwi_post_run ]; then
         chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run || 
cleanup_and_exit 1
     fi
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/expanddeps 
new/obs-build-2012.07.02/expanddeps
--- old/obs-build-2012.06.05/expanddeps 2012-06-05 16:24:36.000000000 +0200
+++ new/obs-build-2012.07.02/expanddeps 2012-07-02 10:41:12.000000000 +0200
@@ -60,8 +60,8 @@
 $archs = '' unless defined $archs;
 die("you must specfiy a depfile!\n") unless defined $rpmdeps;
 
-my @extradeps = grep {!/(^|\/)PKGBUILD$/ && !/\.(?:spec|dsc|kiwi)$/} @ARGV;
-my @specs = grep {/(^|\/)PKGBUILD$/ || /\.(?:spec|dsc|kiwi)$/} @ARGV;
+my @extradeps = grep {!/(^|\/)(?:PKGBUILD|_preinstallimage)$/ && 
!/\.(?:spec|dsc|kiwi)$/} @ARGV;
+my @specs = grep {/(^|\/)(?:PKGBUILD|_preinstallimage)$/ || 
/\.(?:spec|dsc|kiwi)$/} @ARGV;
 die("can only work with at most one spec\n") if @specs > 1;
 my $spec = $specs[0];
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/gettype 
new/obs-build-2012.07.02/gettype
--- old/obs-build-2012.06.05/gettype    2012-06-05 16:24:36.000000000 +0200
+++ new/obs-build-2012.07.02/gettype    2012-07-02 10:41:12.000000000 +0200
@@ -32,5 +32,5 @@
 die("Usage: gettype --dist <dist> --archpath <archpath> [--configdir 
<configdir>]\n") if @ARGV;
 
 my $cf = Build::read_config_dist($dist, $archs, $configdir);
-exit 0 unless $cf->{'type'};
-print "$cf->{'type'}\n";
+exit 0 unless $cf->{'binarytype'};
+print "$cf->{'binarytype'}\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/init_buildsystem 
new/obs-build-2012.07.02/init_buildsystem
--- old/obs-build-2012.06.05/init_buildsystem   2012-06-05 16:24:36.000000000 
+0200
+++ new/obs-build-2012.07.02/init_buildsystem   2012-07-02 10:41:12.000000000 
+0200
@@ -103,36 +103,80 @@
 cleanup_and_exit()
 {
     trap EXIT
-    [ "$BUILD_ROOT" != / ] || chown $browner $BUILD_ROOT
+    test "$BUILD_ROOT" = / -a -n "$browner" && chown "$browner" "$BUILD_ROOT"
     # umount so init_buildsystem can be used standalone
 # XXX: use stat -f /dev/pts/ -c %T  to check whether it's mounted and not 
suppress errors then?
-    umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
-    umount -n $BUILD_ROOT/proc 2> /dev/null || true
-    umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
-    umount -n $BUILD_ROOT/mnt 2> /dev/null || true
+    umount -n "$BUILD_ROOT/proc/sys/fs/binfmt_misc" 2> /dev/null || true
+    umount -n "$BUILD_ROOT/proc" 2> /dev/null || true
+    umount -n "$BUILD_ROOT/dev/pts" 2> /dev/null || true
+    umount -n "$BUILD_ROOT/mnt" 2> /dev/null || true
     exit ${1:-0}
 }
 
 clean_build_root()
 {
        test -n "$BUILD_ROOT" && {
-           umount -n $BUILD_ROOT/proc/sys/fs/binfmt_misc 2> /dev/null || true
-           umount -n $BUILD_ROOT/proc 2> /dev/null || true
-           umount -n $BUILD_ROOT/dev/pts 2> /dev/null || true
-           umount -n $BUILD_ROOT/mnt 2> /dev/null || true
-           rm -rf -- $BUILD_ROOT/*
-           rm -rf -- $BUILD_ROOT/.build
-           rm -rf -- $BUILD_ROOT/.root
-           rm -rf -- $BUILD_ROOT/.init_b_cache
-           mkdir -p $BUILD_ROOT/proc
-           mkdir -p $BUILD_ROOT/dev/pts
+           umount -n "$BUILD_ROOT/proc/sys/fs/binfmt_misc" 2> /dev/null || true
+           umount -n "$BUILD_ROOT/proc" 2> /dev/null || true
+           umount -n "$BUILD_ROOT/dev/pts" 2> /dev/null || true
+           umount -n "$BUILD_ROOT/mnt" 2> /dev/null || true
+           rm -rf -- "$BUILD_ROOT"/*
+           rm -rf -- "$BUILD_ROOT/.build"
+           rm -rf -- "$BUILD_ROOT/.root"
+           rm -rf -- "$BUILD_ROOT/.init_b_cache"
+           rm -rf -- "$BUILD_ROOT/.preinstall_image/*"
+           rm -rf -- "$BUILD_ROOT/.preinstallimage"*
+           mkdir -p "$BUILD_ROOT/proc"
+           mkdir -p "$BUILD_ROOT/dev/pts"
            if [ "$UID" = '0' ]; then
-                   mount -n -tproc none $BUILD_ROOT/proc
-                   mount -n -tdevpts none $BUILD_ROOT/dev/pts
+                   mount -n -tproc none "$BUILD_ROOT/proc"
+                   mount -n -tdevpts none "$BUILD_ROOT/dev/pts"
            fi
        }
 }
 
+
+unsafe_preinstall_check()
+{
+    # cpio isn't safe so we require bsdtar for VMs. chroot is
+    # unsafe anyways so it's ok for that.
+    if test -n "$PREPARE_VM" ; then
+       echo "Error: setting up a VM requires bsdtar for security reasons."
+       echo "Please install bsdtar."
+       cleanup_and_exit 1
+    fi
+}
+
+preinstall_image_filter()
+{
+    for PKG in "$@" ; do
+       test -e "$BUILD_ROOT/.preinstall_image/$PKG" && continue
+       echo $PKG
+    done
+}
+
+preinstall_image()
+{
+    check_exit
+    if test -n "$2" ; then
+       echo "unpacking preinstall image $2"
+    else
+       echo "unpacking preinstall image"
+    fi
+    cd $BUILD_ROOT || cleanup_and_exit 1
+    if test -x /usr/bin/bsdtar ; then
+       TAR="/usr/bin/bsdtar -P --chroot -o --numeric-owner -x"
+    else
+       unsafe_preinstall_check
+       TAR="tar -x"
+    fi
+    # pipe output through perl to print a dot every 1000 lines
+    if ! $TAR -z --exclude .build --exclude .init_b_cache -f 
"$BUILD_ROOT/.init_b_cache/rpms/$1" -v > >(perl -e '$|=1; my $done=0; $done++ % 
1000 or print "." while <STDIN>; print "\n";')  2>&1 ; then
+       echo "unpack failed."
+       cleanup_and_exit 1
+    fi
+}
+
 preinstall()
 {
     check_exit
@@ -142,13 +186,7 @@
        CPIO="/usr/bin/bsdtar -P --chroot -o --numeric-owner -x -f-"
        TAR="/usr/bin/bsdtar -P --chroot -o --numeric-owner -x"
     else
-       # cpio isn't safe so we require bsdtar for VMs. chroot is
-       # unsafe anyways so it's ok for that.
-       if [ -n "$PREPARE_VM" ]; then
-           echo "Error: setting up a VM requires bsdtar for security reasons."
-           echo "Please install bsdtar"
-           cleanup_and_exit 1
-       fi
+       unsafe_preinstall_check
        CPIO="cpio --extract --unconditional --preserve-modification-time 
--make-directories --no-absolute-filenames --quiet"
        TAR="tar -x"
     fi
@@ -540,7 +578,7 @@
 trap fail_exit EXIT
 
 if [ "$BUILD_ROOT" = / ]; then
-    browner="$(stat -c %U /)"
+    browner="$(stat -c %u /)"
 fi
 
 if [ -n "$CLEAN_BUILD" ]; then
@@ -596,8 +634,8 @@
     #
     # now make sure that all the packages are installed.
     #
-    rm -rf $BUILD_ROOT/.init_b_cache
-    mkdir -p $BUILD_ROOT/.init_b_cache/scripts
+    rm -rf "$BUILD_ROOT/.init_b_cache"
+    mkdir -p "$BUILD_ROOT/.init_b_cache/scripts"
 
     if test -z "$RPMLIST" ; then
        #
@@ -628,7 +666,7 @@
           test "$PKG" = "rpmid:" && continue
           echo "${SRC##*/}"
        done < $BUILD_ROOT/.init_b_cache/rpmlist
-       rm -rf $BUILD_ROOT/.init_b_cache
+       rm -rf "$BUILD_ROOT/.init_b_cache"
        cleanup_and_exit 0
     fi
 
@@ -664,7 +702,10 @@
     PACKAGES_TO_VMINSTALL=
     PACKAGES_TO_CBPREINSTALL=
     PACKAGES_TO_CBINSTALL=
+    PREINSTALL_IMAGE=
+    PREINSTALL_IMAGE_SOURCE=
     RUNSCRIPTS_SEEN=
+    PACKAGES_FROM_PREINSTALLIMAGE=
     GUESSED_DIST=unknown
     mkdir -p $BUILD_ROOT/.init_b_cache/rpms
     while read PKG SRC ; do
@@ -676,6 +717,15 @@
            PACKAGES_TO_VMINSTALL=$SRC
            continue
        fi
+       if test "$PKG" = "preinstallimage:" ; then
+           PREINSTALL_IMAGE=${SRC##*/}
+           ln -s "$SRC" "$BUILD_ROOT/.init_b_cache/rpms/${SRC##*/}"
+           continue
+       fi
+       if test "$PKG" = "preinstallimagesource:" ; then
+           PREINSTALL_IMAGE_SOURCE="$SRC"
+           continue
+       fi
        # these additional preinstall / install values are only set for 
        # emulated "CrossBuild" setups - thus CB(pre)install
        if test "$PKG" = "cbpreinstall:" ; then
@@ -707,6 +757,11 @@
            echo "Warning: ignoring unsupported tag '$PKG'" >&2
            continue
        fi
+       if test "$SRC" = "preinstallimage" ; then
+           PACKAGES_FROM_PREINSTALLIMAGE="$PACKAGES_FROM_PREINSTALLIMAGE $PKG"
+           PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL $PKG"
+           continue
+       fi
        if [ "${SRC#/}" = "$SRC" ]; then
            url="$SRC"
            case "$url" in
@@ -732,18 +787,27 @@
 
     echo "$GUESSED_DIST" > $BUILD_ROOT/.guessed_dist
     test -n "$BUILD_DIST" || BUILD_DIST="$GUESSED_DIST"
-    DIST_TYPE=`gettype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" 
--archpath "$BUILD_ARCH"`
-    case "$DIST_TYPE" in
-       spec)  PSUF=rpm ;;
-       dsc)   PSUF=deb ;;
-       arch)  PSUF=arch ;;
-       *)
+    PSUF=`gettype --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath 
"$BUILD_ARCH"`
+    case "$PSUF" in
+       UNKNOWN|'')
            # auto detect from packages
+           if test -n "$PREINSTALL_IMAGE" ; then
+               echo "cannot autodetect build type when using a preinstall 
image" >&2
+               cleanup_and_exit 1
+           fi
            PSUF=rpm
-           test -L $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
-           test -L $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
+           test -e $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb && PSUF=deb
+           test -e $BUILD_ROOT/.init_b_cache/rpms/pacman.arch && PSUF=arch
            ;;
     esac
+
+    if test -n "$PREINSTALL_IMAGE" ; then
+       for PKG in $PACKAGES_FROM_PREINSTALLIMAGE ; do
+           # touch the file so that the copying works
+           touch $BUILD_ROOT/.init_b_cache/rpms/"$PKG.$PSUF"
+       done
+    fi
+
 fi
 
 #
@@ -768,25 +832,35 @@
     for PKG in $PACKAGES_TO_RUNSCRIPTS ; do
        : > $BUILD_ROOT/.init_b_cache/scripts/$PKG.run
     done
-    PACKAGES_TO_PREINSTALL=`reorder $PACKAGES_TO_PREINSTALL`
-    progress_setup PACKAGES_TO_PREINSTALL
-    for PKG in $PACKAGES_TO_PREINSTALL ; do
-       progress_step PACKAGES_TO_PREINSTALL
+    PACKAGES_TO_PREINSTALL_FILTERED="$PACKAGES_TO_PREINSTALL"
+    PACKAGES_TO_VMINSTALL_FILTERED="$PACKAGES_TO_VMINSTALL"
+    PACKAGES_TO_CBPREINSTALL_FILTERED="$PACKAGES_TO_CBPREINSTALL"
+    rm -f "$BUILD_ROOT/.preinstall_image"/*
+    if test -n "$PREINSTALL_IMAGE" ; then
+       preinstall_image "$PREINSTALL_IMAGE" "$PREINSTALL_IMAGE_SOURCE"
+       PACKAGES_TO_PREINSTALL_FILTERED=`preinstall_image_filter 
$PACKAGES_TO_PREINSTALL_FILTERED`
+       PACKAGES_TO_VMINSTALL_FILTERED=`preinstall_image_filter 
$PACKAGES_TO_VMINSTALL_FILTERED`
+       PACKAGES_TO_CBPREINSTALL_FILTERED=`preinstall_image_filter 
$PACKAGES_TO_VMINSTALL_FILTERED`
+    fi
+    PACKAGES_TO_PREINSTALL_FILTERED=`reorder $PACKAGES_TO_PREINSTALL_FILTERED`
+    progress_setup PACKAGES_TO_PREINSTALL_FILTERED
+    for PKG in $PACKAGES_TO_PREINSTALL_FILTERED ; do
+       progress_step PACKAGES_TO_PREINSTALL_FILTERED
        preinstall ${PKG##*/}
     done
     if test -n "$PREPARE_VM" ; then
-        PACKAGES_TO_VMINSTALL=`reorder $PACKAGES_TO_VMINSTALL`
-       progress_setup PACKAGES_TO_VMINSTALL
-       for PKG in $PACKAGES_TO_VMINSTALL ; do
-           progress_step PACKAGES_TO_VMINSTALL
+        PACKAGES_TO_VMINSTALL_FILTERED=`reorder 
$PACKAGES_TO_VMINSTALL_FILTERED`
+       progress_setup PACKAGES_TO_VMINSTALL_FILTERED
+       for PKG in $PACKAGES_TO_VMINSTALL_FILTERED ; do
+           progress_step PACKAGES_TO_VMINSTALL_FILTERED
            preinstall ${PKG##*/}
        done
     fi
     # add cbpreinstall if cross HOST != TARGET
-    PACKAGES_TO_CBINSTALL=`reorder $PACKAGES_TO_CBINSTALL`
-    progress_setup PACKAGES_TO_CBPREINSTALL
-    for PKG in $PACKAGES_TO_CBPREINSTALL ; do
-       progress_step PACKAGES_TO_CBPREINSTALL
+    PACKAGES_TO_CBINSTALL_FILTERED=`reorder $PACKAGES_TO_CBINSTALL_FILTERED`
+    progress_setup PACKAGES_TO_CBPREINSTALL_FILTERED
+    for PKG in $PACKAGES_TO_CBPREINSTALL_FILTERED ; do
+       progress_step PACKAGES_TO_CBPREINSTALL_FILTERED
         preinstall ${PKG##*/}
     done
     if [ -w /root ]; then
@@ -809,8 +883,7 @@
        ln -s -f ../$PKG.$PSUF $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF
        check_exit
     done
-    # alreadyinstalled check will not work, but we have to live with
-    # that...
+    # alreadyinstalled check will not work, but we have to live with that...
     echo -n 'reordering...'
     PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
     echo 'done'
@@ -833,7 +906,7 @@
 #
 # create .build.binaries directory if requested
 #
-rm -rf $BUILD_ROOT/.build.binaries
+rm -rf "$BUILD_ROOT/.build.binaries"
 if test -n "$CREATE_BUILD_BINARIES" ; then
     echo "creating .build.binaries directory..."
     mkdir -p "$BUILD_ROOT/.build.binaries"
@@ -864,7 +937,6 @@
 #
 if ! test -e $BUILD_ROOT/.build/init_buildsystem.data ; then
     echo -n 'reordering...'
-    PACKAGES_TO_INSTALL_FIRST=`reorder $PACKAGES_TO_INSTALL_FIRST`
     PACKAGES_TO_INSTALL=`reorder $PACKAGES_TO_INSTALL`
     echo 'done'
 fi
@@ -896,7 +968,7 @@
     test "$PKG" = "*" && continue
     ln $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG 
$BUILD_ROOT/.init_b_cache/todelete/$PKG
 done
-for PKG in $PACKAGES_TO_INSTALL_FIRST $PACKAGES_TO_INSTALL 
$PACKAGES_TO_CBINSTALL ; do
+for PKG in $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL ; do
     rm -f $BUILD_ROOT/.init_b_cache/todelete/$PKG
 done
 for PKG in $BUILD_ROOT/.init_b_cache/todelete/* ; do
@@ -906,16 +978,16 @@
     rpm_e "$PKG"
     check_exit
 done
-rm -rf $BUILD_ROOT/.init_b_cache/todelete
+rm -rf "$BUILD_ROOT/.init_b_cache/todelete"
 
-rm -rf $BUILD_ROOT/.init_b_cache/preinstalls
-mkdir -p $BUILD_ROOT/.init_b_cache/preinstalls
+rm -rf "$BUILD_ROOT/.init_b_cache/preinstalls"
+mkdir -p "$BUILD_ROOT/.init_b_cache/preinstalls"
 for PKG in $PACKAGES_TO_PREINSTALL $PACKAGES_TO_CBPREINSTALL; do
     touch "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG"
 done
 
-rm -rf $BUILD_ROOT/installed-pkg
-mkdir -p $BUILD_ROOT/installed-pkg
+rm -rf "$BUILD_ROOT/installed-pkg"
+mkdir -p "$BUILD_ROOT/installed-pkg"
 
 RPMCHECKOPTS=
 RPMCHECKOPTS_HOST=
@@ -924,34 +996,49 @@
 test -x $BUILD_ROOT/usr/bin/rpmsign && RPMCHECKOPTS="--nodigest --nosignature"
 test -x /usr/bin/rpmsign && RPMCHECKOPTS_HOST="--nodigest --nosignature"
 
-MAIN_LIST="$PACKAGES_TO_INSTALL_FIRST $PACKAGES_TO_INSTALL 
$PACKAGES_TO_CBINSTALL"
+test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1
+
+MAIN_LIST="$PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL"
 progress_setup MAIN_LIST
-for PKG in $PACKAGES_TO_INSTALL_FIRST RUN_LDCONFIG $PACKAGES_TO_INSTALL 
$PACKAGES_TO_CBINSTALL; do
-    case $PKG in
-      RUN_LDCONFIG)
-       test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 
2>&1
-       continue
-      ;;
-    esac
+for PKG in $PACKAGES_TO_INSTALL $PACKAGES_TO_CBINSTALL; do
+    test -f $BUILD_ROOT/installed-pkg/$PKG && continue
     progress_step MAIN_LIST
 
-    test -f $BUILD_ROOT/installed-pkg/$PKG && continue
+    if test -e "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" -a ! -s 
"$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" ; then
+       # preinstallimage package, make sure it's 
+       if ! test -e $BUILD_ROOT/.preinstall_image/$PKG ; then
+           echo "Package $PKG is missing from the preinstall image"
+           cleanup_and_exit 1
+       fi
+       read PKG_HDRMD5 PKGID < $BUILD_ROOT/.preinstall_image/$PKG
+       echo "preinstalled ${PKGID%% *}"
+       echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+       continue
+    fi
+    PKG_HDRMD5=
+    if test -d $BUILD_ROOT/.preinstall_image ; then
+       if ! test -e $BUILD_ROOT/.preinstall_image/$PKG ; then
+           PKG_HDRMD5=`perl -I$BUILD_DIR -MBuild -e 'print 
Build::queryhdrmd5($ARGV[0])' $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
+           test -n "$PKG_HDRMD5" || cleanup_and_exit 1
+       fi
+    fi
+    test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF || continue
 
     if test $PSUF = deb ; then
        # debian world, install deb files
-       test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.deb || continue
        if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.deb" -ef 
"$BUILD_ROOT/.init_b_cache/$PKG.deb" ; then
            rm -f $BUILD_ROOT/.init_b_cache/$PKG.deb
            cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.deb 
$BUILD_ROOT/.init_b_cache/$PKG.deb || cleanup_and_exit 1
        fi
        PKGID=`readlink $BUILD_ROOT/.init_b_cache/rpms/$PKG.deb`
        PKGID="${PKGID##*/}"
-       PKGID="${PKGID%.deb}"
-       echo "installing ${PKGID%_*}"
+       PKGID="${PKGID%.deb} debian"
+       echo "installing ${PKGID%% *}"
        ( chroot $BUILD_ROOT dpkg --install --force all .init_b_cache/$PKG.deb 
2>&1 || touch $BUILD_ROOT/exit ) | \
            perl -ne '$|=1;/^(Configuration file|Installing new config 
file|Selecting previously deselected|\(Reading database|Unpacking |Setting 
up|Creating config file|Preparing to replace dpkg)/||/^$/||print'
        check_exit
-       echo "$PKGID debian" > $BUILD_ROOT/installed-pkg/$PKG
+       echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+       test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
         # ugly workaround for upstart system. some packages (procps) try
         # to start a service in their configure phase. As we don't have
         # a running upstart, we just link the start binary to /bin/true
@@ -968,7 +1055,6 @@
     fi
 
     if test $PSUF = arch ; then
-       test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF || continue
        if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" -ef 
"$BUILD_ROOT/.init_b_cache/$PKG.$PSUF" ; then 
            rm -f $BUILD_ROOT/.init_b_cache/$PKG.$PSUF
            cp $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF 
$BUILD_ROOT/.init_b_cache/$PKG.$PSUF || cleanup_and_exit 1
@@ -976,24 +1062,24 @@
        PKGID=`readlink $BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF`
        PKGID="${PKGID##*/}"
        PKGID="${PKGID/%.pkg.tar.?z/.arch}"
-       PKGID="${PKGID%.$PSUF}"
-       echo "installing ${PKGID%_*}"
+       PKGID="${PKGID%.arch} arch"
+       echo "installing ${PKGID%% *}"
        # -d -d disables deps checking
        ( chroot $BUILD_ROOT pacman -Uf -d -d --noconfirm 
.init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
            perl -ne '$|=1;/^(warning: could not get filesystem information for 
|loading packages|looking for inter-conflicts|Targets |Total Installed Size: 
|Net Upgrade Size: |Proceed with installation|checking package 
integrity|loading package files|checking available disk space|installing 
|upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for|  
  )/||/^$/||print'
        check_exit
-       echo "$PKGID $PSUF" > $BUILD_ROOT/installed-pkg/$PKG
+       echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+       test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
        continue
     fi
 
-    test -L $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm || continue
-
     if test -f $BUILD_ROOT/.init_b_cache/rpms/$PKG.id -a -f 
$BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then
        read PKGID < $BUILD_ROOT/.init_b_cache/rpms/$PKG.id
        read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG
        if test "$PKGID" = "$OLDPKGID" ; then
            #echo "keeping ${PKGID%% *}"
            echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+           test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
            continue
        fi
     fi
@@ -1013,11 +1099,13 @@
            else
                #echo "keeping ${PKGID%% *}"
                echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+               test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
                continue
            fi
        else
            #echo "keeping ${PKGID%% *}"
            echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+           test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
            continue
        fi
        if test -e "$BUILD_ROOT/.init_b_cache/preinstalls/$PKG" ; then
@@ -1032,7 +1120,7 @@
     if test "$USE_FORCE" = true ; then
        export ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --force"
     fi
-    # work around for cross-build installs, we must not overwrite the running 
rpm
+    # FIXME: work around for cross-build installs, we must not overwrite the 
running rpm
     if test "$PKG" = rpm ; then
        for i in $BUILD_ROOT/.init_b_cache/preinstalls/rpm-x86-* ; do
            test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
@@ -1051,11 +1139,12 @@
     rm -f $BUILD_ROOT/.init_b_cache/$PKG.rpm
     check_exit
     echo "$PKGID" > $BUILD_ROOT/installed-pkg/$PKG
+    test -n "$PKG_HDRMD5" && echo "$PKG_HDRMD5 $PKGID" > 
$BUILD_ROOT/.preinstall_image/$PKG
 
 done
 
 if test $PSUF = deb ; then
-    echo "configure all installed packages..."
+    echo "configuring all installed packages..."
     # configure all packages after complete installation, not for each package 
like rpm does
     # We need to run this twice, because of cyclic dependencies as it does not 
succeed on most
     # debian based distros in the first attempt.
@@ -1218,7 +1307,7 @@
 #fi
 
 rm -f $BUILD_ROOT/.rpmmacros $BUILD_ROOT/root/.rpmmacros
-rm -rf $BUILD_ROOT/.init_b_cache
+rm -rf "$BUILD_ROOT/.init_b_cache"
 rm -f $BUILD_IS_RUNNING
 rm -f $TMPFILE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/obs-build-2012.06.05/order 
new/obs-build-2012.07.02/order
--- old/obs-build-2012.06.05/order      2012-06-05 16:24:36.000000000 +0200
+++ new/obs-build-2012.07.02/order      2012-07-02 10:41:12.000000000 +0200
@@ -61,6 +61,10 @@
   my $q;
   for my $suf ('rpm', 'deb', 'arch') {
     next unless -f "$cachedir/$p.$suf";
+    if (! -s "$cachedir/$p.$suf") {
+      $q = {'provides' => [], 'requires' => []}; # package from 
preinstallimage, no need to order
+      last;
+    }
     $q = Build::query("$cachedir/$p.$suf", 'filelist' => 1, 'alldeps' => 1);
     die("bad binary: $p.$suf\n") unless $q;
     push @{$q->{'provides'}}, @{$q->{'filelist'}} if $suf eq 'rpm' && 
$q->{'filelist'};

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to