From e3b0c0350793349afc1602431da2895eb0041a82 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Nov 2017 03:33:06 +0200 Subject: [PATCH] update-source-version: Escape plus sign if it occurs in version --- pkgs/common-updater/scripts/update-source-version | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index 13f8adf56771..c5f7db281625 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -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\"|"