aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2017-07-29 13:49:51 +0100
committerPascal Terjan <pterjan@mageia.org>2017-10-02 22:56:30 +0100
commit536be8dbb27733521e3cbb312fbcbf6adbd36362 (patch)
treec224e8daa48fd0f5d05b936bd8c3ad728423ad85
parentf0c98920922d6eb92a2cbd681b05d2c6bc4f0881 (diff)
downloadiurt-536be8dbb27733521e3cbb312fbcbf6adbd36362.tar
iurt-536be8dbb27733521e3cbb312fbcbf6adbd36362.tar.gz
iurt-536be8dbb27733521e3cbb312fbcbf6adbd36362.tar.bz2
iurt-536be8dbb27733521e3cbb312fbcbf6adbd36362.tar.xz
iurt-536be8dbb27733521e3cbb312fbcbf6adbd36362.zip
Use urpm to parse synthesis
This allows it to work with xz compressed synthesis.
-rw-r--r--NEWS1
-rwxr-xr-xiurt32
2 files changed, 12 insertions, 21 deletions
diff --git a/NEWS b/NEWS
index fecf79b..9845d05 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
- iurt: support resuming a full rebuild
- ulri: improve handling of build failures
- iurt: fix stale command detection when log is not created quickly enough
+- iurt: use urpm to parse synthesis (fixes support for xz)
0.6.29
- iurt: support chroot tarballs with non gz compression
diff --git a/iurt b/iurt
index a379926..9f27e52 100755
--- a/iurt
+++ b/iurt
@@ -53,7 +53,7 @@ use Mkcd::Commandline qw(parseCommandLine usage);
use MDK::Common;
use Filesys::Df qw(df);
use POSIX;
-
+use urpm;
# copied from drakx' standalone:
sub bug_handler {
@@ -1285,28 +1285,18 @@ sub check_media {
my $synthesis_file = "$config->{repository}/$run->{distro}/$run->{my_arch}/media/$m/$subdir/media_info/synthesis.hdlist.cz";
if (-f $synthesis_file) {
plog("Parsing $synthesis_file");
- # FIXME: this is reinventing the wheel and will fail if default compressor change:
- if (open my $syn, "zcat $synthesis_file |") {
- local $_;
- while (<$syn>) {
- my @prov;
- if (/^\@provides@(.*)/) {
- foreach my $p (split '@', $1) {
- if ($p =~ /([^[]+)(?:\[(.*)\])?/g) {
- push @prov, $1;
- $provides->{$1} = $2 || 1;
- }
- }
- } elsif (/\@info\@([^@]+)@/) {
- my $p = $1;
- my ($name) = $p =~ /(.*)-[^-]+-[^-]+\./;
- $provides->{$p} = 1;
- $pack_provide->{$_} = $name foreach @prov;
+ my $urpm = urpm->new;
+ $urpm->parse_synthesis($synthesis_file, callback => sub {
+ my ($urpm, $pkg) = @_;
+ my $name = $pkg->name;
+ $provides->{$pkg->fullname} = 1;
+ foreach ($pkg->provides) {
+ if ($_ =~ /([^[]+)(?:\[(.*)\])?/g) {
+ $provides->{$1} = $2 || 1;
+ $pack_provide->{$1} = $name;
}
}
- } else {
- die "FATAL $program_name: Could not open $synthesis_file\n";
- }
+ });
}
}
}