mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-15 10:47:58 +00:00
update-source-version: Escape plus sign if it occurs in version
This commit is contained in:
parent
d6cc334d6b
commit
e3b0c03507
@ -39,8 +39,8 @@ if [ "$oldVersion" = "$newVersion" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Escape dots, there should not be any other regex characters allowed in store path names
|
||||
oldVersion=$(echo "$oldVersion" | sed -re 's|\.|\\.|g')
|
||||
# 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
|
||||
pattern="/\bversion\b\s*=/ s|\"$oldVersion\"|\"$newVersion\"|"
|
||||
|
Loading…
Reference in New Issue
Block a user