Try again to fix the TOTALNUM issue
We can't do it in make_image, as that may end up running in parallel. Instead, do the update of TOTALNUM at the end of make_disc_trees.pl.
This commit is contained in:
parent
ae89572871
commit
c7cc669655
|
@ -334,6 +334,9 @@ if ($max_done == 0) {
|
||||||
}
|
}
|
||||||
|
|
||||||
print LOG "Finished: $pkgs_done packages placed\n";
|
print LOG "Finished: $pkgs_done packages placed\n";
|
||||||
|
|
||||||
|
last_minute_update($disknum);
|
||||||
|
|
||||||
print "Finished: $pkgs_done packages placed\n";
|
print "Finished: $pkgs_done packages placed\n";
|
||||||
system("date >> $log");
|
system("date >> $log");
|
||||||
|
|
||||||
|
@ -344,6 +347,46 @@ close(LOG);
|
||||||
# Local helper functions
|
# Local helper functions
|
||||||
#
|
#
|
||||||
#############################################
|
#############################################
|
||||||
|
|
||||||
|
# Only once we know how many CDs we're making can we fill in the
|
||||||
|
# TOTALNUM number in README.{html,txt} (and therefore also update the
|
||||||
|
# md5sum.txt entries for those files)
|
||||||
|
sub last_minute_update {
|
||||||
|
my $total_disks = shift;
|
||||||
|
|
||||||
|
for (my $disknum = 1; $disknum <= $total_disks; $disknum++) {
|
||||||
|
my $cddir = "$bdir/CD$disknum";
|
||||||
|
|
||||||
|
chdir $cddir;
|
||||||
|
|
||||||
|
for my $upd ("README.html", "README.txt") {
|
||||||
|
my $buf = "";
|
||||||
|
print LOG " Last-minute update of $cddir/$upd\n";
|
||||||
|
open(README, "< $upd") or
|
||||||
|
die "Failed to open $upd for reading: $!\n";
|
||||||
|
while (defined (my $line = <README>)) {
|
||||||
|
$line =~ s/TOTALNUM/$total_disks/g;
|
||||||
|
$buf .= $line
|
||||||
|
}
|
||||||
|
close(README);
|
||||||
|
open(README, "> $upd") or
|
||||||
|
die "Failed to open $upd for writing: $!\n";
|
||||||
|
print README $buf;
|
||||||
|
close(README);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Now update the md5sums.txt for the README files
|
||||||
|
open(MD5LIST, ">> md5sum.txt") or
|
||||||
|
die "Failed to open md5sum.txt file: $!\n";
|
||||||
|
foreach my $file (glob "./README.*") {
|
||||||
|
my ($md5, $size) = checksum_file($file, "md5");
|
||||||
|
printf MD5LIST "%s %s\n", $md5, $file;
|
||||||
|
}
|
||||||
|
close(MD5LIST);
|
||||||
|
chdir $bdir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Load up information about all the packages
|
# Load up information about all the packages
|
||||||
sub load_packages_cache {
|
sub load_packages_cache {
|
||||||
my $arch = shift;
|
my $arch = shift;
|
||||||
|
@ -811,7 +854,7 @@ sub start_disc {
|
||||||
# Grab all the early stuff, apart from dirs that will change later
|
# Grab all the early stuff, apart from dirs that will change later
|
||||||
print " Starting the md5sum.txt file\n";
|
print " Starting the md5sum.txt file\n";
|
||||||
chdir $cddir;
|
chdir $cddir;
|
||||||
system("find . -type f | grep -v -e ^\./\.disk -e ^\./dists | xargs md5sum >> md5sum.txt");
|
system("find . -type f | grep -v -e ^\./\.disk -e ^\./dists -e ^\./README | xargs md5sum >> md5sum.txt");
|
||||||
chdir $bdir;
|
chdir $bdir;
|
||||||
|
|
||||||
$mkisofs_opts = "";
|
$mkisofs_opts = "";
|
||||||
|
@ -944,6 +987,7 @@ sub finish_disc {
|
||||||
find (\&md5_files_for_md5sum, $dir);
|
find (\&md5_files_for_md5sum, $dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close(MD5LIST);
|
close(MD5LIST);
|
||||||
|
|
||||||
# And sort; it should make things faster for people checking
|
# And sort; it should make things faster for people checking
|
||||||
|
|
|
@ -24,22 +24,6 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FILES=$DIR/*.volid
|
FILES=$DIR/*.volid
|
||||||
NUM_CDS=$(ls -1 $FILES | wc -l)
|
|
||||||
|
|
||||||
last_minute_update () {
|
|
||||||
echo " Last-minute updates:"
|
|
||||||
# Aaargh. Only now that we know how many CDs we're making can we
|
|
||||||
# fill in the TOTALNUM number in README.{html,txt} (and therefore also
|
|
||||||
# update the md5sum.txt entries for those files)
|
|
||||||
for file in README.html README.txt
|
|
||||||
do
|
|
||||||
echo " $file"
|
|
||||||
OLD_MD5=`md5sum ./$file`
|
|
||||||
sed -i "s?TOTALNUM?$NUM_CDS?" $file
|
|
||||||
NEW_MD5=`md5sum ./$file`
|
|
||||||
sed -i "s?$OLD_MD5?$NEW_MD5?" md5sum.txt
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Grab the xorriso version and turn it into a number we can use
|
# Grab the xorriso version and turn it into a number we can use
|
||||||
xorriso_version() {
|
xorriso_version() {
|
||||||
|
@ -56,10 +40,6 @@ do
|
||||||
n=${dir##$DIR/}
|
n=${dir##$DIR/}
|
||||||
dir=$DIR/CD$n
|
dir=$DIR/CD$n
|
||||||
|
|
||||||
cd $dir
|
|
||||||
# Anything last-minute that can only be done now?
|
|
||||||
last_minute_update
|
|
||||||
|
|
||||||
cd $dir/..
|
cd $dir/..
|
||||||
|
|
||||||
opts=`cat $DIR/$n.mkisofs_opts` || true
|
opts=`cat $DIR/$n.mkisofs_opts` || true
|
||||||
|
|
Loading…
Reference in New Issue