aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2009-05-07 13:41:45 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2009-05-07 13:41:45 +0000
commite76b3a8a4e6c0c277853c997a9463ecf52db8002 (patch)
tree8fde7957082eff30287972b0dbb64d04f4f1b3de
parent809f5f2b2fac8bc90d73506711906b20c8970bc3 (diff)
downloadspec-helper-e76b3a8a4e6c0c277853c997a9463ecf52db8002.tar
spec-helper-e76b3a8a4e6c0c277853c997a9463ecf52db8002.tar.gz
spec-helper-e76b3a8a4e6c0c277853c997a9463ecf52db8002.tar.bz2
spec-helper-e76b3a8a4e6c0c277853c997a9463ecf52db8002.tar.xz
spec-helper-e76b3a8a4e6c0c277853c997a9463ecf52db8002.zip
* replace deprecated 'lzmash' command with 'lzma'
* add support for xz
-rwxr-xr-xcompress_files9
1 files changed, 6 insertions, 3 deletions
diff --git a/compress_files b/compress_files
index 90d092b..0130a75 100755
--- a/compress_files
+++ b/compress_files
@@ -10,7 +10,7 @@ use File::Basename;
use Fcntl ':mode';
my $ext = $ARGV[0] ||= '.gz';
-die "Unknown extension $ext" unless $ext =~ /^\.(?:gz|bz2|lzma)$/;
+die "Unknown extension $ext" unless $ext =~ /^\.(?:gz|bz2|lzma|xz)$/;
my $buildroot = $ENV{RPM_BUILD_ROOT};
die "No build root defined" unless $buildroot;
@@ -88,7 +88,7 @@ my $function = sub {
# skip excluded files
return if $File::Find::name =~ $exclude_pattern;
# skip compressed files
- return if $_ =~ /\.(?:gz|bz2|lzma)$/;
+ return if $_ =~ /\.(?:gz|bz2|lzma|xz)$/;
# skip particular files
return if $_ eq 'dir' || $_ eq 'whatis';
@@ -101,7 +101,8 @@ foreach my $dir (@mandirs) {
# uncompress info/man pages using another format
uncompress_files('.gz', 'gzip') if $ext ne '.gz';
uncompress_files('.bz2', 'bzip2') if $ext ne '.bz2';
-uncompress_files('.lzma', 'lzmash') if $ext ne '.lzma';
+uncompress_files('.lzma', 'lzma') if $ext ne '.lzma';
+uncompress_files('.xz', 'xz') if $ext ne '.xz';
# Look for files with hard links. If we are going to compress both,
# we can preserve the hard link across the compression and save
@@ -134,6 +135,8 @@ if (@f) {
: $ext eq '.bz2' ? qw/bzip2 -9f/
: $ext eq '.lzma' ? qw/lzma -9f --text/
: qw//
+ : $ext eq '.xz' ? qw/xz -9f --text/
+ : qw//
;
xargs(\@f, @command);
}