summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2008-08-21 13:35:40 -0700
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 17:28:26 -0800
commitc30d007532075b24765a02b337ef0d2f6dd8dfd3 (patch)
treef63b5bec49e375030fadbe7a635ed43c7c0f1e0d
parente538e77a1afd4a537cb00b30fb1963f7f1c83f92 (diff)
optimize the grep a bit more
-rwxr-xr-xdebian/local/pam-auth-update4
1 files changed, 2 insertions, 2 deletions
diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update
index ad7b22f7..af3b0422 100755
--- a/debian/local/pam-auth-update
+++ b/debian/local/pam-auth-update
@@ -90,6 +90,8 @@ if (!@enabled) {
@enabled = grep { $profiles{$_}->{'Default'} eq 'yes' } @sorted;
$priority = 'high' unless ($force);
} elsif (-e $savedir . '/seen') {
+ # filter out any options that are no longer available for any reason
+ @enabled = grep { $profiles{$_} } @enabled;
# add any previously-unseen configs
my %seen;
open(SEEN,$savedir . '/seen');
@@ -100,8 +102,6 @@ if (!@enabled) {
close(SEEN);
push(@enabled,
grep { $profiles{$_}->{'Default'} eq 'yes' && !$seen{$_} } @sorted);
- # filter out any options that are no longer available for any reason
- @enabled = grep { $profiles{$_} } @enabled;
@enabled = sort { $profiles{$b}->{'Priority'} <=> $profiles{$a}->{'Priority'} } @enabled;
my $prev = '';
@enabled = grep { $_ ne $prev && (($prev) = $_) } @enabled;