From 80ec7792a5fab15df155f9f78ac42aa6508578cd Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 22 Jun 2007 09:40:38 +0000 Subject: be backward compatible with distros <= 2007.0 --- genhdlist2 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/genhdlist2 b/genhdlist2 index 4dedd25..6559bbb 100644 --- a/genhdlist2 +++ b/genhdlist2 @@ -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 { -- cgit v1.2.1