libreoffice/install-with-hardlinks.diff
2012-11-23 16:08:34 +00:00

16 lines
974 B
Diff

--- solenv/bin/modules/installer/worker.pm.old 2012-11-07 15:41:56.000000000 +0100
+++ solenv/bin/modules/installer/worker.pm 2012-11-15 17:46:20.000000000 +0100
@@ -519,7 +519,11 @@ sub install_simple ($$$$$$)
unlink "$destdir$destination";
}
- copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $sourcepath -> $destdir$destination $!";
+ my $copied = 0;
+ # try to save space by hardlinking files; symlinks can't be hardlinked ;-)
+ $copied = link ("$sourcepath", "$destdir$destination") if (! -l $sourcepath);
+ $copied = copy ("$sourcepath", "$destdir$destination") if (! $copied);
+ die "Can't copy file: $sourcepath -> $destdir$destination $!" if (! $copied);
my $sourcestat = stat($sourcepath);
utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination");
chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!";