Class: RPM::DB
Class Method Summary collapse
-
.each ⇒ Object
deprecated
Deprecated.
Use RPM::Transaction#each
-
.open(writable = false, root = '/', &block) ⇒ RPM::DB
The package database is opened, but transactional processing (@see RPM::DB#transaction) cannot be done for when
writable
is false.
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
-
#count_packages(name) ⇒ Object
database.
- #each {|Package| ... } ⇒ Object
- #each_match(key, val) {|Package| ... } ⇒ Object
-
#home ⇒ Object
deprecated
Deprecated.
Not possible to get home value in newer RPM versions
-
#init_iterator(tag, val) ⇒ RPM::MatchIterator
Creates an iterator for
tag
andval
. -
#root ⇒ String
The root path of the database.
Class Method Details
.each ⇒ Object
Deprecated.
Use RPM::Transaction#each
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/rpm/db.rb', line 105 def self.each DB.open do |db| it = MatchIterator.from_ptr(RPM::C.rpmdbInitIterator(db.ptr, 0, nil, 0)) if block_given? it.each do |pkg| yield pkg end end end end |
.open(writable = false, root = '/', &block) ⇒ RPM::DB
The package database is opened, but transactional processing (@see RPM::DB#transaction) cannot be done for when writable
is false. When writable
is false
then the generated object gets freezed.
76 77 78 |
# File 'lib/rpm/db.rb', line 76 def self.open(writable=false, root='/', &block) open_for_transaction(Transaction.new(:root => root), :writable => false, &block) end |
Instance Method Details
#closed? ⇒ Boolean
58 59 60 |
# File 'lib/rpm/db.rb', line 58 def closed? ptr.null? end |
#count_packages(name) ⇒ Object
database
118 119 |
# File 'lib/rpm/db.rb', line 118 def count_packages(name) end |
#each {|Package| ... } ⇒ Object
45 46 47 |
# File 'lib/rpm/db.rb', line 45 def each(&block) @ts.each(&block) end |
#each_match(key, val) {|Package| ... } ⇒ Object
34 35 36 |
# File 'lib/rpm/db.rb', line 34 def each_match(key, val, &block) @ts.each_match(key, val, &block) end |
#home ⇒ Object
Deprecated.
Not possible to get home value in newer RPM versions
95 96 97 |
# File 'lib/rpm/db.rb', line 95 def home raise NotImplementedError end |
#init_iterator(tag, val) ⇒ RPM::MatchIterator
Returns Creates an iterator for tag
and val
.
19 20 21 |
# File 'lib/rpm/db.rb', line 19 def init_iterator(tag, val) @ts.init_iterator(tag, val) end |