Skip to content

Commit

Permalink
'acs' now shows *all* dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
epitron committed Oct 13, 2011
1 parent cdda4a8 commit 5dfeded
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 8 additions & 4 deletions acs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require 'rubygems'
require 'epitools'

IO.popen("apt-cache show #{ARGV * ' '}", "rb") do |apt|
lesspipe(:wrap=>true) do |less|
lesspipe(:wrap=>true) do |less|
IO.popen("apt-cache show #{ARGV * ' '}", "rb") do |apt|

separator = ("#"*50).light_cyan

Expand Down Expand Up @@ -31,8 +31,12 @@ IO.popen("apt-cache show #{ARGV * ' '}", "rb") do |apt|
less.puts

## dependencies
deps = info["Depends"].scan(/(\S+) \(([^\)]+)\)/)
deps = deps.map { |name, ver| "<7>#{name} <8>(<9>#{ver}<8>)".colorize }
deps = info["Depends"].scan(/([^\s,]+)(?: \(([^\)]+)\))?/)
deps = deps.map do |name, ver|
result = "<7>#{name} "
result += "<8>(<9>#{ver}<8>)" if ver
result.colorize
end

if deps.any?
less.puts " <11>depends:".colorize
Expand Down
3 changes: 3 additions & 0 deletions trace
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ lesspipe do |less|
Open3.popen3("strace #{ARGV.join ' '}") do |inp,out,err,wait_thr|

p [:process_status, wait_thr.value]

out.sync = true
err.sync = true

loop do
readers, slurp = IO.select([err, out], [], [], 1)
Expand Down

0 comments on commit 5dfeded

Please sign in to comment.