aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2000-02-28 14:39:18 +0000
committerFrederic Lepied <flepied@mandriva.com>2000-02-28 14:39:18 +0000
commit82f561ce59177878736b15a09d57d32446acf27e (patch)
tree251e952116b984aef97914afa2ceed2afeae22f8
parentea7335a5eb3fcab424caec4d50b1be5e55bd921b (diff)
downloadspec-helper-82f561ce59177878736b15a09d57d32446acf27e.tar
spec-helper-82f561ce59177878736b15a09d57d32446acf27e.tar.gz
spec-helper-82f561ce59177878736b15a09d57d32446acf27e.tar.bz2
spec-helper-82f561ce59177878736b15a09d57d32446acf27e.tar.xz
spec-helper-82f561ce59177878736b15a09d57d32446acf27e.zip
* use EXCLUDE_FROM_COMPRESS env variable to list files to exlcude
from compression.
-rwxr-xr-xcompress_files18
1 files changed, 17 insertions, 1 deletions
diff --git a/compress_files b/compress_files
index eaaec0d..37f5c35 100755
--- a/compress_files
+++ b/compress_files
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
#---------------------------------------------------------------
# Project : Linux-Mandrake
# Module : spec-helper
@@ -113,6 +113,22 @@ foreach $sofile (@sofiles) {
push @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" 2>/dev/null || true`);
+# Exclude files from compression.
+if (@files && defined($ENV{EXCLUDE_FROM_COMPRESS})) {
+ @new=();
+ foreach (@files) {
+ $ok=1;
+ foreach $x (split(' ',$ENV{EXCLUDE_FROM_COMPRESS})) {
+ if (/\Q$x\E/) {
+ $ok='';
+ last;
+ }
+ }
+ push @new,$_ if $ok;
+ }
+ @files=@new;
+}
+
# Look for files with hard links. If we are going to compress both,
# we can preserve the hard link across the compression and save
# space in the end.