diff options
Diffstat (limited to 'usr/src/pinyadmin/sbin/newrepo')
-rwxr-xr-x | usr/src/pinyadmin/sbin/newrepo | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/pinyadmin/sbin/newrepo b/usr/src/pinyadmin/sbin/newrepo index d5ca30c..a178ecb 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 = <STDIN> ); - 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; }; |