diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-10-16 07:18:26 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-10-16 07:18:26 -0400 |
| commit | 08a8484d73bd04507c7371fd7b5b582943f07493 (patch) | |
| tree | bab50337b162320c231d2af9d7ffd8f893db0eb1 | |
| parent | 183a8eef55d925fd75c4c3a0348704887d6e3fbf (diff) | |
| download | greypool-08a8484d73bd04507c7371fd7b5b582943f07493.tar.gz | |
Implement masking.
| -rw-r--r-- | TODO | 2 | ||||
| -rwxr-xr-x | greypool | 25 |
2 files changed, 19 insertions, 8 deletions
@@ -4,8 +4,6 @@ TODO list for greypool - handle ^C gracefully during wget downloads. -- actually implement "mask" - - improve the interactive config: - cache the repo list? - better UI for choosing a repo @@ -327,14 +327,13 @@ sub parse_file { @$hr{qw/status repo visiblename version/}; if($r_repo eq $repo && $status eq 'outdated') { - if(!defined($ignore{$proj}) && !defined($ignore{$name})) { - my %item = ( + my $item = { + name => $name, projname => $proj, oldver => $version, - newver => $newest); - $report{$name} = \%item; - last; - } + newver => $newest}; + $report{$name} = $item unless ignored_or_masked($item); + last; } } } @@ -343,6 +342,20 @@ sub parse_file { return $lastpkg eq $firstpkg ? undef : $lastpkg; } +sub ignored_or_masked { + my $i = shift; + + for(qw/name projname/) { + return 1 if $ignore{$i->{$_}}; + } + + my $maskvers = $masked{$i->{name}}; + $maskvers = $masked{$i->{projname}} unless $maskvers; + return unless $maskvers; + + return grep { $i->{newver} eq $_ } @$maskvers; +} + # do our own URL escaping to avoid depending on an external module. # based on: https://en.wikipedia.org/wiki/URL_escaping # ...and also the perldoc for URI::Escape |
