summaryrefslogtreecommitdiff
path: root/scripts/dpkg-gensymbols.pl
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-05-20 15:22:35 +0200
committerGuillem Jover <guillem@debian.org>2012-05-23 09:09:24 +0200
commit2e62609bbee5104f546df72c861a09f919d0fad6 (patch)
treec9dc785ccda7b0439601bd403f9b0a2f664c0810 /scripts/dpkg-gensymbols.pl
parented0095e40833d362a1cb6b7cf22ae27d4895827b (diff)
downloaddpkg-2e62609bbee5104f546df72c861a09f919d0fad6.tar.gz
scripts: Use new pkg_name_is_illegal() instead of ad-hoc checks
Diffstat (limited to 'scripts/dpkg-gensymbols.pl')
-rwxr-xr-xscripts/dpkg-gensymbols.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/dpkg-gensymbols.pl b/scripts/dpkg-gensymbols.pl
index c57433120..9e900b20b 100755
--- a/scripts/dpkg-gensymbols.pl
+++ b/scripts/dpkg-gensymbols.pl
@@ -3,6 +3,7 @@
# dpkg-gensymbols
#
# Copyright © 2007 Raphaël Hertzog
+# Copyright © 2007-2012 Guillem Jover <guillem@debian.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -22,6 +23,7 @@ use warnings;
use Dpkg;
use Dpkg::Arch qw(get_host_arch);
+use Dpkg::Package;
use Dpkg::Shlibs qw(@librarypaths);
use Dpkg::Shlibs::Objdump;
use Dpkg::Shlibs::SymbolFile;
@@ -95,8 +97,10 @@ Options:
my @files;
while (@ARGV) {
$_ = shift(@ARGV);
- if (m/^-p([-+0-9a-z.]+)$/) {
- $oppackage = $1;
+ if (m/^-p/) {
+ $oppackage = $';
+ my $err = pkg_name_is_illegal($oppackage);
+ error(_g("illegal package name '%s': %s"), $oppackage, $err) if $err;
} elsif (m/^-c(\d)?$/) {
$compare = defined($1) ? $1 : 1;
} elsif (m/^-q$/) {
@@ -115,8 +119,6 @@ while (@ARGV) {
warning(_g("pattern '%s' did not match any file"), $file)
unless scalar(@to_add);
}
- } elsif (m/^-p(.*)/) {
- error(_g("Illegal package name \`%s'"), $1);
} elsif (m/^-P(.+)$/) {
$packagebuilddir = $1;
$packagebuilddir =~ s{/+$}{};