aboutsummaryrefslogtreecommitdiffstats
path: root/compress_files
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2008-05-08 16:32:03 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2008-05-08 16:32:03 +0000
commitbcf50c9868ecc4dd1c237bb846de36dc12c330ef (patch)
tree3b42bb60547075eded4154b5fa136e20663457b5 /compress_files
parent06b7ce79325001e0b8e8e72c51d88ff3e5b370a2 (diff)
downloadspec-helper-bcf50c9868ecc4dd1c237bb846de36dc12c330ef.tar
spec-helper-bcf50c9868ecc4dd1c237bb846de36dc12c330ef.tar.gz
spec-helper-bcf50c9868ecc4dd1c237bb846de36dc12c330ef.tar.bz2
spec-helper-bcf50c9868ecc4dd1c237bb846de36dc12c330ef.tar.xz
spec-helper-bcf50c9868ecc4dd1c237bb846de36dc12c330ef.zip
no more call to external commands for file linking and deletions
Diffstat (limited to 'compress_files')
-rwxr-xr-xcompress_files14
1 files changed, 7 insertions, 7 deletions
diff --git a/compress_files b/compress_files
index bb879b7..79e0c1b 100755
--- a/compress_files
+++ b/compress_files
@@ -44,8 +44,8 @@ foreach my $dir (@sodirs) {
}
foreach my $sofile (@sofiles) {
my $sodest = shift(@sodests);
- system "rm", "-f",$sofile;
- system "ln", "-sf",$sodest,$sofile;
+ unlink $sofile;
+ symlink $sodest, $sofile;
}
my @files;
@@ -108,9 +108,9 @@ if (@f) {
# they are again.
foreach (keys %hardlinks) {
# Remove old file.
- system("rm", "-f", $_);
+ unlink $_;
# Make new hardlink.
- system("ln", "$hardlinks{$_}$ext", "$_$ext");
+ link "$hardlinks{$_}$ext", "$_$ext";
}
# Fix up symlinks that were pointing to the uncompressed files.
@@ -122,11 +122,11 @@ while (<$FIND>) {
my ($directory) = m!(.*)/!;
my $linkval = readlink($_);
if (! -e "$directory/$linkval" && -e "$directory/$linkval$ext") {
- system("rm", "-f", $_);
- system("ln", "-sf", "$linkval$ext", "$_$ext");
+ unlink $_;
+ symlink "$linkval$ext", "$_$ext";
} elsif (! -e "$directory/$linkval" && ! -e "$directory/$linkval$ext" && $directory =~ m|man/|) {
#Bad link go on nowhere (any better idea) ?
- unlink($_);
+ unlink $_;
}
}