From e76b3a8a4e6c0c277853c997a9463ecf52db8002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Thu, 7 May 2009 13:41:45 +0000 Subject: * replace deprecated 'lzmash' command with 'lzma' * add support for xz --- compress_files | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'compress_files') 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); } -- cgit v1.2.1