* extfs/apt.in, extfs/dpkg.in: Avoid stat on non-existing file.

This commit is contained in:
Andrew V. Samoilov 2002-12-24 06:33:46 +00:00
parent 47e32ea5a5
commit 1edcc92829
3 changed files with 19 additions and 9 deletions

View File

@ -1,3 +1,7 @@
2002-12-24 Adam Byrtek <alpha@debian.org>
* extfs/apt.in, extfs/dpkg.in: Avoid stat on non-existing file.
2002-12-20 Andrew V. Samoilov <sav@bcs.zp.ua> 2002-12-20 Andrew V. Samoilov <sav@bcs.zp.ua>
* smbfs.c: Resurrect and use myumask for generated permissions. * smbfs.c: Resurrect and use myumask for generated permissions.

View File

@ -93,10 +93,13 @@ sub fm
sub ls { sub ls {
my ($file,$path,$mode) = @_; my ($file,$path,$mode) = @_;
my @stat = stat($file);
# mode, nlink, uid, gid, size, mtime, filename if (-f $file) {
printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777), my @stat = stat(_);
$stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path; # mode, nlink, uid, gid, size, mtime, filename
printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777),
$stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path;
}
} }
$DATE=bt(time()); $DATE=bt(time());
@ -125,7 +128,7 @@ sub list
print "-r-xr--r-- 1 root root $sz $DATE DIST-UPGRADE\n"; print "-r-xr--r-- 1 root root $sz $DATE DIST-UPGRADE\n";
ls("/etc/apt/sources.list","sources.list"); ls("/etc/apt/sources.list","sources.list");
ls("/etc/apt/apt.conf","apt.conf"); ls('/etc/apt/apt.conf','apt.conf') if (-f '/etc/apt/apt.conf');
print "drwxr-xr-x 1 root root 0 $DATE all\n"; print "drwxr-xr-x 1 root root 0 $DATE all\n";

View File

@ -93,10 +93,13 @@ sub fm
sub ls { sub ls {
my ($file,$path,$mode) = @_; my ($file,$path,$mode) = @_;
my @stat = stat($file);
# mode, nlink, uid, gid, size, mtime, filename if (-f $file) {
printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777), my @stat = stat(_);
$stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path; # mode, nlink, uid, gid, size, mtime, filename
printf "%s %d %d %d %d %s %s\n", $mode || ft($file).fm($stat[2] & 07777),
$stat[3], $stat[4], $stat[5], $stat[7], bt($stat[9]), $path;
}
} }
$DATE=bt(time()); $DATE=bt(time());