diff options
author | Ludwig Nussel <ludwig.nussel@suse.de> | 2010-01-22 13:24:56 +0100 |
---|---|---|
committer | Ludwig Nussel <ludwig.nussel@suse.de> | 2010-01-22 14:14:59 +0100 |
commit | 91bd3969abd9778b16a983a4be2451bfca1637a2 (patch) | |
tree | 0b6864d32595b2e2e9370bc0da5f8e37decb7811 /createrepomddeps | |
parent | 4be67338bb2026b2372d1bc3f45065e1a943cc8f (diff) | |
download | build-91bd3969abd9778b16a983a4be2451bfca1637a2.tar.gz build-91bd3969abd9778b16a983a4be2451bfca1637a2.tar.bz2 build-91bd3969abd9778b16a983a4be2451bfca1637a2.zip |
add support for using the system's zypp repos
Diffstat (limited to 'createrepomddeps')
-rwxr-xr-x | createrepomddeps | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/createrepomddeps b/createrepomddeps index 9258262..61c604a 100755 --- a/createrepomddeps +++ b/createrepomddeps @@ -360,21 +360,41 @@ my $p = new XML::Parser( }); #my $url = '/mounts/mirror/SuSE/ftp.suse.com/pub/suse/update/10.1/'; -foreach my $url (@ARGV) { - $url .= '/' unless $url =~ /\/$/; +for my $url (@ARGV) { + my $dir; + if ($url =~ /^zypp:\/\/([^\/]*)\/?/) { + use Build::Zypp; + my $repo = Build::Zypp::parsecfg($1); + die "can't parse $1\n" unless $repo; + my $type = $repo->{'type'}; + if($type eq 'rpm-md') { + my $name = $repo->{'name'}; + $dir = "/var/cache/zypp/raw/$name/"; + $baseurl = $url; + $baseurl .= '/' unless $baseurl =~ /\/$/; + } elsif ($type eq 'yast2') { + # XXX + exec ($INC[0].'/createyastdeps', $url); + } else { + die "unsupported repo type: $type\n"; + } + } else { + $dir = $url; + $dir .= '/' unless $dir =~ /\/$/; + $baseurl = $dir; + } - $baseurl = $url; @primaryfiles = (); @cursor = ([undef, $repomdparser]); - $p->parsefile($url . 'repodata/repomd.xml'); + $p->parsefile($dir . 'repodata/repomd.xml'); # print Dumper(\@primaryfiles); foreach my $f (@primaryfiles) { @cursor = ([undef, $primaryparser]); - my $u = $url . $f->{'location'}; + my $u = $dir . $f->{'location'}; $u = 'gzip -cd ' . $u . '|' if ($u =~ /\.gz$/); # XXX my $fh; |