update-source-version: Don't require whitespace around equals sign

This commit is contained in:
Tuomas Tynkkynen 2017-06-09 00:35:17 +03:00
parent ce421a7283
commit 022b0c9abc

View File

@ -42,9 +42,9 @@ fi
# Escape regex metacharacter that are allowed in store path names
oldVersion=$(echo "$oldVersion" | sed -re 's|[.+]|\\&|g')
if [ $(grep -c -E "^\s*(let\b)?\s*version\s+=\s+\"$oldVersion\"" "$nixFile") = 1 ]; then
if [ $(grep -c -E "^\s*(let\b)?\s*version\s*=\s*\"$oldVersion\"" "$nixFile") = 1 ]; then
pattern="/\bversion\b\s*=/ s|\"$oldVersion\"|\"$newVersion\"|"
elif [ $(grep -c -E "^\s*(let\b)?\s*name\s+=\s+\"[^-]+-$oldVersion\"" "$nixFile") = 1 ]; then
elif [ $(grep -c -E "^\s*(let\b)?\s*name\s*=\s*\"[^-]+-$oldVersion\"" "$nixFile") = 1 ]; then
pattern="/\bname\b\s*=/ s|-$oldVersion\"|-$newVersion\"|"
else
die "Couldn't figure out where out where to patch in new version in '$attr'!"