diff options
author | Michael Schroeder <mls@suse.de> | 2010-07-23 14:14:08 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2010-07-23 14:14:08 +0200 |
commit | 8e37c329d804dd94e3261675a13f2ecf94f0b42d (patch) | |
tree | 7c2d1c1a4e63ad40d6326b63916906af95d1821b /createrepomddeps | |
parent | 71baad0385c40ed5f5116fa2ad8026e9b588b208 (diff) | |
download | obs-build-8e37c329d804dd94e3261675a13f2ecf94f0b42d.tar.gz obs-build-8e37c329d804dd94e3261675a13f2ecf94f0b42d.tar.bz2 obs-build-8e37c329d804dd94e3261675a13f2ecf94f0b42d.zip |
- do not add files to provides to stay compatible to createrpmdeps
- die if the metadata download failed
- use 3-arg form for metadata open
Diffstat (limited to 'createrepomddeps')
-rwxr-xr-x | createrepomddeps | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/createrepomddeps b/createrepomddeps index 6793a28..672636c 100755 --- a/createrepomddeps +++ b/createrepomddeps @@ -57,11 +57,12 @@ my $primaryparser = { 'rpm:obsoletes' => { 'rpm:entry' => { _start => \&primary_handle_package_obsoletes }, }, 'rpm:buildhost' => { _text => \&primary_collect_text, _end => \&primary_store_text }, 'rpm:sourcerpm' => { _text => \&primary_collect_text, _end => \&primary_store_text }, - file => { - _start => \&primary_handle_file_start, - _text => \&primary_collect_text, - _end => \&primary_handle_file_end - }, +### currently commented out, as we ignore file provides in createrpmdeps +# file => { +# _start => \&primary_handle_file_start, +# _text => \&primary_collect_text, +# _end => \&primary_handle_file_end +# }, }, location => { _start => \&primary_handle_package_location }, }, @@ -419,12 +420,16 @@ for my $url (@ARGV) { my $u = $dir . $f->{'location'}; if ($url =~ /^http:\/\/([^\/]*)\/?/) { - system($INC[0].'/download', $dir . "repodata/", $baseurl . "repodata/" . basename($u)); + if (system($INC[0].'/download', $dir . "repodata/", $baseurl . "repodata/" . basename($u))) { + die("download failed\n"); + } } - $u = 'gzip -cd ' . $u . '|' if ($u =~ /\.gz$/); # XXX - my $fh; - open($fh, $u) or next; + if ($u =~ /\.gz$/) { + open($fh, '-|', 'gzip', '-cd', $u) or next; # XXX + } else { + open($fh, '<', $u) or next; + } $p->parse($fh); close($fh); } |