The following commit has been merged in the master branch:
commit 818c6a459764b613fbff5fb9d72b64db5de6f262
Author: Peter Palfrader <[email protected]>
Date: Sat Feb 7 22:18:15 2009 +0000
Do not shell out for ln -s anymore
Signed-off-by: Frank Lichtenheld <[email protected]>
diff --git a/bin/extract_files b/bin/extract_files
index b5753b2..49b489f 100755
--- a/bin/extract_files
+++ b/bin/extract_files
@@ -291,7 +291,7 @@ sub extract_copyright_to_pkgpool {
my $pkg2 = $1;
if ($pkg_data->{bin_list}{$pkg2}) {
add_log( $log, "symlink points to $pkg2, make symlink to
copyright file" );
- (system("ln", "-s", "$pkg2.copyright", $tgt ) == 0)
+ (symlink( "$pkg2.copyright", $tgt ) == 1 )
or add_log( $log, "symlink creation failed" );
} else {
add_log( $log, "symlink points to $pkg2, don't know what to
do with that" );
@@ -305,7 +305,7 @@ sub extract_copyright_to_pkgpool {
add_log( $log, "copyright file $tgt still doesn't exist" );
if (-e $src_tgt) {
add_log( $log, "copyright file of the source package exists,
make symlink" );
- (system("ln", "-s", "copyright", $tgt ) == 0)
+ (symlink( "copyright", $tgt ) == 1 )
or add_log( $log, "symlink generation failed" );
} else {
add_log( $log, "give up on $bin_pkg" );
@@ -324,7 +324,7 @@ sub extract_copyright_to_pkgpool {
keys %{$pkg_data->{bin_list}})) {
if (-e "$target_dir/$bin_pkg.copyright") {
add_log( $log, "copyright file $target_dir/$bin_pkg.copyright
seems like a good guess to me, make a symlink" );
- (system("ln", "-s", "$bin_pkg.copyright", $src_tgt ) == 0)
+ (symlink( "$bin_pkg.copyright", $src_tgt ) == 1 )
or do {
add_log( $log, "symlink generation failed" );
next;
@@ -378,7 +378,7 @@ sub manage_current_link {
unless (-l $current_link) {
add_log( $log, "create new current link" );
(chdir( $parent_dir ) and
- not system( 'ln', '-s', $dirname, 'current' )) or
+ (symlink( $dirname, 'current' ) == 1 )) or
add_log( $log, "creating new current link failed: $!" );
} else {
my $old_target = readlink( $current_link );
@@ -389,7 +389,7 @@ sub manage_current_link {
"old_version=$old_version; overwriting current link" );
(chdir( $parent_dir ) and
unlink( 'current' ) and
- not system( 'ln', '-s', $dirname, 'current' )) or
+ (symlink( $dirname, 'current' ) == 1 )) or
add_log( $log, "overwriting current link failed: $!" );
} else {
add_log( $log,
--
APT Archive Web-Frontend (Alioth repository)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]