[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. apt-listbugs/0.1.9-8-g42862ed

Francesco Poli (wintermute) invernomuto at paranoici.org
Sun Jul 7 21:22:14 UTC 2013


The following commit has been merged in the master branch:
commit 42862ed8d3ae1222fb8d137bf2e3534fc59095bc
Author: Francesco Poli (wintermute) <invernomuto at paranoici.org>
Date:   Sun Jul 7 22:37:29 2013 +0200

    code cleanup: replace tabs with spaces

diff --git a/debian/copyright b/debian/copyright
index 217a773..6b0f945 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,8 +1,8 @@
 This package is maintained by Francesco Poli.
 
 The original source can always be found at:
-	http://ftp.debian.org/debian/pool/main/a/apt-listbugs/
-	http://git.debian.org/?p=apt-listbugs/apt-listbugs.git
+        http://ftp.debian.org/debian/pool/main/a/apt-listbugs/
+        http://git.debian.org/?p=apt-listbugs/apt-listbugs.git
 
 Copyright (C) 2002-2004  Masato Taruishi <taru at debian.org>
 Copyright (C) 2006-2008  Junichi Uekawa <dancer at debian.org>
diff --git a/debian/cron.daily b/debian/cron.daily
index 9040efd..bdce2cf 100755
--- a/debian/cron.daily
+++ b/debian/cron.daily
@@ -2,21 +2,21 @@
 
 prefclean() {
 
-	test -x /usr/share/apt-listbugs/aptcleanup || return 0
-	test -x /usr/sbin/apt-listbugs || return 0
-	test -f /etc/apt/preferences || return 0
+    test -x /usr/share/apt-listbugs/aptcleanup || return 0
+    test -x /usr/sbin/apt-listbugs || return 0
+    test -f /etc/apt/preferences || return 0
 
-	tmp=$(tempfile)
+    tmp=$(tempfile)
 
-	/usr/share/apt-listbugs/aptcleanup > "$tmp" || return 0
-	if ! diff -B "$tmp" /etc/apt/preferences > /dev/null; then
-		if test -f "/var/backups/apt-listbugs.preferences"; then
-			savelog -q /var/backups/apt-listbugs.preferences
-		fi
-		cp -aH /etc/apt/preferences /var/backups/apt-listbugs.preferences
-		cp "$tmp" /etc/apt/preferences
-  	fi
-  	/bin/rm -f "$tmp"
+    /usr/share/apt-listbugs/aptcleanup > "$tmp" || return 0
+    if ! diff -B "$tmp" /etc/apt/preferences > /dev/null; then
+        if test -f "/var/backups/apt-listbugs.preferences"; then
+            savelog -q /var/backups/apt-listbugs.preferences
+        fi
+        cp -aH /etc/apt/preferences /var/backups/apt-listbugs.preferences
+        cp "$tmp" /etc/apt/preferences
+    fi
+    /bin/rm -f "$tmp"
 
 }
 
diff --git a/lib/apt-listbugs/logic.rb b/lib/apt-listbugs/logic.rb
index f01cacc..f09782f 100644
--- a/lib/apt-listbugs/logic.rb
+++ b/lib/apt-listbugs/logic.rb
@@ -106,69 +106,69 @@ class AppConfig
   def parse_options
     opt_parser = GetoptLong.new
     opt_parser.set_options(['--help', '-h', GetoptLong::NO_ARGUMENT],
-			   ['--severity', '-s', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--version', '-v', GetoptLong::NO_ARGUMENT],
-			   ['--tag', '-T', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--stats', '-S', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--bugs', '-B', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--show-downgrade', '-D', GetoptLong::NO_ARGUMENT],
-			   ['--hostname', '-H', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--port', '-p', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--pin-priority', '-P', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--title', '-E', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--quiet', '-q', GetoptLong::NO_ARGUMENT],
-			   ['--aptconf', '-C', GetoptLong::REQUIRED_ARGUMENT],
-			   ['--force-yes', '-y', GetoptLong::NO_ARGUMENT],
-			   ['--force-no', '-n', GetoptLong::NO_ARGUMENT],
-			   ['--debug', '-d', GetoptLong::NO_ARGUMENT]
-			   );
+                           ['--severity', '-s', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--version', '-v', GetoptLong::NO_ARGUMENT],
+                           ['--tag', '-T', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--stats', '-S', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--bugs', '-B', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--show-downgrade', '-D', GetoptLong::NO_ARGUMENT],
+                           ['--hostname', '-H', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--port', '-p', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--pin-priority', '-P', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--title', '-E', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--quiet', '-q', GetoptLong::NO_ARGUMENT],
+                           ['--aptconf', '-C', GetoptLong::REQUIRED_ARGUMENT],
+                           ['--force-yes', '-y', GetoptLong::NO_ARGUMENT],
+                           ['--force-no', '-n', GetoptLong::NO_ARGUMENT],
+                           ['--debug', '-d', GetoptLong::NO_ARGUMENT]
+                           );
 
     begin
       opt_parser.each_option { |optname, optargs|
-	case optname
-	when '--help'
-	  usage
-	  exit 0
+        case optname
+        when '--help'
+          usage
+          exit 0
         when '--version'
           puts $VERSION
           exit 0
-	when '--severity'
+        when '--severity'
           case optargs
           when "all"
             @severity = ["critical","grave","serious","important","normal","minor","wishlist"]
           else
             @severity = optargs.split(',')
           end
-	when '--tag'
-	  @tag = optargs.split(',')
-	when '--stats'
-	  @stats = optargs.split(',')
-	when '--bugs'
-	  @fbugs = optargs.split(',')
-	when '--show-downgrade'
-	  @show_downgrade = true
-	when '--hostname'
-	  @hostname = optargs
-	when '--port'
-	  @port = optargs.to_i
-	when '--pin-priority'
-	  @pin_priority = optargs
-	when '--title'
-	  @title = optargs
-	when '--quiet'
-	  @quiet = true
-	when '--aptconf'
-	  @apt_conf = " -c " + optargs
-	when '--debug'
-	  $DEBUG = 1
-	when '--force-yes'
-	  @yes = true
-	when '--force-no'
-	  @yes = false
-	end
+        when '--tag'
+          @tag = optargs.split(',')
+        when '--stats'
+          @stats = optargs.split(',')
+        when '--bugs'
+          @fbugs = optargs.split(',')
+        when '--show-downgrade'
+          @show_downgrade = true
+        when '--hostname'
+          @hostname = optargs
+        when '--port'
+          @port = optargs.to_i
+        when '--pin-priority'
+          @pin_priority = optargs
+        when '--title'
+          @title = optargs
+        when '--quiet'
+          @quiet = true
+        when '--aptconf'
+          @apt_conf = " -c " + optargs
+        when '--debug'
+          $DEBUG = 1
+        when '--force-yes'
+          @yes = true
+        when '--force-no'
+          @yes = false
+        end
       }
     rescue GetoptLong::AmbigousOption, GetoptLong::NeedlessArgument,
-	GetoptLong::MissingArgument, GetoptLong::InvalidOption
+        GetoptLong::MissingArgument, GetoptLong::InvalidOption
       usage
       exit 1
     end
@@ -347,145 +347,145 @@ class Viewer
       end
 
       if @config.command == "list"
-	return true
+        return true
       end
 
       answer = "n"
       hold_pkgs = []
       while true
-	ask_str = _("Are you sure you want to install/upgrade the above packages?").dup
-	if @config.querybts != nil || @config.browser != nil
-	  if hold_pkgs.empty?
-	    ask_str << " [Y/n/?/...]"
-	  else
-	    ask_str << " [N/?/...]"
-	  end
-	else
-	  ask_str << " [Y/n]"
-	end
-	if @config.yes.nil?
+        ask_str = _("Are you sure you want to install/upgrade the above packages?").dup
+        if @config.querybts != nil || @config.browser != nil
+          if hold_pkgs.empty?
+            ask_str << " [Y/n/?/...]"
+          else
+            ask_str << " [N/?/...]"
+          end
+        else
+          ask_str << " [Y/n]"
+        end
+        if @config.yes.nil?
           a = @config.frontend.ask ask_str
         else
           a = "y" if @config.yes
           a = "n" if ! @config.yes
         end
-	if a == ""
-	  if hold_pkgs.empty?
-	    answer = "y"
-	  else
-	    answer = "n"
-	  end
-	else
-	  answer = a.downcase
-	end
-	case answer
-	when "y"
-	  return true
-	when "a"
-	  if hold_pkgs.empty?
+        if a == ""
+          if hold_pkgs.empty?
+            answer = "y"
+          else
+            answer = "n"
+          end
+        else
+          answer = a.downcase
+        end
+        case answer
+        when "y"
+          return true
+        when "a"
+          if hold_pkgs.empty?
             bugs.each { |bug|
               if ! @config.system_ignore_bugs.include?(bug.bug_number)
                 @config.system_ignore_bugs.add(bug)
                 @config.system_ignore_bugs.add(bug.bug_number)
               end
             }
-	    return true
-	  end
-	when "n"
-	  return false
-	when /^#?(\d+)$/
-	  if @config.querybts != nil
-	    system("#{@config.querybts} -u text #{$1} < /dev/tty")
+            return true
+          end
+        when "n"
+          return false
+        when /^#?(\d+)$/
+          if @config.querybts != nil
+            system("#{@config.querybts} -u text #{$1} < /dev/tty")
           else
             @config.frontend.puts sprintf(_("You must install the reportbug package to be able to do this"))
           end
-	when /^i\s+(\d+)$/
-	  if ! @config.system_ignore_bugs.include?($1)
-	    @config.system_ignore_bugs.add($1)
-	    Factory::BugsFactory.delete_ignore_bugs(bugs)
-	    @config.frontend.puts sprintf(_("%s ignored"), $1)
-	  else
-	    @config.frontend.puts sprintf(_("%s already ignored"), $1)
-	  end
-	when "r"
-	  display_bugs(bugs, new_pkgs.keys - hold_pkgs, cur_pkgs, new_pkgs)
-
-	when /^(h|p)\s+(.+)$/
-	  key = $1
-	  if key == "h"
-	    @config.frontend.puts DeprecatedWarningHeader
-	    @config.frontend.puts DeprecatedWarning
-	    @config.frontend.puts DeprecatedWarningHeader
-	  end
-	  pkgs = $2.split(/\s+/)
-	  if key == "h"
-	    h = on_hold(pkgs)
-	  else
-	    h = pinned(pkgs, cur_pkgs, bugs)
-	  end
-	  hold_pkgs.concat(h) if h != nil
-
-	when "w"
-	  puts bugs if $DEBUG
-	  display_bugs_as_html(bugs, cur_pkgs.keys - hold_pkgs, cur_pkgs, new_pkgs) if @config.browser != nil
+        when /^i\s+(\d+)$/
+          if ! @config.system_ignore_bugs.include?($1)
+            @config.system_ignore_bugs.add($1)
+            Factory::BugsFactory.delete_ignore_bugs(bugs)
+            @config.frontend.puts sprintf(_("%s ignored"), $1)
+          else
+            @config.frontend.puts sprintf(_("%s already ignored"), $1)
+          end
+        when "r"
+          display_bugs(bugs, new_pkgs.keys - hold_pkgs, cur_pkgs, new_pkgs)
+
+        when /^(h|p)\s+(.+)$/
+          key = $1
+          if key == "h"
+            @config.frontend.puts DeprecatedWarningHeader
+            @config.frontend.puts DeprecatedWarning
+            @config.frontend.puts DeprecatedWarningHeader
+          end
+          pkgs = $2.split(/\s+/)
+          if key == "h"
+            h = on_hold(pkgs)
+          else
+            h = pinned(pkgs, cur_pkgs, bugs)
+          end
+          hold_pkgs.concat(h) if h != nil
+
+        when "w"
+          puts bugs if $DEBUG
+          display_bugs_as_html(bugs, cur_pkgs.keys - hold_pkgs, cur_pkgs, new_pkgs) if @config.browser != nil
 
         when /(h|p)/
-	  key = $1
-	  if key == "h"
-	    @config.frontend.puts DeprecatedWarningHeader
-	    @config.frontend.puts DeprecatedWarning
-	    @config.frontend.puts DeprecatedWarningHeader
-	  end
-	  pkgs = {}
-	  if key == "p"
-	    bugs.each { |bug|
-	      ## FIXME: need to parse preferences correctly?
-	      if ! system("grep -q \"Package: #{bug.pkg_name}\" /etc/apt/preferences 2> /dev/null")
-	        pkgs[bug.pkg_name] = 1
-	      end
+          key = $1
+          if key == "h"
+            @config.frontend.puts DeprecatedWarningHeader
+            @config.frontend.puts DeprecatedWarning
+            @config.frontend.puts DeprecatedWarningHeader
+          end
+          pkgs = {}
+          if key == "p"
+            bugs.each { |bug|
+              ## FIXME: need to parse preferences correctly?
+              if ! system("grep -q \"Package: #{bug.pkg_name}\" /etc/apt/preferences 2> /dev/null")
+                pkgs[bug.pkg_name] = 1
+              end
             }
-	  else
+          else
             bugs.each { |bug|
               pkgs[bug.pkg_name] = 1
             }
-	  end
-	  if pkgs.size != 0
+          end
+          if pkgs.size != 0
             if @config.frontend.yes_or_no? ngettext(
              # TRANSLATORS: %{plist} is a comma-separated list of %{npkgs} packages to be pinned or put on hold.
              "The following %{npkgs} package will be pinned or on hold:\n %{plist}\nAre you sure?",
              "The following %{npkgs} packages will be pinned or on hold:\n %{plist}\nAre you sure?",
              pkgs.size) % {:npkgs => pkgs.size,
                            :plist => pkgs.keys.join(', ')}
-	      if key == "h"
+              if key == "h"
                 h = on_hold(pkgs.keys)
               else
                 h = pinned(pkgs.keys, cur_pkgs, bugs)
               end
             end
-	    hold_pkgs.concat(h) if h != nil
-	  else
-	    @config.frontend.puts sprintf(_("All selected packages are already pinned or on hold. Ignoring %s command."), key)
-	  end
-	else
-	  if hold_pkgs.empty?
-	    @config.frontend.puts "" +
+            hold_pkgs.concat(h) if h != nil
+          else
+            @config.frontend.puts sprintf(_("All selected packages are already pinned or on hold. Ignoring %s command."), key)
+          end
+        else
+          if hold_pkgs.empty?
+            @config.frontend.puts "" +
               # TRANSLATORS: the dashes (-) in the following strings are vertically aligned, please keep their alignment consistent
               _("     y     - continue the apt installation, but do not mark the bugs\n             as ignored.\n") +
               _("     a     - continue the apt installation and mark all the above bugs\n             as ignored.\n")
-	  end
-	  @config.frontend.puts "" +
-	    _("     n     - stop the apt installation.\n") +
-	    _("   <num>   - query the specified bug number (requires reportbug).\n") +
-	    _("  #<num>   - same as <num>\n") +
-	    _("     r     - redisplay bug lists.\n") +
-	    _(" p <pkg..> - pin pkgs (restart APT session to enable).\n") +
-	    _(" p         - pin all the above pkgs (restart APT session to enable).\n") +
-	    _(" i <num>   - mark bug number <num> as ignored.\n") +
-	    _("     ?     - print this help.\n")
-	  if @config.browser != nil
-	    @config.frontend.puts sprintf(_("     w     - display bug lists in HTML (uses %s).\n"), File.basename(@config.browser))
-	  end
-	end
+          end
+          @config.frontend.puts "" +
+            _("     n     - stop the apt installation.\n") +
+            _("   <num>   - query the specified bug number (requires reportbug).\n") +
+            _("  #<num>   - same as <num>\n") +
+            _("     r     - redisplay bug lists.\n") +
+            _(" p <pkg..> - pin pkgs (restart APT session to enable).\n") +
+            _(" p         - pin all the above pkgs (restart APT session to enable).\n") +
+            _(" i <num>   - mark bug number <num> as ignored.\n") +
+            _("     ?     - print this help.\n")
+          if @config.browser != nil
+            @config.frontend.puts sprintf(_("     w     - display bug lists in HTML (uses %s).\n"), File.basename(@config.browser))
+          end
+        end
       end
     end
 
@@ -503,11 +503,11 @@ class Viewer
         pin_ver = "0.no.version"
         pin_pri = @config.pin_priority
         if cur_pkgs[pkg] != nil
-	  pin_ver = cur_pkgs[pkg]['version']
+          pin_ver = cur_pkgs[pkg]['version']
         else
           pin_ver = "*"
           pin_pri = "-30000"
-	end
+        end
         holdstr << "\nExplanation: Pinned by apt-listbugs at #{Time.now}"
         bugs_of_pkg( bugs, pkg ).each { |bug|
           holdstr << "\nExplanation:   ##{bug.bug_number}: #{bug.desc}"
@@ -519,8 +519,8 @@ class Viewer
       if holdstr != ""
         File.open("/etc/apt/preferences", "a") { |io|
           io.puts holdstr
-	  @config.frontend.puts sprintf(_("%s pinned by adding Pin preferences in /etc/apt/preferences. Restart APT session to enable"), pkgs.join(' '))
-	  return pkgs
+          @config.frontend.puts sprintf(_("%s pinned by adding Pin preferences in /etc/apt/preferences. Restart APT session to enable"), pkgs.join(' '))
+          return pkgs
         }
       end
       return nil
@@ -544,55 +544,55 @@ class Viewer
       p_bug_numbers = []
       bugs_statistics = {}
       @config.stats.each { |stat|
-	@config.severity.each { |severity|
-	  pkgs.each { |pkg|
-	    bug_exist = 0
-	    bugs_statistics[pkg] = 0 unless bugs_statistics[pkg]
-	    bugs.each_by_category(pkg, severity, stat) { |bug|
-	      next if p_bug_numbers.include?(bug.bug_number)
-	      bugs_statistics[pkg] += 1
-	      p_bug_numbers << bug.bug_number
-	      if bug_exist == 0
+        @config.severity.each { |severity|
+          pkgs.each { |pkg|
+            bug_exist = 0
+            bugs_statistics[pkg] = 0 unless bugs_statistics[pkg]
+            bugs.each_by_category(pkg, severity, stat) { |bug|
+              next if p_bug_numbers.include?(bug.bug_number)
+              bugs_statistics[pkg] += 1
+              p_bug_numbers << bug.bug_number
+              if bug_exist == 0
                 # TRANSLATORS: %{sevty} is the severity of some of the bugs found for package %{packg}.
                 buf = _("%{sevty} bugs of %{packg} (") % {:sevty => severity,
                                                           :packg => pkg}
-		buf += "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
-		buf += "-> #{new_pkgs[pkg]['version']}) <#{@config.statmap(bug.stat)}>"
-		@config.frontend.puts buf
-		bug_exist = 1
-	      end
-	      bug_str = " ##{bug.bug_number} - #{bug.desc}"
+                buf += "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
+                buf += "-> #{new_pkgs[pkg]['version']}) <#{@config.statmap(bug.stat)}>"
+                @config.frontend.puts buf
+                bug_exist = 1
+              end
+              bug_str = " ##{bug.bug_number} - #{bug.desc}"
               # TRANSLATORS: "Found" refers to one singular bug
               bug_str += sprintf(_(" (Found: %s)"), "#{bug.found}") if ( ! bug.found.nil? ) && $DEBUG
               # TRANSLATORS: "Fixed" refers to one singular bug
               bug_str += sprintf(_(" (Fixed: %s)"), "#{bug.fixed}") if ! bug.fixed.nil?
-	      @config.frontend.puts bug_str
-	      if bug.mergeids.size > 0
+              @config.frontend.puts bug_str
+              if bug.mergeids.size > 0
                 # TRANSLATORS: "Merged" refers to one singular bug
-		bug_str =  _("   Merged with:").dup()
-		bug.mergeids.each { |m|
-		  bug_str << " #{m}"
-		  p_bug_numbers << m
-		}
-		@config.frontend.puts bug_str
-	      end
-	    }
+                bug_str =  _("   Merged with:").dup()
+                bug.mergeids.each { |m|
+                  bug_str << " #{m}"
+                  p_bug_numbers << m
+                }
+                @config.frontend.puts bug_str
+              end
+            }
           }
         }
       }
       stat_str_ary = []
       bugs_statistics.each { |pkg, num|
-	if num > 0
+        if num > 0
           # TRANSLATORS: %{nbugs} is the number of bugs found for package %{packg}.
           buf = ngettext("%{packg}(%{nbugs} bug)",
                          "%{packg}(%{nbugs} bugs)", num) % {:packg => pkg,
                                                             :nbugs => num}
-	  stat_str_ary << buf
-	end
+          stat_str_ary << buf
+        end
       }
       if stat_str_ary.size > 0
-	@config.frontend.puts _("Summary:\n ") + stat_str_ary.join(', ')
-	return true
+        @config.frontend.puts _("Summary:\n ") + stat_str_ary.join(', ')
+        return true
       else
         return false
       end
@@ -600,15 +600,15 @@ class Viewer
 
     def each_state_table(o, bugs, stats)
       stats.each { |stat|
-	sub = bugs.sub("stat", stat)
-	if sub.size > 0
-	  o.puts "<table border=2 width=100%>"
+        sub = bugs.sub("stat", stat)
+        if sub.size > 0
+          o.puts "<table border=2 width=100%>"
           # TRANSLATORS: %s is a bug status such as forwarded, done, pending, pending-fixed, etc. see the -S option in the man page.
           o.puts sprintf(" <caption>" + _("Bug reports which are marked as %s in the bug tracking system") + "</caption>", stat)
           o.puts " <tr><th>" + _("package") + "</th><th>" + _("severity") + "</th><th>" + _("bug number") + "</th><th>" + _("description") + "</th></tr>"
-	  yield sub
-	  o.puts "</table><br>"
-	end
+          yield sub
+          o.puts "</table><br>"
+        end
       }
     end
 
@@ -625,19 +625,19 @@ class Viewer
       tmp.puts "<h2>" + _("Bug reports") + "</h2>"
 
       each_state_table(tmp, bugs, @config.stats) { |bugs|
-	bugs.each { |bug|
-	  tmp.puts "<tr><td>#{bug.pkg_name}</td><td>#{bug.severity}</td><td><a href=\"http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=#{bug.bug_number}\">##{bug.bug_number}</a></td><td>#{bug.desc}</td></tr>"
-	  displayed_pkgs << bug.pkg_name if !displayed_pkgs.include?(bug.pkg_name)
+        bugs.each { |bug|
+          tmp.puts "<tr><td>#{bug.pkg_name}</td><td>#{bug.severity}</td><td><a href=\"http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=#{bug.bug_number}\">##{bug.bug_number}</a></td><td>#{bug.desc}</td></tr>"
+          displayed_pkgs << bug.pkg_name if !displayed_pkgs.include?(bug.pkg_name)
         }
       }
 
       tmp.puts "<h2>" + _("Package upgrade information in question") + "</h2>"
       tmp.puts "<ul>"
       displayed_pkgs.each { |pkg|
-	tmp.puts "<li>#{pkg}("
-	tmp.puts "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
-	tmp.puts "-> #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
-	tmp.puts ")"
+        tmp.puts "<li>#{pkg}("
+        tmp.puts "#{cur_pkgs[pkg]['version']} " if cur_pkgs[pkg] != nil
+        tmp.puts "-> #{new_pkgs[pkg]['version']}" if new_pkgs[pkg] != nil
+        tmp.puts ")"
       }
       tmp.puts "</ul>"
 
@@ -699,8 +699,8 @@ class Viewer
           if @config.stats.include?( bug.stat )
             item = maker.items.new_item
             item.link = "http://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=#{bug.bug_number}"
-	    item.title = encode("Bug##{bug.bug_number}: #{bug.desc}")
-	    item.date = Time.parse("#{bug.time.year}/#{bug.time.month}/#{bug.time.day} #{bug.time.hour}:#{bug.time.min}:#{bug.time.sec}")
+            item.title = encode("Bug##{bug.bug_number}: #{bug.desc}")
+            item.date = Time.parse("#{bug.time.year}/#{bug.time.month}/#{bug.time.day} #{bug.time.hour}:#{bug.time.min}:#{bug.time.sec}")
 
             buf = ""
 
@@ -723,7 +723,7 @@ class Viewer
 
             item.description = buf
 
-	  end
+          end
         }
 
       }
@@ -763,7 +763,7 @@ module Factory
 
     def delete_ignore_pkgs(new_pkgs)
       new_pkgs.delete_if { |name, pkg|
-	config.system_ignore_bugs.include?(name)
+        config.system_ignore_bugs.include?(name)
       }
     end
 
@@ -999,12 +999,12 @@ module Factory
       yield _("Parsing Found/Fixed information..."), "0%"
 
       bugs.delete_if { |bug|
-	val = false
-	name = bug.pkg_name
-	new_ver = nil
-	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
+        val = false
+        name = bug.pkg_name
+        new_ver = nil
+        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..."),
@@ -1026,13 +1026,13 @@ module Factory
         val = false
         puts "#{bug}" if $DEBUG
         config.tag.each { |tag|
-	  if bug.tags && bug.tags.include?( tag )
+          if bug.tags && bug.tags.include?( tag )
             puts "#{bug} has {tag}" if $DEBUG
-	  else
-	    val = true
-	  end
-	}
-	val
+          else
+            val = true
+          end
+        }
+        val
       }
     end
 
@@ -1093,17 +1093,17 @@ class ConsoleFrontend
     while true
       msgyn = "#{msg}"
       if default == true
-	msgyn << " [Y/n]"
+        msgyn << " [Y/n]"
       else
-	msgyn << " [y/N]"
+        msgyn << " [y/N]"
       end
       a = ask msgyn
       if a == ""
-	return default
+        return default
       elsif a == "Y" || a == "y"
-	return true
+        return true
       elsif a == "N" || a == "n"
-	return false
+        return false
       end
     end
   end
diff --git a/lib/debian/apt_preferences.rb b/lib/debian/apt_preferences.rb
index c50e139..576cba0 100644
--- a/lib/debian/apt_preferences.rb
+++ b/lib/debian/apt_preferences.rb
@@ -29,7 +29,7 @@ module Debian
           if /(\S+): (.+)$/ =~ line
             self[$1] = "" if self[$1] == nil
             self[$1] << $2
-	  end
+          end
         end
       end
 
diff --git a/lib/debian/bts.rb b/lib/debian/bts.rb
index ea7c201..1fd5692 100644
--- a/lib/debian/bts.rb
+++ b/lib/debian/bts.rb
@@ -37,16 +37,16 @@ module Debian
 
       # use SOAP interface to obtain the index.
       class SoapIndex < Parser
-	def initialize(host, port)
+        def initialize(host, port)
           @host = host
           @port = port
-	  @indexes = {}
-	  @buf = nil
-	end
+          @indexes = {}
+          @buf = nil
+        end
 
         ParseStep = 200
 
-	def parse(pkgs, severities = ["critical", "grave"])
+        def parse(pkgs, severities = ["critical", "grave"])
           require 'debian/btssoap'
           soap = Debian::BTSSOAP::Soap.new(@host, @port)
           sa = Debian::BTSSOAP::StringArray.new
@@ -72,7 +72,7 @@ module Debian
           }
           soap.get_status(sa).each { |b| bugs << b }
           bugs
-	end
+        end
       end
     end
   end
diff --git a/lib/debian/bug.rb b/lib/debian/bug.rb
index 6699d01..58e9d35 100644
--- a/lib/debian/bug.rb
+++ b/lib/debian/bug.rb
@@ -23,7 +23,7 @@ module Debian
   class Bug
 
     def initialize (pkg_name, bug_number, severity,
-		    stat, desc, tags = [], mergeids = [], time = Time.now )
+                    stat, desc, tags = [], mergeids = [], time = Time.now )
       @pkg_name = pkg_name
       @bug_number = bug_number
       @severity = severity
@@ -43,14 +43,14 @@ module Debian
 
     def inspect
       @bug_number + " - " +
-	@pkg_name + " - " +
-	@severity + " - " +
-	@stat + " - " +
-	@tags.to_s + " - " +
-	@desc + " merged with: " + @mergeids.join(', ') +
-	@found.to_s + " - " +
-	@fixed.to_s + " - " +
-	@time.to_s
+        @pkg_name + " - " +
+        @severity + " - " +
+        @stat + " - " +
+        @tags.to_s + " - " +
+        @desc + " merged with: " + @mergeids.join(', ') +
+        @found.to_s + " - " +
+        @fixed.to_s + " - " +
+        @time.to_s
     end
 
     attr_accessor :pkg_name, :bug_number, :severity,
@@ -62,9 +62,9 @@ module Debian
 
     def each_by_category (pkg, sev, stat)
       each { |bug|
-	yield bug if bug.pkg_name == pkg &&
-	  bug.severity == sev &&
-	  bug.stat == stat
+        yield bug if bug.pkg_name == pkg &&
+          bug.severity == sev &&
+          bug.stat == stat
       }
     end
 
diff --git a/lib/debian/mytempfile.rb b/lib/debian/mytempfile.rb
index 753b477..92f5c9a 100644
--- a/lib/debian/mytempfile.rb
+++ b/lib/debian/mytempfile.rb
@@ -32,11 +32,11 @@ class MyTempfile < DelegateClass(File)
       Thread.critical = true
 
       begin
-	tmpname = _tmpname(basename,tmpdir,n)
-	lock = tmpname + '.lock'
-	n += 1
+        tmpname = _tmpname(basename,tmpdir,n)
+        lock = tmpname + '.lock'
+        n += 1
       end while @@cleanlist.include?(tmpname) or
-	File.exist?(lock) or File.exist?(tmpname)
+        File.exist?(lock) or File.exist?(tmpname)
 
       Dir.mkdir(lock)
     rescue
@@ -79,7 +79,7 @@ class MyTempfile < DelegateClass(File)
     __setobj__(@tmpfile)
   end
 
-  def _close	# :nodoc:
+  def _close    # :nodoc:
     @tmpfile.close if @tmpfile
     @data[1] = @tmpfile = nil
   end
@@ -134,22 +134,22 @@ class MyTempfile < DelegateClass(File)
   alias length size
 
   class << self
-    def callback(data)	# :nodoc:
+    def callback(data)  # :nodoc:
       pid = $$
       lambda{
-	if pid == $$
-	  path, tmpfile, cleanlist = *data
+        if pid == $$
+          path, tmpfile, cleanlist = *data
 
-	  print "removing ", path, "..." if $DEBUG
+          print "removing ", path, "..." if $DEBUG
 
-	  tmpfile.close if tmpfile
+          tmpfile.close if tmpfile
 
-	  # keep this order for thread safeness
-	  File.unlink(path) if File.exist?(path)
-	  cleanlist.delete(path) if cleanlist
+          # keep this order for thread safeness
+          File.unlink(path) if File.exist?(path)
+          cleanlist.delete(path) if cleanlist
 
-	  print "done\n" if $DEBUG
-	end
+          print "done\n" if $DEBUG
+        end
       }
     end
 
@@ -162,15 +162,15 @@ class MyTempfile < DelegateClass(File)
       tempfile = new(*args)
 
       if block_given?
-	begin
-	  yield(tempfile)
-	ensure
-	  tempfile.close
-	end
+        begin
+          yield(tempfile)
+        ensure
+          tempfile.close
+        end
 
-	nil
+        nil
       else
-	tempfile
+        tempfile
       end
     end
   end
diff --git a/tests/000_func b/tests/000_func
index 32ee3e5..2079b8b 100644
--- a/tests/000_func
+++ b/tests/000_func
@@ -3,18 +3,18 @@
 success()
 {
     if "$@" ; then
-	:
+        :
     else
-	exit 1;
+        exit 1;
     fi
 }
 
 fail()
 {
     if "$@"; then
-	exit 1;
+        exit 1;
     else
-	:
+        :
     fi
 }
 
@@ -24,9 +24,9 @@ grep-result()
     shift
     "$@" 2>&1 | tee tests/log/tmp
     if grep "$v" tests/log/tmp; then
-	return
+        return
     else
-	exit 1
+        exit 1
     fi
 }
 
@@ -36,8 +36,8 @@ grep-result-not()
     shift
     "$@" 2>&1 | tee tests/log/tmp
     if grep "$v" tests/log/tmp; then
-	exit 1
+        exit 1
     else
-	return
+        return
     fi
 }
diff --git a/tests/003_apt-listbugs-apt.sh b/tests/003_apt-listbugs-apt.sh
index 6456f1e..0786e71 100755
--- a/tests/003_apt-listbugs-apt.sh
+++ b/tests/003_apt-listbugs-apt.sh
@@ -1,4 +1,4 @@
 (echo 'VERSION 2'; echo '' ;
     ls -1 ../*$(dpkg-parsechangelog | sed -n 's/^Version: //p')*.deb | \
-	sed 's/^/x x x x /') \
-	| time ./apt-listbugs -d apt -y || true
+        sed 's/^/x x x x /') \
+        | time ./apt-listbugs -d apt -y || true
diff --git a/tests/004_apt-listbugs-full.sh b/tests/004_apt-listbugs-full.sh
index 9b50422..495169c 100755
--- a/tests/004_apt-listbugs-full.sh
+++ b/tests/004_apt-listbugs-full.sh
@@ -1,4 +1,4 @@
 (echo 'VERSION 2'; echo '' ;
     ls -1 /var/cache/apt/archives/*.deb | \
-	sed 's/^/x x x x /') \
-	| time ./apt-listbugs -d apt -y || true
+        sed 's/^/x x x x /') \
+        | time ./apt-listbugs -d apt -y || true

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list