From 26297ed05c122a0867a94f96a87b3bf58d1c52ee Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Wed, 7 Jul 2010 16:00:00 -0700 Subject: Fix some type constraint stuff. --- usr/src/pinyadmin/sbin/newrepo | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/src/pinyadmin/sbin') diff --git a/usr/src/pinyadmin/sbin/newrepo b/usr/src/pinyadmin/sbin/newrepo index 1f83e82..49a4755 100755 --- a/usr/src/pinyadmin/sbin/newrepo +++ b/usr/src/pinyadmin/sbin/newrepo @@ -3,6 +3,8 @@ use strict; use warnings; +use Moose::Util::TypeConstraints qw( find_type_constraint ); + use Piny; my ( $name ) = @ARGV; @@ -12,7 +14,7 @@ if ( not defined $name ) { exit 1; }; -if ( not Piny::Repo::Reponame->check( $name ) ) { +if ( not find_type_constraint( "Reponame" )->check( $name ) ) { print "That is not a valid repo name; must be at least 1 character long, begin with a lowercase alphanumeric character, and contain only alphanumeric characters and dashes.\n"; exit 1; }; @@ -23,7 +25,7 @@ while( 1 ) { print "Provide a one-line description to be used in repo listings, the shorter the better:\n"; chomp( $description = ); - if ( not Piny::Repo::SimpleText->check( $description ) ) { + if ( not find_type_constraint( "SimpleText" )->check( $description ) ) { print "Must be 1-80 characters long; control characters (including tab) not allowed.\n"; next; }; -- cgit v1.2.3