Add an option to hide autoremovals too far in the future

This is useful to avoid notifications when the maintainer or other folks
will fix the issue and the package will migrate before the autoremoval.

Implements: https://bugs.debian.org/826935
parent 3ca304dd
......@@ -98,6 +98,10 @@ optparse = OptionParser.new do |opts|
$installed_packages = installed_packages
end
opts.on("--autorm-days <N>", Integer, "Only show autoremovals within the next N days") do |autorm_days|
$autorm_days = autorm_days
end
end
optparse.parse!
......@@ -326,8 +330,13 @@ unless $kas
end
if autoremoval.length > 0
puts $old ? 'Packages going to be removed from Debian \'testing\' (the maintainer might need help):' : 'New packages going to be removed from Debian \'testing\' (the maintainer might need help):'
if defined?($autorm_days)
autorm_date = Time.now.to_date + $autorm_days
autorm = "until #{autorm_date.to_s} "
end
puts $old ? "Packages going to be removed from Debian 'testing' #{autorm}(the maintainer might need help):" : "New packages going to be removed from Debian 'testing' #{autorm}(the maintainer might need help):"
autoremoval.sort_by { |r| [r['source'], r['package']] }.each do |r|
next if defined?($autorm_days) && Time.at(r['removal_time']).to_date > autorm_date
bugs = r['bugs'].map { |b| "##{b}" }
if bugs.count == 0
bugs = ''
......
......@@ -4,6 +4,7 @@ how-can-i-help (17) UNRELEASED; urgency=medium
* Switch from `dpkg -l` to dpkg-query
* Add an option to disable updating the cache when it is populated
* Add an option to disable opportunities for packages installed locally
* Add an option to hide autoremovals too far in the future (Closes: #826935)
-- Paul Wise <pabs@debian.org> Sat, 29 Jun 2019 10:39:53 +0800
......
......@@ -49,6 +49,9 @@ Options must come before the other command line arguments.
*--installed-packages*, *--no-installed-packages*::
Enable or disable showing opportunities for packages installed locally.
*--autorm-days <N>*::
Only show autoremovals within the next N days.
PROXY SUPPORT
-------------
*how-can-i-help* uses the HTTP_PROXY (or http_proxy) environment variable as
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment