aboutsummaryrefslogtreecommitdiffstats
path: root/compress_files
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-07-12 12:08:45 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-07-12 12:08:45 +0000
commit1523cc37b367d02f092b0c91045ef0e5e5a28181 (patch)
tree2a370cb44773ee266f53f6fab06184f9cd7ad76a /compress_files
parent3d80b4855f1c68d852f6e6d79522fdb6f59827c7 (diff)
downloadspec-helper-1523cc37b367d02f092b0c91045ef0e5e5a28181.tar
spec-helper-1523cc37b367d02f092b0c91045ef0e5e5a28181.tar.gz
spec-helper-1523cc37b367d02f092b0c91045ef0e5e5a28181.tar.bz2
spec-helper-1523cc37b367d02f092b0c91045ef0e5e5a28181.tar.xz
spec-helper-1523cc37b367d02f092b0c91045ef0e5e5a28181.zip
- switch to lzma compression
Diffstat (limited to 'compress_files')
-rwxr-xr-xcompress_files14
1 files changed, 8 insertions, 6 deletions
diff --git a/compress_files b/compress_files
index bdeb408..b703540 100755
--- a/compress_files
+++ b/compress_files
@@ -111,10 +111,12 @@ foreach my $sofile (@sofiles) {
system "ln", "-sf",$sodest,$sofile;
}
-my @files = split(/\n/, `find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/lib/perl5/man -type f ! -name "*.gz" -a ! -name "*.bz2" ! -name 'dir' ! -name 'whatis' 2>/dev/null || true`);
+my @files = split(/\n/, `find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/lib/perl5/man -type f ! -name "*.gz" -a ! -name "*.bz2" -a ! -name "*.lzma" ! -name 'dir' ! -name 'whatis' 2>/dev/null || true`);
my @gz_files = split(/\n/, `find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/lib/perl5/man -type f -name "*.gz" 2>/dev/null || true`);
if (@gz_files) { xargs(\@gz_files, "gzip", "-d"); $? ? die "Something wrong with the decompression of the gzip man/info file, fix this ASAP" : exec($0) }
+my @bz_files = split(/\n/, `find usr/info usr/share/info usr/man usr/share/man usr/X11*/man usr/lib/perl5/man -type f -name "*.bz2" 2>/dev/null || true`);
+if (@bz_files) { xargs(\@bz_files, "bzip2", "-d"); $? ? die "Something wrong with the decompression of the gzip man/info file, fix this ASAP" : exec($0) }
# Exclude files from compression.
if (@files && defined($ENV{EXCLUDE_FROM_COMPRESS})) {
@@ -158,7 +160,7 @@ if (@f) {
# Make executables not be anymore.
xargs(\@f, "chmod", "a-x");
- xargs(\@f, "bzip2", "-9f");
+ xargs(\@f, "lzma", "-9f");
}
@@ -168,7 +170,7 @@ foreach (keys %hardlinks) {
# Remove old file.
system("rm", "-f", $_);
# Make new hardlink.
- system("ln", "$hardlinks{$_}.bz2", "$_.bz2");
+ system("ln", "$hardlinks{$_}.lzma", "$_.lzma");
}
# Fix up symlinks that were pointing to the uncompressed files.
@@ -179,10 +181,10 @@ while (<$FIND>) {
chomp;
my ($directory) = m!(.*)/!;
my $linkval = readlink($_);
- if (! -e "$directory/$linkval" && -e "$directory/$linkval.bz2") {
+ if (! -e "$directory/$linkval" && -e "$directory/$linkval.lzma") {
system("rm", "-f", $_);
- system("ln", "-sf", "$linkval.bz2", "$_.bz2");
- } elsif (! -e "$directory/$linkval" && ! -e "$directory/linkval.bz2" && $directory =~ m|man/|) {
+ system("ln", "-sf", "$linkval.lzma", "$_.lzma");
+ } elsif (! -e "$directory/$linkval" && ! -e "$directory/$linkval.lzma" && $directory =~ m|man/|) {
#Bad link go on nowhere (any better idea) ?
unlink($_);
}