[libnet-dbus-perl] 286/335: Clarify error message for invalid interfaces (rt #44837)

Intrigeri intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.

commit cb6ea1b1e3a58a431320312ca0a2638eb0923bf5
Author: Daniel P. Berrange <dan at berrange.com>
Date:   Tue Jun 28 23:21:53 2011 +0100

    Clarify error message for invalid interfaces (rt #44837)
---
 lib/Net/DBus/Exporter.pm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/Net/DBus/Exporter.pm b/lib/Net/DBus/Exporter.pm
index 5c06587..e0e2425 100644
--- a/lib/Net/DBus/Exporter.pm
+++ b/lib/Net/DBus/Exporter.pm
@@ -507,11 +507,15 @@ sub dbus_signal {
 sub _validate_interface {
     my $interface = shift;
 
-    die "interface name '$interface' is not valid. " .
-	"Names must consist of at least two tokens, separated by '.'. " .
-	"Each token can use the characters a-z, A-Z, 0-9, _. " .
-	"Tokens must not start with a leading digit."
-	unless $interface =~ /^[a-zA-Z_]\w*(\.[a-zA-Z_]\w*)+$/;
+    die "interface name '$interface' is not valid.\n" .
+	" * Interface names are composed of 1 or more elements separated by a\n" .
+	"   period ('.') character. All elements must contain at least one character.\n" .
+	" * Each element must only contain the ASCII characters '[A-Z][a-z][0-9]_'\n" .
+	"   and must not begin with a digit.\n" .
+	" * Interface names must contain at least one '.' (period) character (and\n" .
+	"   thus at least two elements).\n" .
+	" * Interface names must not begin with a '.' (period) character.\n"
+    	unless $interface =~ /^[a-zA-Z_]\w*(\.[a-zA-Z_]\w*)+$/;
 }
 
 1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git



More information about the Pkg-perl-cvs-commits mailing list