From: Yu Watanabe Date: Thu, 1 Jun 2023 01:06:59 +0000 (+0900) Subject: udev-rules: terminate log messages with period X-Git-Tag: v254-rc1~284^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4134614fc0c0dd172b8aa626c7f5c75489ca9554;p=thirdparty%2Fsystemd.git udev-rules: terminate log messages with period --- diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index e5a25bd1191..646d4829c11 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -304,7 +304,7 @@ static void log_unknown_owner(sd_device *dev, UdevRuleLine *line, int error, con if (IN_SET(abs(error), ENOENT, ESRCH)) log_udev_rule_internal(dev, line->rule_file, line->line_number, LOG_ERR, error, - "Unknown %s '%s', ignoring", entity, name); + "Unknown %s '%s', ignoring.", entity, name); else log_udev_rule_internal(dev, line->rule_file, line->line_number, LOG_ERR, error, "Failed to resolve %s '%s', ignoring: %m", entity, name); @@ -844,7 +844,7 @@ static int parse_token(UdevRuleLine *rule_line, const char *key, char *attr, Ude cmd = udev_builtin_lookup(value); if (cmd >= 0) { - log_line_debug(rule_line, "Found builtin command '%s' for %s, replacing attribute", value, key); + log_line_debug(rule_line, "Found builtin command '%s' for %s, replacing attribute.", value, key); r = rule_line_add_token(rule_line, TK_M_IMPORT_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd)); } else r = rule_line_add_token(rule_line, TK_M_IMPORT_PROGRAM, op, value, NULL); @@ -940,7 +940,7 @@ static int parse_token(UdevRuleLine *rule_line, const char *key, char *attr, Ude check_value_format_and_warn(rule_line, key, value, true); r = rule_line_add_token(rule_line, TK_A_OWNER, op, value, NULL); } else { - log_line_debug(rule_line, "User name resolution is disabled, ignoring %s=%s", key, value); + log_line_debug(rule_line, "User name resolution is disabled, ignoring %s=\"%s\".", key, value); return 0; } } else if (streq(key, "GROUP")) { @@ -968,7 +968,7 @@ static int parse_token(UdevRuleLine *rule_line, const char *key, char *attr, Ude check_value_format_and_warn(rule_line, key, value, true); r = rule_line_add_token(rule_line, TK_A_GROUP, op, value, NULL); } else { - log_line_debug(rule_line, "Resolving group name is disabled, ignoring GROUP=\"%s\"", value); + log_line_debug(rule_line, "Resolving group name is disabled, ignoring GROUP=\"%s\".", value); return 0; } } else if (streq(key, "MODE")) { @@ -1013,7 +1013,7 @@ static int parse_token(UdevRuleLine *rule_line, const char *key, char *attr, Ude cmd = udev_builtin_lookup(value); if (cmd < 0) return log_line_error_errno(rule_line, SYNTHETIC_ERRNO(EINVAL), - "Unknown builtin command '%s', ignoring", value); + "Unknown builtin command '%s', ignoring.", value); r = rule_line_add_token(rule_line, TK_A_RUN_BUILTIN, op, value, UDEV_BUILTIN_CMD_TO_PTR(cmd)); } else return log_line_invalid_attr(rule_line, key); @@ -1043,7 +1043,7 @@ static int parse_token(UdevRuleLine *rule_line, const char *key, char *attr, Ude SET_FLAG(rule_line->type, LINE_HAS_LABEL, true); return 1; } else - return log_line_error_errno(rule_line, SYNTHETIC_ERRNO(EINVAL), "Invalid key '%s'", key); + return log_line_error_errno(rule_line, SYNTHETIC_ERRNO(EINVAL), "Invalid key '%s'.", key); if (r < 0) return log_oom(); @@ -1274,7 +1274,7 @@ static void rule_resolve_goto(UdevRuleFile *rule_file) { } if (!line->goto_line) { - log_line_error(line, "GOTO=\"%s\" has no matching label, ignoring", + log_line_error(line, "GOTO=\"%s\" has no matching label, ignoring.", line->goto_label); SET_FLAG(line->type, LINE_HAS_GOTO, false); @@ -1424,11 +1424,11 @@ static void udev_check_conflicts_duplicates(UdevRuleLine *line) { if (new_duplicates) { duplicates = new_duplicates; - log_line_warning(line, "duplicate expressions"); + log_line_warning(line, "duplicate expressions."); } if (new_conflicts) { conflicts = new_conflicts; - log_line_error(line, "conflicting match expressions, the line has no effect"); + log_line_error(line, "conflicting match expressions, the line has no effect."); } if (conflicts && duplicates) return; @@ -1544,7 +1544,7 @@ int udev_rules_parse_file(UdevRules *rules, const char *filename, bool extra_che } if (ignore_line) - log_file_error(rule_file, line_nr, "Line is too long, ignored"); + log_file_error(rule_file, line_nr, "Line is too long, ignored."); else if (len > 0) (void) rule_add_line(rule_file, line, line_nr, extra_checks); @@ -1554,7 +1554,7 @@ int udev_rules_parse_file(UdevRules *rules, const char *filename, bool extra_che if (continuation) log_file_error(rule_file, line_nr, - "Unexpected EOF after line continuation, line ignored"); + "Unexpected EOF after line continuation, line ignored."); rule_resolve_goto(rule_file); diff --git a/src/udev/udevadm-verify.c b/src/udev/udevadm-verify.c index 58d35fef133..cf9ad67b048 100644 --- a/src/udev/udevadm-verify.c +++ b/src/udev/udevadm-verify.c @@ -122,7 +122,7 @@ static int verify_rules_file(UdevRules *rules, const char *fname) { unsigned mask = (1U << LOG_ERR) | (1U << LOG_WARNING); if (issues & mask) return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "%s: udev rules check failed", fname); + "%s: udev rules check failed.", fname); return 0; } @@ -215,7 +215,7 @@ int verify_main(int argc, char *argv[], void *userdata) { return log_error_errno(r, "Failed to enumerate rules files: %m"); if (arg_root && strv_isempty(files)) return log_error_errno(SYNTHETIC_ERRNO(ENOENT), - "No rules files found in %s", arg_root); + "No rules files found in %s.", arg_root); return verify_rules(rules, files); } diff --git a/test/units/testsuite-17.11.sh b/test/units/testsuite-17.11.sh index 56e9ac24ac9..765a30df298 100755 --- a/test/units/testsuite-17.11.sh +++ b/test/units/testsuite-17.11.sh @@ -168,16 +168,16 @@ assert_0 "${rules}" printf 'RUN+="/bin/true"%8176s\\\n #\n' ' ' ' ' >"${rules}" echo >>"${rules}" cat >"${exp}" <"${rules}" cat >"${exp}" <"${rules}" cat >"${exp}" <"${rules}" cat >"${exp}" <"${exp}" <"${exp}" <"${rules}" <<'EOF' KERNEL!="", KERNEL=="?*", KERNEL=="", NAME="a" EOF cat >"${exp}" <"${exp}" <"${exp}" <