[meego-commits] 10557: Changes to Tools:Building/build

Jian-feng Ding no_reply at build.meego.com
Fri Dec 3 03:13:28 UTC 2010


Hi,
I have made the following changes to build in project Tools:Building. Please review and accept ASAP.

Thank You,
Jian-feng Ding

[This message was auto-generated]

---

Request #10557:

  submit:   devel:tools:building/build(r12) -> Tools:Building/build


Message:
    Update to 2010.11.24 (from Fathi)

State:   new          2010-12-02T19:13:27 jfding
Comment: None



changes files:
--------------
--- build.changes
+++ build.changes
@@ -0,0 +1,3 @@
+* Wed Dec 01 2010 Fathi Boudra <fathi.boudra at nokia.com> - 2010.11.24
+- Update to 2010.11.24: add workaround for Ubuntu 10 builds (BMC#10713)
+

old:
----
  build-2010.08.04.tar.gz

new:
----
  build-2010.11.24.tar.gz

spec files:
-----------
--- build.spec
+++ build.spec
@@ -17,13 +17,12 @@
 
 # norootforbuild
 
-
 Name:           build
 License:        GPLv2+
 Group:          Development/Tools/Building
 AutoReqProv:    on
 Summary:        A Script to Build SUSE Linux RPMs
-Version:        2010.08.04
+Version:        2010.11.24
 Release:        1
 # osc rm build-*tar.bz2
 # REVISION=$(svn info https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/build | sed -ne "/Revision: /s///p")
@@ -55,8 +54,6 @@
 This package provides a script for building RPMs for SUSE Linux in a
 chroot environment.
 
-
-
 %prep
 %setup -q
 
@@ -64,16 +61,15 @@
 
 %install
 make DESTDIR=$RPM_BUILD_ROOT install
-install %{SOURCE1} %{buildroot}/usr/lib/build/configs
-cd $RPM_BUILD_ROOT/usr/lib/build/configs/
+install %{SOURCE1} %{buildroot}%{_prefix}/lib/build/configs
+cd %{buildroot}%{_prefix}/lib/build/configs/
 ln -s meego-1.0.conf default.conf
 
 %files
 %defattr(-,root,root)
 %doc README
-/usr/bin/build
-/usr/bin/buildvc
-/usr/bin/unrpm
-/usr/lib/build
+%{_bindir}/build
+%{_bindir}/buildvc
+%{_bindir}/unrpm
+%{_prefix}/lib/build
 %{_mandir}/man1/build.1*
-

dsc files:
----------
--- build.dsc
+++ build.dsc
@@ -1,9 +1,8 @@
 Format: 1.0
 Source: build
-Version: 2010.08.04
+Version: 2010.11.24-1
 Binary: build
-Maintainer: Adrian Schroeter <adrian at suse.de>
+Maintainer: Jian-feng Ding <jian-feng.ding at intel.com>
 Architecture: all
-Standards-Version: 3.7.2
-Build-Depends: debhelper (>= 4)
-
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 7)

other changes:
--------------

++++++ build-2010.08.04.tar.gz -> build-2010.11.24.tar.gz
--- Build.pm
+++ Build.pm
@@ -77,6 +77,38 @@
   $config->{'conflicth'} = \%conflicts;
 }
 
+# 'canonicalize' dist string as found in rpm dist tags
+sub dist_canon($$) {
+  my ($rpmdist, $arch) = @_;
+  $rpmdist = lc($rpmdist);
+  $rpmdist =~ s/-/_/g;
+  $rpmdist =~ s/opensuse/suse linux/;
+  my $rpmdista;
+  if ($rpmdist =~ /\(/) {
+    $rpmdista = $rpmdist;
+    $rpmdista =~ s/.*\(//;
+    $rpmdista =~ s/\).*//;
+  } else {
+    $rpmdista = $arch;
+  }
+  $rpmdista =~ s/i[456]86/i386/;
+  $rpmdist = '' unless $rpmdista =~ /^(i386|x86_64|ia64|ppc|ppc64|s390|s390x)$/;
+  my $dist = 'default';
+  if ($rpmdist =~ /unitedlinux 1\.0.*/) {
+    $dist = "ul1-$rpmdista";
+  } elsif ($rpmdist =~ /suse sles_(\d+)/) {
+    $dist = "sles$1-$rpmdista";
+  } elsif ($rpmdist =~ /suse linux enterprise (\d+)/) {
+    $dist = "sles$1-$rpmdista";
+  } elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
+    # alpha version
+    $dist = "$1.".($2 + 1)."-$rpmdista";
+  } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
+    $dist = "$1-$rpmdista";
+  }
+  return $dist;
+}
+
 sub read_config_dist {
   my ($dist, $archpath, $configdir) = @_;
 
@@ -86,11 +118,20 @@
   $arch = 'noarch' if $arch eq '';
   die("Please specify a distribution!\n") unless defined $dist;
   if ($dist !~ /\//) {
+    my $saved = $dist;
     $configdir = '.' unless defined $configdir;
     $dist =~ s/-.*//;
     $dist = "sl$dist" if $dist =~ /^\d/;
     $dist = "$configdir/$dist.conf";
-    $dist = "$configdir/default.conf" unless -e $dist;
+    if (! -e $dist) {
+      $dist =~ s/-.*//;
+      $dist = "sl$dist" if $dist =~ /^\d/;
+      $dist = "$configdir/$dist.conf";
+    }
+    if (! -e $dist) {
+      warn "$saved.conf not found, using default.conf\n" unless $saved eq 'default';
+      $dist = "$configdir/default.conf";
+    }
   }
   die("$dist: $!\n") unless -e $dist;
   my $cf = read_config($arch, $dist);
--- Build/Kiwi.pm
+++ Build/Kiwi.pm
@@ -38,18 +38,19 @@
       $tag = substr($tag, 1);
       chop $tag;
     }
-    my @tag = split(/(=(?:\"[^\"]*\"|[^\"\s]*))?\s+/, "$tag ");
+    my @tag = split(/(=(?:\"[^\"]*\"|\'[^\']*\'|[^\"\s]*))?\s+/, "$tag ");
     $tag = shift @tag;
     shift @tag;
     push @tag, undef if @tag & 1;
     my %atts = @tag;
     for (values %atts) {
       next unless defined $_;
-      s/^=\"([^\"]*)\"$/=$1/s;
+      s/^=\"([^\"]*)\"$/=$1/s or s/^=\'([^\']*)\'$/=$1/s;
       s/^=//s;
       s/</</g;
       s/>/>/g;
       s/&/&/g;
+      s/'/\'/g;
       s/"/\"/g;
     }
     if ($mode == 0 || $mode == 2) {
@@ -86,6 +87,19 @@
   return grep(delete($h{$_}), @_);
 }
 
+sub findFallBackArchs {
+  my ($fallbackArchXML, $arch) = @_;
+  my @fa;
+
+  for my $a (@{$fallbackArchXML->{'arch'}||[]}) {
+    if ( $a->{'id'} eq $arch && $a->{'fallback'} ) {
+      @fa = unify( $a->{'fallback'}, findFallBackArchs($fallbackArchXML, $a->{'fallback'}));
+    }
+  }
+
+  return @fa
+}
+
 sub kiwiparse {
   my ($xml, $arch, $count) = @_;
   $count ||= 0;
@@ -166,7 +180,7 @@
   for my $repository (@repositories) {
     my $kiwisource = ($repository->{'source'} || [])->[0];
     next if $kiwisource->{'path'} eq '/var/lib/empty';	# grr
-    die("bad path: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
+    die("bad path using not obs:/ URL: $kiwisource->{'path'}\n") unless $kiwisource->{'path'} =~ /^obs:\/\/\/?([^\/]+)\/([^\/]+)\/?$/;
     push @repos, "$1/$2";
   }
 
@@ -217,6 +231,12 @@
     push @additionalarchs, split(',', $package->{'onlyarch'}) if $package->{'onlyarch'};
   }
   @requiredarch = unify(@requiredarch, @additionalarchs);
+  
+  my @fallbackarchs;
+  for my $arch (@requiredarch) {
+    push @fallbackarchs, findFallBackArchs($instsource->{'architectures'}[0], $arch) if $instsource->{'architectures'}[0];
+  }
+  @requiredarch = unify(@requiredarch, @fallbackarchs);
 
   if (!$instsource) {
     my $packman = $preferences->{'packagemanager'}->[0]->{'_content'};
--- Build/Rpm.pm
+++ Build/Rpm.pm
@@ -334,6 +334,9 @@
 	push @$badarch, split(' ', $1);
       }
     }
+    if (@subpacks && $preamble && exists($ret->{'version'}) && $line =~ /^Version\s*:\s*(\S+)/i) {
+      $ret->{'multiversion'} = 1 if $ret->{'version'} ne $1;
+    }
     if ($line =~ /^(?:Requires\(pre\)|Requires\(post\)|PreReq)\s*:\s*(\S.*)$/i) {
       my $deps = $1;
       my @deps = $deps =~ /([^\s\[,]+)(\s+[<=>]+\s+[^\s\[,]+)?(\s+\[[^\]]+\])?[\s,]*/g;
--- Makefile
+++ Makefile
@@ -46,6 +46,7 @@
 	    substitutedeps \
 	    debtransform \
 	    mkbaselibs \
+	    mkdrpms \
 	    createrepomddeps \
 	    createyastdeps \
 	    changelog2spec \
@@ -53,6 +54,7 @@
 	    download \
 	    spec_add_patch \
 	    spectool \
+	    signdummy \
 	    unrpm \
 	    $(DESTDIR)$(pkglibdir)
 	install -m644 Build/*.pm $(DESTDIR)$(pkglibdir)/Build
--- build
+++ build
@@ -82,11 +82,18 @@
 RSYNCSRC=
 RSYNCDEST=
 RSYNCDONE=
-: ${EMULATOR_ARCHS:="armv4l armv5el armv6el armv7el sh4 ppc ppc64 mips mipsel"}
-: ${CACHE_DIR:=/var/cache/build}
+SIGNDUMMY=
 
+# list of archs which need emulator initialization
+: ${EMULATOR_ARCHS:="armv4l armv5el armv6el armv7el armv8el mips mipsel mips64 mips64el ppc ppc64 sh4"}
 export EMULATOR_ARCHS
 
+# list of devices registered by binfmt handlers in /proc/sys/fs/binfmt_misc
+: ${EMULATOR_DEVS:="arm mips mipsel mips64 mips64el ppc sh4 sparc"}
+export EMULATOR_DEVS
+
+: ${CACHE_DIR:=/var/cache/build}
+
 # This is for insserv
 export YAST_IS_RUNNING=instsys
 
@@ -493,6 +500,10 @@
     local i=0
     local d
     local dest
+    if [ -z "$old_packages" ]; then
+	rm -rf "$BUILD_ROOT"/.build.oldpackages*
+	return 0
+    fi
     for d in "${old_packages[@]}"; do
 	dest="$BUILD_ROOT/.build.oldpackages"
 	test "$i" = 0 || dest="$dest$i"
@@ -953,6 +964,9 @@
 	  shell=1
 	  shift
       ;;
+      --signdummy)
+	SIGNDUMMY=1
+      ;;
       -*)
 	echo Unknown Option "$PARAM". Exit.
 	cleanup_and_exit 1
@@ -974,7 +988,7 @@
 	# mark job as failed so that we don't extract packages
 	echo -n "BUILDSTATUS1" >"$VM_SWAP"
     fi
-    (set -C; > "$BUILD_ROOT/exit" || true)
+    (set -C; > "$BUILD_ROOT/exit" 2>/dev/null || true)
     if test "$VM_TYPE" = 'lxc'; then
 	LXCID=${BUILD_ROOT##*/}
 	lxc-stop -n "$LXCID" || true
@@ -1133,7 +1147,7 @@
 	if test ! -e "$VM_IMAGE"; then
 	    echo "Creating $VM_IMAGE (${VMDISK_ROOTSIZE}M)"
 	    mkdir -p "${VM_IMAGE%/*}"
-	    dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 )) || cleanup_and_exit 3
+	    dd if=/dev/zero of="$VM_IMAGE" bs=1 count=1 seek=$(( ${VMDISK_ROOTSIZE} * 1024 * 1024 - 1 )) || cleanup_and_exit 3
 	    if test -z "$CLEAN_BUILD" ; then
 		vm_img_mkfs "$VMDISK_FILESYSTEM" "$VM_IMAGE" || cleanup_and_exit 3
 	    fi
@@ -1142,7 +1156,7 @@
 	    # setup VM_SWAP
 	    echo "Creating $VM_SWAP (${VMDISK_SWAPSIZE}M)"
 	    mkdir -p "${VM_SWAP%/*}"
-	    dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 )) || cleanup_and_exit 3
+	    dd if=/dev/zero of="$VM_SWAP" bs=1 count=1 seek=$(( ${VMDISK_SWAPSIZE} * 1024 * 1024 - 1 )) || cleanup_and_exit 3
 	fi
 	if test ! -e "$VM_IMAGE" ; then
 	    echo "you need to create $VM_IMAGE first"
@@ -1353,6 +1367,7 @@
 	echo "BUILD_DIST='${BUILD_DIST//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
 	echo "RELEASE='${RELEASE//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
 	echo "BUILD_DEBUG='${BUILD_DEBUG//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
+	echo "SIGNDUMMY='${SIGNDUMMY//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
 	echo "DO_LINT='${DO_LINT//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
 	echo "DO_CHECKS='${DO_CHECKS//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
 	echo "NOROOTFORBUILD='${NOROOTFORBUILD//"'"/$Q}'" >> $BUILD_ROOT/.build/build.data
@@ -1450,7 +1465,7 @@
 		set -- $qemu_bin -no-reboot -nographic -net none \
 		    -kernel $qemu_kernel \
 		    -initrd $qemu_initrd \
-		    -append "root=$qemu_rootdev panic=1 quiet noapic rw elevator=noop console=ttyS0 init=$vm_init_script" \
+		    -append "root=$qemu_rootdev panic=1 quiet no-kvmclock rw elevator=noop console=ttyS0 init=$vm_init_script" \
 		    ${MEMSIZE:+-m $MEMSIZE} \
 		    "${qemu_args[@]}"
 
@@ -1501,6 +1516,17 @@
 			mkdir -p RPMS/$arch
 			mv "$i" RPMS/$arch/
 		    done
+                    # For built MS-Windows apps via cross built mechanism
+		    for i in *.exe ; do
+			test -e "$i" || continue
+			mkdir -p EXE
+			mv "$i" EXE/
+		    done
+		    for i in *.zip ; do
+			test -e "$i" || continue
+			mkdir -p ZIP
+			mv "$i" ZIP/
+		    done
 		elif test "$BUILDTYPE" = dsc ; then
 		    mkdir -p DEBS
 		    find . -type f | while read i; do mv "$i" DEBS/; done
@@ -1560,6 +1586,16 @@
     fi
 
     #
+    # install dummy sign program if needed
+    #
+    test -f $BUILD_ROOT/usr/bin/sign_installed && mv $BUILD_ROOT/usr/bin/sign_installed $BUILD_ROOT/usr/bin/sign
+    if test -n "$SIGNDUMMY" ; then
+	test -f $BUILD_ROOT/usr/bin/sign && mv $BUILD_ROOT/usr/bin/sign $BUILD_ROOT/usr/bin/sign_installed
+	cp $BUILD_DIR/signdummy $BUILD_ROOT/usr/bin/sign
+	chmod 755 $BUILD_ROOT/usr/bin/sign
+    fi
+
+    #
     # check if we want to build with the abuild user
     #
     BUILD_USER=abuild
@@ -1585,7 +1621,7 @@
 	    mkdir -p $BUILD_ROOT/home/abuild
 	    chown "$ABUILD_UID:$ABUILD_GID" $BUILD_ROOT/home/abuild
 	else
-	    if ! egrep "^abuild::${ABUILD_UID}:${ABUILD_GID}" >/dev/null <$BUILD_ROOT/etc/passwd ; then
+	    if ! egrep "^abuild:x?:${ABUILD_UID}:${ABUILD_GID}" >/dev/null <$BUILD_ROOT/etc/passwd ; then
 		echo "abuild user present in the buildroot ($BUILD_ROOT) but uid:gid does not match"
 		echo "buildroot currently using:"
 		egrep "^abuild:" <$BUILD_ROOT/etc/passwd
@@ -1654,7 +1690,7 @@
     # now clean up RPM building directories
     #
     rm -rf $BUILD_ROOT$TOPDIR
-    for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT; do
+    for i in BUILD RPMS/`uname -m` RPMS/i386 RPMS/noarch SOURCES SPECS SRPMS BUILDROOT ZIP EXE; do
 	mkdir -p $BUILD_ROOT$TOPDIR/$i
     done
     chown -R "$ABUILD_UID:$ABUILD_GID" "$BUILD_ROOT$TOPDIR"
@@ -1788,7 +1824,7 @@
     BUILD_SUCCEEDED=false
 
     if test -n "$OVERLAY" ; then
-	if -d "$OVERLAY"; then
+	if test -d "$OVERLAY"; then
 	    pushd $OVERLAY
 	    echo "Copying overlay to BUILD_ROOT"
 	    tar -cpf - . | (cd $BUILD_ROOT ; tar -xvf -)
@@ -1966,11 +2002,12 @@
 	    fi
 	fi
     fi
-    if test -x "$BUILD_ROOT/usr/bin/makedeltarpm" \
-	-a -x $BUILD_ROOT/usr/lib/build/makedeltarpms; then
+    if test ! -e $BUILD_ROOT/.build/.same_result_marker \
+	-a -x "$BUILD_ROOT/usr/bin/makedeltarpm" \
+	-a -x $BUILD_ROOT/usr/lib/build/mkdrpms; then
 	echo "... creating delta rpms"
 	ds=("$BUILD_ROOT/$TOPDIR"/RPMS/* "$BUILD_ROOT$TOPDIR/SRPMS")
-	chroot $BUILD_ROOT /usr/lib/build/makedeltarpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
+	chroot $BUILD_ROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
     fi
 fi
 
@@ -1980,7 +2017,7 @@
     args="--padstart 512 --padend 512 -v"
     case "$BUILDTYPE" in
 	spec)
-	    computeblocklists $args $TOPDIR/RPMS/*/*.rpm $TOPDIR/SRPMS/* > "$VM_SWAP"
+	    computeblocklists $args $TOPDIR/RPMS/*/*.{d,}rpm $TOPDIR/SRPMS/* $TOPDIR/ZIP/* $TOPDIR/EXE/* > "$VM_SWAP"
 	    ;;
 	dsc)
 	    computeblocklists $args $TOPDIR/DEBS/*.deb $TOPDIR/SOURCES.DEB/* > "$VM_SWAP"
--- build.1
+++ build.1
@@ -157,7 +157,7 @@
 You can use this to add more options to RPM.
 
 .SH SEE ALSO
-.BR rpm (1),
+.BR rpm (8),
 .TP
 .BR "Maximum RPM":
 .I http://www.rpm.org/max-rpm/
--- computeblocklists
+++ computeblocklists
@@ -52,7 +52,7 @@
   }
 
   my $bsize = 'xxxx';
-  ioctl(F, 2, $bsize) || die("FIGETBSZ: $!\n");
+  ioctl(F, 2, $bsize) || ioctl(F, 536870914, $bsize) || die("FIGETBSZ: $!\n");
   $bsize = unpack("L", $bsize);
 
   my @stat = stat(F);
@@ -66,7 +66,9 @@
   for ($b = 0; $b < $blocks; ++$b) {
     my $block = pack('I', $b);
     if(not defined ioctl(F, 1, $block)) {
-      die "$file: $!";
+	if(not defined ioctl(F, 536870913, $block)) {
+	    die "$file: $!";
+	}
     }
     $block = unpack('I', $block);
     if($b == 0) {
--- expanddeps
+++ expanddeps
@@ -101,6 +101,7 @@
   $packs{$_} ||= "$_.$arch" for @{$packs_arch{$arch} || []};
 }
 
+# XXX: move to separate tool
 if (!defined($dist) || $dist eq '') {
   my $rpmarch = (grep {$fn{"rpm.$_"}} @archs)[0];
   if (!$rpmarch) {
@@ -117,33 +118,7 @@
       my %res = Build::Rpm::rpmq($rpmfn, 1010);
       $rpmdist = $res{1010}->[0] || '';
     }
-    $rpmdist = lc($rpmdist);
-    $rpmdist =~ s/-/_/g;
-    $rpmdist =~ s/opensuse/suse linux/;
-    my $rpmdista;
-    if ($rpmdist =~ /\(/) {
-      $rpmdista = $rpmdist;
-      $rpmdista =~ s/.*\(//;
-      $rpmdista =~ s/\).*//;
-    } else {
-      $rpmdista = $archs[0];
-    }
-    $rpmdista =~ s/i[456]86/i386/;
-    $rpmdist = '' unless $rpmdista =~ /^(i386|x86_64|ia64|ppc|ppc64|s390|s390x)$/;
-    if ($rpmdist =~ /unitedlinux 1\.0.*/) {
-      $dist = "ul1-$rpmdista";
-    } elsif ($rpmdist =~ /suse sles_(\d+)/) {
-      $dist = "sles$1-$rpmdista";
-    } elsif ($rpmdist =~ /suse linux enterprise (\d+)/) {
-      $dist = "sles$1-$rpmdista";
-    } elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
-      # alpha version
-      $dist = "$1.".($2 + 1)."-$rpmdista";
-    } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
-      $dist = "$1-$rpmdista";
-    } else {
-      $dist = 'default';
-    }
+    $dist = Build::dist_canon($rpmdist, $archs[0]);
   }
   print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n";
 }
--- init_buildsystem
+++ init_buildsystem
@@ -812,6 +812,16 @@
 	    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
+        # 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
+	if test -e "$BUILD_ROOT/sbin/start"; then
+	    if test "$BUILD_ROOT/sbin/start" -ef "$BUILD_ROOT/sbin/initctl" ; then
+		echo "linking /sbin/start to /bin/true"
+		mv "$BUILD_ROOT/sbin/start" "$BUILD_ROOT/sbin/start.disabled"
+		ln -s "/bin/true" "$BUILD_ROOT/sbin/start"
+	    fi
+	fi
 	continue
     fi
 
@@ -861,6 +871,12 @@
     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
+    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"
+	done
+    fi
     echo "installing ${PKGID%% *}"
     if ! test "$BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm" -ef "$BUILD_ROOT/.init_b_cache/$PKG.rpm" ; then
 	rm -f $BUILD_ROOT/.init_b_cache/$PKG.rpm
--- initscript_qemu_vm
+++ initscript_qemu_vm
@@ -11,12 +11,18 @@
 
 echo   ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:'             > /proc/sys/fs/binfmt_misc/register
 echo   ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:'         > /proc/sys/fs/binfmt_misc/register
+
 echo   ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:'             > /proc/sys/fs/binfmt_misc/register
+
 echo   ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:'           > /proc/sys/fs/binfmt_misc/register
 echo   ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel:'       > /proc/sys/fs/binfmt_misc/register
-echo   ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:'     > /proc/sys/fs/binfmt_misc/register
-echo   ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
-echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:'       > /proc/sys/fs/binfmt_misc/register
-echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:'   > /proc/sys/fs/binfmt_misc/register
+#echo   ':mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32:'     > /proc/sys/fs/binfmt_misc/register
+#echo   ':mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
+#echo   ':mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64:'       > /proc/sys/fs/binfmt_misc/register
+#echo   ':mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el:'   > /proc/sys/fs/binfmt_misc/register
+
+echo    ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
+echo    ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
 
-exec /.build/build 
+#exec /.build/build 
+/bin/bash-static /.build/build
--- makedeltarpms
+++ makedeltarpms
-#!/usr/bin/perl -w
-
-BEGIN {
-  unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
-}
-
-use Build;
-use strict;
-
-my %oldpkgs;
-
-sub query
-{
-    my $file = shift;
-    return undef if $file =~ /\.(?:patch|delta)\.rpm$/; # XXX: rpmtags?
-    my %res = Build::Rpm::rpmq($file, qw/NAME VERSION RELEASE ARCH SOURCERPM NOSOURCE NOPATCH 1124/);
-    return undef unless %res;
-    return undef if $res{'1124'}->[0] && $res{'1124'}->[0] eq 'drpm';
-    my $arch;
-    if ($res{'SOURCERPM'}->[0]) {
-	$arch = $res{'ARCH'}->[0];
-    } else {
-#	if ($res{'NOSOURCE'}->[0] || $res{'NOPATCH'}->[0]) {
-#	    $arch = 'nosrc';
-#	} else {
-#	    $arch = 'src';
-#	}
-	return undef;
-    }
-    return { name => $res{'NAME'}->[0], file => $file, version => $res{'VERSION'}->[0], release => $res{'RELEASE'}->[0], arch => $arch};
-}
-
-my $prevbuild = shift @ARGV || die "USAGE: $0 <oldpkgdir> <directories...>";
-my @prevbuild = ($prevbuild);
-my $i = 1;
-while (-e $prevbuild.$i) {
-    push @prevbuild, $prevbuild.$i;
-    ++$i;
-}
-for my $dir (@prevbuild) {
-    for my $file (glob $dir.'/*.rpm') {
-	my $q = query($file);
-	next unless $q;
-	my $n = $q->{'name'}.'.'.$q->{'arch'};
-	push @{$oldpkgs{$n}}, $q;
-    }
-}
-
-my $sysret = 0;
-for my $dir (@ARGV) {
-    for my $file (glob $dir.'/*.rpm') {
-	my $q = query($file);
-	next unless $q;
-	my $n = $q->{'name'}.'.'.$q->{'arch'};
-	next unless exists $oldpkgs{$n};
-	for my $old (@{$oldpkgs{$n}}) {
-	    my $v = $old->{'version'};
-	    my $r = $old->{'release'};
-	    if ($v eq $q->{'version'} && $r eq $q->{'release'}) {
-		# skip if same version and release
-		next;
-	    }
-	    $v .= '_'.$q->{'version'} unless $v eq $q->{'version'};
-	    $r .= '_'.$q->{'release'} unless $r eq $q->{'release'};
-	    my $on = $old->{'file'};
-	    my $nn = $q->{'file'};
-	    my $dn = sprintf("%s-%s-%s.%s.delta.rpm", $q->{'name'}, $v, $r, $q->{'arch'});
-	    print "$dn ... ";
-	    $dn = $dir.'/'.$dn;
-	    my $ret = system('makedeltarpm', $on, $nn, $dn);
-	    if ($ret || ! -e $dn) {
-		print "FAILED\n";
-		$sysret = 1;
-	    } else {
-		my $ns = (stat($dn))[7] || 1;
-		my $os = (stat($file))[7] || 1;
-		my $saved = int($ns / $os * 100);
-		if ($ns >= $os) {
-		    print "too big ($saved%), removed\n";
-		    unlink $file;
-		} else {
-		    print "ok ($saved%)\n";
-		}
-	    }
-	}
-    }
-}
-
-exit $sysret;
--- mkbaselibs
+++ mkbaselibs
@@ -1092,6 +1092,10 @@
 my @debugrpms;
 for my $rpm (@pkgs) {
   my $rpmn = $rpm;
+  unless (-f $rpm) {
+    warn ("$rpm does not exist, skipping\n");
+    next;
+  }
   next if $rpm =~ /\.(no)?src\.rpm$/;  # ignore source rpms
   next if $rpm =~ /\.spm$/;
   $rpmn =~ s/.*\///;   # Remove leading path info
--- mkdrpms
+++ mkdrpms
+#!/usr/bin/perl -w
+
+BEGIN {
+  unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use Build;
+use strict;
+
+my $limit = 80; # throw away deltas bigger than this percentage of the reference
+my %oldpkgs;
+
+sub query
+{
+    my $file = shift;
+    return undef if $file =~ /\.(?:patch|delta)\.rpm$/; # XXX: rpmtags?
+    my %res = Build::Rpm::rpmq($file, qw/NAME VERSION RELEASE ARCH SOURCERPM NOSOURCE NOPATCH 1124/);
+    return undef unless %res;
+    return undef if $res{'1124'}->[0] && $res{'1124'}->[0] eq 'drpm';
+    my $arch;
+    if ($res{'SOURCERPM'}->[0]) {
+	$arch = $res{'ARCH'}->[0];
+    } else {
+#	if ($res{'NOSOURCE'}->[0] || $res{'NOPATCH'}->[0]) {
+#	    $arch = 'nosrc';
+#	} else {
+#	    $arch = 'src';
+#	}
+	return undef;
+    }
+    return { name => $res{'NAME'}->[0], file => $file, version => $res{'VERSION'}->[0], release => $res{'RELEASE'}->[0], arch => $arch};
+}
+
+while (@ARGV) {
+  if ($ARGV[0] eq '--limit') {
+    shift @ARGV || die "--limit needs an argument\n";
+    $limit = shift @ARGV;
+    next;
+  }
+  last;
+}
+
+my $prevbuild = shift @ARGV || die "USAGE: $0 <oldpkgdir> <directories...>";
+my @prevbuild = ($prevbuild);
+my $i = 1;
+while (-e $prevbuild.$i) {
+    push @prevbuild, $prevbuild.$i;
+    ++$i;
+}
+for my $dir (@prevbuild) {
+    for my $file (glob $dir.'/*.rpm') {
+	my $q = query($file);
+	next unless $q;
+	my $n = $q->{'name'}.'.'.$q->{'arch'};
+	push @{$oldpkgs{$n}}, $q;
+    }
+}
+
+my $sysret = 0;
+for my $dir (@ARGV) {
+    for my $file (glob $dir.'/*.rpm') {
+	my $q = query($file);
+	next unless $q;
+	my $n = $q->{'name'}.'.'.$q->{'arch'};
+	next unless exists $oldpkgs{$n};
+	for my $old (@{$oldpkgs{$n}}) {
+	    my $v = $old->{'version'};
+	    my $r = $old->{'release'};
+	    if ($v eq $q->{'version'} && $r eq $q->{'release'}) {
+		# skip if same version and release
+		next;
+	    }
+	    $v .= '_'.$q->{'version'} unless $v eq $q->{'version'};
+	    $r .= '_'.$q->{'release'} unless $r eq $q->{'release'};
+	    my $on = $old->{'file'};
+	    my $nn = $q->{'file'};
+	    my $dn = sprintf("%s-%s-%s.%s.drpm", $q->{'name'}, $v, $r, $q->{'arch'});
+	    print "$dn ... ";
+	    $dn = $dir.'/'.$dn;
+	    my $ret = system('makedeltarpm', $on, $nn, $dn);
+	    if ($ret || ! -e $dn) {
+		print "FAILED\n";
+		$sysret = 1;
+	    } else {
+		my $ns = (stat($dn))[7] || 1;
+		my $os = (stat($file))[7] || 1;
+		my $factor = int($ns / $os * 100);
+		if ($factor > $limit) {
+		    print "too big ($factor%), removed\n";
+		    unlink $dn;
+		} else {
+		    print "ok ($factor%)\n";
+		}
+	    }
+	}
+    }
+}
+
+exit $sysret;
--- signdummy
+++ signdummy
+#!/usr/bin/perl
+
+# simple "sign" replacement that does nothing but
+# write a 2048 byte file with a fixed signature.
+# sign is used in kiwi builds to sign repositories
+
+my $mode;
+
+while (@ARGV) {
+  if ($ARGV[0] =~ /^-([cdr])$/) {
+    $mode = $1;
+    shift @ARGV;
+    next;
+  }
+  if ($ARGV[0] eq '--') {
+    shift @ARGV;
+    last;
+  }
+  if ($ARGV[0] =~ /^-/) {
+    die("unsupported option $ARGV[0]\n");
+  }
+  last;
+}
+die("only detached mode possible\n") if !$mode || $mode ne 'd';
+die("filter mode not supported\n") unless @ARGV;
+
+for my $file (@ARGV) {
+  local *F;
+  open(F, '<', $file) || die("$file: $!\n");
+  my $buf = '';
+  1 while sysread(F, $buf, 16384, length($buf));
+  close(F) || die("$file: $!\n");
+  my $block = "sIGnMe!\n";
+  $block .= sprintf("%08x%08x\n", length($buf), unpack("%32C*", $buf));
+  $block .= "\0" x (2048 - length($block));
+  open(F, '>', "$file.asc") || die("$file.asc: $!\n");
+  (syswrite(F, $block) || 0) == 2048 || die("$file.asc: $!\n");
+  close(F) || die("$file.asc: $!\n");
+}
--- spectool
+++ spectool
@@ -170,16 +170,19 @@
 }
 push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
 
-$dist = 'default' unless $dist;
+unless ($dist) {
+    $dist = `rpm -q --qf '%{DISTRIBUTION}' rpm 2>/dev/null`;
+    $dist = Build::dist_canon($dist||'', $archs[0]);
+}
 
 if($dist !~ /\// && !defined $configdir) {
   if($0 =~ /^\//) {
     use File::Basename qw/dirname/;
     $configdir = dirname($0).'/configs';
-    undef $configdir unless -e $configdir.'/default.conf';
+    undef $configdir unless -e $configdir.'/sl11.3.conf';
   } else {
     $configdir = $builddir.'/configs';
-    undef $configdir unless -e $configdir.'/default.conf';
+    undef $configdir unless -e $configdir.'/sl11.3.conf';
   }
   if(!defined $configdir) {
     print STDERR "please specify config dir\n";
@@ -274,7 +277,7 @@
       for my $t (keys %$parsed) {
         next unless ($t =~ /^(?:source|patch)\d*/);
         my $url = $parsed->{$t};
-        next unless $url =~ /^(?:http|ftp):\/\//;
+        next unless $url =~ /^(?:https?|ftp):\/\//;
         my $file = $url;
         $file =~ s/.*\///;
         next if -e $file;
--- t
+++ t
+(directory)
--- t/dist
+++ t/dist
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 9;
+use Build;
+
+sub d {
+  Build::dist_canon($_[0], $_[1]||'i586');
+}
+
+is(d("UnitedLinux 1.0 (x86-64)"),       "ul1-x86_64");
+is(d("SuSE SLES-8 (ia64)"),             "sles8-ia64");
+is(d("SuSE Linux 8.2 (x86-64)"),        "8.2-x86_64");
+is(d("SuSE SLES-9 (x86-64)"),           "sles9-x86_64");
+is(d("SUSE Linux 10.1 (PPC64)"),        "10.1-ppc64");
+is(d("SUSE Linux Enterprise 10 (PPC)"), "sles10-ppc");
+is(d("openSUSE 10.3 (X86-64)"),         "10.3-x86_64");
+is(d("SUSE Linux Enterprise 11"),       "sles11-i386");
+is(d("openSUSE 11.3"),                  "11.3-i386");
--- vc
+++ vc
@@ -109,7 +109,7 @@
 	touch $changelog
 fi
 
-tmpfile=`mktemp -q $changelog.XXXXXX`
+tmpfile=`mktemp -q $changelog.vctmp.XXXXXX`
 if [ $? -ne 0 ]; then
 	echo "$0: Can't create temp file, exiting..."
 	exit 1

++++++ debian.changelog
--- debian.changelog
+++ debian.changelog
@@ -1,3 +1,10 @@
+build (2010.11.24-1) unstable; urgency=low
+
+  * New upstream release: 2010.11.24
+    - add workaround for Ubuntu 10 builds.
+
+ -- Fathi Boudra <fathi.boudra at nokia.com>  Wed, 01 Dec 2010 11:47:49 +0200
+
 build (2010.08.04) unstable; urgency=low
 
   * Update to 2010.08.04 git snapshot

++++++ debian.tar.gz
--- compat
+++ compat
@@ -1 +1 @@
-4
+7
--- control
+++ control
@@ -1,9 +1,9 @@
 Source: build
 Section: devel
 Priority: optional
-Maintainer: Adrian Schroeter <adrian at suse.de>
-Build-Depends: debhelper (>= 4)
-Standards-Version: 3.7.2
+Maintainer: Jian-feng Ding <jian-feng.ding at intel.com>
+Build-Depends: debhelper (>= 7)
+Standards-Version: 3.8.0
 
 Package: build
 Architecture: all
@@ -12,4 +12,3 @@
 Description: A script to build SUSE Linux RPMs
  This package provides a script for building RPMs for SUSE Linux
  in a chroot environment.
-
--- rules
+++ rules
@@ -1,16 +1,4 @@
 #!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany
-# This file and all modifications and additions to the pristine package
-# are under the same license as the package itself.
-#
-# Please submit bugfixes or commens via http://bugs.opensuse.org
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
@@ -22,9 +10,7 @@
 	dh_testdir
 	touch configure-stamp
 
-
 build: build-stamp
-
 build-stamp: configure-stamp 
 	dh_testdir
 	touch build-stamp
@@ -41,7 +27,8 @@
 	dh_testroot
 	dh_clean -k 
 	dh_installdirs
-	make DESTDIR=$(CURDIR)/debian/build install
+
+	make install DESTDIR=$(CURDIR)/debian/build
 	install debian/meego-1.0.conf $(CURDIR)/debian/build/usr/lib/build/configs
 	(cd $(CURDIR)/debian/build/usr/lib/build/configs/;ln -s meego-1.0.conf default.conf)
 




More information about the MeeGo-commits mailing list