]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portable: Clean up includes 37467/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 21:35:14 +0000 (23:35 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 22:02:00 +0000 (00:02 +0200)
Split out of #37344.

14 files changed:
src/portable/portable.c
src/portable/portable.h
src/portable/portablectl.c
src/portable/portabled-bus.c
src/portable/portabled-bus.h
src/portable/portabled-forward.h [new file with mode: 0644]
src/portable/portabled-image-bus.c
src/portable/portabled-image-bus.h
src/portable/portabled-image.c
src/portable/portabled-image.h
src/portable/portabled-operation.c
src/portable/portabled-operation.h
src/portable/portabled.c
src/portable/portabled.h

index 763f283bb4a56a093b658cefb4f5f14ffc1eb174..75e32abcce272889b807e525af0d7a9d28ea36e0 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <linux/loop.h>
 
+#include "sd-bus.h"
 #include "sd-messages.h"
 
 #include "bus-common-errors.h"
@@ -9,7 +10,6 @@
 #include "bus-locator.h"
 #include "chase.h"
 #include "conf-files.h"
-#include "constants.h"
 #include "copy.h"
 #include "data-fd-util.h"
 #include "dirent-util.h"
 #include "dissect-image.h"
 #include "env-file.h"
 #include "env-util.h"
-#include "errno-list.h"
+#include "errno-util.h"
 #include "escape.h"
 #include "extension-util.h"
+#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "fs-util.h"
+#include "glyph-util.h"
 #include "install.h"
 #include "iovec-util.h"
-#include "locale-util.h"
 #include "log-context.h"
+#include "log.h"
 #include "loop-util.h"
 #include "mkdir.h"
-#include "nulstr-util.h"
 #include "os-util.h"
 #include "path-lookup.h"
 #include "portable.h"
@@ -44,7 +45,7 @@
 #include "string-table.h"
 #include "strv.h"
 #include "tmpfile-util.h"
-#include "user-util.h"
+#include "unit-name.h"
 #include "vpick.h"
 
 /* Markers used in the first line of our 20-portable.conf unit file drop-in to determine, that a) the unit file was
index 03977159f0835164dc25d168b88a7b99b982abb9..c0ce30f72dd6e42b3dff11ddeebaf2bdbd037344 100644 (file)
@@ -1,13 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
-
 #include "dissect-image.h"
-#include "hashmap.h"
-#include "macro.h"
+#include "forward.h"
 #include "runtime-scope.h"
-#include "set.h"
 #include "string-util.h"
 
 typedef struct PortableMetadata {
index 6624f36299c2af4e44d61ed5ad95cdf56f999b5c..ab49cf6edf7e751dcbbbfc10044b0623c7ece5ce 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <getopt.h>
 
 #include "sd-bus.h"
 #include "bus-unit-util.h"
 #include "bus-wait-for-jobs.h"
 #include "chase.h"
-#include "constants.h"
-#include "dirent-util.h"
 #include "env-file.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "format-table.h"
 #include "fs-util.h"
-#include "locale-util.h"
+#include "install.h"
 #include "main-func.h"
 #include "os-util.h"
 #include "pager.h"
-#include "parse-argument.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "polkit-agent.h"
@@ -31,7 +27,6 @@
 #include "pretty-print.h"
 #include "string-util.h"
 #include "strv.h"
-#include "terminal-util.h"
 #include "verbs.h"
 
 static PagerFlags arg_pager_flags = 0;
index f313ce37ca93ef8cc3803e766e2be393d5817a59..e347db5c0db4763f0ef7c604fee9681b58dd806e 100644 (file)
@@ -1,20 +1,23 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
 #include "btrfs-util.h"
-#include "bus-common-errors.h"
+#include "bus-error.h"
 #include "bus-object.h"
 #include "bus-polkit.h"
 #include "discover-image.h"
 #include "fd-util.h"
+#include "hashmap.h"
 #include "io-util.h"
+#include "log.h"
 #include "portable.h"
 #include "portabled.h"
 #include "portabled-bus.h"
 #include "portabled-image.h"
 #include "portabled-image-bus.h"
 #include "strv.h"
-#include "user-util.h"
 
 static int property_get_pool_path(
                 sd_bus *bus,
index c216c3aa75972ee2f4085679bc2068130fa416da..b95ce5c647449b9e88c12aefa57b054dd97bf4db 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
+#include "sd-bus-vtable.h"
 
-typedef struct PortableChange PortableChange;
+#include "portabled-forward.h"
 
 extern const sd_bus_vtable manager_vtable[];
 
diff --git a/src/portable/portabled-forward.h b/src/portable/portabled-forward.h
new file mode 100644 (file)
index 0000000..c4529f0
--- /dev/null
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "forward.h" // IWYU pragma: export
+
+typedef struct Manager Manager;
+typedef struct Operation Operation;
+typedef struct PortableChange PortableChange;
index 6a35262e6d0e072c55dd6d49fdee4c11a476326a..021035ab85c6d47aec461e680b9b694707840a6f 100644 (file)
@@ -2,29 +2,32 @@
 
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
+#include "sd-bus.h"
+
 #include "alloc-util.h"
 #include "bus-common-errors.h"
 #include "bus-get-properties.h"
-#include "bus-label.h"
 #include "bus-object.h"
 #include "bus-polkit.h"
 #include "bus-util.h"
 #include "discover-image.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "hashmap.h"
+#include "image-policy.h"
 #include "io-util.h"
 #include "os-util.h"
+#include "path-util.h"
 #include "portable.h"
 #include "portabled.h"
 #include "portabled-bus.h"
 #include "portabled-image.h"
 #include "portabled-image-bus.h"
+#include "portabled-operation.h"
 #include "process-util.h"
 #include "strv.h"
-#include "user-util.h"
 
 static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_type, image_type, ImageType);
 
index d37c244315ee79994a3b4dd8be5d7665e3450688..5784d3ab1512da89bb526afc2cb2b84903913881 100644 (file)
@@ -1,12 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
+#include "sd-bus-vtable.h"
 
 #include "bus-object.h"
-#include "discover-image.h"
-
-typedef struct Manager Manager;
+#include "portabled-forward.h"
 
 int bus_image_common_get_os_release(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, sd_bus_error *error);
 int bus_image_common_get_metadata(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, sd_bus_error *error);
index f14d1a69efd42420e72f3d36725ea74aaba436ab..961ca4588a6881f620b230646d7794514d182d55 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "portable.h"
+#include "sd-event.h"
+
+#include "discover-image.h"
+#include "hashmap.h"
 #include "portabled.h"
 #include "portabled-image.h"
 
index 424694b3fd8f83dd9ed4d81e7091f17e660d0523..ababa411a88c92edca22615a759342d973d8d9e1 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
-
-#include "discover-image.h"
-#include "hashmap.h"
-
-typedef struct Manager Manager;
+#include "portabled-forward.h"
 
 Image *manager_image_cache_get(Manager *m, const char *name_or_path);
 
index 0e4a6e4629437b33f2e27c7845c548e864db4866..236904c728c09ae2493c8e374c45fece3778d4a5 100644 (file)
@@ -1,9 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <sys/wait.h>
 #include <unistd.h>
 
+#include "sd-bus.h"
+#include "sd-event.h"
+
 #include "alloc-util.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "log.h"
 #include "portabled.h"
 #include "portabled-operation.h"
index efbadc4620954e0e49f4dcaedcb069b3f4a22868..7d3210a3f35eeee9e580bd44840a35f664e8ccb4 100644 (file)
@@ -1,19 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/types.h>
-
-#include "sd-bus.h"
-#include "sd-event.h"
-
 #include "list.h"
-
-typedef struct Manager Manager;
-typedef struct Operation Operation;
+#include "portabled-forward.h"
 
 #define OPERATIONS_MAX 64
 
-struct Operation {
+typedef struct Operation {
         Manager *manager;
         pid_t pid;
         sd_bus_message *message;
@@ -22,7 +15,7 @@ struct Operation {
         sd_event_source *event_source;
         int (*done)(Operation *o, int ret, sd_bus_error *error);
         LIST_FIELDS(Operation, operations);
-};
+} Operation;
 
 int operation_new(Manager *manager, pid_t child, sd_bus_message *message, int errno_fd, Operation **ret);
 Operation *operation_free(Operation *o);
index ddc9935a7d6bb61b0db5af38c438d7f692304af3..b9c880992d5d35748c20ad791a12215d11493ee9 100644 (file)
@@ -1,24 +1,24 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <sys/stat.h>
-#include <sys/types.h>
 
 #include "sd-bus.h"
+#include "sd-event.h"
 
 #include "alloc-util.h"
 #include "bus-log-control-api.h"
-#include "bus-polkit.h"
 #include "bus-util.h"
 #include "common-signal.h"
 #include "constants.h"
 #include "daemon-util.h"
+#include "hashmap.h"
+#include "log.h"
 #include "main-func.h"
 #include "portabled.h"
-#include "portabled-bus.h"
 #include "portabled-image-bus.h"
-#include "process-util.h"
 #include "service-util.h"
 #include "signal-util.h"
+#include "time-util.h"
 
 static Manager* manager_unref(Manager *m);
 DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref);
index 418c1040dafb1fca9a03ae0ccea08c760fb978c0..c7ce2479555d4e9039cefd4c83d451343de0d950 100644 (file)
@@ -1,13 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-bus.h"
-#include "sd-event.h"
-
 #include "bus-object.h"
-#include "hashmap.h"
 #include "list.h"
-#include "portabled-operation.h"
+#include "portabled-forward.h"
 #include "runtime-scope.h"
 
 typedef struct Manager {