mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
udev-rules: fix grammar in diagnostics about lines that have no effect
Fixes: 25de7aa7b9 ("udev: modernize udev-rules.c")
This commit is contained in:
@@ -1232,7 +1232,7 @@ static int rule_add_line(UdevRuleFile *rule_file, const char *line_str, unsigned
|
||||
}
|
||||
|
||||
if (rule_line->type == 0) {
|
||||
log_line_warning(rule_line, "The line takes no effect, ignoring.");
|
||||
log_line_warning(rule_line, "The line has no effect, ignoring.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1264,7 +1264,7 @@ static void rule_resolve_goto(UdevRuleFile *rule_file) {
|
||||
line->goto_label = NULL;
|
||||
|
||||
if ((line->type & ~(LINE_HAS_LABEL|LINE_IS_REFERENCED)) == 0) {
|
||||
log_line_notice(line, "The line takes no effect any more, dropping");
|
||||
log_line_notice(line, "The line has no effect any more, dropping.");
|
||||
/* LINE_IS_REFERENCED implies LINE_HAS_LABEL */
|
||||
if (line->type & LINE_HAS_LABEL)
|
||||
udev_rule_line_clear_tokens(line);
|
||||
@@ -1411,7 +1411,7 @@ static void udev_check_conflicts_duplicates(UdevRuleLine *line) {
|
||||
}
|
||||
if (new_conflicts) {
|
||||
conflicts = new_conflicts;
|
||||
log_line_error(line, "conflicting match expressions, the line takes no effect");
|
||||
log_line_error(line, "conflicting match expressions, the line has no effect");
|
||||
}
|
||||
if (conflicts && duplicates)
|
||||
return;
|
||||
|
||||
@@ -173,7 +173,7 @@ EOF
|
||||
test_syntax_error '=' 'Invalid key/value pair, ignoring.'
|
||||
test_syntax_error 'ACTION{a}=="b"' 'Invalid attribute for ACTION.'
|
||||
test_syntax_error 'ACTION:="b"' 'Invalid operator for ACTION.'
|
||||
test_syntax_error 'ACTION=="b"' 'The line takes no effect, ignoring.'
|
||||
test_syntax_error 'ACTION=="b"' 'The line has no effect, ignoring.'
|
||||
test_syntax_error 'DEVPATH{a}=="b"' 'Invalid attribute for DEVPATH.'
|
||||
test_syntax_error 'DEVPATH:="b"' 'Invalid operator for DEVPATH.'
|
||||
test_syntax_error 'KERNEL{a}=="b"' 'Invalid attribute for KERNEL.'
|
||||
@@ -275,15 +275,15 @@ test_syntax_error 'LABEL{a}="b"' 'Invalid attribute for LABEL.'
|
||||
test_syntax_error 'LABEL=="b"' 'Invalid operator for LABEL.'
|
||||
test_syntax_error 'LABEL="b"' 'LABEL="b" is unused.'
|
||||
test_syntax_error 'a="b"' "Invalid key 'a'"
|
||||
test_syntax_error 'KERNEL=="", KERNEL=="?*", NAME="a"' 'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'KERNEL=="abc", KERNEL!="abc", NAME="b"' 'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'KERNEL=="|a|b", KERNEL!="b|a|", NAME="c"' 'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'KERNEL=="a|b", KERNEL=="c|d|e", NAME="f"' 'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'KERNEL=="", KERNEL=="?*", NAME="a"' 'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'KERNEL=="abc", KERNEL!="abc", NAME="b"' 'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'KERNEL=="|a|b", KERNEL!="b|a|", NAME="c"' 'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'KERNEL=="a|b", KERNEL=="c|d|e", NAME="f"' 'conflicting match expressions, the line has no effect'
|
||||
# shellcheck disable=SC2016
|
||||
test_syntax_error 'ENV{DISKSEQ}=="?*", ENV{DEVTYPE}!="partition", ENV{DISKSEQ}!="?*", ENV{ID_IGNORE_DISKSEQ}!="1", SYMLINK+="disk/by-diskseq/$env{DISKSEQ}"' \
|
||||
'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'ACTION=="a*", ACTION=="bc*", NAME="d"' 'conflicting match expressions, the line takes no effect'
|
||||
test_syntax_error 'ACTION=="a*|bc*", ACTION=="d*|ef*", NAME="g"' 'conflicting match expressions, the line takes no effect'
|
||||
'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'ACTION=="a*", ACTION=="bc*", NAME="d"' 'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'ACTION=="a*|bc*", ACTION=="d*|ef*", NAME="g"' 'conflicting match expressions, the line has no effect'
|
||||
test_syntax_error 'KERNEL!="", KERNEL=="?*", NAME="a"' 'duplicate expressions'
|
||||
test_syntax_error 'KERNEL=="|a|b", KERNEL=="b|a|", NAME="c"' 'duplicate expressions'
|
||||
# shellcheck disable=SC2016
|
||||
@@ -312,7 +312,7 @@ assert_0 "${rules}"
|
||||
echo 'GOTO="a"' >"${rules}"
|
||||
cat >"${exp}" <<EOF
|
||||
${rules}:1 GOTO="a" has no matching label, ignoring
|
||||
${rules}:1 The line takes no effect any more, dropping
|
||||
${rules}:1 The line has no effect any more, dropping.
|
||||
${rules}: udev rules check failed
|
||||
EOF
|
||||
cp "${workdir}/default_output_1_fail" "${exo}"
|
||||
@@ -343,7 +343,7 @@ EOF
|
||||
cat >"${exp}" <<EOF
|
||||
${rules}:2 Contains multiple LABEL keys, ignoring LABEL="a".
|
||||
${rules}:1 GOTO="a" has no matching label, ignoring
|
||||
${rules}:1 The line takes no effect any more, dropping
|
||||
${rules}:1 The line has no effect any more, dropping.
|
||||
${rules}:2 LABEL="b" is unused.
|
||||
${rules}: udev rules check failed
|
||||
EOF
|
||||
@@ -355,7 +355,7 @@ KERNEL!="", KERNEL=="?*", KERNEL=="", NAME="a"
|
||||
EOF
|
||||
cat >"${exp}" <<EOF
|
||||
${rules}:1 duplicate expressions
|
||||
${rules}:1 conflicting match expressions, the line takes no effect
|
||||
${rules}:1 conflicting match expressions, the line has no effect
|
||||
${rules}: udev rules check failed
|
||||
EOF
|
||||
cp "${workdir}/default_output_1_fail" "${exo}"
|
||||
|
||||
Reference in New Issue
Block a user