]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysupdate: replace local specifier_table[] by common system_and_tmp_specifier_table[]
authorLennart Poettering <lennart@amutable.com>
Fri, 3 Jul 2026 13:35:48 +0000 (15:35 +0200)
committerLennart Poettering <lennart@amutable.com>
Fri, 3 Jul 2026 14:09:49 +0000 (16:09 +0200)
It's byte-by-byte exactly the same thing, hence drop the local copy.

src/sysupdate/sysupdate-feature.c
src/sysupdate/sysupdate-transfer.c
src/sysupdate/sysupdate.c
src/sysupdate/sysupdate.h

index 0c9bb112fe9b71d402052768dd50b72d713183c2..45a913f7c16a39aa99d7b5c70968ce2a64e00d40 100644 (file)
@@ -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);
index c79743cad6908f94ca3436451b6f13248b2f295c..08396d61b1c0c5520a7dcff08af831a1add2c004 100644 (file)
@@ -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);
index 87c1cc6d4292e4b22d8de54fee4e0c59660e88a8..0a805378cf29aa451f66183f15d2d0be35d913e1 100644 (file)
@@ -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, \
index 02a9f7c8f348cce69adbfb890401df00964f55e4..3dcaae527d1969dfb92bfbda617f7d93c11f8915 100644 (file)
@@ -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[];