summaryrefslogtreecommitdiffstats
path: root/src/sysupdate
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-03-02 11:09:42 +0100
committerLennart Poettering <lennart@poettering.net>2023-06-20 19:02:31 +0200
commitf5c6b4f4d9a45a67fb7ab047f3946649540a501e (patch)
tree1080cef61ca5403a1fc5d735053cd762f794eb05 /src/sysupdate
parentpath-util: split filename_is_valid() in two (diff)
downloadsystemd-f5c6b4f4d9a45a67fb7ab047f3946649540a501e.tar.xz
systemd-f5c6b4f4d9a45a67fb7ab047f3946649540a501e.zip
string-util: move version_is_valid() into generic code
While we are at it, replace the sloppy use of filename_is_valid() by the less sloppy filename_part_is_valid() (as added by the preceeding commit), since we don#t want to be too restrictive here. (After all, version strings invalid as standalone filenames might be valid as part of filenames, and hence we should allow them).
Diffstat (limited to 'src/sysupdate')
-rw-r--r--src/sysupdate/meson.build2
-rw-r--r--src/sysupdate/sysupdate-pattern.c1
-rw-r--r--src/sysupdate/sysupdate-transfer.c1
-rw-r--r--src/sysupdate/sysupdate-util.c13
-rw-r--r--src/sysupdate/sysupdate-util.h6
5 files changed, 0 insertions, 23 deletions
diff --git a/src/sysupdate/meson.build b/src/sysupdate/meson.build
index 2f8c2305da..1bd6bbf9a9 100644
--- a/src/sysupdate/meson.build
+++ b/src/sysupdate/meson.build
@@ -15,8 +15,6 @@ systemd_sysupdate_sources = files(
'sysupdate-transfer.h',
'sysupdate-update-set.c',
'sysupdate-update-set.h',
- 'sysupdate-util.c',
- 'sysupdate-util.h',
'sysupdate.c',
'sysupdate.h',
)
diff --git a/src/sysupdate/sysupdate-pattern.c b/src/sysupdate/sysupdate-pattern.c
index 6d9c8d8f8b..c9e2067c58 100644
--- a/src/sysupdate/sysupdate-pattern.c
+++ b/src/sysupdate/sysupdate-pattern.c
@@ -8,7 +8,6 @@
#include "stdio-util.h"
#include "string-util.h"
#include "sysupdate-pattern.h"
-#include "sysupdate-util.h"
typedef enum PatternElementType {
PATTERN_LITERAL,
diff --git a/src/sysupdate/sysupdate-transfer.c b/src/sysupdate/sysupdate-transfer.c
index bbc3a5bcaa..dd2b1e45eb 100644
--- a/src/sysupdate/sysupdate-transfer.c
+++ b/src/sysupdate/sysupdate-transfer.c
@@ -24,7 +24,6 @@
#include "sysupdate-pattern.h"
#include "sysupdate-resource.h"
#include "sysupdate-transfer.h"
-#include "sysupdate-util.h"
#include "sysupdate.h"
#include "tmpfile-util.h"
#include "web-util.h"
diff --git a/src/sysupdate/sysupdate-util.c b/src/sysupdate/sysupdate-util.c
index c7a23015ce..eacc592f62 100644
--- a/src/sysupdate/sysupdate-util.c
+++ b/src/sysupdate/sysupdate-util.c
@@ -2,16 +2,3 @@
#include "path-util.h"
#include "sysupdate-util.h"
-
-bool version_is_valid(const char *s) {
- if (isempty(s))
- return false;
-
- if (!filename_is_valid(s))
- return false;
-
- if (!in_charset(s, ALPHANUMERICAL ".,_-+"))
- return false;
-
- return true;
-}
diff --git a/src/sysupdate/sysupdate-util.h b/src/sysupdate/sysupdate-util.h
deleted file mode 100644
index afa3a9d498..0000000000
--- a/src/sysupdate/sysupdate-util.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#pragma once
-
-#include <stdbool.h>
-
-bool version_is_valid(const char *s);