From 62338df8f49bf1d4e45a10286b079e7171cac83c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 17 Feb 2007 20:08:53 +0000 Subject: [PATCH] * scripts/dpkg-source.pl (checkstats): Take '$dscdir' as an explicit argument. Fix all callers. (checktype): Take '$dir', '$fn' and '$type' as explicit arguments. Fix all callers. --- ChangeLog | 7 +++++++ scripts/dpkg-source.pl | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54e17406..9ca95677 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-02-17 Guillem Jover + + * scripts/dpkg-source.pl (checkstats): Take '$dscdir' as an explicit + argument. Fix all callers. + (checktype): Take '$dir', '$fn' and '$type' as explicit arguments. Fix + all callers. + 2007-02-17 Guillem Jover * scripts/update-alternatives.pl: Check if '$alink' is defined before diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl index 2d6033c0..d4dd9485 100755 --- a/scripts/dpkg-source.pl +++ b/scripts/dpkg-source.pl @@ -454,7 +454,7 @@ if ($opmode eq 'build') { my $mode = S_IMODE((lstat(_))[2]); if (-l _) { $type{$fn}= 'symlink'; - &checktype('-l') || next; + checktype($origdir, $fn, '-l') || next; defined($n= readlink("$dir/$fn")) || &syserr(sprintf(_g("cannot read link %s"), "$dir/$fn")); defined($n2= readlink("$origdir/$fn")) || @@ -518,7 +518,7 @@ if ($opmode eq 'build') { } } elsif (-p _) { $type{$fn}= 'pipe'; - &checktype('-p'); + checktype($origdir, $fn, '-p'); } elsif (-b _ || -c _ || -S _) { &unrepdiff(_g("device or socket is not allowed")); } elsif (-d _) { @@ -689,7 +689,7 @@ if ($opmode eq 'build') { &error(sprintf(_g("repeated file type - files `%s' and `%s'"), $seen{$_}, $file)) if $seen{$_}; $seen{$_} = $file; - checkstats($file); + checkstats($dscdir, $file); if (/^\.(?:orig(-\w+)?\.)?tar$/) { if ($1) { push @tarfiles, $file; } # push orig-foo.tar.gz to the end @@ -906,6 +906,7 @@ if ($opmode eq 'build') { } sub checkstats { + my $dscdir = shift; my ($f) = @_; my @s; my $m; @@ -1264,7 +1265,9 @@ sub cpiostderr { } sub checktype { - if (!lstat("$origdir/$fn")) { + my ($dir, $fn, $type) = @_; + + if (!lstat("$dir/$fn")) { &unrepdiff2(_g("nonexistent"),$type{$fn}); } else { $v= eval("$_[0] _ ? 2 : 1"); $v || &internerr(sprintf(_g("checktype %s (%s)"), "$@", $_[0])); -- 2.39.5