3
0
Fork 0
forked from mirrors/nixpkgs

go: Drop unnecessary backslash-escape

There's no backslash interpretation going on within single-quote strings
which means there's no need to escape the backslash. Since this was going
on within single-quote strings the $exclude variable ended up having 2
backslashes (`\\`) instead of the intended single backslash. This meant
that the regex that was built up was incorrect. For example prometheus'
exclude contents before and after this change are:

✕: \(/_\|examples\|Godeps\|testdata\\|documentation/prometheus-mixin\)
✓: \(/_\|examples\|Godeps\|testdata\|documentation/prometheus-mixin\)
This commit is contained in:
Manuel Mendez 2022-04-03 22:29:02 -04:00 committed by zowoq
parent bb7e4b378e
commit 60543c4f9e
2 changed files with 2 additions and 2 deletions

View file

@ -176,7 +176,7 @@ let
IFS=' ' read -r -a excludedArr <<<$excludedPackages
printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}"
excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf
exclude+='\\|'"$excludedAlternates"
exclude+='\|'"$excludedAlternates"
fi
exclude+='\)'

View file

@ -155,7 +155,7 @@ let
IFS=' ' read -r -a excludedArr <<<$excludedPackages
printf -v excludedAlternates '%s\\|' "''${excludedArr[@]}"
excludedAlternates=''${excludedAlternates%\\|} # drop final \| added by printf
exclude+='\\|'"$excludedAlternates"
exclude+='\|'"$excludedAlternates"
fi
exclude+='\)'