diff options
author | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-07-07 16:00:00 -0700 |
---|---|---|
committer | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-07-07 16:00:00 -0700 |
commit | 26297ed05c122a0867a94f96a87b3bf58d1c52ee (patch) | |
tree | 79e3a035ce966de2846d2d1ef3eb8427cd2761b3 /usr/src/pinyadmin/sbin/newrepo | |
parent | d809044c2f00d7f8358dc8013c4e6639760aba67 (diff) | |
download | piny-code-26297ed05c122a0867a94f96a87b3bf58d1c52ee.tar.gz piny-code-26297ed05c122a0867a94f96a87b3bf58d1c52ee.zip |
Fix some type constraint stuff.
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 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 = <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; }; |