diff options
author | Jacob Pipkin <d4wnr4z0r@yahoo.com> | 2012-05-30 11:11:44 -0500 |
---|---|---|
committer | Jacob Pipkin <d4wnr4z0r@yahoo.com> | 2012-05-30 11:11:44 -0500 |
commit | 153f351ce8561ce750c3fa43073259d87d420f59 (patch) | |
tree | 41c32ed0799bdd02b4eba8d4704524dc85628eb7 | |
parent | 65eb542a3dcd027289c41afa25a4cea3f40eff10 (diff) | |
download | sbotools2-153f351ce8561ce750c3fa43073259d87d420f59.tar.xz |
for req parsing, work around case where last thing in README is list of requirements with no period at end
-rwxr-xr-x | sboupgrade | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; |