Skip to content

Commit

Permalink
Merge pull request #14 from AitorATuin/bugfix/issue13
Browse files Browse the repository at this point in the history
Fix: Allow NewVersion to use recipes including multibyte characters
  • Loading branch information
lucasvr authored Jan 20, 2017
2 parents c363de4 + 0e009ff commit cf71b83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/NewVersion
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ cd "$newrecipedir" || Die "Failed creating new recipe dir."

[ -e "Recipe" ] || Die "Recipe file not found."

grep -v '# Recipe for version' Recipe > Recipe.old
# Use -a to avoid considering the file as binary if there are multibyte characters
grep -av '# Recipe for version' Recipe > Recipe.old

if [ "$compileRecipeAuthor" != "" ]
then
Expand All @@ -130,7 +131,7 @@ then
fi

# if both old and new version are in "x.y.z" format...
if echo "$oldversion;;;$newversion" | grep -q "^[^.]\+\.[^.]\+\.[^.]\+;;;[^.]\+\.[^.]\+\.[^.]\+$"
if echo "$oldversion;;;$newversion" | grep -aq "^[^.]\+\.[^.]\+\.[^.]\+;;;[^.]\+\.[^.]\+\.[^.]\+$"
then
# ...replace all "x.y" occurrences too
oldmajormiddle=`echo "$oldversion" | cut -d. -f 1-2`
Expand Down

0 comments on commit cf71b83

Please sign in to comment.