From c05c77b707b247e2493aae20ecaca531a72ecad9 Mon Sep 17 00:00:00 2001 From: "y0169.zhang" Date: Thu, 18 Aug 2016 12:37:48 +0900 Subject: [PATCH] Add --use-higher-deps option, which repo provides higher version deps, use it Change-Id: I127bc0a55dc59a9b4f737d41a02c1b37532fa030 --- depanneur | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/depanneur b/depanneur index 4f1559e..6eb6069 100755 --- a/depanneur +++ b/depanneur @@ -130,6 +130,7 @@ my $icecream = 0; # use icecream to specify the number of parallel process my $noinit = 0; # don't check build root, just go into it and building my $keep_packs = 0; # don't remove useless rpm packages from build root my $thread_export = 0; # use thread when gbs export source code +my $use_higher_deps = 0; # which repo provides higher version deps, use it my @defines; # define extra macros for 'rpmbuild' my $arg_spec = ""; # spec file to be built this time my $start_time = ""; # build start time @@ -204,6 +205,7 @@ GetOptions ( "noinit" => \$noinit, "keep-packs" => \$keep_packs, "thread-export" => \$thread_export, + "use-higher-deps" => \$use_higher_deps, "define=s" => \@defines, "spec=s" => \$arg_spec, "clean-repos" => \$clean_repos, @@ -971,7 +973,18 @@ sub refresh_repo { next if $req{$1}; $req{$1} = $2; } elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) { - if ($ids{$1} && !$packs_done{$1} && defined($pkgF) && defined($pkgP) && defined($pkgR)) { + my $r = 0; + if ($use_higher_deps == 1) { + $r = 1; + } else { + if ($packs_done{$1}) { + $r = 0; + } else { + $r = 1; + } + } + + if ($ids{$1} && ($r == 1) && defined($pkgF) && defined($pkgP) && defined($pkgR)) { my $i = $1; my $oldid = $ids{$1}; my $newid = $2; @@ -1636,6 +1649,7 @@ sub build_package { push @args, "--jobs " . $nprocessors * 2; push @args, "--no-init" if ($noinit == 1); push @args, "--keep-packs" if ($keep_packs == 1); + push @args, "--use-higher-deps" if ($use_higher_deps == 1); push @args, "--cachedir $cache_dir"; push @args, "--dist $dist_configs/$dist.conf"; push @args, "--arch $archpath"; -- 2.34.1