summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2008-08-21 14:09:16 -0700
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 17:28:26 -0800
commit4324c28e77e9cbb77fe4c1b1c3d6e09bf439d4ef (patch)
treed7554a22c3d66f5a3371274410e6b84bedd63af0 /debian
parentc30d007532075b24765a02b337ef0d2f6dd8dfd3 (diff)
implement --remove, which allows deconfiguring of modules in advance of package
removal
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/local/pam-auth-update14
1 files changed, 11 insertions, 3 deletions
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'} }