[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. debian/0.1.3-18-g9acbf92
Ryan Niebur
ryanryan52 at gmail.com
Mon May 10 01:14:20 UTC 2010
The following commit has been merged in the master branch:
commit 24a84f0fb04e824b79cf14d18f54cc62133d2be8
Author: Francesco Poli (t1000) <frx at firenze.linux.it>
Date: Wed May 5 22:41:01 2010 +0200
drop useless trailing spaces
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index e873208..0b2fed9 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -68,7 +68,7 @@ class AppConfig
@severity = ["critical", "grave", "serious"]
@tag = nil
@stats = ["forwarded", "done", "pending", "pending-fixed", ""]
- @statmap = [["forwarded", _("forwarded")],
+ @statmap = [["forwarded", _("forwarded")],
["done", _("marked as done in some version")],
["pending", _("unfixed")],
["pending-fixed", _("tagged as pending a fix")]]
@@ -118,7 +118,7 @@ class AppConfig
['--force-no', '-n', GetoptLong::NO_ARGUMENT],
['--debug', '-d', GetoptLong::NO_ARGUMENT]
);
-
+
begin
opt_parser.each_option { |optname, optargs|
case optname
@@ -173,7 +173,7 @@ class AppConfig
@quiet = true
@yes = false if @yes.nil?
end
-
+
@title = "Debian Bugs of #{Socket.gethostname} (#{@severity.join(', ')})" if ! @title
# http_proxy sanity check
@@ -187,10 +187,10 @@ class AppConfig
end
# proxy settings in apt.conf
- if /http_proxy='(.*)'/ =~ `apt-config #{@apt_conf} shell http_proxy acquire::http::proxy`
+ if /http_proxy='(.*)'/ =~ `apt-config #{@apt_conf} shell http_proxy acquire::http::proxy`
puts "proxy configuration from apt.conf: #{$1}" if $DEBUG
if $1 == 'DIRECT' || $1 == ''
- puts "Disabling proxy due to DIRECT, or empty string" if $DEBUG
+ puts "Disabling proxy due to DIRECT, or empty string" if $DEBUG
ENV.delete("http_proxy")
ENV.delete("soap_use_proxy")
else
@@ -198,9 +198,9 @@ class AppConfig
ENV["soap_use_proxy"] = "on"
end
end
- if /http_proxy='(.*)'/ =~ `apt-config #{@apt_conf} shell http_proxy acquire::http::proxy::bugs.debian.org`
+ if /http_proxy='(.*)'/ =~ `apt-config #{@apt_conf} shell http_proxy acquire::http::proxy::bugs.debian.org`
puts "proxy configuration from apt.conf, specific for bugs.debian.org: #{$1}" if $DEBUG
- if $1 == 'DIRECT'
+ if $1 == 'DIRECT'
puts "Disabling proxy due to DIRECT" if $DEBUG
ENV.delete("http_proxy")
ENV.delete("soap_use_proxy")
@@ -210,7 +210,7 @@ class AppConfig
end
end
- # command
+ # command
command = ARGV.shift
case command
when nil
@@ -230,8 +230,8 @@ class AppConfig
end
@parser =
- Debian::BTS::Parser::SoapIndex.new(@hostname, @port)
-
+ Debian::BTS::Parser::SoapIndex.new(@hostname, @port)
+
if FileTest.executable?("#{QUERYBTS}")
@querybts = QUERYBTS
end
@@ -288,7 +288,7 @@ class IgnoreBugs < Array
def add(entry, write=true)
if write == true
@@path_mutex[@path].synchronize {
- begin
+ begin
open(@path, "a") { |file|
file.puts entry
}
@@ -700,7 +700,7 @@ Pin-Priority: #{pin_pri}
}
@config.frontend.puts rss.to_s
end
-
+
end
end
@@ -786,7 +786,7 @@ module Factory
end
pkgs
end
-
+
def delete_ignore_pkgs(new_pkgs)
new_pkgs.delete_if { |name, pkg|
config.system_ignore_bugs.include?(name)
@@ -809,12 +809,12 @@ module Factory
pkgres = []
pkgs.each_key { |pkg|
pkgres << "#{pkg}"
- }
+ }
i=0
max=pkgres.size
step=(pkgres.size/100)*10+1
status = Debian::Packages.new(Debian::Dpkg::STATUS_FILE, pkgres) do
- yield _("Reading package status..."),
+ yield _("Reading package status..."),
"#{(i.to_f/max.to_f*100).to_i}%" if (i % step) == 0
i += 1
end
@@ -857,7 +857,7 @@ module Factory
# obtain a list of package names
tmppkgs = []
new_pkgs.each_key { |k| tmppkgs << k }
-
+
# send the list of package names and severity to be parsed.
bugs = config.parser.parse(tmppkgs, config.severity) { |pct|
yield _("Retrieving bug reports..."), pct
@@ -884,9 +884,9 @@ module Factory
config.frontend.puts _("Error retrieving bug reports from the server with the following error message:")
config.frontend.puts " W: #{$!}"
if exception.kind_of? SocketError
- config.frontend.puts _("It appears that your network connection is down. Check network configuration and try again")
+ config.frontend.puts _("It appears that your network connection is down. Check network configuration and try again")
else
- config.frontend.puts _("It could be because your network is down, or because of broken proxy servers, or the BTS server itself is down. Check network configuration and try again")
+ config.frontend.puts _("It could be because your network is down, or because of broken proxy servers, or the BTS server itself is down. Check network configuration and try again")
end
retrycount -= 1
retry if config.frontend.yes_or_no?(_("Retry downloading bug information?")) && retrycount > 0
@@ -894,7 +894,7 @@ module Factory
bugs = []
end
yield _("Retrieving bug reports..."), "100%"
-
+
if block_given?
yield _("Retrieving bug reports..."), _("Done")
end
@@ -936,14 +936,14 @@ module Factory
yield version
end
}
- end
+ end
def find_max_version_below_ver(space_delimited_bts_version, new_ver, pkg_name)
# find the max version from found/fixed that is below new_ver
# data format of space_delimited_bts_version:
# space-delimited PACKAGE/VERSION, or VERSION.
- maxver=nil
+ maxver=nil
iterate_fixed_found_version(space_delimited_bts_version, pkg_name) { |each_ver|
# check each fixed_ver
if Debian::Dpkg.compare_versions(each_ver, "le", new_ver) &&
@@ -953,13 +953,13 @@ module Factory
}
maxver
end
-
+
def find_min_version_above_ver(space_delimited_bts_version, new_ver, pkg_name)
# find the min version from found/fixed that is above new_ver
# data format of space_delimited_bts_version:
# space-delimited PACKAGE/VERSION, or VERSION.
- minver=nil
+ minver=nil
iterate_fixed_found_version(space_delimited_bts_version, pkg_name) { |each_ver|
# check each each_ver
if Debian::Dpkg.compare_versions(each_ver, "ge", new_ver) &&
@@ -969,19 +969,19 @@ module Factory
}
minver
end
-
+
def am_i_buggy(ver, fixed, found)
# find out if this version is buggy or not depending on the fixed / found array.
# how do I handle casees of found / fixed = nil?
puts " .. checking ver #{ver} against fixed:#{fixed} found:#{found}" if $DEBUG
-
+
fixed_max_below = nil
found_max_below = nil
fixed_min_above = nil
found_min_above = nil
-
+
fixed_max_below = find_max_version_below_ver(fixed, ver, name) if ! fixed.nil?
found_max_below = find_max_version_below_ver(found, ver, name) if ! found.nil?
@@ -993,11 +993,11 @@ module Factory
# if ( found_max_below <= fixed_max_below ), I know it's fixed by ver.
# there are cases where found_max_below and fixed_max_below isn't available, ingnore it.
- if fixed_max_below == nil && found_max_below == nil
+ if fixed_max_below == nil && found_max_below == nil
# this is a hard thing to handle, but do some guessing here:
- # bug was not fixed or found before this version in consideration.
+ # bug was not fixed or found before this version in consideration.
# It either means it wasn't found before this version, or 'found' version info is missing from BTS.
- if found_min_above == nil
+ if found_min_above == nil
# no new version found; which I guess signifies that the BTS is missing version info.
puts " ... found is nil; I guess I am buggy" if $DEBUG
val=true
@@ -1006,7 +1006,7 @@ module Factory
# buggy; except for a case where it's fixed before the
# found_min, which probably means 'found' info is missing
# from BTS.
- if fixed_min_above == nil ||
+ if fixed_min_above == nil ||
Debian::Dpkg.compare_versions(fixed_min_above, "gt", found_min_above)
puts " ... Bug is 'found' on a later version, I guess I am not buggy" if $DEBUG
val=false
@@ -1025,12 +1025,12 @@ module Factory
else
# default path.
end
- end
+ end
end
val
end
-
+
def bug_is_irrelevant(name, cur_ver, new_ver, bug_number, fixed, found, bug_stat="")
# find out if the bug number is irrelevant for this specific upgrade, from fixed/found information.
# @return false: bug is relevant, true: bug is irrelevant, should be removed.
@@ -1051,13 +1051,13 @@ module Factory
new_ver=cur_ver
cur_ver=nil
end
-
+
# ignore bugs that have no fixed version info, and is closed with a XXXX-done
if fixed.nil? && bug_stat == "done"
puts "bug_number:##{bug_number} -- apparently closed with XXXX-done without version info" if $DEBUG
val = true
##316121
- else if new_ver.nil?
+ else if new_ver.nil?
# This is an impossible case
puts "ARRGH I shouldn't be here!" if $DEBUG
val=nil
@@ -1081,7 +1081,7 @@ module Factory
step=(max/100)*10+1
i=0
yield _("Parsing Found/Fixed information..."), "0%"
-
+
bugs.delete_if { |bug|
val = false
name = bug.pkg_name
@@ -1089,13 +1089,13 @@ module Factory
cur_ver = nil
new_ver = new_pkgs[name]["version"] if new_pkgs[name] != nil
cur_ver = cur_pkgs[name]["version"] if cur_pkgs[name] != nil
-
+
# show progress
- yield _("Parsing Found/Fixed information..."),
+ yield _("Parsing Found/Fixed information..."),
"#{(i.to_f/max.to_f*100).to_i}%" if (i % step) == 0
i += 1
- val = true if bug_is_irrelevant(name, cur_ver, new_ver,
+ val = true if bug_is_irrelevant(name, cur_ver, new_ver,
bug.bug_number, bug.fixed, bug.found, bug.stat)
val
}
@@ -1119,15 +1119,15 @@ module Factory
val
}
end
-
+
module_function :create, :delete_ignore_bugs,
:delete_uninteresting_bugs,
:delete_regexp_bugs,
:bug_is_irrelevant,
:am_i_buggy,
- :delete_irrelevant_bugs, :delete_unwanted_tag_bugs,
- :find_max_version_below_ver,
- :find_min_version_above_ver,
+ :delete_irrelevant_bugs, :delete_unwanted_tag_bugs,
+ :find_max_version_below_ver,
+ :find_min_version_above_ver,
:iterate_fixed_found_version
end
@@ -1154,7 +1154,7 @@ class ConsoleFrontend
def puts(msg)
$stdout.puts msg
end
-
+
def tty
@tty ||= open("/dev/tty")
--
apt-listbugs development tree
More information about the Apt-listbugs-commits
mailing list