mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
Move os-util.[ch] to basic/
parse_os_release() will be used basic/hostname-util.c later on.
This commit is contained in:
parent
fd03a6a92b
commit
6ef06723b1
@ -170,6 +170,8 @@ basic_sources = files('''
|
||||
nulstr-util.h
|
||||
ordered-set.c
|
||||
ordered-set.h
|
||||
os-util.c
|
||||
os-util.h
|
||||
parse-util.c
|
||||
parse-util.h
|
||||
path-lookup.c
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "env-file.h"
|
||||
#include "env-util.h"
|
||||
#include "fd-util.h"
|
||||
@ -9,8 +8,27 @@
|
||||
#include "fs-util.h"
|
||||
#include "macro.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "string-util.h"
|
||||
#include "strv.h"
|
||||
#include "utf8.h"
|
||||
|
||||
bool image_name_is_valid(const char *s) {
|
||||
if (!filename_is_valid(s))
|
||||
return false;
|
||||
|
||||
if (string_has_cc(s, NULL))
|
||||
return false;
|
||||
|
||||
if (!utf8_is_valid(s))
|
||||
return false;
|
||||
|
||||
/* Temporary files for atomically creating new files */
|
||||
if (startswith(s, ".#"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int path_is_extension_tree(const char *path, const char *extension) {
|
||||
int r;
|
@ -6,6 +6,8 @@
|
||||
/* The *_extension_release flavours will look for /usr/lib/extension-release/extension-release.NAME
|
||||
* in accordance with the OS extension specification, rather than for /usr/lib/ or /etc/os-release. */
|
||||
|
||||
bool image_name_is_valid(const char *s) _pure_;
|
||||
|
||||
int path_is_extension_tree(const char *path, const char *extension);
|
||||
static inline int path_is_os_tree(const char *path) {
|
||||
return path_is_extension_tree(path, NULL);
|
@ -18,6 +18,7 @@
|
||||
#include "loop-util.h"
|
||||
#include "missing_capability.h"
|
||||
#include "mount-util.h"
|
||||
#include "os-util.h"
|
||||
#include "process-util.h"
|
||||
#include "raw-clone.h"
|
||||
#include "strv.h"
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "machine-pool.h"
|
||||
#include "machined.h"
|
||||
#include "missing_capability.h"
|
||||
#include "os-util.h"
|
||||
#include "path-util.h"
|
||||
#include "process-util.h"
|
||||
#include "stdio-util.h"
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "bus-wait-for-jobs.h"
|
||||
#include "def.h"
|
||||
#include "dirent-util.h"
|
||||
#include "discover-image.h"
|
||||
#include "env-file.h"
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "fs-util.h"
|
||||
#include "locale-util.h"
|
||||
#include "main-func.h"
|
||||
#include "os-util.h"
|
||||
#include "pager.h"
|
||||
#include "parse-util.h"
|
||||
#include "path-util.h"
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "fileio.h"
|
||||
#include "io-util.h"
|
||||
#include "missing_capability.h"
|
||||
#include "os-util.h"
|
||||
#include "portable.h"
|
||||
#include "portabled-bus.h"
|
||||
#include "portabled-image-bus.h"
|
||||
|
@ -1250,23 +1250,6 @@ int image_name_lock(const char *name, int operation, LockFile *ret) {
|
||||
return make_lock_file(p, operation, ret);
|
||||
}
|
||||
|
||||
bool image_name_is_valid(const char *s) {
|
||||
if (!filename_is_valid(s))
|
||||
return false;
|
||||
|
||||
if (string_has_cc(s, NULL))
|
||||
return false;
|
||||
|
||||
if (!utf8_is_valid(s))
|
||||
return false;
|
||||
|
||||
/* Temporary files for atomically creating new files */
|
||||
if (startswith(s, ".#"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool image_in_search_path(
|
||||
ImageClass class,
|
||||
const char *root,
|
||||
|
@ -76,8 +76,6 @@ int image_read_only(Image *i, bool b);
|
||||
const char* image_type_to_string(ImageType t) _const_;
|
||||
ImageType image_type_from_string(const char *s) _pure_;
|
||||
|
||||
bool image_name_is_valid(const char *s) _pure_;
|
||||
|
||||
int image_path_lock(const char *path, int operation, LockFile *global, LockFile *local);
|
||||
int image_name_lock(const char *name, int operation, LockFile *ret);
|
||||
|
||||
|
@ -198,8 +198,6 @@ shared_sources = files('''
|
||||
numa-util.h
|
||||
openssl-util.c
|
||||
openssl-util.h
|
||||
os-util.c
|
||||
os-util.h
|
||||
output-mode.c
|
||||
output-mode.h
|
||||
pager.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user