summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-05-17 16:32:44 +0200
committerMichael Schroeder <mls@suse.de>2013-05-17 16:32:44 +0200
commit0424ef2001157e0bf0385da84828a6075c8d291c (patch)
tree975f8bd1d859e61803f72e485d4713ae4b9b5148 /examples
parent64ff7df719bcabc86c2c81089745dc4aadbe43b6 (diff)
downloadlibsolv-0424ef2001157e0bf0385da84828a6075c8d291c.tar.gz
libsolv-0424ef2001157e0bf0385da84828a6075c8d291c.tar.bz2
libsolv-0424ef2001157e0bf0385da84828a6075c8d291c.zip
allow SOLVID_META queries through SOLVID_POS
Add 'meta' attribute in repo bindings and get rid of no longer neededed lookup methods.
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/p5solv10
-rwxr-xr-xexamples/pysolv10
-rwxr-xr-xexamples/rbsolv10
3 files changed, 15 insertions, 15 deletions
diff --git a/examples/p5solv b/examples/p5solv
index 77b26c7..5c25954 100755
--- a/examples/p5solv
+++ b/examples/p5solv
@@ -387,8 +387,8 @@ sub load_ext {
return 1;
}
print "fetching]\n";
- my $defvendorid = $self->{'handle'}->lookup_id($solv::SOLVID_META, $solv::SUSETAGS_DEFAULTVENDOR);
- my $descrdir = $self->{'handle'}->lookup_str($solv::SOLVID_META, $solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr';
+ my $defvendorid = $self->{'handle'}->{'meta'}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR);
+ my $descrdir = $self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr';
my $filechksum = $repodata->lookup_checksum($solv::SOLVID_META, $solv::SUSETAGS_FILE_CHECKSUM);
my $f = $self->download("$descrdir/$filename", 1, $filechksum);
return 0 unless $f;
@@ -418,8 +418,8 @@ sub load {
}
$self->{'handle'}->add_content($f, 0);
print "fetching\n";
- my $defvendorid = $self->{'handle'}->lookup_id($solv::SOLVID_META, $solv::SUSETAGS_DEFAULTVENDOR);
- my $descrdir = $self->{'handle'}->lookup_str($solv::SOLVID_META, $solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr';
+ my $defvendorid = $self->{'handle'}->{'meta'}->lookup_id($solv::SUSETAGS_DEFAULTVENDOR);
+ my $descrdir = $self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DESCRDIR) || 'suse/setup/descr';
my ($filename, $filechksum) = $self->find('packages.gz');
($filename, $filechksum) = $self->find('packages') unless $filename;
if ($filename) {
@@ -445,7 +445,7 @@ sub load {
sub packagespath {
my ($self) = @_;
- return ($self->{'handle'}->lookup_str($solv::SOLVID_META, $solv::SUSETAGS_DATADIR) || 'suse') . '/';
+ return ($self->{'handle'}->{'meta'}->lookup_str($solv::SUSETAGS_DATADIR) || 'suse') . '/';
}
package Repo::unknown;
diff --git a/examples/pysolv b/examples/pysolv
index 2293ff5..f300d08 100755
--- a/examples/pysolv
+++ b/examples/pysolv
@@ -418,8 +418,8 @@ class repo_susetags(repo_generic):
return True
self.handle.add_content(f, 0)
print "fetching"
- defvendorid = self.handle.lookup_id(solv.SOLVID_META, solv.SUSETAGS_DEFAULTVENDOR)
- descrdir = self.handle.lookup_str(solv.SOLVID_META, solv.SUSETAGS_DESCRDIR)
+ defvendorid = self.handle.meta.lookup_id(solv.SUSETAGS_DEFAULTVENDOR)
+ descrdir = self.handle.meta.lookup_str(solv.SUSETAGS_DESCRDIR)
if not descrdir:
descrdir = "suse/setup/descr"
(filename, filechksum) = self.find('packages.gz')
@@ -510,8 +510,8 @@ class repo_susetags(repo_generic):
return True
sys.stdout.write("fetching]\n")
sys.stdout.flush()
- defvendorid = self.handle.lookup_id(solv.SOLVID_META, solv.SUSETAGS_DEFAULTVENDOR)
- descrdir = self.handle.lookup_str(solv.SOLVID_META, solv.SUSETAGS_DESCRDIR)
+ defvendorid = self.handle.meta.lookup_id(solv.SUSETAGS_DEFAULTVENDOR)
+ descrdir = self.handle.meta.lookup_str(solv.SUSETAGS_DESCRDIR)
if not descrdir:
descrdir = "suse/setup/descr"
filechksum = repodata.lookup_checksum(solv.SOLVID_META, solv.SUSETAGS_FILE_CHECKSUM)
@@ -526,7 +526,7 @@ class repo_susetags(repo_generic):
return True
def packagespath(self):
- datadir = repo.handle.lookup_str(solv.SOLVID_META, solv.SUSETAGS_DATADIR)
+ datadir = repo.handle.meta.lookup_str(solv.SUSETAGS_DATADIR)
if not datadir:
datadir = 'suse'
return datadir + '/'
diff --git a/examples/rbsolv b/examples/rbsolv
index ad57e4d..e011010 100755
--- a/examples/rbsolv
+++ b/examples/rbsolv
@@ -366,8 +366,8 @@ class Repo_susetags < Repo_generic
@handle.add_content(f, 0)
f.close
puts "fetching"
- defvendorid = @handle.lookup_id(Solv::SOLVID_META, Solv::SUSETAGS_DEFAULTVENDOR)
- descrdir = @handle.lookup_str(Solv::SOLVID_META, Solv::SUSETAGS_DESCRDIR)
+ defvendorid = @handle.meta.lookup_id(Solv::SUSETAGS_DEFAULTVENDOR)
+ descrdir = @handle.meta.lookup_str(Solv::SUSETAGS_DESCRDIR)
descrdir = "suse/setup/descr" unless descrdir
(filename, filechksum) = find('packages.gz')
(filename, filechksum) = find('packages') unless filename
@@ -449,8 +449,8 @@ class Repo_susetags < Repo_generic
return true
end
puts "fetching]\n"
- defvendorid = @handle.lookup_id(Solv::SOLVID_META, Solv::SUSETAGS_DEFAULTVENDOR)
- descrdir = @handle.lookup_str(Solv::SOLVID_META, Solv::SUSETAGS_DESCRDIR)
+ defvendorid = @handle.meta.lookup_id(Solv::SUSETAGS_DEFAULTVENDOR)
+ descrdir = @handle.meta.lookup_str(Solv::SUSETAGS_DESCRDIR)
descrdir = "suse/setup/descr" unless descrdir
filechksum = repodata.lookup_checksum(Solv::SOLVID_META, Solv::SUSETAGS_FILE_CHECKSUM)
f = download("#{descrdir}/#{filename}", true, filechksum)
@@ -464,7 +464,7 @@ class Repo_susetags < Repo_generic
end
def packagespath()
- datadir = @handle.lookup_str(Solv::SOLVID_META, Solv::SUSETAGS_DATADIR)
+ datadir = @handle.meta.lookup_str(Solv::SUSETAGS_DATADIR)
datadir = "suse" unless datadir
return datadir + '/'
end