Subject: | Regex issue in modern perl and increase limit on modern package names. |
I just used Software-Packager-Solaris to build some packages and the
regex that checks file names was broken. Also, modern Solaris as a 32
character limit not 9.
Here's the patch to fix both:
diff -u
/.cpan/build/Software-Packager-Solaris-0.1/lib/Software/Packager/Solaris.pm
Solaris.pm
---
/.cpan/build/Software-Packager-Solaris-0.1/lib/Software/Packager/Solaris.pmThu
Oct 26 14:08:23 2006
+++ Solaris.pm Fri Sep 11 21:30:26 2009
@@ -153,15 +153,15 @@
warn "Warning: Package name \"$name\" does not
start with a letter. Removing non letters from the start.\n";
$name =~ s/^(.*?)(?=[a-zA-Z])(.*)/$2/;
}
- if ($name !~ /[a-zA-Z0-9+-]!/)
+ if ($name !~ /^[a-zA-Z0-9\+-]+$/)
{
warn "Warning: Package name \"$name\" contains
charaters other that alphanumeric, + and -. Removing them.\n";
$name =~ tr/a-zA-Z0-9+-//cd;
}
- if (length $name > 9)
+ if (length $name > 32)
{
- warn "Warning: Package name \"$name\" is longer
than 9 charaters. Truncating to 9 charaters.\n";
- $name = sprintf("%.9s", $name);
+ warn "Warning: Package name \"$name\" is longer
than 32 charaters. Truncating to 32 charaters.\n";
+ $name = sprintf("%.32s", $name);
}
if ($name =~ /^install$|^new$|^all$/)
{
--
Save our economy, demand finishing metric conversion from your federal
and state representatives.