Hello community, here is the log from the commit of package build for openSUSE:Factory checked in at 2015-10-14 16:35:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/build (Old) and /work/SRC/openSUSE:Factory/.build.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "build" Changes: -------- --- /work/SRC/openSUSE:Factory/build/build.changes 2015-10-06 13:22:53.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.build.new/build.changes 2015-10-14 16:35:15.000000000 +0200 @@ -1,0 +2,7 @@ +Fri Oct 9 08:41:04 UTC 2015 - [email protected] + +- avoid dependency to perl(parent) again +- fixed buildtime source service execution +- fixed debian collax support + +------------------------------------------------------------------- Old: ---- obs-build-20150917.tar.gz New: ---- obs-build-20151006.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ build.spec ++++++ --- /var/tmp/diff_new_pack.7X3dnY/_old 2015-10-14 16:35:16.000000000 +0200 +++ /var/tmp/diff_new_pack.7X3dnY/_new 2015-10-14 16:35:16.000000000 +0200 @@ -22,7 +22,7 @@ Summary: A Script to Build SUSE Linux RPMs License: GPL-2.0+ and GPL-2.0 Group: Development/Tools/Building -Version: 20150917 +Version: 20151006 Release: 0 Source: obs-build-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -38,7 +38,6 @@ Requires: binutils Requires: perl Requires: tar -Requires: perl(parent) %if 0%{?fedora} Requires: perl-MD5 Requires: perl-TimeDate ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.7X3dnY/_old 2015-10-14 16:35:16.000000000 +0200 +++ /var/tmp/diff_new_pack.7X3dnY/_new 2015-10-14 16:35:16.000000000 +0200 @@ -1,5 +1,5 @@ pkgname=build -pkgver=20150917 +pkgver=20151006 pkgrel=0 pkgdesc="Build packages in sandbox" arch=('i686' 'x86_64') ++++++ build.dsc ++++++ --- /var/tmp/diff_new_pack.7X3dnY/_old 2015-10-14 16:35:16.000000000 +0200 +++ /var/tmp/diff_new_pack.7X3dnY/_new 2015-10-14 16:35:16.000000000 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: build -Version: 20150917 +Version: 20151006 Binary: build Maintainer: Adrian Schroeter <[email protected]> Architecture: all ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.7X3dnY/_old 2015-10-14 16:35:16.000000000 +0200 +++ /var/tmp/diff_new_pack.7X3dnY/_new 2015-10-14 16:35:16.000000000 +0200 @@ -1,4 +1,4 @@ -build (20150917) unstable; urgency=low +build (20151006) unstable; urgency=low * Update to current git trunk - add sles11sp2 build config and adapt autodetection ++++++ obs-build-20150917.tar.gz -> obs-build-20151006.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150917/Build/Archrepo.pm new/obs-build-20151006/Build/Archrepo.pm --- old/obs-build-20150917/Build/Archrepo.pm 2015-09-17 12:45:53.000000000 +0200 +++ new/obs-build-20151006/Build/Archrepo.pm 2015-10-09 08:19:45.000000000 +0200 @@ -25,9 +25,9 @@ eval { require Archive::Tar; }; if (!defined &Archive::Tar::iter) { - die("Archive::Tar is not available\n") unless defined &Archive::Tar::new; *Archive::Tar::iter = sub { my ($class, $filename) = @_; + die("Archive::Tar is not available\n") unless defined &Archive::Tar::new; my $handle = $class->_get_handle($filename, 1, 'rb') or return undef; my @data; return sub { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150917/Build/Mdkrepo.pm new/obs-build-20151006/Build/Mdkrepo.pm --- old/obs-build-20150917/Build/Mdkrepo.pm 2015-09-17 12:45:53.000000000 +0200 +++ new/obs-build-20151006/Build/Mdkrepo.pm 2015-10-09 08:19:45.000000000 +0200 @@ -86,6 +86,8 @@ $s->{'requires'} = parsedeps(substr($_, 10)); } elsif (/^\@suggests\@/) { $s->{'suggests'} = parsedeps(substr($_, 10)); + } elsif (/^\@recommends\@/) { + $s->{'recommends'} = parsedeps(substr($_, 12)); } elsif (/^\@obsoletes\@/) { $s->{'obsoletes'} = parsedeps(substr($_, 11)); } elsif (/^\@conflicts\@/) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150917/Build.pm new/obs-build-20151006/Build.pm --- old/obs-build-20150917/Build.pm 2015-09-17 12:45:53.000000000 +0200 +++ new/obs-build-20151006/Build.pm 2015-10-09 08:19:45.000000000 +0200 @@ -363,7 +363,7 @@ } if (!$config->{'binarytype'}) { $config->{'binarytype'} = 'rpm' if $config->{'type'} eq 'spec' || $config->{'type'} eq 'kiwi'; - $config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc' || $config->{'type'} eq 'livebuild'; + $config->{'binarytype'} = 'deb' if $config->{'type'} eq 'dsc' || $config->{'type'} eq 'collax' || $config->{'type'} eq 'livebuild'; $config->{'binarytype'} = 'arch' if $config->{'type'} eq 'arch'; $config->{'binarytype'} ||= 'UNDEFINED'; } @@ -657,8 +657,8 @@ } ### just for API compability -sub get_cbpreinstalls { return @{[]}; } -sub get_cbinstalls { return @{[]}; } +sub get_cbpreinstalls { return (); } +sub get_cbinstalls { return (); } ########################################################################### diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150917/build new/obs-build-20151006/build --- old/obs-build-20150917/build 2015-09-17 12:45:53.000000000 +0200 +++ new/obs-build-20151006/build 2015-10-09 08:19:45.000000000 +0200 @@ -1280,7 +1280,7 @@ if test -e _service; then echo "Running build time source services..." - $BUILD_DIR/runservices || cleanup_and_exit 1 + $BUILD_DIR/runservices --buildroot "$BUILD_ROOT" || cleanup_and_exit 1 fi echo ----------------------------------------------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obs-build-20150917/runservices new/obs-build-20151006/runservices --- old/obs-build-20150917/runservices 2015-09-17 12:45:53.000000000 +0200 +++ new/obs-build-20151006/runservices 2015-10-09 08:19:45.000000000 +0200 @@ -12,6 +12,9 @@ use Build::SimpleXML; +my $servicedir = '/usr/lib/obs/service'; +my $buildroot = ''; + sub ls { local *D; opendir(D, $_[0]) || return (); @@ -21,26 +24,27 @@ } sub run_services { - my ($xml, $count) = @_; - $count ||= 0; - die("_service inclusion depth limit reached\n") if $count++ > 10; - my $servicedir = "/usr/lib/obs/service"; + my ($xml) = @_; - my @servicxml; my $servicexml = Build::SimpleXML::parse($xml); - die("not a _service file\n") unless $servicexml && $servicexml->{'services'}; + die("not a valid _service file\n") unless $servicexml && $servicexml->{'services'}; $servicexml = $servicexml->{'services'}->[0]; - my $tempdir = File::Temp::tempdir('CLEANUP' => 1); + my $tempdir; + if ($buildroot ne '') { + $tempdir = File::Temp::tempdir('CLEANUP' => 1, 'DIR' => "$buildroot/tmp"); + die("bad tempdir\n") unless $tempdir =~ s/^\Q$buildroot\E//; + } else { + $tempdir = File::Temp::tempdir('CLEANUP' => 1); + } # take default version setting - my $services = ($servicexml->{'service'} || []); - for my $s (@{$services || []}) { + for my $s (@{$servicexml->{'service'} || []}) { # buildtime only is default next unless $s->{'mode'} && $s->{'mode'} eq 'buildtime'; die("missing name in service\n") unless $s->{'name'}; - if (!-x "$servicedir/$s->{'name'}") { + if (! -x "$buildroot$servicedir/$s->{'name'}") { die("service '$s->{'name'}' configured to run, but is not available\n"); } @@ -54,27 +58,35 @@ } push @run, "--outdir"; push @run, $tempdir; - if (system(@run) != 0) { - die("service run failed for $s->{'name'}\n") + my $pid = fork(); + die("fork: $!\n") unless defined $pid; + if ($pid == 0) { + if ($buildroot ne '') { + chroot($buildroot) || die("chroot $buildroot: $!\n"); + } + exec(@run); + die("$run[0]: $!\n"); } + 1 while waitpid($pid, 0) != $pid; + die("service run failed for service '$s->{'name'}'\n") if $?; # copy back - for my $file (grep {!/^[:\.]/} ls($tempdir)) { - File::Copy::move("$tempdir/$file", $file) if -f "$tempdir/$file"; + for my $file (grep {!/^[:\.]/} ls("$buildroot$tempdir")) { + File::Copy::move("$buildroot$tempdir/$file", $file) if -f "$buildroot$tempdir/$file"; } } } +if (@ARGV > 1 && $ARGV[0] eq '--buildroot') { + shift @ARGV; + $buildroot = shift @ARGV; + $buildroot = '' if $buildroot && $buildroot eq '/'; + die("bad buildroot\n") unless $buildroot eq '' || $buildroot =~ /^\//; +} + local *F; -open(F, '<', "_service") || die("_service: $!\n"); +open(F, '<', '_service') || die("_service: $!\n"); my $xml = ''; 1 while sysread(F, $xml, 4096, length($xml)) > 0; close F; -my $d; -eval { - $d = run_services($xml); -}; -if ($@) { - print $@; - exit(1); -} -exit(0); + +run_services($xml);
