sysupdate: replace local specifier_table[] by common system_and_tmp_specifier_table[]
It's byte-by-byte exactly the same thing, hence drop the local copy.
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
#include "conf-parser.h"
|
||||
#include "hash-funcs.h"
|
||||
#include "path-util.h"
|
||||
#include "specifier.h"
|
||||
#include "string-util.h"
|
||||
#include "sysupdate.h"
|
||||
#include "sysupdate-feature.h"
|
||||
#include "web-util.h"
|
||||
|
||||
@@ -65,7 +65,7 @@ static int config_parse_url_specifiers(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = specifier_printf(rvalue, NAME_MAX, specifier_table, root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in %s=, ignoring: %s", lvalue, rvalue);
|
||||
|
||||
@@ -127,7 +127,7 @@ static int config_parse_protect_version(
|
||||
|
||||
assert(rvalue);
|
||||
|
||||
r = specifier_printf(rvalue, NAME_MAX, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in ProtectVersion=, ignoring: %s", rvalue);
|
||||
@@ -166,7 +166,7 @@ static int config_parse_min_version(
|
||||
|
||||
assert(rvalue);
|
||||
|
||||
r = specifier_printf(rvalue, NAME_MAX, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in MinVersion=, ignoring: %s", rvalue);
|
||||
@@ -205,7 +205,7 @@ static int config_parse_url_specifiers(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = specifier_printf(rvalue, NAME_MAX, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in %s=, ignoring: %s", lvalue, rvalue);
|
||||
@@ -244,7 +244,7 @@ static int config_parse_current_symlink(
|
||||
|
||||
assert(rvalue);
|
||||
|
||||
r = specifier_printf(rvalue, NAME_MAX, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in CurrentSymlink=, ignoring: %s", rvalue);
|
||||
@@ -333,7 +333,7 @@ static int config_parse_resource_pattern(
|
||||
if (r == 0)
|
||||
break;
|
||||
|
||||
r = specifier_printf(word, NAME_MAX, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(word, NAME_MAX, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in MatchPattern=, ignoring: %s", rvalue);
|
||||
@@ -377,7 +377,7 @@ static int config_parse_resource_path(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = specifier_printf(rvalue, PATH_MAX-1, specifier_table, t->context->root, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, PATH_MAX-1, system_and_tmp_specifier_table, t->context->root, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in Path=, ignoring: %s", rvalue);
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "pretty-print.h"
|
||||
#include "runtime-scope.h"
|
||||
#include "sort-util.h"
|
||||
#include "specifier.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "sysupdate.h"
|
||||
@@ -74,12 +73,6 @@ STATIC_DESTRUCTOR_REGISTER(arg_component, freep);
|
||||
STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep);
|
||||
STATIC_DESTRUCTOR_REGISTER(arg_transfer_source, freep);
|
||||
|
||||
const Specifier specifier_table[] = {
|
||||
COMMON_SYSTEM_SPECIFIERS,
|
||||
COMMON_TMP_SPECIFIERS,
|
||||
{}
|
||||
};
|
||||
|
||||
#define CONTEXT_NULL \
|
||||
(Context) { \
|
||||
.sync = true, \
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
#pragma once
|
||||
|
||||
#include "specifier.h"
|
||||
#include "sysupdate-forward.h"
|
||||
#include "sysupdate-target.h"
|
||||
|
||||
@@ -46,5 +45,3 @@ typedef struct Context {
|
||||
} Context;
|
||||
|
||||
void context_done(Context *c);
|
||||
|
||||
extern const Specifier specifier_table[];
|
||||
|
||||
Reference in New Issue
Block a user