diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-08-11 15:32:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-08-11 15:32:55 +0000 |
commit | c5399523daa90db86e0dd1220d5480e7baf1cfd3 (patch) | |
tree | 0334fb402018ba2061b2418d4ad75579188cf87e | |
parent | e0c8dc16a48b88912b7845d051b7bfee4a6d3559 (diff) | |
download | urpmi-c5399523daa90db86e0dd1220d5480e7baf1cfd3.tar urpmi-c5399523daa90db86e0dd1220d5480e7baf1cfd3.tar.gz urpmi-c5399523daa90db86e0dd1220d5480e7baf1cfd3.tar.bz2 urpmi-c5399523daa90db86e0dd1220d5480e7baf1cfd3.tar.xz urpmi-c5399523daa90db86e0dd1220d5480e7baf1cfd3.zip |
move get_packages_list() (for next commit)
-rw-r--r-- | urpm/media.pm | 19 | ||||
-rw-r--r-- | urpm/sys.pm | 15 |
2 files changed, 17 insertions, 17 deletions
diff --git a/urpm/media.pm b/urpm/media.pm index db99910f..d0cbb3b7 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -613,7 +613,7 @@ sub _compute_flags_for_skiplist { my ($urpm, $cmdline_skiplist) = @_; my %uniq; $urpm->compute_flags( - get_packages_list($urpm->{skiplist}, $cmdline_skiplist), + urpm::sys::get_packages_list($urpm->{skiplist}, $cmdline_skiplist), skip => 1, callback => sub { my ($urpm, $pkg) = @_; @@ -629,7 +629,7 @@ sub _compute_flags_for_instlist { my %uniq; $urpm->compute_flags( - get_packages_list($urpm->{instlist}), + urpm::sys::get_packages_list($urpm->{instlist}), disable_obsolete => 1, callback => sub { my ($urpm, $pkg) = @_; @@ -1861,19 +1861,4 @@ sub clean { } } - -#- get the list of packages that should not be upgraded or installed, -#- typically from the inst.list or skip.list files. -sub get_packages_list { - my ($file, $o_extra) = @_; - my $val = []; - open(my $f, '<', $file); - foreach (<$f>, split /,/, $o_extra || '') { - chomp; s/#.*$//; s/^\s*//; s/\s*$//; - next if $_ eq ''; - push @$val, $_; - } - $val; -} - 1; diff --git a/urpm/sys.pm b/urpm/sys.pm index 20061813..90f91e8d 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -10,6 +10,21 @@ use POSIX (); (our $VERSION) = q($Revision$) =~ /(\d+)/; + +#- get the list of packages that should not be upgraded or installed, +#- typically from the inst.list or skip.list files. +sub get_packages_list { + my ($file, $o_extra) = @_; + my $val = []; + open(my $f, '<', $file); + foreach (<$f>, split /,/, $o_extra || '') { + chomp; s/#.*$//; s/^\s*//; s/\s*$//; + next if $_ eq ''; + push @$val, $_; + } + $val; +} + #- find used mount point from a pathname, use a optional mode to allow #- filtering according the next operation (mount or umount). sub find_mntpoints { |