summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2010-03-16 22:05:15 -0500
committerVictor Lowther <victor.lowther@gmail.com>2010-03-16 22:05:15 -0500
commitc3d7dfac7b8dba7c205170ce55428a35eb4d4ce7 (patch)
tree9546a983988b756ffc9cc52d85ef1432b04b7ad3
parent2ec6109275a7ff6b3aa859c9981299e85ff68173 (diff)
parent0ed2f3950e4797c592d89dcbe9d2bc194e560a2c (diff)
Merge branch 'master' into pm-utils-1.3pm-utils-1.3.0
Conflicts: src/import-fdi-quirkdb.in
-rw-r--r--src/import-fdi-quirkdb.in23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/import-fdi-quirkdb.in b/src/import-fdi-quirkdb.in
index 263c3be..ff11ffe 100644
--- a/src/import-fdi-quirkdb.in
+++ b/src/import-fdi-quirkdb.in
@@ -21,10 +21,10 @@
. "@PM-UTILS-LIBDIR@/pm-functions"
shopt -s extglob
-begin_match='<match key="([a-z._]+)" ([a-z_]+)="([^"]+)">'
+begin_match='<match key *= *"([a-z._]+)" ([a-z_]+) *= *"([^"]+)">'
end_match='</match>'
-merge='<merge key="([^"]+)" type="bool">true</merge>'
-remove='<remove key="([^"]+)"></remove>'
+merge='<merge key *= *"([^"]+)" type *= *"bool">true</merge>'
+remove='<remove key *= *"([^"]+)"></remove>'
begin_comment='<!--'
end_comment='-->'
in_comment=0
@@ -54,10 +54,10 @@ escape_match() {
lit="${lit//\\/\\\\}"
lit="${lit//./\\.}"
lit="${lit//^/\\^}"
- lit="${lit//[/\\\[}"
- lit="${lit//]/\\\]}"
- lit="${lit//(/\\\(}"
- lit="${lit//)/\\\)}"
+ lit="${lit//[/\\[}"
+ lit="${lit//]/\\]}"
+ lit="${lit//\(/\\(}"
+ lit="${lit//)/\\)}"
lit="${lit//\*/\\\*}"
lit="${lit//\+/\\\+}"
lit="${lit//\?/\\\?}"
@@ -65,20 +65,17 @@ escape_match() {
lit="${lit//\}/\\\}}"
lit="${lit//\|/\\\|}"
lit="${lit//\$/\\\$}"
- # nuke leading and trailing spaces, they just confuse things.
- lit="${lit%%+( )}"
- lit="${lit##+( )}"
# second, handle the various comparison cases, munging them into
# extended regular expressions that bash understands.
case $1 in
string) lit="^${lit}\$" ;;
int|uint64) fun=numeric_compare_eq ;;
- string_outof) lit="${lit%;}"; lit="^(${lit/(*( );*( )/|})\$" ;;
+ string_outof) lit="${lit%;}"; lit="^(${lit//;/|})\$" ;;
int_outof) fun=numeric_compare_eq_list ;;
contains) ;;
- contains_outof) lit="${lit%;}"; lit="${lit//*( );*( )/|}" ;;
+ contains_outof) lit="${lit%;}"; lit="${lit//;/|}" ;;
prefix) lit="^${lit}" ;;
- prefix_outof) lit="${lit%;}"; lit="^(${lit//*( );*( )/|})" ;;
+ prefix_outof) lit="${lit%;}"; lit="^(${lit//;/|})" ;;
suffix) lit="${lit}\$" ;;
contains_ncase) fun=regex_ncase ;;
contains_not) fun=regex_inverse ;;