Re: Review request for apt-listbugs template po file
Francesco Poli wrote:
> http://anonscm.debian.org/gitweb/?p=apt-listbugs/apt-listbugs.git;a=blob;f=apt-listbugs;hb=HEAD
Again, inline comments, attached revisions.
> [...]
> apt-listbugs is a tool which retrieves bug reports from the Debian
> Bug Tracking System and lists them. Especially, it is intended to
s/Especially/In particular/
[...]
> * -s <severities> | --severity <severities>
>
> Severities you want to see separated by comma, possible values are critical, grave, serious, important, normal, minor and wishlist. Default: [critical,grave,serious]
> You can specify '--severity all' to specify all severities.
They aren't things I want to see separated by comma; say
Severities you want to see, separated by commas;
(Repeated a couple of times)
[...]
> Note that 'pending' does not mean 'tagged pending', but 'still open, pending to be fixed'.
Say "pending a fix" ("pending" here is a preposition)
[...]
> * -H <hostname> | --hostname <hostname>
>
> Specifies the hostname of Debian Bug Tracking System [bugs.debian.org].
Insert article: "of the Debian Bug Tracking System" (repeated once).
[...]
> * apt
>
> Reads package actions from standard input (typically provided by apt
> or other compatible package manager: Pre-Install-Pkgs hook info
> protocol version 2 is expected, see apt.conf(5) for more details).
I suppose that should be s/:/;/ and s/,/ - /
[...]
> * APT_LISTBUGS_FRONTEND
>
> If this variable is set to "none" apt-listbugs will not execute at all,
, ;
> this might be useful if you would like to script the use of a program that
> calls apt-listbugs.
[...]
> Bugs to ignore when in apt mode. I would suggest setting this to
> "FTBFS" since those bugs tend to not affect the user, but this
> defaults to nothing. This will be evaluated using ruby regular
> expressions.
s/ruby/Ruby/
--
JBR with qualifications in linguistics, experience as a Debian
sysadmin, and probably no clue about this particular package
#!/usr/bin/ruby1.8
#
# apt-listbugs: retrieves bug reports and lists them
#
# Copyright (C) 2002 Masato Taruishi <taru@debian.org>
# Copyright (C) 2006-2008 Junichi Uekawa <dancer@debian.org>
# Copyright (C) 2008-2012 Francesco Poli <invernomuto@paranoici.org>
# Copyright (C) 2009 Ryan Niebur <ryan@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License with
# the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
# if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
#
#
=begin
== NAME
apt-listbugs - Lists critical bugs before each apt upgrade/installation
== SYNOPSIS
apt-listbugs [options] <command> [arguments]
== DESCRIPTION
apt-listbugs is a tool which retrieves bug reports from the Debian
Bug Tracking System and lists them. In particular, it is intended to
be invoked before each upgrade by apt, or other similar package managers,
in order to check whether the upgrade/installation is safe.
== USAGE
apt-listbugs [-h] [-v] [-s <severities>] [-T <tags>] [-S <stats>] [-B <bug#>] [-D] [-H <hostname>] [-p <port>] [-P <priority>] [-E <title>] [-q] [-C <apt.conf>] [-y] [-n] [-d] <command> [arguments]
== OPTIONS
* -h | --help
Print usage help and exit
* -v | --version
Print version number and exit
* -s <severities> | --severity <severities>
Severities you want to see, separated by commas; possible values are critical, grave, serious, important, normal, minor and wishlist. Default: [critical,grave,serious]
You can specify '--severity all' to specify all severities.
* -T <tags> | --tag <tags>
Tags you want to see, separated by comma.
* -S <stats> | --stats <stats>
Status you want to see, separated by commas. Default: [forwarded,done,pending,pending-fixed]
Note that 'pending' does not mean 'tagged pending', but 'still open, pending a fix'.
* -B <bug#> | --bugs <bug#>
By default, apt-listbugs will consider all bugs.
This option adds a restriction to the bug numbers you want to see, separated by commas
(e.g. 123456,567890,135792). If this option is specified, all other
bugs will be ignored.
* -D | --show-downgrade
Shows bugs of downgraded packages. (apt mode only)
* -H <hostname> | --hostname <hostname>
Specifies the hostname of the Debian Bug Tracking System [bugs.debian.org].
* -p <port> | --port <port>
Specifies the port number of the web interface of the Debian Bug Tracking System [80].
* -P <priority> | --pin-priority <priority>
Specifies Pin-Priority value [1000].
* -E <title> | --title <title>
Specifies the title of rss output.
* -q | --quiet
Don't display progress bar. This option is assumed if stdout is not a
terminal or if /dev/tty cannot be opened.
* -C <apt.conf> | --aptconf <apt.conf>
Specifies the apt configuration file to use.
* -y | --force-yes
Assumes that you select yes for all questions.
* -n | --force-no
Assumes that you select no for all questions. This option is
assumed if stdout is not a terminal or if /dev/tty cannot be opened.
* -d | --debug
Give extra debug output, important for debugging problems. Please
include -d when reporting problems.
== COMMANDS
* apt
Reads package actions from standard input (typically provided by apt
or other compatible package manager; Pre-Install-Pkgs hook info
protocol version 2 is expected - see apt.conf(5) for more details).
* list [<package1[/version]> <package2[/version]>...]
Reads package names from the arguments and simply lists bugs of
these packages. Package versions may be specified with a slash, as in
apt/1.0 for example.
* rss [<package1[/version]> <package2[/version]>...]
Reads package names from the arguments and lists bugs of these packages
in rss format. Again, package versions may be specified with a slash.
== ENVIRONMENT VARIABLES
* APT_LISTBUGS_FRONTEND
If this variable is set to "none", apt-listbugs will not execute at all;
this might be useful if you would like to script the use of a program that
calls apt-listbugs.
* http_proxy
If http_proxy is set, the value is used for HTTP Proxy, unless
proxy settings are found in APT configuration (see below).
== CONFIGURATION FILE
apt-listbugs understands APT configuration file (see apt.conf). The
notable configuration options are
* Acquire::HTTP::Proxy
Default HTTP Proxy setting (overrides any http_proxy environment variable
value).
An empty string or the special keyword 'DIRECT' will disable proxy.
* Acquire::HTTP::Proxy::bugs.debian.org
Specific HTTP Proxy setting (overrides the default HTTP Proxy setting).
Useful for setting HTTP proxy for apt-listbugs.
The special keyword 'DIRECT' will disable proxy.
* AptListbugs::IgnoreRegexp
Bugs to ignore when in apt mode. I would suggest setting this to
"FTBFS" since those bugs tend to not affect the user, but this
defaults to nothing. This will be evaluated using Ruby regular
expressions.
== OUTPUT EXAMPLE
[bug severity] bugs of [package] ([current version] -> [package version to be installed]) <[status of bug report]>
[bug #] - [bug title] [(Fixed: fixed version, if it's fixed in a future version)]
e.g.
Retrieving bug reports... Done
Parsing Found/Fixed information... Done
important bugs of apt-listbugs (0.0.47 -> 0.0.49) <unfixed>
#332442 - apt-listbugs: Apt-listbugs doesn't actually download any bug reports
#389903 - apt-listbugs: Does not offer to exit if timeout occurs fetching reports
Summary:
apt-listbugs(2 bugs)
== EXIT CODE
* 0
Success.
* 1
When something is wrong.
* 10
To warn APT not to proceed.
* 130
When a SIGINT was received (for instance because the user
pressed [Ctrl+C]).
== AUTHORS
apt-listbugs was originally written by Masato Taruishi
<taru@debian.org>, and rewritten by Junichi Uekawa
<dancer@debian.org> in 2006 to handle BTS Versioning features and the
SOAP interface. The --bugs option was added by Francesco Poli
<invernomuto@paranoici.org> in 2008. During 2009-2010, apt-listbugs was
maintained by Francesco Poli and Ryan Niebur <ryan@debian.org>.
It is currently maintained by Francesco Poli and Thomas Mueller
<thomas.mueller@tmit.eu>.
Latest source-code is available from
http://git.debian.org/?p=apt-listbugs/apt-listbugs.git
== SEE ALSO
apt.conf(5), sensible-browser(1), www-browser(1), querybts(1)
=end
# exit gracefully when user presses [Ctrl+C]
Signal.trap("SIGINT") { $stderr.puts "Interrupted"; exit 130 }
if File.expand_path(__FILE__).match(/^\/usr\/s?bin\//)
$LOAD_PATH.unshift("/usr/share/apt-listbugs")
$VERSION = `dpkg-query -W -f='${Version}' apt-listbugs`
else
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "lib"))
$VERSION = `dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2`
end
require 'getoptlong'
require 'debian'
require 'debian/bug'
require 'debian/bts'
require 'thread'
require 'tempfile'
require 'gettext'
require 'rss/maker'
require 'apt-listbugs/logic'
include GetText
GetText::bindtextdomain("apt-listbugs")
# ad-hoc
require 'debian/mytempfile'
class HtmlTempfile < MyTempfile
def _tmpname(basename,tmpdir,n)
sprintf('%s/%s%d.%d.html', tmpdir, basename, $$, n)
end
end
## main from here
# Drop out as early as possible if this env var is set.
if ENV["APT_LISTBUGS_FRONTEND"] == "none"
exit 0
end
# handle options
config = AppConfig.new
config.parse_options
Factory.config = config
# handle arguments
new_pkgs = {}
cur_pkgs = {}
holdpkgs = {}
case config.command
when "apt"
# parse apt VERSION 2 input.
puts if $DEBUG
puts "Pre-Install-Pkgs hook info:" if $DEBUG
state=1
STDIN.each { |pkg|
pkg=pkg.rstrip
case state
when 1
# the version header, only one line.
if pkg == "VERSION 2"
puts "#{pkg}" if $DEBUG
state=2
else
$stderr.print _("E: apt Pre-Install-Pkgs is not giving me expected 'VERSION 2' string.\n")
exit 1
end
when 2
# apt configuration lines
case pkg
when ""
puts "#{pkg}" if $DEBUG
state=3
when /^quiet=(.*)/
if $1.to_i > 0
puts "#{pkg}" if $DEBUG
config.quiet=true
end
end
when 3
# package action lines
puts "#{pkg}" if $DEBUG
pkgname, old_ver, direction, new_ver, filename = pkg.split(" ")
case filename
when "**CONFIGURE**"
# none
when "**REMOVE**"
# none
when nil
$stderr.print _("E: apt Pre-Install-Pkgs is giving me fewer fields than expected.\n")
exit 1
else
case direction
when "="
# no version change, hence no new bug can be introduced
# into the system by this package
when ">", "<"
# ">" means downgrade, "<" means upgrade
if ( config.show_downgrade or direction == "<" )
if ( pkgname != nil and new_ver != "-" )
f = {}
f["package"] = pkgname
f["version"] = new_ver
new_pkgs[f["package"]] = f
if ( old_ver != "-" )
f = {}
f["package"] = pkgname
f["version"] = old_ver
cur_pkgs[f["package"]] = f
end
end
end
else
$stderr.print _("E: apt Pre-Install-Pkgs is giving me an unknown direction of version change.\n")
exit 1
end
end
end
}
puts if $DEBUG
when "list", "rss"
ARGV.each { |pkg|
# parse 'apt-listbugs list pkgname/version .... ' combination
if ( pkg != nil )
f = {}
case pkg
when /^(.*)\/(.*)$/
f["package"] = $1
f["version"] = $2
else
f["package"] = pkg
end
new_pkgs[f["package"]] = f
end
}
end
exit 0 if new_pkgs.size == 0
Factory::BugsFactory.delete_ignore_pkgs(new_pkgs) if config.command == "apt"
# exitting if no new packages is found
exit 0 if new_pkgs.size == 0
# reading bug reports
begin
bugs = Factory::BugsFactory.create(new_pkgs, cur_pkgs) { |msg, val|
config.frontend.progress(msg, val) if config.quiet == false
}
rescue
config.frontend.puts " ... E: #{$!}"
exit 1
end
Factory::BugsFactory.delete_ignore_bugs(bugs) if config.command == "apt"
Factory::BugsFactory.delete_regexp_bugs(bugs, config.ignore_regexp) if config.command == "apt" and config.ignore_regexp
Factory::BugsFactory.delete_uninteresting_bugs(bugs) if config.fbugs
Factory::BugsFactory.delete_unwanted_tag_bugs(bugs) if config.tag
begin
Factory::BugsFactory.delete_irrelevant_bugs(bugs, cur_pkgs, new_pkgs) { |msg, val|
config.frontend.progress(msg, val) if config.quiet == false
}
rescue
config.frontend.puts " ... E: #{$!}"
exit 1
end
exit 0 if config.command != "rss" && bugs.size == 0
# read done. now starting viewer
viewer = nil
case config.command
when "apt"
viewer = Viewer::SimpleViewer.new(config)
when "list"
viewer = Viewer::SimpleViewer.new(config)
when "rss"
viewer = Viewer::RSSViewer.new(config)
end
if viewer.view(new_pkgs, cur_pkgs, bugs) == false
ErrorWarning = _("****** Exit with an error by force in order to stop the installation. ******")
ErrorWarningHeader = "*" * ErrorWarning.length
config.frontend.puts ErrorWarningHeader
config.frontend.puts ErrorWarning
config.frontend.puts ErrorWarningHeader
config.frontend.close
exit 10
end
config.frontend.close
--- apt-listbugs.pristine 2012-07-12 13:26:11.455378804 +0100
+++ apt-listbugs 2012-07-12 14:58:11.347391954 +0100
@@ -36,7 +36,7 @@
== DESCRIPTION
apt-listbugs is a tool which retrieves bug reports from the Debian
-Bug Tracking System and lists them. Especially, it is intended to
+Bug Tracking System and lists them. In particular, it is intended to
be invoked before each upgrade by apt, or other similar package managers,
in order to check whether the upgrade/installation is safe.
@@ -56,23 +56,23 @@
* -s <severities> | --severity <severities>
- Severities you want to see separated by comma, possible values are critical, grave, serious, important, normal, minor and wishlist. Default: [critical,grave,serious]
+ Severities you want to see, separated by commas; possible values are critical, grave, serious, important, normal, minor and wishlist. Default: [critical,grave,serious]
You can specify '--severity all' to specify all severities.
* -T <tags> | --tag <tags>
- Tags you want to see separated by comma.
+ Tags you want to see, separated by comma.
* -S <stats> | --stats <stats>
- Status you want to see separated by comma. Default: [forwarded,done,pending,pending-fixed]
+ Status you want to see, separated by commas. Default: [forwarded,done,pending,pending-fixed]
- Note that 'pending' does not mean 'tagged pending', but 'still open, pending to be fixed'.
+ Note that 'pending' does not mean 'tagged pending', but 'still open, pending a fix'.
* -B <bug#> | --bugs <bug#>
By default, apt-listbugs will consider all bugs.
- This option adds a restriction to the bug numbers you want to see separated by commas
+ This option adds a restriction to the bug numbers you want to see, separated by commas
(e.g. 123456,567890,135792). If this option is specified, all other
bugs will be ignored.
@@ -82,11 +82,11 @@
* -H <hostname> | --hostname <hostname>
- Specifies the hostname of Debian Bug Tracking System [bugs.debian.org].
+ Specifies the hostname of the Debian Bug Tracking System [bugs.debian.org].
* -p <port> | --port <port>
- Specifies the port number of the web interface of Debian Bug Tracking System [80].
+ Specifies the port number of the web interface of the Debian Bug Tracking System [80].
* -P <priority> | --pin-priority <priority>
@@ -124,8 +124,8 @@
* apt
Reads package actions from standard input (typically provided by apt
- or other compatible package manager: Pre-Install-Pkgs hook info
- protocol version 2 is expected, see apt.conf(5) for more details).
+ or other compatible package manager; Pre-Install-Pkgs hook info
+ protocol version 2 is expected - see apt.conf(5) for more details).
* list [<package1[/version]> <package2[/version]>...]
@@ -142,7 +142,7 @@
* APT_LISTBUGS_FRONTEND
- If this variable is set to "none" apt-listbugs will not execute at all,
+ If this variable is set to "none", apt-listbugs will not execute at all;
this might be useful if you would like to script the use of a program that
calls apt-listbugs.
@@ -174,7 +174,7 @@
Bugs to ignore when in apt mode. I would suggest setting this to
"FTBFS" since those bugs tend to not affect the user, but this
- defaults to nothing. This will be evaluated using ruby regular
+ defaults to nothing. This will be evaluated using Ruby regular
expressions.
== OUTPUT EXAMPLE
Reply to: