From 8b9ea10d4fa56c53c50769852dade0ed771da53d Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 25 Apr 2005 15:48:07 +0000 Subject: Add support for a prohibit-remove option in urpmi.cfg (Michael Scherer) --- man/C/urpmi.cfg.5 | 5 +++++ urpm.pm | 4 +++- urpm/cfg.pm | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/man/C/urpmi.cfg.5 b/man/C/urpmi.cfg.5 index 24baf04b..e6febbc1 100644 --- a/man/C/urpmi.cfg.5 +++ b/man/C/urpmi.cfg.5 @@ -110,6 +110,11 @@ errors. Specifies that the media should not be reconfigured (by a reconfiguration file present on the medium). +.TP +.B prohibit-remove +A commę-separated list of package names that must never be removed (just like +basesystem). + .SS Medium description A medium is described as follows : diff --git a/urpm.pm b/urpm.pm index de0715e4..8c9c7a96 100644 --- a/urpm.pm +++ b/urpm.pm @@ -148,6 +148,7 @@ sub read_config { post-clean pre-clean priority-upgrade + prohibit-remove resume retry split-length @@ -3118,8 +3119,9 @@ sub find_removed_from_basesystem { my ($urpm, $db, $state, $callback_base) = @_; if ($callback_base && %{$state->{rejected} || {}}) { my %basepackages; + my @dont_remove = ('basesystem', split /,\s*/, $urpm->{global_config}{'prohibit-remove'}); #- check if a package to be removed is a part of basesystem requires. - $db->traverse_tag('whatprovides', [ 'basesystem' ], sub { + $db->traverse_tag('whatprovides', \@dont_remove, sub { my ($p) = @_; $basepackages{$p->fullname} = 0; }); diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 02f1f57e..1d085a65 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -147,6 +147,7 @@ sub load_config ($;$) { |excludepath |split-(?:level|length) |priority-upgrade + |prohibit-remove |downloader |retry )\s*:\s*['"]?(.*?)['"]?$/x -- cgit v1.2.1