[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. 0.0.96-10-gd56d2e6

Ryan Niebur ryanryan52 at gmail.com
Mon Jun 8 07:04:08 UTC 2009


The following commit has been merged in the master branch:
commit a77b8f2bf3e9f50f972fa3228fe355be57ec6bbb
Author: Francesco Poli (t1000) <frx at firenze.linux.it>
Date:   Sat Jun 6 00:19:11 2009 +0200

    simplify and add robustness checks in aptcleanup
    
    simplify the code that evaluates unpinned_candidate_version in aptcleanup
    add some checks to make aptcleanup more robust

diff --git a/aptcleanup b/aptcleanup
index 5fdd338..2798293 100755
--- a/aptcleanup
+++ b/aptcleanup
@@ -47,9 +47,9 @@ p.pins.each do |pin|
     pinnedpkgs << pinned_package
 
     # which version would get installed, if the pinning were removed ?
-
-    unpinned_candidate_version = `#{APTCACHE} -o Dir::Etc::Preferences=#{unpinned_preferences} policy #{pinned_package}`.split("\n").select{|x| x.match("Candidate:")}.collect{|x| "/" + x.split(" ")[1]}.first
-    if unpinned_candidate_version == "/(none)"
+    unpinned_candidate_version = ""
+    unpinned_candidate_version = "/" + `#{APTCACHE} -o Dir::Etc::Preferences=#{unpinned_preferences} policy #{pinned_package}`.split("\n").select{|x| x.match("Candidate:")}[0].split(" ")[1]
+    if unpinned_candidate_version == "/(none)" or unpinned_candidate_version == nil
       unpinned_candidate_version = ""
       $stderr.puts "Warning: no candidate version for #{pinned_package}" if $DEBUG
     end
diff --git a/debian/changelog b/debian/changelog
index 25da5c5..7e4ac34 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,8 +6,9 @@ apt-listbugs (0.1.0) UNRELEASED; urgency=low
 
   [ Francesco Poli (t1000) ]
   * improve logic: apt-listbugs may now pin uninstalled packages too
+  * simplify code and add some robustness checks in aptcleanup
 
- -- Ryan Niebur <ryanryan52 at gmail.com>  Wed, 03 Jun 2009 00:15:49 -0700
+ -- Francesco Poli (t1000) <frx at firenze.linux.it>  Fri, 05 Jun 2009 23:37:18 +0200
 
 apt-listbugs (0.0.96) unstable; urgency=low
 

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list