aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsboupgrade13
1 files changed, 8 insertions, 5 deletions
diff --git a/sboupgrade b/sboupgrade
index 57557e2..dd4fed9 100755
--- a/sboupgrade
+++ b/sboupgrade
@@ -89,15 +89,18 @@ sub grok_readme {
script_error ('grok_readme requires two arguments') unless exists $_[1];
my ($sbo, $readme) = @_;
my $readme_orig = $readme;
- # work around missing period at end of list of requirements (given 2 \ns)
+ # work around missing period at end of list of requirements (given 2 \ns),
+ # or no period at end of whole thing.
+ my $endchar = $1 if $readme =~ /(.)$/;
+ $readme =~ s/.$/$endchar./;
$readme =~ s/\n\n/./g;
$readme =~ s/\n//g;
- my $string = $3 if $readme =~
- /([Tt]his|$sbo|)\s+[Rr]equires(|:)\s+([^\.]+)/;
+ my $string = $4 if $readme =~
+ /([Tt]his|$sbo|)\s+[Rr]equire(s|)(|:)\s+([^\.]+)/;
return unless defined $string;
# remove anything in brackets or parens
- $string =~ s/\[[^\]]+\]//g;
- $string =~ s/\([^\)]+\)//g;
+ $string =~ s/(\s)*\[[^\]]+\](\s)*//g;
+ $string =~ s/(\s)*\([^\)]+\)(\s)*//g;
# converts and to comma
$string =~ s/(\s+|,)and\s+/,/g;
$string =~ s/,\s+/,/g;