diff options
-rw-r--r-- | urpm.pm | 16 | ||||
-rwxr-xr-x | urpmi | 3 | ||||
-rw-r--r-- | urpmi.spec | 7 | ||||
-rwxr-xr-x | urpmq | 14 |
4 files changed, 35 insertions, 5 deletions
@@ -57,6 +57,7 @@ sub new { my ($class) = @_; bless { config => "/etc/urpmi/urpmi.cfg", + skiplist => "/etc/urpmi/skip.list", depslist => "/var/lib/urpmi/depslist.ordered", provides => "/var/lib/urpmi/provides", compss => "/var/lib/urpmi/compss", @@ -1113,6 +1114,21 @@ sub filter_minimal_packages_to_upgrade { } } +#- get out of package that should not be upgraded. +sub deselect_unwanted_packages { + my ($urpm, $packages) = @_; + + my %skip; + local ($_, *F); + open F, $urpm->{skiplist}; + while (<F>) { + chomp; s/#.*$//; s/^\s*//; s/\s*$//; + my $pkg = $urpm->{params}{info}{$_} or next; + exists $packages->{$pkg->{id}} && defined $packages->{$pkg->{id}} and delete $packages->{$pkg->{id}}; + } + close F; +} + #- select source for package selected. #- according to keys given in the packages hash. #- return a list of list containing the source description for each rpm, @@ -185,6 +185,9 @@ if ($minimal) { $urpm->filter_packages_to_upgrade(\%packages, $ask_choice, complete => $complete); } +#- get out of package that should not be upgraded. +$urpm->deselect_unwanted_packages(\%packages); + #- package to install as a array of strings. my @to_install; @@ -2,7 +2,7 @@ Name: urpmi Version: 1.5 -Release: 6mdk +Release: 7mdk License: GPL Source0: %{name}.tar.bz2 Summary: User mode rpm install @@ -113,6 +113,11 @@ autoirpm.uninstall %changelog +* Fri Feb 23 2001 François Pons <fpons@mandrakesoft.com> 1.5-7mdk +- added /etc/urpmi/skip.list for package that should not + be upgraded. +- remove -v option of urpmq to match -v as verbose. + * Mon Feb 19 2001 François Pons <fpons@mandrakesoft.com> 1.5-6mdk - fixed urpmq --headers with exotic rpm filename. - fixed closing using tee (need testing). @@ -47,12 +47,12 @@ This is free software and may be redistributed under the terms of the GNU GPL. usage: -h - print this help message. + -v - verbose mode. -d - extend query to package dependancies. -u - remove package if a better version is already installed. -c - choose complete method for resolving requires closure. -g - print groups too with name. - -v - print version too with name. - -r - print release too with name. + -r - print version and release too with name. --auto-select - automatically select packages for upgrading the system. --headers - extract headers for package listed from urpmi db to @@ -76,8 +76,8 @@ for (@ARGV) { /u/ and do { $query->{upgrade} = 1; next }; /c/ and do { $query->{complete} = 1; next }; /g/ and do { $query->{group} = 1; next }; - /v/ and do { $query->{version} = 1; next }; - /r/ and do { $query->{release} = 1; next }; + /v/ and do { $query->{verbose} = 1; next }; + /r/ and do { $query->{version} = $query->{release} = 1; next }; die( sprintf _("urpmq: unknown option \"-$1\", check usage with --help\n")); } next }; @nextargv and do { my $r = shift @nextargv; $r and $$r = $_; next }; /\.rpm$/ and do { -r $_ or print STDERR _("urpmq: cannot read rpm file \"$_\"\n"), next; @@ -88,6 +88,9 @@ for (@ARGV) { #- params contains informations to parse installed system. my $urpm = new urpm; +#- remove verbose if not asked. +$query->{verbose} or $urpm->{log} = sub {}; + $urpm->read_depslist; $query && $query->{group} and $urpm->read_compss; @@ -120,6 +123,9 @@ if ($query->{auto_select}) { } } +#- get out of package that should not be upgraded. +$urpm->deselect_unwanted_packages(\%packages); + #- filter to add in packages selected required packages. $query->{deps} && !$query->{upgrade} and $urpm->compute_closure(\%packages); $query->{upgrade} and $urpm->filter_packages_to_upgrade(\%packages, complete => $query->{complete}); |