summaryrefslogtreecommitdiff
path: root/bin/meta-normalize-stdio
diff options
context:
space:
mode:
Diffstat (limited to 'bin/meta-normalize-stdio')
-rwxr-xr-xbin/meta-normalize-stdio9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/meta-normalize-stdio b/bin/meta-normalize-stdio
index 69d9ad6..d703741 100755
--- a/bin/meta-normalize-stdio
+++ b/bin/meta-normalize-stdio
@@ -124,7 +124,8 @@ year = lambda {|name, num|
}
# This regex is taken from http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
-_email_regex = /^[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
+email = restring(/^[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/)
+
email_list = lambda {|name, ary|
if !ary.is_a?(Array)
error "`#{name}' must be a list"
@@ -133,7 +134,7 @@ email_list = lambda {|name, ary|
if ary.first.end_with?("@parabola.nu") and ary.count >= 2
preserve = 2
end
- ary = semiordered_list(preserve, restring(_email_regex)).call(name, ary)
+ ary = semiordered_list(preserve, email).call(name, ary)
end
ary
}
@@ -158,12 +159,12 @@ shell = lambda {|name, sh|
format = unordered_map1(
{
"username" => restring(/^[a-z][a-z0-9-]*$/),
- "fullname" => string,
+ "fullname" => restring(/./), # non-empty
"email" => email_list,
"groups" => semiordered_list(1, string),
"pgp_keyid" => restring(/^[0-9A-F]{40}$/),
"pgp_revoked_keyids" => unordered_list(restring(/^[0-9A-F]{40}$/)),
- "ssh_keys" => unordered_map2(string, string),
+ "ssh_keys" => unordered_map2(email, string),
"shell" => shell,
"extra" => unordered_map1(
{