diff options
author | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-17 14:49:26 -0400 |
---|---|---|
committer | Andrew Robbins <contact@andrewrobbins.info> | 2017-07-17 14:49:26 -0400 |
commit | 47ee86bd9b625367f2246540f4c56e1b60b621d1 (patch) | |
tree | 909bba403e29bd1f5b8bd3deaf9bbfa0a1495b3f /libs | |
parent | a84218d9d2d8181cc8fe31ae855590683a6617e4 (diff) | |
download | librebootfr-47ee86bd9b625367f2246540f4c56e1b60b621d1.tar.gz librebootfr-47ee86bd9b625367f2246540f4c56e1b60b621d1.zip |
Properly escape and quote regular expressions
Diffstat (limited to 'libs')
-rwxr-xr-x | libs/project | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libs/project b/libs/project index 0f30ace3..0e5e8690 100755 --- a/libs/project +++ b/libs/project @@ -23,7 +23,7 @@ PROJECT_ACTIONS_FUNCTIONS=( "${PROJECT_ACTIONS_HELPERS[@]}" ) -INSTALL_REGEX="\([^:]*\):\(.*\)" +INSTALL_REGEX='\([^:]*\):\(.*\)' project_include() { local project=$1 @@ -776,7 +776,7 @@ project_build_check() { while read rule do - source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\1/g" ) + source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\1/g" ) source_path="$build_path/$source" # Source may contain a wildcard. @@ -858,10 +858,10 @@ project_install() { while read rule do - source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\1/g" ) + source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\1/g" ) source_path="$build_path/$source" - destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\2/g" ) + destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\2/g" ) destination_path="$install_path/$destination" destination_directory_path=$( dirname "$destination_path" ) @@ -899,10 +899,10 @@ project_install() { while read rule do - source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\1/g" ) + source=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\1/g" ) source_path="$project_path/$INSTALL/$path/$source" - destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\2/g" ) + destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\2/g" ) destination_path="$install_path/$destination" destination_directory_path=$( dirname "$destination_path" ) @@ -952,7 +952,7 @@ project_install_check() { while read rule do - destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\2/g" ) + destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\2/g" ) destination_path="$install_path/$destination" if ! [ -f "$destination_path" ] && ! [ -d "$destination_path" ] @@ -986,7 +986,7 @@ project_install_check() { while read rule do - destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\2/g" ) + destination=$( printf '%s\n' "$rule" | sed "s/$INSTALL_REGEX/\\2/g" ) destination_path="$install_path/$destination" if ! [ -f "$destination_path" ] && ! [ -d "$destination_path" ] |