aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-06-22 00:14:32 +0000
committerColin Guthrie <colin@mageia.org>2013-12-22 14:26:21 +0000
commit97a852f6b6218f307d6b31a7c5bf67a509fae3ba (patch)
tree5ebeedeb7a5bfe999438993c66a46b2836c8d97c
parent09906eae3497ae29b10e0d14dc9ae6343b0fc6d5 (diff)
downloadspec-helper-97a852f6b6218f307d6b31a7c5bf67a509fae3ba.tar
spec-helper-97a852f6b6218f307d6b31a7c5bf67a509fae3ba.tar.gz
spec-helper-97a852f6b6218f307d6b31a7c5bf67a509fae3ba.tar.bz2
spec-helper-97a852f6b6218f307d6b31a7c5bf67a509fae3ba.tar.xz
spec-helper-97a852f6b6218f307d6b31a7c5bf67a509fae3ba.zip
simplify xargs() usage now that all callers care about its return value
Note: This commit was accidentally missed when importing from subversion and has now been restored.
-rwxr-xr-xcompress_files12
1 files changed, 5 insertions, 7 deletions
diff --git a/compress_files b/compress_files
index 4702dae..7831d07 100755
--- a/compress_files
+++ b/compress_files
@@ -120,9 +120,8 @@ if (@files) {
: $ext eq '.xz' ? qw(xz -f)
: qw()
;
- xargs(\@files, @command);
- die "Something wrong with the man/info file compression"
- if $?;
+ xargs(\@files, @command)
+ or die "Something wrong with the man/info file compression";
}
# Fix up symlinks that were pointing to the uncompressed files.
@@ -176,7 +175,7 @@ sub xargs {
$length = $static_length + length($arg) + 1;
}
}
- system(@_, @collect) if @collect > 0;
+ system(@_, @collect) == 0 if @collect > 0;
}
# uncompress info/man pages with a given extension
@@ -203,9 +202,8 @@ sub uncompress_files {
}
if (@compressed_files) {
- xargs(\@compressed_files, $command, "-d");
- die "Something wrong with the decompression of the $extension man/info file"
- if $?;
+ xargs(\@compressed_files, $command, "-d")
+ or die "Something wrong with the decompression of the $extension man/info file";
my $length = length($extension);
push(@files, map { substr($_, 0, -$length) } @compressed_files);
}