From 4324c28e77e9cbb77fe4c1b1c3d6e09bf439d4ef Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Thu, 21 Aug 2008 14:09:16 -0700 Subject: implement --remove, which allows deconfiguring of modules in advance of package removal --- debian/local/pam-auth-update | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'debian/local/pam-auth-update') diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update index af3b0422..694f8da7 100755 --- a/debian/local/pam-auth-update +++ b/debian/local/pam-auth-update @@ -36,7 +36,7 @@ my $errtemplate = 'libpam-runtime/conflicts'; my $overridetemplate = 'libpam-runtime/override'; my $confdir = '/etc/pam.d'; my $savedir = '/var/lib/pam'; -my (%profiles, @sorted, @enabled, @conflicts); +my (%profiles, @sorted, @enabled, @conflicts, %removals); my $force = 0; my $priority = 'high'; @@ -62,13 +62,21 @@ while ($#ARGV >= 0) { $force = 1; } elsif ($opt eq '--package') { $priority = 'medium'; + } elsif ($opt eq '--remove') { + while ($#ARGV >= 0) { + last if ($ARGV[0] =~ /^--/); + ${removals{shift} = 1; + } + # --remove implies --package + $priority = 'medium' if (keys(%removals)); } - # FIXME: we need an option that will permit us to remove configs in - # prerm remove, to avoid having a broken config at any point. } x_loadtemplatefile('/var/lib/dpkg/info/libpam-runtime.templates','libpam-runtime'); +# If we're being called for package removal, filter out those options here +@sorted = grep { !$removals{$_} } @sorted; + # always sort by priority, so we have consistency and don't have to # shuffle later @sorted = sort { $profiles{$b}->{'Priority'} <=> $profiles{$a}->{'Priority'} } -- cgit v1.2.3