diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-07-20 16:28:25 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-07-20 16:28:25 -0700 |
commit | f0ac1c7a0bce57bebce0a644a564b3f71bdb0d6e (patch) | |
tree | 8ba6b0ba67efdc6c20ef667e2304fc2c6635302e /bin/locmaint | |
parent | 083aaf9512d47487d6266e1d184041c09aaaee3e (diff) | |
download | dotfiles-f0ac1c7a0bce57bebce0a644a564b3f71bdb0d6e.tar.gz |
add facility to permit packages not available from any mirrors
Diffstat (limited to 'bin/locmaint')
-rwxr-xr-x | bin/locmaint | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/bin/locmaint b/bin/locmaint index bd2930ea..a3b89746 100755 --- a/bin/locmaint +++ b/bin/locmaint @@ -135,6 +135,8 @@ our %known_bad_obsolete_conffiles = ( # CODE -- no more edit me +my $xdg_config_root = $ENV{XDG_CONFIG_HOME} || catfile $ENV{HOME}, ".config"; + exit main(); sub main { @@ -521,8 +523,21 @@ sub do_sysmaint { delete @purgeable{@build_deps_packages}; } } - my @obsolete_packages - = grep { $purgeable{$_}{obsolete} } keys %purgeable; + + # this is machine-specific, rather than being stored in this script, + # because each time reinstall machine, the list should be reset + my %local_pkgs; + my $local_pkgs_file = catfile $xdg_config_root, qw(locmaint local_pkgs); + if (-e $local_pkgs_file) { + open my $local_pkgs_fh, "<", $local_pkgs_file; + for (<$local_pkgs_fh>) { + chomp; + $local_pkgs{$_} = undef; + } + } + + my @obsolete_packages = grep !exists $local_pkgs{$_}, + grep $purgeable{$_}{obsolete}, keys %purgeable; # packages go in and out of testing frequently, so we probably # don't want to remove them unless (@obsolete_packages == 0 || $suite eq TESTING) { |