chiark / gitweb /
rules: fix md "change"/"remove" handling
[elogind.git] / extras / rule_generator / rule_generator.functions
index 495bb7b..b972091 100644 (file)
@@ -92,6 +92,9 @@ find_all_rules() {
        local linkre="$2"
        local match="$3"
 
        local linkre="$2"
        local match="$3"
 
-       local search='.*[[:space:],]'"$key"'"\('"$linkre"'\)"[[:space:]]*\(,.*\|\\\|\)$'
-       echo $(sed -n -e "${match}s/${search}/\1/p" $RO_RULES_FILE $RULES_FILE 2>/dev/null)
+       local search='.*[[:space:],]'"$key"'"('"$linkre"')".*'
+       echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \
+               $RO_RULES_FILE \
+               $([ -e $RULES_FILE ] && echo $RULES_FILE) \
+               2>/dev/null)
 }
 }