The following commit has been merged in the debian-master branch:
commit f199862788c8ad81dd559771b539930fdda871a9
Merge: f1deb5744025ae41fc89f90b8dcba2df6f821077
5e2289543a3358df734ff5235db02c380343a256
Author: Frank Lichtenheld <[email protected]>
Date: Sun Feb 8 17:19:10 2009 +0000
Merge commit 'alioth/debian-master' into debian-master
diff --combined bin/extract_files
index 1d3ce91,269078c..79b9946
--- a/bin/extract_files
+++ b/bin/extract_files
@@@ -130,6 -130,13 +130,13 @@@ sub add_log
$$log .= localtime().": @_\n";
}
+ sub touch {
+ my $filename = shift;
+ sysopen(H, $filename, O_WRONLY|O_NONBLOCK|O_CREAT) or return undef;
+ close(H);
+ return 1;
+ }
+
##################################################
# PACKAGE HANDLING (UNPACKING/CLEANUP)
@@@ -227,8 -234,8 +234,8 @@@ sub to_update
if ($config_data->{structure} == PKGPOOL) {
my $dir = "$target/".pkg_pool_directory( $pkg_data );
- if (!$force && -d $dir && -f "$dir/log") {
- (system( "touch", "$dir/log" ) == 0)
+ if (!$force && -f "$dir/log") {
+ (utime(undef,undef,"$dir/log") == 1)
or do_warning( "touch of $dir/log failed" );
return 0;
} else {
@@@ -284,7 -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" );
@@@ -298,11 -305,11 +305,11 @@@
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" );
- (system( "touch", "$tgt.ERROR" ) == 0)
+ touch("$tgt.ERROR")
or add_log( $log, "even the touch of $tgt.ERROR failed :("
);
}
}
@@@ -317,7 -324,7 +324,7 @@@
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;
@@@ -327,7 -334,7 +334,7 @@@
}
unless (-e $src_tgt) {
add_log( $log, "give up" );
- (system( "touch", "$src_tgt.ERROR" ) == 0) or
+ touch("$src_tgt.ERROR") or
add_log( $log, "even the touch of $src_tgt.ERROR failed :(" );
}
}
@@@ -371,7 -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 );
@@@ -382,7 -389,7 +389,7 @@@
"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,
@@@ -557,10 -564,6 +564,10 @@@ sub read_deb
}
}
$cache{$debname} ||= qx/dpkg-deb --info "$debname" control/;
+ unless ( $cache{$debname} ) {
+ do_warning( "extracting control information of file $debname failed" );
+ return;
+ }
my $control = $cache{$debname};
unless ( $raw_data = $parser->parse_mem( $control,
--
APT Archive Web-Frontend (Alioth repository)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]