Skip to content
Snippets Groups Projects
Commit e2fbd316 authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

Change so that if delta file is larger than new revision, compress the

new revision if its uncompressed, otherwise just copy it.
parent 8208d44b
No related branches found
No related tags found
No related merge requests found
......@@ -101,16 +101,22 @@ foreach my $v2_file (glob($v2_dir . '/*')) {
$delta_size = (stat $delta_file)[7];
if ($delta_size > $v2_size) {
print "\tOoops, delta file larger than new revision\n";
print "\t(copying new file)\n";
$patch_command = 'ADD';
copy($v2_file, $delta_file);
print "\tOoops, delta file larger than new revision ";
if ($v2_file =~ /.gz$/) {
print "(copying new file)\n";
$patch_command = 'ADD';
copy($v2_file, $delta_file);
} else {
print "(compressing new file)\n";
$patch_command = 'ZIP';
do_compress($v2_file, $delta_file);
}
} else {
$patch_command = 'PATCH';
}
}
} else {
$patch_command = 'ZIP'; # (was 'ADD')
$patch_command = 'ZIP';
print "\tCopying (and compressing) new file\n";
do_compress($v2_file, $delta_file);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment