~ubuntu-branches/ubuntu/vivid/debtags/vivid-proposed

« back to all changes in this revision

Viewing changes to libapt-front/swig/ruby/apt-cat.rb

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2006-03-18 20:31:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20060318203147-d9uzdeong5f5nk14
Tags: 1.5.5
* Added dumpavail command.
* Don't rebuild the database on install: apt-index-watcher does it instead.
  Closes: #357103.
* Compiles with g++ 4.1.  Closes: #357360.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/ruby1.8
2
 
 
3
 
require "aptfront"
4
 
 
5
 
Aptfront::aptFrontInit()
6
 
cache = Aptfront::Global::cache()
7
 
puts cache
8
 
if (not cache.openCacheFile(Aptfront::OpProgress.new(), Aptfront::Cache::OpenReadOnly))
9
 
  puts "Error opening cache"
10
 
  error = Aptfront::getGlobalError()
11
 
  error.DumpErrors()
12
 
end
13
 
 
14
 
cache.openRecordsCache
15
 
pc = cache.packageCache
16
 
pl = pc.packageList
17
 
 
18
 
pl.each { |it|
19
 
  puts "Package: " + it.name
20
 
  #puts "Candidate Version: " + it.candidateVersion.versionString
21
 
  it.versionList.each { |v|
22
 
    puts "Version: " + v.versionString + (v == it.candidateVersion ? " (candidate)" : '') + (v == it.currentVersion ? " (current)" : '')
23
 
    puts "Section: " + v.section
24
 
    puts "Architecture: " + v.architecture
25
 
    puts "Description: " + v.shortDescription + v.longDescription
26
 
  }
27
 
  puts
28
 
}