From 0397383aba26010b9898b64b3d237ceacb976ce2 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Tue, 15 Apr 2003 05:39:25 +0000 Subject: [PATCH] Strip trailing / from the file args in dpkg-statoverride. --- ChangeLog | 5 +++++ debian/changelog | 2 ++ scripts/dpkg-statoverride.pl | 3 +++ 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9c7e3d8e..7c5e8780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Apr 15 00:35:40 CDT 2003 Adam Heath + + * scripts/dpkg-statoverride.pl: Strip trailing / from the file args in + dpkg-statoverride. + Tue Apr 15 00:26:06 CDT 2003 Adam Heath * Makefile.in: Surround sed call with ''. diff --git a/debian/changelog b/debian/changelog index 0f1ad592..ab868d1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ dpkg (1.10.10) unstable; urgency=low * Update archtable for hurd. Closes: #187509. * Make the dpkg-iasearch conflicts versioned. Closes: #170698. * Surround sed call with '' in Makefile.in. Closes: #187534. + * Strip trailing / from the file args in dpkg-statoverride. Closes: + #184239. -- Adam Heath UNRELEASED diff --git a/scripts/dpkg-statoverride.pl b/scripts/dpkg-statoverride.pl index 38cb7b4c..ee6fe10e 100755 --- a/scripts/dpkg-statoverride.pl +++ b/scripts/dpkg-statoverride.pl @@ -98,6 +98,7 @@ if ($mode eq "add") { (($mode<0) or (oct($mode)>07777)) && &badusage("illegal mode $mode"); $file= $ARGV[3]; $file =~ m/\n/ && &badusage("file may not contain newlines"); + $file =~ s,/*$,, && print STDERR "stripping trailing /\n"; if (defined $owner{$file}) { print STDERR "An override for \"$file\" already exists, "; @@ -124,6 +125,7 @@ if ($mode eq "add") { } elsif ($mode eq "remove") { @ARGV==1 || &badusage("--remove needs one arguments"); $file=$ARGV[0]; + $file =~ s,/*$,, && print STDERR "stripping trailing /\n"; if (not defined $owner{$file}) { print STDERR "No override present.\n"; exit(0) if ($doforce); @@ -142,6 +144,7 @@ if ($mode eq "add") { s/\W/\\$&/g; s/\\\?/./g; s/\\\*/.*/g; + s,/*$,, && print STDERR "stripping trailing /\n"; push(@list,"^$_\$"); } $pat= join('|',@list); -- 2.39.5