diff options
author | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-12-23 23:02:48 +0000 |
---|---|---|
committer | Martin Whitaker <mageia@martin-whitaker.me.uk> | 2017-12-23 23:11:17 +0000 |
commit | 74a9117e361bcb2f6f8383830b867d4a266c7021 (patch) | |
tree | 98dbd27d6fd2e40ac80bf0ada11dd8b433abe408 | |
parent | 4db90ef93a4afc72e7c5c07eea956c36178e3d4e (diff) | |
download | rpmtools-74a9117e361bcb2f6f8383830b867d4a266c7021.tar rpmtools-74a9117e361bcb2f6f8383830b867d4a266c7021.tar.gz rpmtools-74a9117e361bcb2f6f8383830b867d4a266c7021.tar.bz2 rpmtools-74a9117e361bcb2f6f8383830b867d4a266c7021.tar.xz rpmtools-74a9117e361bcb2f6f8383830b867d4a266c7021.zip |
gendistrib: avoid errors when hdlists are not stored in the main media_info
gendistrib assumes the hdlist and synthesis files are present in the
master media_info directory, and tries to calculate md5sums for them.
This results in error messages if they are not stored there. This patch
prevents the errors.
-rwxr-xr-x | gendistrib | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -183,9 +183,12 @@ if (grep { !$_->{noneedrebuild} } @hdlists) { unless ($nomd5sum) { # this MD5SUM is mostly obsolete, but is still needed up to 2007.1 # (and even on cooker for existing urpmi.cfg) - my $md5sum = `cd $destinfodir ; /usr/bin/md5sum hdlist_* synthesis*`; + require File::Glob; + my $md5sum1 = `cd $destinfodir ; /usr/bin/md5sum hdlist_*` if glob("$destinfodir/hdlist_*"); + my $md5sum2 = `cd $destinfodir ; /usr/bin/md5sum synthesis*` if glob("$destinfodir/synthesis*"); open my $md5sumfh, '>', "$destinfodir/MD5SUM" or die "Can't create $destinfodir/MD5SUM: $!\n"; - print $md5sumfh $md5sum; + print $md5sumfh $md5sum1 if $md5sum1; + print $md5sumfh $md5sum2 if $md5sum2; } print STDERR "Calculating size of medias\n" unless $nooutput; |