aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-17 10:57:35 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-02-17 10:57:35 +0000
commitdd0e093481b9dad3d807827aff2875278beb06c7 (patch)
treeb581f7ae1b2fcfd584a84b7fde900792a8d9b701
parent21140ccc06542c4f5aa0bdd37afd2a69289c7a3e (diff)
downloadrpmtools-dd0e093481b9dad3d807827aff2875278beb06c7.tar
rpmtools-dd0e093481b9dad3d807827aff2875278beb06c7.tar.gz
rpmtools-dd0e093481b9dad3d807827aff2875278beb06c7.tar.bz2
rpmtools-dd0e093481b9dad3d807827aff2875278beb06c7.tar.xz
rpmtools-dd0e093481b9dad3d807827aff2875278beb06c7.zip
Generate MD5SUM files
-rwxr-xr-xgendistrib37
1 files changed, 35 insertions, 2 deletions
diff --git a/gendistrib b/gendistrib
index 8f1f5db..3f7d43f 100755
--- a/gendistrib
+++ b/gendistrib
@@ -21,6 +21,7 @@
#- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
use strict;
+use Cwd;
use URPM;
use URPM::Build;
use Getopt::Long;
@@ -101,10 +102,11 @@ foreach (<$fh>) {
push @hdlists, {
synthesis => "$root/media/media_info/synthesis.$name",
hdlist => "$root/media/media_info/$name",
- synthesis2 => "$root/$dir/media_info/synthesis.hdlist.cz",
- hdlist2 => "$root/$dir/media_info/hdlist.cz",
dir => $dir,
descr => $descr,
+ mediainfo => "$root/$dir/media_info",
+ synthesis2 => "$root/$dir/media_info/synthesis.hdlist.cz",
+ hdlist2 => "$root/$dir/media_info/hdlist.cz",
md5sum => "$root/$dir/media_info/MD5SUM",
};
}
@@ -185,6 +187,11 @@ foreach (0..$#hdlists) {
end => $end,
synthesis => $e->{synthesis});
+ unless ($nomediainfo && $nomd5sum) {
+ mkdir $e->{mediainfo}, 0755
+ or print STDERR qq(Can't create directory "$e->{mediainfo}": $!\n);
+ }
+
unless ($nomediainfo) {
print STDERR qq(link alternate locations of synthesis and hdlists\n) unless $nooutput;
link $e->{hdlist}, $e->{hdlist2}
@@ -192,6 +199,20 @@ foreach (0..$#hdlists) {
link $e->{synthesis}, $e->{synthesis2}
or print STDERR qq(link failed for "$e->{synthesis2}": $!\n);
}
+
+ unless ($nomd5sum) {
+ print STDERR qq(generate MD5SUM for media\n);
+ my $here = getcwd();
+ chdir $e->{mediainfo};
+ my $md5sum = `/usr/bin/md5sum hdlist* synthesis*`;
+ chdir $here;
+ if (open my $md5sumfh, '>', $e->{md5sum}) {
+ print $md5sumfh $md5sum;
+ close $md5sumfh;
+ } else {
+ print STDERR qq(Can't create "$e->{md5sum}": $!\n);
+ }
+ }
}
clean_cache();
@@ -203,6 +224,18 @@ $urpm->build_base_files(depslist => $urpmfiles{depslist},
#- safety cleaning
unlink $urpmfiles{md5sum};
+unless ($nomd5sum) {
+ my $here = getcwd();
+ chdir "$root/media/media_info";
+ my $md5sum = `/usr/bin/md5sum hdlist* synthesis*`;
+ chdir $here;
+ if (open my $md5sumfh, '>', $urpmfiles{md5sum}) {
+ print $md5sumfh $md5sum;
+ close $md5sumfh;
+ } else {
+ print STDERR qq(Can't create "$urpmfiles{md5sum}": $!\n);
+ }
+}
#- check if there are NOTFOUND in dependencies, check if they are in other media, warn the user.
if ($nooutput || !$nochkdep) {