sbotools2

Maintenance fork of the original sbotools version 2
Log | Files | Refs | README

commit 153f351ce8561ce750c3fa43073259d87d420f59
parent 65eb542a3dcd027289c41afa25a4cea3f40eff10
Author: Jacob Pipkin <d4wnr4z0r@yahoo.com>
Date:   Wed, 30 May 2012 11:11:44 -0500

for req parsing, work around case where last thing in README is list of requirements with no period at end

Diffstat:
Msboupgrade | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git 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;