diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-06-22 09:40:38 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-06-22 09:40:38 +0000 |
commit | 80ec7792a5fab15df155f9f78ac42aa6508578cd (patch) | |
tree | e20fbabf6c33f67919d199fe912d0da0791d0358 | |
parent | d12b0fe7a0bf20c297f5606ec5d713605dcf7d69 (diff) | |
download | rpmtools-80ec7792a5fab15df155f9f78ac42aa6508578cd.tar rpmtools-80ec7792a5fab15df155f9f78ac42aa6508578cd.tar.gz rpmtools-80ec7792a5fab15df155f9f78ac42aa6508578cd.tar.bz2 rpmtools-80ec7792a5fab15df155f9f78ac42aa6508578cd.tar.xz rpmtools-80ec7792a5fab15df155f9f78ac42aa6508578cd.zip |
be backward compatible with distros <= 2007.0
-rw-r--r-- | genhdlist2 | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -188,11 +188,18 @@ sub add_pkg_header { sub build_synthesis { my ($urpm, $synthesis) = @_; - $urpm->build_synthesis( - start => 0, - end => $#{$urpm->{depslist}}, - synthesis => $synthesis, - ) or die "build_synthesis failed (disk full?)\n"; + # for compatibility with perl-URPM < 1.48 (ie < 2007.1), + # creating empty synthesis by hand. This is only needed to run on old distros + if (@{$urpm->{depslist}} == 0) { + open(my $hsynth, "| /bin/gzip > $synthesis"); + close $hsynth or die "Can't create empty synthesis $synthesis: $!\n"; + } else { + $urpm->build_synthesis( + start => 0, + end => $#{$urpm->{depslist}}, + synthesis => $synthesis, + ) or die "build_synthesis failed (disk full?)\n"; + } } sub generate_md5sum { |