aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-04-11 16:06:52 +0000
committerFrancois Pons <fpons@mandriva.com>2003-04-11 16:06:52 +0000
commite6afdabda415104a478da84a09dcb78c73b80ce2 (patch)
treeea1d90d5817fc360e9e74c6f313d539f4e396611 /URPM
parentb73e161f4c85132e6c12d67a4ec413f9118659b1 (diff)
downloadperl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.gz
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.bz2
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.tar.xz
perl-URPM-e6afdabda415104a478da84a09dcb78c73b80ce2.zip
brand new 0.82 version (flag_skip, excludedocs, fix NULL get_name)
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm40
1 files changed, 40 insertions, 0 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index dc424fb..f67612c 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -11,12 +11,14 @@ sub find_candidate_packages {
foreach (split '\|', $dep) {
if (/^\d+$/) {
my $pkg = $urpm->{depslist}[$_];
+ $pkg->flag_skip and next;
$pkg->arch eq 'src' || $pkg->is_arch_compat or next;
$avoided && exists $avoided->{$pkg->fullname} and next;
push @{$packages{$pkg->name}}, $pkg;
} elsif (my ($property, $name) = /^(([^\s\[]*).*)/) {
foreach (keys %{$urpm->{provides}{$name} || {}}) {
my $pkg = $urpm->{depslist}[$_];
+ $pkg->flag_skip and next;
$pkg->is_arch_compat or next;
$avoided && exists $avoided->{$pkg->fullname} and next;
#- check if at least one provide of the package overlap the property.
@@ -641,6 +643,44 @@ sub compute_installed_flags {
\%sizes;
}
+#- compute skip flag according to hash describing package to remove
+#- $skip is a hash reference described as follow :
+#- key is package name or regular expression on fullname if /.../
+#- value is reference to hash indicating sense information ({ '' => undef } if none).
+#- options hash :
+#- callback : sub to be called for each package with skip flag activated,
+sub compute_skip_flags {
+ my ($urpm, $skip, %options) = @_;
+
+ #- avoid losing our time.
+ %$skip or return;
+
+ foreach my $pkg (@{$urpm->{depslist}[$_]}) {
+ #- check if fullname is matching a regexp.
+ if (grep { exists($skip->{$_}{''}) && /^\/(.*)\/$/ && $pkg->fullname =~ /$1/ } keys %$skip) {
+ #- a single selection on fullname using a regular expression.
+ unless ($pkg->flag_skip) {
+ $pkg->set_flag_skip;
+ $options{callback} and $options{callback}->($urpm, $pkg, %options);
+ }
+ } else {
+ #- check if a provides match at least one package.
+ foreach ($pkg->provides) {
+ if (my ($n, $s) = /^([^\s\[]*)(?:\[\*\])?\[?([^\s\]]*\s*[^\s\]]*)/) {
+ foreach my $sn ($n, grep { /^\/(.*)\/$/ && $n =~ /$1/ } keys %$skip) {
+ foreach (keys %{$skip->{$sn} || {}}) {
+ if (URPM::ranges_overlap($_, $s) && !$pkg->flag_skip) {
+ $pkg->set_flag_skip;
+ $options{callback} and $options{callback}->($urpm, $pkg, %options);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
#- select packages to upgrade, according to package already registered.
#- by default, only takes best package and its obsoleted and compute
#- all installed or upgrade flag.