[Apt-listbugs-commits] [SCM] apt-listbugs development tree branch, master, updated. 0.0.95-14-gb48edc5

Ryan Niebur ryanryan52 at gmail.com
Fri May 15 07:30:27 UTC 2009


The following commit has been merged in the master branch:
commit c6dc9e8934d15afddf047f6aa0687d314faef2b3
Author: Ryan Niebur <ryanryan52 at gmail.com>
Date:   Fri May 15 00:20:05 2009 -0700

    replace the awk with pure ruby string manipulation

diff --git a/aptcleanup b/aptcleanup
index 9ef9fae..623a27d 100755
--- a/aptcleanup
+++ b/aptcleanup
@@ -27,7 +27,6 @@ require 'debian/apt_preferences'
 require 'tempfile'
 
 APTCACHE = "/usr/bin/apt-cache"
-AWK = "/usr/bin/awk"
 LISTBUGS = "/usr/sbin/apt-listbugs"
 
 # read apt preferences
@@ -47,8 +46,8 @@ 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} | #{AWK} '/Candidate:/ { printf "/%s", $2; }'`
-    unpinned_candidate_version.chomp!
+
+    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]}.chomp
     if unpinned_candidate_version == "/(none)"
       unpinned_candidate_version = ""
       $stderr.puts "Warning: no candidate version for #{pinned_package}" if $DEBUG
diff --git a/debian/changelog b/debian/changelog
index 18c489b..9bb9a58 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -19,8 +19,9 @@ apt-listbugs (0.0.96) UNRELEASED; urgency=low
   * update Copyright statements
   * don't ignore errors from 'make clean'
   * add semi-colon to apt configuration (Closes: #527064)
+  * minor improvements to Francesco's aptcleanup patch
 
- -- Ryan Niebur <ryanryan52 at gmail.com>  Mon, 11 May 2009 01:28:09 -0700
+ -- Ryan Niebur <ryanryan52 at gmail.com>  Fri, 15 May 2009 00:20:01 -0700
 
 apt-listbugs (0.0.95) unstable; urgency=low
 

-- 
apt-listbugs development tree



More information about the Apt-listbugs-commits mailing list