diff options
author | SoonKyu Park <sk7.park@samsung.com> | 2017-04-04 20:28:34 +0900 |
---|---|---|
committer | SoonKyu Park <sk7.park@samsung.com> | 2017-04-04 20:28:34 +0900 |
commit | 42b9aef59d0185e879e19c3d572969ae0f816680 (patch) | |
tree | fd153a24d1ef95fea31afa392b187da2247ce5eb | |
parent | b6e1a2cb3b07a263e2cf270f35893f46cb5c0e2b (diff) | |
parent | 5405ec3109bafaaf41cdf5c6ac88f819005b88e4 (diff) | |
download | build-42b9aef59d0185e879e19c3d572969ae0f816680.tar.gz build-42b9aef59d0185e879e19c3d572969ae0f816680.tar.bz2 build-42b9aef59d0185e879e19c3d572969ae0f816680.zip |
Merge branch 'master' into devel
-rw-r--r-- | Build.pm | 66 | ||||
-rwxr-xr-x | createdirdeps | 6 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rwxr-xr-x | expanddeps | 53 | ||||
-rwxr-xr-x | init_buildsystem | 9 | ||||
-rw-r--r-- | packaging/build.changes | 5 | ||||
-rw-r--r-- | packaging/build.spec | 6 |
7 files changed, 135 insertions, 16 deletions
@@ -586,11 +586,13 @@ sub get_cbinstalls { return @{[]}; } sub readdeps { my ($config, $pkginfo, @depfiles) = @_; - my %requires; local *F; + my %requires; my %provides; my %pkgconflicts; my %pkgobsoletes; + my %recommends; + my %supplements; my $dofileprovides = %{$config->{'fileprovides'} || {}}; for my $depfile (@depfiles) { if (ref($depfile) eq 'HASH') { @@ -599,6 +601,8 @@ sub readdeps { $requires{$rr} = $depfile->{$rr}->{'requires'}; $pkgconflicts{$rr} = $depfile->{$rr}->{'conflicts'}; $pkgobsoletes{$rr} = $depfile->{$rr}->{'obsoletes'}; + $recommends{$rr} = $depfile->{$rr}->{'recommends'}; + $supplements{$rr} = $depfile->{$rr}->{'supplements'}; } next; } @@ -640,7 +644,7 @@ sub readdeps { } my %ss; @ss = grep {!$ss{$_}++} @ss; - if ($s =~ /^(P|R|C|O):(.*)\.(.*)-\d+\/\d+\/\d+:$/) { + if ($s =~ /^(P|R|C|O|r|s):(.*)\.(.*)-\d+\/\d+\/\d+:$/) { my $pkgid = $2; my $arch = $3; if ($1 eq "P") { @@ -666,6 +670,16 @@ sub readdeps { $pkginfo->{$pkgid}->{'obsoletes'} = \@ss if $pkginfo; next; } + if ($1 eq "r") { + $recommends{$pkgid} = \@ss; + $pkginfo->{$pkgid}->{'recommends'} = \@ss if $pkginfo; + next; + } + if ($1 eq "s") { + $supplements{$pkgid} = \@ss; + $pkginfo->{$pkgid}->{'supplements'} = \@ss if $pkginfo; + next; + } } } close F; @@ -689,6 +703,8 @@ sub readdeps { $config->{'requiresh'} = \%requires; $config->{'pkgconflictsh'} = \%pkgconflicts; $config->{'pkgobsoletesh'} = \%pkgobsoletes; + $config->{'recommendsh'} = \%recommends; + $config->{'supplementsh'} = \%supplements; makewhatprovidesh($config); } @@ -716,6 +732,8 @@ sub writedeps { print $fh "R:$id".join(' ', @{$pkg->{'requires'}})."\n" if $pkg->{'requires'}; print $fh "C:$id".join(' ', @{$pkg->{'conflicts'}})."\n" if $pkg->{'conflicts'}; print $fh "O:$id".join(' ', @{$pkg->{'obsoletes'}})."\n" if $pkg->{'obsoletes'}; + print $fh "r:$id".join(' ', @{$pkg->{'recommends'}})."\n" if $pkg->{'recommends'}; + print $fh "s:$id".join(' ', @{$pkg->{'supplements'}})."\n" if $pkg->{'supplements'}; print $fh "I:$id".getbuildid($pkg)."\n"; } @@ -751,6 +769,8 @@ sub forgetdeps { delete $config->{'requiresh'}; delete $config->{'pkgconflictsh'}; delete $config->{'pkgobsoletesh'}; + delete $config->{'recommendsh'}; + delete $config->{'supplementsh'}; } my %addproviders_fm = ( @@ -854,6 +874,17 @@ sub checkobsoletes { return 0; } +sub todo2recommended { + my ($config, $recommended, $todo) = @_; + my $whatprovides = $config->{'whatprovidesh'}; + my $pkgrecommends = $config->{'recommendsh'} || {}; + for my $p (splice @$todo) { + for my $r (@{$pkgrecommends->{$p} || []}) { + $recommended->{$_} = 1 for @{$whatprovides->{$r} || addproviders($config, $r)} + } + } +} + sub expand { my ($config, @p) = @_; @@ -863,6 +894,8 @@ sub expand { my $prefer = $config->{'preferh'}; my $ignore = $config->{'ignoreh'}; my $ignoreconflicts = $config->{'expandflags:ignoreconflicts'}; + my $ignoreignore; + my $userecommendsforchoices = 1; my $whatprovides = $config->{'whatprovidesh'}; my $requires = $config->{'requiresh'}; @@ -880,8 +913,18 @@ sub expand { } @p = grep {!/^-/} @p; - my %p; # expanded packages my %aconflicts; # packages we are conflicting with + for (grep {/^!/} @p) { + my $r = /^!!/ ? substr($_, 2) : substr($_, 1); + my @q = @{$whatprovides->{$r} || addproviders($config, $r)}; + @q = nevrmatch($config, $r, @q) if /^!!/; + $aconflicts{$_} = "is in BuildConflicts" for @q; + } + my %recommended; # recommended by installed packages + my @rec_todo; # installed todo + + @p = grep {!/^[-!]/} @p; + my %p; # expanded packages # add direct dependency packages. this is different from below, # because we add packages even if the dep is already provided and @@ -910,6 +953,7 @@ sub expand { $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)}); } } + push @rec_todo, $q[0] if $userecommendsforchoices; } push @p, @directdepsend; @@ -975,6 +1019,12 @@ sub expand { last; } } + if ($doamb == 2) { + todo2recommended($config, \%recommended, \@rec_todo) if @rec_todo; + my @pq = grep {$recommended{$_}} @q; + print "recommended [@pq] among [@q]\n" if $expand_dbg; + @q = @pq if @pq; + } if (@q > 1) { if ($r ne $p) { push @error, "have choice for $r needed by $p: @q"; @@ -996,6 +1046,7 @@ sub expand { $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)}); } } + push @rec_todo, $q[0] if $userecommendsforchoices; @error = (); $doamb = 0; } @@ -1004,11 +1055,12 @@ sub expand { next if @p; # still work to do # only ambig stuff left - if (@pamb && !$doamb) { + if (@pamb && ($doamb == 0 || $doamb == 1)) { @p = @pamb; @pamb = (); - $doamb = 1; - print "now doing undecided dependencies\n" if $expand_dbg; + todo2recommended($config, \%recommended, \@rec_todo) if @rec_todo; + $doamb = %recommended ? 2 : 3; + print "now doing undecided dependencies, $doamb = $doamb\n" if $expand_dbg; next; } return undef, @error if @error; @@ -1020,6 +1072,7 @@ sub order { my ($config, @p) = @_; my $requires = $config->{'requiresh'}; + my $recommends = $config->{'recommendsh'}; my $whatprovides = $config->{'whatprovidesh'}; my %deps; my %rdeps; @@ -1117,6 +1170,7 @@ sub add_all_providers { my ($config, @p) = @_; my $whatprovides = $config->{'whatprovidesh'}; my $requires = $config->{'requiresh'}; + my $recommends = $config->{'recommendsh'}; my %a; for my $p (@p) { for my $r (@{$requires->{$p} || [$p]}) { diff --git a/createdirdeps b/createdirdeps index 280e4f5..49bf09e 100755 --- a/createdirdeps +++ b/createdirdeps @@ -51,7 +51,7 @@ my %old; if (defined($oldfile) && open(F, '<', $oldfile)) { while (<F>) { chomp; - $old{$1} = $_ if /^([PRCOI]:[^ ]+): /; + $old{$1} = $_ if /^([PRrsCOI]:[^ ]+): /; } close F; } @@ -78,14 +78,14 @@ for my $dir (@ARGV) { next if $seen{$idx}; $seen{$idx} = 1; print "F:$idx: $path\n"; - for (qw{P R C O I}) { + for (qw{P R r s C O I}) { print $old{"$_:$idx"}."\n" if $old{"$_:$idx"}; } next; } } } - my $q = Build::query($path, 'addselfprovides' => 1, 'conflicts' => 1, 'evra' => 1, 'buildtime' => 1, 'alldeps' => 1); + my $q = Build::query($path, 'addselfprovides' => 1, 'conflicts' => 1, 'evra' => 1, 'buildtime' => 1, 'weakdeps' => 1); next unless $q && defined($q->{'name'}) && defined($q->{'arch'}) && defined($q->{'version'}); my $idx = "$q->{'name'}.$q->{'arch'}-$id"; next if $seen{$idx}; diff --git a/debian/changelog b/debian/changelog index 8a03c43..fa48aff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +build (20150115-tizen20170114) unstable; urgency=high + + * update tizen version to tizen20170114 + + -- SoonKyu Park <sk7.park@samsung.com> Sat, 14 Jan 2017 19:30:22 +0200 + build (20150115-tizen20161231) unstable; urgency=high * update tizen version to tizen20161231 @@ -126,7 +126,7 @@ if (defined($dist) && $dist ne '') { $binarytype = $cf->{'binarytype'} if $cf->{'binarytype'} && $cf->{'binarytype'} ne 'UNDEFINED'; } -my (%fn, %prov, %req, %con, %obs); +my (%fn, %prov, %req, %con, %obs, %rec, %sup); my %packs; my %repo; @@ -170,7 +170,7 @@ my %exportfilters = %{$cf->{'exportfilter'}}; open(F, '<', $rpmdeps) || die("$rpmdeps: $!\n"); # WARNING: the following code assumes that the 'I' tag comes last -my ($pkgF, $pkgP, $pkgR, $pkgC, $pkgO); +my ($pkgF, $pkgP, $pkgR, $pkgC, $pkgO, $pkgr, $pkgs); my $verscmp = \&Build::Rpm::verscmp; @@ -210,6 +210,8 @@ while(<F>) { $pkgR = $2; next if $req{$1}; $req{$1} = $2; + } elsif (/^r:(.*?)-\d+\/\d+\/\d+: (.*)$/) { + $pkgr = $2; } elsif (/^C:(.*?)-\d+\/\d+\/\d+: (.*)$/) { $pkgC = $2; next if $con{$1}; @@ -218,6 +220,10 @@ while(<F>) { $pkgO = $2; next if $obs{$1}; $obs{$1} = $2; + } elsif (/^r:(.*?)-\d+\/\d+\/\d+: (.*)$/) { + $pkgr = $2; + } elsif (/^s:(.*?)-\d+\/\d+\/\d+: (.*)$/) { + $pkgs = $2; } elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) { my $r = 0; if ($usehigherdeps) { @@ -241,11 +247,16 @@ while(<F>) { $fn{$i} = $pkgF; $prov{$i} = $pkgP; delete $req{$i}; + delete $rec{$i}; delete $con{$i}; delete $obs{$i}; + delete $rec{$i}; + delete $sup{$i}; $req{$i} = $pkgR; $con{$i} = $pkgC if defined $pkgC; $obs{$i} = $pkgO if defined $pkgO; + $rec{$i} = $pkgr if defined $pkgr; + $sup{$i} = $pkgs if defined $pkgs; } else { next if $ids{$1}; $ids{$1} = $2; @@ -255,6 +266,8 @@ while(<F>) { undef $pkgR; undef $pkgC; undef $pkgO; + undef $pkgr; + undef $pkgs; } elsif ($_ eq 'D:') { %packs_done = %ids; } @@ -267,7 +280,7 @@ for my $arch (@archs) { for my $pack (keys %packs) { my $r = {}; - my (@s, $s, @pr, @re, @co, @ob); + my (@s, $s, @pr, @re, @co, @ob, @rc, @su); @s = split(' ', $prov{$packs{$pack}} || ''); while (@s) { $s = shift @s; @@ -324,10 +337,44 @@ for my $pack (keys %packs) { splice(@s, 0, 2); } } + @s = split(' ', $rec{$packs{$pack}} || ''); + while (@s) { + $s = shift @s; + next if !$dofileprovides && $s =~ /^\//; + if ($s =~ /^rpmlib\(/) { + splice(@s, 0, 2); + next; + } + push @rc, $s; + while (@s && $s[0] =~ /^[\(<=>|]/) { + $rc[-1] .= " $s[0] $s[1]"; + $rc[-1] =~ s/ \((.*)\)/ $1/; + $rc[-1] =~ s/(<|>){2}/$1/; + splice(@s, 0, 2); + } + } + @s = split(' ', $sup{$packs{$pack}} || ''); + while (@s) { + $s = shift @s; + next if !$dofileprovides && $s =~ /^\//; + if ($s =~ /^rpmlib\(/) { + splice(@s, 0, 2); + next; + } + push @su, $s; + while (@s && $s[0] =~ /^[\(<=>|]/) { + $su[-1] .= " $s[0] $s[1]"; + $su[-1] =~ s/ \((.*)\)/ $1/; + $su[-1] =~ s/(<|>){2}/$1/; + splice(@s, 0, 2); + } + } $r->{'provides'} = \@pr; $r->{'requires'} = \@re; $r->{'conflicts'} = \@co; $r->{'obsoletes'} = \@ob; + $r->{'recommends'} = \@rc; + $r->{'supplements'} = \@su; $repo{$pack} = $r; } diff --git a/init_buildsystem b/init_buildsystem index 9d3fd80..2ed0473 100755 --- a/init_buildsystem +++ b/init_buildsystem @@ -978,8 +978,13 @@ for PKG in $MAIN_LIST ; do continue fi fi - - PKGID=$(perl -I$BUILD_DIR -MBuild -e Build::showquery "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" buildid) + + # revert use rpm to query pkgid if building rpm package + if test "$PSUF" != "rpm" ; then + PKGID=$(perl -I$BUILD_DIR -MBuild -e Build::showquery "$BUILD_ROOT/.init_b_cache/rpms/$PKG.$PSUF" buildid) + else + PKGID=`rpm -qp --qf "$RPMIDFMT" $RPMCHECKOPTS_HOST $BUILD_ROOT/.init_b_cache/rpms/$PKG.rpm` + fi if test -f $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG ; then read OLDPKGID < $BUILD_ROOT/.init_b_cache/alreadyinstalled/$PKG diff --git a/packaging/build.changes b/packaging/build.changes index 29a4d9c..f6d1350 100644 --- a/packaging/build.changes +++ b/packaging/build.changes @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Sat Jan 14 19:30:00 CST 2017 - sk7.park@samsung.com + +- update tizen version to tizen20170114 + +------------------------------------------------------------------- Sat Dec 31 19:30:00 CST 2016 - sk7.park@samsung.com - update tizen version to tizen20161231 diff --git a/packaging/build.spec b/packaging/build.spec index fbf5b77..adc331f 100644 --- a/packaging/build.spec +++ b/packaging/build.spec @@ -72,7 +72,7 @@ Requires: build-mkbaselibs %if 0%{?suse_version} > 1120 || 0%{?mdkversion} Recommends: build-mkdrpms %endif -Provides: tizen-build = 20161231 +Provides: tizen-build = 20170114 %description This package provides a script for building RPMs for SUSE Linux in a chroot environment. @@ -116,7 +116,7 @@ Group: Development/Tools/Building Requires: build BuildRequires: gcc BuildRequires: glibc-devel -Provides: tizen-build-initvm-%{initvm_arch} = 20161231 +Provides: tizen-build-initvm-%{initvm_arch} = 20170114 Obsoletes: build-initvm %if 0%{?suse_version} BuildRequires: glibc-devel-static @@ -194,6 +194,8 @@ test -e default.conf /usr/lib/build/initvm.* %changelog +* Sat Jan 14 2017 sk7.park@samsung.com +- update tizen version to tizen20170114 * Sat Dec 31 2016 sk7.park@samsung.com - update tizen version to tizen20161231 * Wed Sep 28 2016 sk7.park@samsung.com |