summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-21 14:34:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-21 14:34:50 +0000
commit6c2bdf36b20c2f3b23e3923c7065840c780b31f4 (patch)
tree8a6f74c8244841beaaa422c12f92279178b76da5 /urpm.pm
parent1df0d930db2c69f55819d96f88a4d08943351802 (diff)
downloadurpmi-6c2bdf36b20c2f3b23e3923c7065840c780b31f4.tar
urpmi-6c2bdf36b20c2f3b23e3923c7065840c780b31f4.tar.gz
urpmi-6c2bdf36b20c2f3b23e3923c7065840c780b31f4.tar.bz2
urpmi-6c2bdf36b20c2f3b23e3923c7065840c780b31f4.tar.xz
urpmi-6c2bdf36b20c2f3b23e3923c7065840c780b31f4.zip
create _compute_flags_for_skiplist() and _compute_flags_for_instlist() out of configure()
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm60
1 files changed, 35 insertions, 25 deletions
diff --git a/urpm.pm b/urpm.pm
index 7f22c677..753dccd2 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -725,34 +725,44 @@ sub configure {
}
}
#- determine package to withdraw (from skip.list file) only if something should be withdrawn.
- unless ($options{nodepslist} || $options{no_skiplist}) {
- my %uniq;
- $urpm->compute_flags(
- get_packages_list($urpm->{skiplist}, $options{cmdline_skiplist}),
- skip => 1,
- callback => sub {
- my ($urpm, $pkg) = @_;
- $pkg->is_arch_compat && ! exists $uniq{$pkg->fullname} or return;
- $uniq{$pkg->fullname} = undef;
- $urpm->{log}(N("skipping package %s", scalar($pkg->fullname)));
- },
- );
- }
- unless ($options{nodepslist}) {
- my %uniq;
- $urpm->compute_flags(
- get_packages_list($urpm->{instlist}),
- disable_obsolete => 1,
- callback => sub {
- my ($urpm, $pkg) = @_;
- $pkg->is_arch_compat && ! exists $uniq{$pkg->fullname} or return;
- $uniq{$pkg->fullname} = undef;
- $urpm->{log}(N("would install instead of upgrade package %s", scalar($pkg->fullname)));
- },
- );
+ if (!$options{nodepslist}) {
+ _compute_flags_for_skiplist($urpm, $options{cmdline_skiplist}) if !$options{no_skiplist};
+ _compute_flags_for_instlist($urpm);
}
}
+sub _compute_flags_for_skiplist {
+ my ($urpm, $cmdline_skiplist) = @_;
+ my %uniq;
+ $urpm->compute_flags(
+ get_packages_list($urpm->{skiplist}, $cmdline_skiplist),
+ skip => 1,
+ callback => sub {
+ my ($urpm, $pkg) = @_;
+ $pkg->is_arch_compat && ! exists $uniq{$pkg->fullname} or return;
+ $uniq{$pkg->fullname} = undef;
+ $urpm->{log}(N("skipping package %s", scalar($pkg->fullname)));
+ },
+ );
+}
+
+sub _compute_flags_for_instlist {
+ my ($urpm) = @_;
+
+ my %uniq;
+ $urpm->compute_flags(
+ get_packages_list($urpm->{instlist}),
+ disable_obsolete => 1,
+ callback => sub {
+ my ($urpm, $pkg) = @_;
+ $pkg->is_arch_compat && ! exists $uniq{$pkg->fullname} or return;
+ $uniq{$pkg->fullname} = undef;
+ $urpm->{log}(N("would install instead of upgrade package %s", scalar($pkg->fullname)));
+ },
+ );
+
+}
+
#- add a new medium, sync the config file accordingly.
#- returns the new medium's name. (might be different from the requested
#- name if index_name was specified)