]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util: introduce common version() implementation and use it everywhere
authorLennart Poettering <lennart@poettering.net>
Wed, 23 Sep 2015 01:01:06 +0000 (03:01 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 29 Sep 2015 19:08:37 +0000 (21:08 +0200)
This also allows us to drop build.h from a ton of files, hence do so.
Since we touched the #includes of those files, let's order them properly
according to CODING_STYLE.

52 files changed:
src/activate/activate.c
src/analyze/analyze.c
src/basic/util.c
src/basic/util.h
src/binfmt/binfmt.c
src/boot/bootctl.c
src/bus-proxyd/bus-proxyd.c
src/bus-proxyd/stdio-bridge.c
src/cgls/cgls.c
src/cgtop/cgtop.c
src/core/main.c
src/delta/delta.c
src/detect-virt/detect-virt.c
src/escape/escape.c
src/firstboot/firstboot.c
src/hostname/hostnamectl.c
src/hwdb/hwdb.c
src/import/export.c
src/import/import.c
src/import/pull.c
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote.c
src/journal-remote/journal-upload.c
src/journal/cat.c
src/journal/coredumpctl.c
src/journal/journalctl.c
src/libsystemd/sd-bus/busctl.c
src/libsystemd/sd-hwdb/hwdb-internal.h
src/locale/localectl.c
src/login/inhibit.c
src/login/loginctl.c
src/machine-id-commit/machine-id-commit.c
src/machine-id-setup/machine-id-setup-main.c
src/machine/machinectl.c
src/modules-load/modules-load.c
src/network/networkctl.c
src/network/networkd-wait-online.c
src/notify/notify.c
src/nspawn/nspawn.c
src/path/path.c
src/resolve-host/resolve-host.c
src/run/run.c
src/shared/ask-password-api.h
src/shared/sysctl-util.c
src/sleep/sleep.c
src/socket-proxy/socket-proxyd.c
src/sysctl/sysctl.c
src/systemctl/systemctl.c
src/sysusers/sysusers.c
src/timedate/timedatectl.c
src/tmpfiles/tmpfiles.c
src/tty-ask-password-agent/tty-ask-password-agent.c

index 5318829442a8647119c0549d245756ac945c7c29..2dfc4a0bc439684baed573b8c2b8b91ede47b86b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
+#include <getopt.h>
 #include <sys/epoll.h>
 #include <sys/prctl.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
-#include <getopt.h>
+#include <unistd.h>
 
 #include "systemd/sd-daemon.h"
 
-#include "socket-util.h"
-#include "build.h"
 #include "log.h"
-#include "strv.h"
 #include "macro.h"
 #include "signal-util.h"
+#include "socket-util.h"
+#include "strv.h"
 
 static char** arg_listen = NULL;
 static bool arg_accept = false;
@@ -314,9 +313,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0 /* done */;
+                        return version();
 
                 case 'l': {
                         int r = strv_extend(&arg_listen, optarg);
index 3657ef50f1a9b1ff805056a10779dbab6599f323..c8ace3778ed9184dab097e715647ae616222ff22 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <stdlib.h>
 #include <getopt.h>
 #include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
+#include "analyze-verify.h"
 #include "bus-error.h"
-#include "log.h"
-#include "build.h"
-#include "util.h"
-#include "strxcpyx.h"
-#include "strv.h"
-#include "unit-name.h"
-#include "special.h"
+#include "bus-util.h"
 #include "hashmap.h"
+#include "log.h"
 #include "pager.h"
-#include "analyze-verify.h"
+#include "special.h"
+#include "strv.h"
+#include "strxcpyx.h"
 #include "terminal-util.h"
+#include "unit-name.h"
+#include "util.h"
 
 #define SCALE_X (0.1 / 1000.0)   /* pixels per us */
 #define SCALE_Y (20.0)
@@ -1339,9 +1339,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_USER:
                         arg_user = true;
index f7e4aefebb0251c975a0a760a928ee551945d64a..2bad33be1bbbe0ba63d2bf1334cfe8d3f346f35d 100644 (file)
@@ -72,6 +72,7 @@
  * otherwise conflicts with sys/mount.h. Yay, Linux is great! */
 #include <linux/fs.h>
 
+#include "build.h"
 #include "def.h"
 #include "device-nodes.h"
 #include "env-util.h"
@@ -6920,3 +6921,9 @@ int receive_one_fd(int transport_fd, int flags) {
 void nop_signal_handler(int sig) {
         /* nothing here */
 }
+
+int version(void) {
+        puts(PACKAGE_STRING "\n"
+             SYSTEMD_FEATURES);
+        return 0;
+}
index 96811f23d9d308c376787fa76999c12ffeed0fd2..afd906477a69f83d91a438b67b3f195ca7582e14 100644 (file)
@@ -946,3 +946,5 @@ int send_one_fd(int transport_fd, int fd, int flags);
 int receive_one_fd(int transport_fd, int flags);
 
 void nop_signal_handler(int sig);
+
+int version(void);
index 1e216f52bd4c739deb1ac2dc637b9803c8dbcaff..ddb5c88806024556c79f6f1825507a93dfbcd02a 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <limits.h>
 #include <getopt.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "conf-files.h"
+#include "fileio.h"
 #include "log.h"
 #include "strv.h"
 #include "util.h"
-#include "conf-files.h"
-#include "fileio.h"
-#include "build.h"
 
 static const char conf_file_dirs[] = CONF_DIRS_NULSTR("binfmt");
 
@@ -143,9 +142,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case '?':
                         return -EINVAL;
index ac1711b31836cc23017e405832d2361833078d3d..f991e30cfa24f159235aa5f3d2cda58971ad3eb4 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <getopt.h>
-#include <stdlib.h>
 #include <assert.h>
-#include <sys/statfs.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/mman.h>
-#include <dirent.h>
+#include <blkid/blkid.h>
 #include <ctype.h>
-#include <limits.h>
+#include <dirent.h>
+#include <errno.h>
 #include <ftw.h>
+#include <getopt.h>
+#include <limits.h>
 #include <stdbool.h>
-#include <blkid/blkid.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/statfs.h>
+#include <unistd.h>
 
+#include "blkid-util.h"
 #include "efivars.h"
-#include "build.h"
-#include "util.h"
 #include "rm-rf.h"
-#include "blkid-util.h"
+#include "util.h"
 
 static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t *psize, sd_id128_t *uuid) {
         struct statfs sfs;
@@ -967,8 +966,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        printf(VERSION "\n");
-                        return 0;
+                        return version();
 
                 case ARG_PATH:
                         arg_path = optarg;
index 3cc3b33ae70a7322c71afc478bd15fed940c61c3..2bc265d9b491c8a549a9a8608d6612c2f3191748 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
-#include <unistd.h>
-#include <string.h>
 #include <errno.h>
-#include <sys/prctl.h>
-#include <stddef.h>
 #include <getopt.h>
 #include <pthread.h>
+#include <stddef.h>
+#include <string.h>
+#include <sys/prctl.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
-#include "log.h"
-#include "util.h"
 #include "sd-daemon.h"
+
 #include "bus-internal.h"
-#include "build.h"
-#include "strv.h"
-#include "def.h"
-#include "capability.h"
 #include "bus-xml-policy.h"
-#include "proxy.h"
+#include "capability.h"
+#include "def.h"
 #include "formats-util.h"
+#include "log.h"
+#include "proxy.h"
+#include "strv.h"
+#include "util.h"
 
 static char *arg_address = NULL;
 static char **arg_configuration = NULL;
@@ -215,9 +215,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ADDRESS:
                         r = free_and_strdup(&arg_address, optarg);
index f275f6705fb6bc5c0eff6045f532a7cd8548da62..168fc9ead03a3b72dcf90cfb7390df4998164fb0 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
-#include <string.h>
 #include <errno.h>
-#include <stddef.h>
 #include <getopt.h>
+#include <stddef.h>
+#include <string.h>
+#include <unistd.h>
 
-#include "log.h"
-#include "util.h"
 #include "sd-daemon.h"
 #include "sd-bus.h"
+
 #include "bus-internal.h"
 #include "bus-util.h"
-#include "build.h"
-#include "strv.h"
 #include "def.h"
-#include "proxy.h"
 #include "formats-util.h"
+#include "log.h"
+#include "proxy.h"
+#include "strv.h"
+#include "util.h"
 
 static char *arg_address = NULL;
 static char *arg_command_line_buffer = NULL;
@@ -86,9 +86,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ADDRESS: {
                         char *a;
index ec4215f741b288a259e7ed7c7e8c65610cb0d504..d3a5a4df28ad8c3201717202fafc10e8323ac949 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <unistd.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stdio.h>
 #include <string.h>
+#include <unistd.h>
+
+#include "sd-bus.h"
 
+#include "bus-error.h"
+#include "bus-util.h"
 #include "cgroup-show.h"
 #include "cgroup-util.h"
+#include "fileio.h"
 #include "log.h"
-#include "path-util.h"
-#include "util.h"
-#include "pager.h"
-#include "build.h"
 #include "output-mode.h"
-#include "fileio.h"
-#include "sd-bus.h"
-#include "bus-util.h"
-#include "bus-error.h"
+#include "pager.h"
+#include "path-util.h"
 #include "unit-name.h"
+#include "util.h"
 
 static bool arg_no_pager = false;
 static bool arg_kernel_threads = false;
@@ -89,9 +89,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index 9cf13cf57d62eb6e52e26e8f32d985900aa160fd..b404c8361652308ebcb0e88466bc1dae57c8ec41 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
 #include <alloca.h>
+#include <errno.h>
 #include <getopt.h>
 #include <signal.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
 
-#include "path-util.h"
-#include "terminal-util.h"
-#include "process-util.h"
-#include "util.h"
-#include "hashmap.h"
-#include "cgroup-util.h"
-#include "build.h"
-#include "fileio.h"
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
+#include "bus-util.h"
+#include "cgroup-util.h"
+#include "fileio.h"
+#include "hashmap.h"
+#include "path-util.h"
+#include "process-util.h"
+#include "terminal-util.h"
 #include "unit-name.h"
+#include "util.h"
 
 typedef struct Group {
         char *path;
@@ -696,9 +696,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_CPU_TYPE:
                         if (optarg) {
index 76abb0bde9024b00be31b518becc08d5842f7a93..4fe298117c2fa1ef501577baf91f6ce074e283bc 100644 (file)
@@ -931,13 +931,6 @@ static int help(void) {
         return 0;
 }
 
-static int version(void) {
-        puts(PACKAGE_STRING);
-        puts(SYSTEMD_FEATURES);
-
-        return 0;
-}
-
 static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool switching_root) {
         _cleanup_fdset_free_ FDSet *fds = NULL;
         _cleanup_fclose_ FILE *f = NULL;
index 990130d00b853e6c02326566753c1efd8d0e82b0..4edafc7cdf7895d61888bbf1348cd7e193ffc98d 100644 (file)
 ***/
 
 #include <errno.h>
-#include <string.h>
-#include <unistd.h>
 #include <getopt.h>
+#include <string.h>
 #include <sys/prctl.h>
+#include <unistd.h>
 
 #include "hashmap.h"
-#include "util.h"
-#include "path-util.h"
 #include "log.h"
 #include "pager.h"
-#include "build.h"
-#include "strv.h"
+#include "path-util.h"
 #include "process-util.h"
-#include "terminal-util.h"
 #include "signal-util.h"
+#include "strv.h"
+#include "terminal-util.h"
+#include "util.h"
 
 static const char prefixes[] =
         "/etc\0"
@@ -544,9 +543,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index 97ae569ca59bb8901f96d486659e5ac389f3133a..f71371240582a516944955735644bfde60d46fd8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stdbool.h>
+#include <stdlib.h>
 
 #include "util.h"
 #include "virt.h"
-#include "build.h"
 
 static bool arg_quiet = false;
 static enum {
@@ -75,9 +74,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'q':
                         arg_quiet = true;
index 341453398d8cfcd42372c512b8639ec29144eba7..a4bfeb5df53029a6ed04b9de73822716121f0843 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <getopt.h>
 
 #include "log.h"
-#include "unit-name.h"
-#include "build.h"
 #include "strv.h"
+#include "unit-name.h"
 
 static enum {
         ACTION_ESCAPE,
@@ -83,9 +82,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_SUFFIX:
 
index e2a1c00a75dd210af69be7924daf5b56a7ac50ac..4f0c669ca16a98fc494df64da0081d74df2ea23c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-
 #include <fcntl.h>
-#include <unistd.h>
 #include <getopt.h>
 #include <shadow.h>
+#include <unistd.h>
 
-#include "strv.h"
-#include "fileio.h"
+#include "ask-password-api.h"
 #include "copy.h"
-#include "build.h"
+#include "fileio.h"
+#include "hostname-util.h"
+#include "locale-util.h"
 #include "mkdir.h"
-#include "time-util.h"
 #include "path-util.h"
 #include "random-util.h"
-#include "locale-util.h"
-#include "ask-password-api.h"
+#include "strv.h"
 #include "terminal-util.h"
-#include "hostname-util.h"
+#include "time-util.h"
 
 static char *arg_root = NULL;
 static char *arg_locale = NULL;  /* $LANG */
@@ -704,9 +702,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ROOT:
                         free(arg_root);
index dcbad99ae948ddac1a581069034a86fe465722f8..7974683179f927dff62d2ae8180f0c57dc3d35f1 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <getopt.h>
 #include <locale.h>
+#include <stdbool.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "sd-bus.h"
 #include "sd-id128.h"
-#include "hostname-util.h"
-#include "bus-util.h"
+
+#include "architecture.h"
 #include "bus-error.h"
-#include "util.h"
+#include "bus-util.h"
+#include "hostname-util.h"
 #include "spawn-polkit-agent.h"
-#include "build.h"
-#include "architecture.h"
+#include "util.h"
 
 static bool arg_ask_password = true;
 static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
@@ -387,9 +387,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'H':
                         arg_transport = BUS_TRANSPORT_REMOTE;
index 446de3a2fc330f4f10d52fec816e5d376ee719ea..1e415db845c8fa579d6c8768a8ef040c787c33b9 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
+#include <ctype.h>
 #include <getopt.h>
+#include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
-#include "util.h"
-#include "strbuf.h"
 #include "conf-files.h"
-#include "strv.h"
-#include "mkdir.h"
-#include "verbs.h"
-#include "build.h"
-
 #include "hwdb-internal.h"
 #include "hwdb-util.h"
+#include "mkdir.h"
+#include "strbuf.h"
+#include "strv.h"
+#include "util.h"
+#include "verbs.h"
 
 /*
  * Generic udev properties, key/value database based on modalias strings.
@@ -688,9 +686,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_USR:
                         arg_hwdb_bin_dir = UDEVLIBEXECDIR;
index b88d71fec63e7a1c1a00a0c23f6768282436b391..d34105e4ca187e682ca050a00815bb1ad62f3ea4 100644 (file)
 #include <getopt.h>
 
 #include "sd-event.h"
+
 #include "event-util.h"
-#include "signal-util.h"
+#include "export-raw.h"
+#include "export-tar.h"
 #include "hostname-util.h"
-#include "verbs.h"
-#include "build.h"
-#include "machine-image.h"
 #include "import-util.h"
-#include "export-tar.h"
-#include "export-raw.h"
+#include "machine-image.h"
+#include "signal-util.h"
+#include "verbs.h"
 
 static ImportCompressType arg_compress = IMPORT_COMPRESS_UNKNOWN;
 
@@ -260,9 +260,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return help(0, NULL, NULL);
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_FORMAT:
                         if (streq(optarg, "uncompressed"))
index 929a840298a90e8d61a4b2830fdfd02d09f882ae..1c92312585e7a2bb00ae261a1beef6b4603f137e 100644 (file)
 #include <getopt.h>
 
 #include "sd-event.h"
+
 #include "event-util.h"
-#include "verbs.h"
-#include "build.h"
-#include "signal-util.h"
 #include "hostname-util.h"
-#include "machine-image.h"
-#include "import-util.h"
-#include "import-tar.h"
 #include "import-raw.h"
+#include "import-tar.h"
+#include "import-util.h"
+#include "machine-image.h"
+#include "signal-util.h"
+#include "verbs.h"
 
 static bool arg_force = false;
 static bool arg_read_only = false;
@@ -280,9 +280,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return help(0, NULL, NULL);
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_FORCE:
                         arg_force = true;
index 98c22aeec96d8c2cd7aadd55cfba38dcc6f09ff4..29e9424b52ddeb6b1cca476f5bb5d05b6ae5d11c 100644 (file)
 #include <getopt.h>
 
 #include "sd-event.h"
+
 #include "event-util.h"
-#include "verbs.h"
-#include "build.h"
-#include "signal-util.h"
 #include "hostname-util.h"
-#include "machine-image.h"
 #include "import-util.h"
-#include "pull-tar.h"
-#include "pull-raw.h"
+#include "machine-image.h"
 #include "pull-dkr.h"
+#include "pull-raw.h"
+#include "pull-tar.h"
+#include "signal-util.h"
+#include "verbs.h"
 
 static bool arg_force = false;
 static const char *arg_image_root = "/var/lib/machines";
@@ -381,9 +381,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return help(0, NULL, NULL);
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_FORCE:
                         arg_force = true;
index 4e5572db0b1e63da3599227564232ce8bca20a04..29df842277a8dcb3c4dda98048072002760da7c4 100644 (file)
@@ -24,9 +24,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-
 #include <microhttpd.h>
-
 #ifdef HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 #endif
 #include "sd-journal.h"
 #include "sd-daemon.h"
 #include "sd-bus.h"
-#include "log.h"
-#include "util.h"
+
 #include "bus-util.h"
+#include "fileio.h"
+#include "hostname-util.h"
+#include "log.h"
 #include "logs-show.h"
 #include "microhttpd-util.h"
-#include "build.h"
-#include "fileio.h"
 #include "sigbus.h"
-#include "hostname-util.h"
+#include "util.h"
 
 static char *arg_key_pem = NULL;
 static char *arg_cert_pem = NULL;
@@ -909,9 +907,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_KEY:
                         if (arg_key_pem) {
index d6ebca20ec56fb25cf69aecc5daede1174f9b052..50f41a575d6d9f9bef8e5f730e6352d61e208bb1 100644 (file)
 
 #include <errno.h>
 #include <fcntl.h>
+#include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/prctl.h>
 #include <sys/socket.h>
 #include <unistd.h>
-#include <getopt.h>
+
+#ifdef HAVE_GNUTLS
+#include <gnutls/gnutls.h>
+#endif
 
 #include "sd-daemon.h"
-#include "signal-util.h"
+
+#include "conf-parser.h"
+#include "fileio.h"
 #include "journal-file.h"
 #include "journald-native.h"
-#include "socket-util.h"
-#include "build.h"
 #include "macro.h"
+#include "signal-util.h"
+#include "socket-util.h"
 #include "strv.h"
-#include "fileio.h"
-#include "conf-parser.h"
-
-#ifdef HAVE_GNUTLS
-#include <gnutls/gnutls.h>
-#endif
-
-#include "journal-remote.h"
 #include "journal-remote-write.h"
+#include "journal-remote.h"
 
 #define REMOTE_JOURNAL_PATH "/var/log/journal/remote"
 
@@ -1259,9 +1258,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0 /* done */;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0 /* done */;
+                        return version();
 
                 case ARG_URL:
                         if (arg_url) {
index 311bd3fddab7368fb4f9046dba9e48899cdd671a..92ce56805a6060bb7b07cd169fcb911067a224bf 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <curl/curl.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <getopt.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <curl/curl.h>
 
 #include "sd-daemon.h"
-#include "log.h"
-#include "util.h"
-#include "build.h"
+
+#include "conf-parser.h"
 #include "fileio.h"
+#include "formats-util.h"
+#include "log.h"
 #include "mkdir.h"
-#include "conf-parser.h"
 #include "sigbus.h"
-#include "formats-util.h"
 #include "signal-util.h"
+#include "util.h"
 #include "journal-upload.h"
 
 #define PRIV_KEY_FILE CERTIFICATE_ROOT "/private/journal-upload.pem"
@@ -619,9 +619,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0 /* done */;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0 /* done */;
+                        return version();
 
                 case 'u':
                         if (arg_url) {
index be2c2e33548c33d26caee72f341dde985966929b..9a85ff1ffd75cc0affdcbd97f0b9ab10c5b28c69 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 
-#include "systemd/sd-journal.h"
+#include "sd-journal.h"
 
 #include "util.h"
-#include "build.h"
 
 static char *arg_identifier = NULL;
 static int arg_priority = LOG_INFO;
@@ -76,9 +75,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 't':
                         free(arg_identifier);
index 6628e82421c6174e37538aeac60031f598c17a0e..dde56008c152a00549146f96995f6eff65f53e11 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <fcntl.h>
+#include <getopt.h>
 #include <locale.h>
 #include <stdio.h>
 #include <string.h>
-#include <getopt.h>
-#include <fcntl.h>
 #include <unistd.h>
 
 #include "sd-journal.h"
-#include "build.h"
-#include "set.h"
-#include "util.h"
+
+#include "compress.h"
+#include "journal-internal.h"
 #include "log.h"
-#include "path-util.h"
-#include "pager.h"
 #include "macro.h"
-#include "journal-internal.h"
-#include "compress.h"
-#include "sigbus.h"
+#include "pager.h"
+#include "path-util.h"
 #include "process-util.h"
-#include "terminal-util.h"
+#include "set.h"
+#include "sigbus.h"
 #include "signal-util.h"
+#include "terminal-util.h"
+#include "util.h"
 
 static enum {
         ACTION_NONE,
@@ -175,9 +175,7 @@ static int parse_argv(int argc, char *argv[], Set *matches) {
 
                 case ARG_VERSION:
                         arg_action = ACTION_NONE;
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index b38b151485f0c461860ebec9df4b6dc803e53b48..de67a9687cc4d0df5814ce5388ba71c32454054d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <locale.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <fnmatch.h>
-#include <errno.h>
+#include <getopt.h>
+#include <linux/fs.h>
+#include <locale.h>
+#include <poll.h>
+#include <signal.h>
 #include <stddef.h>
-#include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <stdlib.h>
-#include <getopt.h>
-#include <signal.h>
-#include <poll.h>
-#include <sys/stat.h>
+#include <string.h>
 #include <sys/inotify.h>
-#include <linux/fs.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
-#include "sd-journal.h"
 #include "sd-bus.h"
-#include "log.h"
-#include "logs-show.h"
-#include "util.h"
+#include "sd-journal.h"
+
 #include "acl-util.h"
-#include "path-util.h"
+#include "bus-error.h"
+#include "bus-util.h"
+#include "catalog.h"
 #include "fileio.h"
-#include "build.h"
-#include "pager.h"
-#include "strv.h"
-#include "set.h"
-#include "sigbus.h"
-#include "journal-internal.h"
+#include "fsprg.h"
+#include "hostname-util.h"
 #include "journal-def.h"
-#include "journal-verify.h"
+#include "journal-internal.h"
 #include "journal-qrcode.h"
 #include "journal-vacuum.h"
-#include "fsprg.h"
-#include "unit-name.h"
-#include "catalog.h"
+#include "journal-verify.h"
+#include "log.h"
+#include "logs-show.h"
 #include "mkdir.h"
-#include "bus-util.h"
-#include "bus-error.h"
+#include "pager.h"
+#include "path-util.h"
+#include "set.h"
+#include "sigbus.h"
+#include "strv.h"
 #include "terminal-util.h"
-#include "hostname-util.h"
+#include "unit-name.h"
 
 #define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
 
@@ -350,9 +349,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index 5d07d5809c4843b3e2e5093d726a7b1d8e5a47a2..ab8816942c4bcd011161729396991d4cdc27606d 100644 (file)
 
 #include <getopt.h>
 
-#include "strv.h"
-#include "util.h"
-#include "log.h"
-#include "build.h"
-#include "pager.h"
-#include "path-util.h"
-#include "set.h"
-
 #include "sd-bus.h"
-#include "bus-internal.h"
-#include "bus-util.h"
+
 #include "bus-dump.h"
+#include "bus-internal.h"
 #include "bus-signature.h"
 #include "bus-type.h"
+#include "bus-util.h"
 #include "busctl-introspect.h"
+#include "log.h"
+#include "pager.h"
+#include "path-util.h"
+#include "set.h"
+#include "strv.h"
 #include "terminal-util.h"
+#include "util.h"
 
 static bool arg_no_pager = false;
 static bool arg_legend = true;
@@ -1786,9 +1785,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return help();
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index fedccdec722a7008c0fa1bdab69bb54fd433bdc9..13fddfc8ad8e29eace896456ec205fb26e0fae96 100644 (file)
@@ -19,6 +19,7 @@
 #pragma once
 
 #include "sparse-endian.h"
+#include "util.h"
 
 #define HWDB_SIG { 'K', 'S', 'L', 'P', 'H', 'H', 'R', 'H' }
 
index 4a91c7420a6470e1089bfbfa7c4fbd9bd17a969f..26d7d5890e8087825e2b509555bda1efe98e98b3 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <ftw.h>
+#include <getopt.h>
 #include <locale.h>
-#include <stdlib.h>
 #include <stdbool.h>
-#include <getopt.h>
+#include <stdlib.h>
 #include <string.h>
-#include <ftw.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
-#include "util.h"
-#include "spawn-polkit-agent.h"
-#include "build.h"
-#include "strv.h"
-#include "pager.h"
-#include "set.h"
+#include "bus-util.h"
 #include "def.h"
-#include "virt.h"
 #include "fileio.h"
 #include "locale-util.h"
+#include "pager.h"
+#include "set.h"
+#include "spawn-polkit-agent.h"
+#include "strv.h"
+#include "util.h"
+#include "virt.h"
 
 static bool arg_no_pager = false;
 static bool arg_ask_password = true;
@@ -546,9 +546,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_CONVERT:
                         arg_convert = false;
index c53ea8add7c6c1efe2da0812d1117362ce6d1a28..e671341b42055622603674da7bdb8c2163e6ed13 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <fcntl.h>
 #include <getopt.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
-#include <fcntl.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
-#include "util.h"
-#include "build.h"
-#include "strv.h"
+#include "bus-util.h"
 #include "formats-util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "strv.h"
+#include "util.h"
 
 static const char* arg_what = "idle:sleep:shutdown";
 static const char* arg_who = NULL;
@@ -179,9 +179,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_WHAT:
                         arg_what = optarg;
index be5251816174418752224bd823ad7ba85364f3d7..efd6c5f4b0cc595c3b1f7db6c70f3863fc6431bf 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
 #include <errno.h>
-#include <string.h>
 #include <getopt.h>
 #include <locale.h>
+#include <string.h>
+#include <unistd.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
+#include "bus-util.h"
+#include "cgroup-show.h"
+#include "cgroup-util.h"
 #include "log.h"
-#include "util.h"
+#include "logs-show.h"
 #include "macro.h"
 #include "pager.h"
-#include "build.h"
+#include "process-util.h"
+#include "signal-util.h"
+#include "spawn-polkit-agent.h"
 #include "strv.h"
-#include "unit-name.h"
 #include "sysfs-show.h"
-#include "logs-show.h"
-#include "cgroup-show.h"
-#include "cgroup-util.h"
-#include "spawn-polkit-agent.h"
-#include "verbs.h"
-#include "process-util.h"
 #include "terminal-util.h"
-#include "signal-util.h"
+#include "unit-name.h"
+#include "util.h"
+#include "verbs.h"
 
 static char **arg_property = NULL;
 static bool arg_all = false;
@@ -1416,9 +1416,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'p': {
                         r = strv_extend(&arg_property, optarg);
index 0f7748e453542454fe071ae994962efbab98535e..ec3d7f8f975493fa83da028c9e1aeb0e40390ecc 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <getopt.h>
 #include <errno.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-#include "machine-id-setup.h"
 #include "log.h"
-#include "build.h"
+#include "machine-id-setup.h"
+#include "util.h"
 
 static const char *arg_root = NULL;
 
@@ -66,9 +66,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ROOT:
                         arg_root = optarg;
index 20cb60b804592f4896eb70cfe35e6708617222ef..e5606c9a0360728a074ccbd4253f9fd99e4b5684 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <getopt.h>
 #include <errno.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
 
-#include "machine-id-setup.h"
 #include "log.h"
-#include "build.h"
+#include "machine-id-setup.h"
+#include "util.h"
 
 static const char *arg_root = "";
 
@@ -67,9 +67,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ROOT:
                         arg_root = optarg;
index d276fbe9560fc646e6191575ec07a4a0585f3693..b3c8ea44a3061b59b6a5cec5969f929a45dde21b 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/socket.h>
-#include <unistd.h>
+#include <arpa/inet.h>
 #include <errno.h>
-#include <string.h>
+#include <fcntl.h>
 #include <getopt.h>
 #include <locale.h>
-#include <fcntl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
 #include <net/if.h>
+#include <netinet/in.h>
+#include <string.h>
 #include <sys/mount.h>
+#include <sys/socket.h>
+#include <unistd.h>
 
 #include "sd-bus.h"
-#include "log.h"
-#include "util.h"
-#include "macro.h"
-#include "pager.h"
-#include "spawn-polkit-agent.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
-#include "build.h"
-#include "strv.h"
-#include "unit-name.h"
+#include "bus-util.h"
 #include "cgroup-show.h"
-#include "logs-show.h"
 #include "cgroup-util.h"
-#include "ptyfwd.h"
-#include "event-util.h"
-#include "path-util.h"
-#include "mkdir.h"
 #include "copy.h"
-#include "verbs.h"
+#include "env-util.h"
+#include "event-util.h"
+#include "hostname-util.h"
 #include "import-util.h"
+#include "log.h"
+#include "logs-show.h"
+#include "macro.h"
+#include "mkdir.h"
+#include "pager.h"
+#include "path-util.h"
 #include "process-util.h"
-#include "terminal-util.h"
+#include "ptyfwd.h"
 #include "signal-util.h"
-#include "env-util.h"
-#include "hostname-util.h"
+#include "spawn-polkit-agent.h"
+#include "strv.h"
+#include "terminal-util.h"
+#include "unit-name.h"
+#include "util.h"
+#include "verbs.h"
 
 static char **arg_property = NULL;
 static bool arg_all = false;
@@ -2554,9 +2554,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return help(0, NULL, NULL);
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'p':
                         r = strv_extend(&arg_property, optarg);
index 5bbe314ba0371bbbd1491362f93ef6f7f9ce0078..55bb35b9f781da22b961f18d2387230adacb4b6d 100644 (file)
 ***/
 
 #include <errno.h>
+#include <getopt.h>
+#include <limits.h>
 #include <string.h>
 #include <sys/stat.h>
-#include <limits.h>
-#include <getopt.h>
 #include <libkmod.h>
 
+#include "conf-files.h"
 #include "log.h"
-#include "util.h"
 #include "strv.h"
-#include "conf-files.h"
-#include "build.h"
+#include "util.h"
 
 static char **arg_proc_cmdline_modules = NULL;
 
@@ -199,9 +198,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case '?':
                         return -EINVAL;
index 75572b63886227c92e7b031622e1c67c17ca7bbf..c78b9444b6a7dba701aedeb04df629f50e76e26f 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdbool.h>
 #include <getopt.h>
 #include <net/if.h>
+#include <stdbool.h>
 
-#include "sd-network.h"
-#include "sd-netlink.h"
-#include "sd-hwdb.h"
 #include "sd-device.h"
+#include "sd-hwdb.h"
+#include "sd-netlink.h"
+#include "sd-network.h"
 
-#include "strv.h"
-#include "build.h"
-#include "util.h"
-#include "pager.h"
-#include "lldp.h"
-#include "netlink-util.h"
+#include "arphrd-list.h"
 #include "device-util.h"
+#include "ether-addr-util.h"
 #include "hwdb-util.h"
-#include "arphrd-list.h"
+#include "lldp.h"
 #include "local-addresses.h"
+#include "netlink-util.h"
+#include "pager.h"
 #include "socket-util.h"
-#include "ether-addr-util.h"
-#include "verbs.h"
+#include "strv.h"
 #include "terminal-util.h"
+#include "util.h"
+#include "verbs.h"
 
 static bool arg_no_pager = false;
 static bool arg_legend = true;
@@ -1063,9 +1062,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_NO_PAGER:
                         arg_no_pager = true;
index d958b4877149d875e009df87eb12e3e5296fe828..3220c4b7efb46db84e8c537ae2beb830e1b4ede2 100644 (file)
 #include <getopt.h>
 
 #include "sd-daemon.h"
-#include "strv.h"
-#include "build.h"
-#include "signal-util.h"
+
 #include "networkd-wait-online.h"
+#include "signal-util.h"
+#include "strv.h"
 
 static bool arg_quiet = false;
 static usec_t arg_timeout = 120 * USEC_PER_SEC;
@@ -79,9 +79,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'i':
                         if (strv_extend(&arg_interfaces, optarg) < 0)
index 7d53cb6d75ff7ed459fbe13b8652ddcc66df6c97..805ea1a6277663d5badc6a09c80c34fb3170f9ed 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "sd-daemon.h"
 
-#include "build.h"
 #include "env-util.h"
 #include "formats-util.h"
 #include "log.h"
@@ -85,9 +84,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_READY:
                         arg_ready = true;
index 6b5d5d5b7561c91a3a7f432b29eecbe537eeb1fd..16dfe8a7c16705c696d80c98503a6218490f3749 100644 (file)
@@ -50,7 +50,6 @@
 #include "base-filesystem.h"
 #include "blkid-util.h"
 #include "btrfs-util.h"
-#include "build.h"
 #include "cap-list.h"
 #include "capability.h"
 #include "cgroup-util.h"
@@ -414,9 +413,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'D':
                         r = set_sanitized_path(&arg_directory, optarg);
index f7736a42029c4d2677a5dd0bafee571e72523f2a..73b7bd2c01c485c2779879bde648ccc918fed4ea 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
-#include <getopt.h>
 #include <errno.h>
+#include <getopt.h>
+#include <stdio.h>
 #include <stdlib.h>
 
 #include "sd-path.h"
-#include "build.h"
+
+#include "log.h"
 #include "macro.h"
 #include "util.h"
-#include "log.h"
 
 static const char *arg_suffix = NULL;
 
@@ -155,9 +155,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_SUFFIX:
                         arg_suffix = optarg;
index 22af092cc0b3cdcf0a863755472463bf39320062..97516a87a8c8d859d5de3a3f177da36738864118 100644 (file)
 #include <getopt.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
+#include "af-list.h"
 #include "bus-error.h"
+#include "bus-util.h"
 #include "in-addr-util.h"
-#include "af-list.h"
-#include "build.h"
-
-#include "resolved-dns-packet.h"
 #include "resolved-def.h"
+#include "resolved-dns-packet.h"
 
 #define DNS_CALL_TIMEOUT_USEC (45*USEC_PER_SEC)
 
@@ -507,9 +506,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0; /* done */;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0 /* done */;
+                        return version();
 
                 case '4':
                         arg_family = AF_INET;
index 657c6fcaf10a88d0c7acf0a5ff0bbf095d6750c6..2b51b0889bce698050b67052507167046d71c919 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <getopt.h>
+#include <stdio.h>
 
 #include "sd-bus.h"
 #include "sd-event.h"
+
+#include "bus-error.h"
 #include "bus-util.h"
-#include "event-util.h"
-#include "strv.h"
-#include "build.h"
-#include "unit-name.h"
+#include "calendarspec.h"
 #include "env-util.h"
+#include "event-util.h"
+#include "formats-util.h"
 #include "path-util.h"
-#include "bus-error.h"
-#include "calendarspec.h"
 #include "ptyfwd.h"
-#include "formats-util.h"
 #include "signal-util.h"
 #include "spawn-polkit-agent.h"
+#include "strv.h"
+#include "unit-name.h"
 
 static bool arg_ask_password = true;
 static bool arg_scope = false;
@@ -199,9 +199,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_USER:
                         arg_user = true;
index 0954e072be47d75b61f571fde48513867863e5d2..ccb3be0fca7946482b7033252d52aa9444a0437a 100644 (file)
@@ -21,6 +21,9 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <stdbool.h>
+
+#include "time-util.h"
 
 int ask_password_tty(const char *message, usec_t until, bool echo, const char *flag_file, char **_passphrase);
 
index 1de0b94fd5fbb0ac4440018cd9d1c13f5039f2a8..b2cab948efb22c97033e6b540db9321f479be700 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <limits.h>
 #include <getopt.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
+#include "fileio.h"
 #include "log.h"
 #include "util.h"
-#include "fileio.h"
-#include "build.h"
 #include "sysctl-util.h"
 
 char *sysctl_normalize(char *s) {
index 2b2310152d54ab22d55f08f7e87ccddd2f36ebfb..1ba66eb9981078111bab166271f195749b7701c8 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdio.h>
 #include <errno.h>
 #include <getopt.h>
+#include <stdio.h>
 
 #include "sd-messages.h"
-#include "log.h"
-#include "util.h"
-#include "strv.h"
+
+#include "def.h"
 #include "fileio.h"
-#include "build.h"
+#include "log.h"
 #include "sleep-config.h"
-#include "def.h"
+#include "strv.h"
+#include "util.h"
 
 static char* arg_verb = NULL;
 
@@ -165,9 +165,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0; /* done */
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0 /* done */;
+                        return version();
 
                 case '?':
                         return -EINVAL;
index 715f440cb1e4895624fc5a5005ecb9a7539e5330..73c04fdfc089932fa8d74cf4186c0a0fc245d32d 100644 (file)
  ***/
 
 #include <errno.h>
+#include <fcntl.h>
 #include <getopt.h>
+#include <netdb.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <netdb.h>
-#include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
 #include "sd-daemon.h"
 #include "sd-event.h"
 #include "sd-resolve.h"
+
 #include "log.h"
+#include "path-util.h"
+#include "set.h"
 #include "socket-util.h"
 #include "util.h"
-#include "build.h"
-#include "set.h"
-#include "path-util.h"
 
 #define BUFFER_SIZE (256 * 1024)
 #define CONNECTIONS_MAX 256
@@ -603,9 +603,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case '?':
                         return -EINVAL;
index 618844382f79c49e2791db79b2a1c02474f85934..ee34209a30ff99c46915a532e21714302a8d1e9e 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <limits.h>
 #include <getopt.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-#include "log.h"
-#include "strv.h"
-#include "util.h"
-#include "hashmap.h"
-#include "path-util.h"
 #include "conf-files.h"
 #include "fileio.h"
-#include "build.h"
+#include "hashmap.h"
+#include "log.h"
+#include "path-util.h"
+#include "strv.h"
 #include "sysctl-util.h"
+#include "util.h"
 
 static char **arg_prefixes = NULL;
 
@@ -195,9 +194,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_PREFIX: {
                         char *p;
index 34e4751b9412cb25c744b801d0af4f03c8add96f..56c7982b8fe3a1649cfecb916f673fdd407731f3 100644 (file)
@@ -37,7 +37,6 @@
 #include "sd-daemon.h"
 #include "sd-login.h"
 
-#include "build.h"
 #include "bus-common-errors.h"
 #include "bus-error.h"
 #include "bus-message.h"
@@ -6422,9 +6421,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 't': {
                         const char *word, *state;
index aaa33354f490ce0f0021cb8a98b4940f775b5c8d..07494e764bd61a1586066e3abf3d2f2037961622 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <pwd.h>
+#include <getopt.h>
 #include <grp.h>
-#include <shadow.h>
 #include <gshadow.h>
-#include <getopt.h>
+#include <pwd.h>
+#include <shadow.h>
 #include <utmp.h>
 
-#include "util.h"
-#include "hashmap.h"
-#include "specifier.h"
-#include "path-util.h"
-#include "build.h"
-#include "strv.h"
 #include "conf-files.h"
 #include "copy.h"
-#include "utf8.h"
 #include "fileio-label.h"
-#include "uid-range.h"
-#include "selinux-util.h"
 #include "formats-util.h"
+#include "hashmap.h"
+#include "path-util.h"
+#include "selinux-util.h"
+#include "specifier.h"
+#include "strv.h"
+#include "uid-range.h"
+#include "utf8.h"
+#include "util.h"
 
 typedef enum ItemType {
         ADD_USER = 'u',
@@ -1767,9 +1766,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_ROOT:
                         free(arg_root);
index 12a7ed6718b7a53157bed7dbdd44ce011a880cb7..ea41227e526d2a4226dbcdbd338a20bda3174b0e 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdlib.h>
-#include <stdbool.h>
 #include <getopt.h>
 #include <locale.h>
+#include <stdbool.h>
+#include <stdlib.h>
 
 #include "sd-bus.h"
-#include "bus-util.h"
+
 #include "bus-error.h"
-#include "util.h"
+#include "bus-util.h"
+#include "pager.h"
 #include "spawn-polkit-agent.h"
-#include "build.h"
 #include "strv.h"
-#include "pager.h"
 #include "terminal-util.h"
+#include "util.h"
 
 static bool arg_no_pager = false;
 static bool arg_ask_password = true;
@@ -374,9 +374,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case 'H':
                         arg_transport = BUS_TRANSPORT_REMOTE;
index 8f29256c6da9175983b1d3a4487a278a3104838e..d219764bc69a2ff71a294f4d668076c9b0605c4c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
-#include <fcntl.h>
+#include <dirent.h>
 #include <errno.h>
-#include <string.h>
+#include <fcntl.h>
+#include <fnmatch.h>
+#include <getopt.h>
+#include <glob.h>
 #include <limits.h>
-#include <dirent.h>
+#include <linux/fs.h>
+#include <stdbool.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stddef.h>
-#include <getopt.h>
-#include <stdbool.h>
-#include <time.h>
-#include <glob.h>
-#include <fnmatch.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <sys/xattr.h>
-#include <linux/fs.h>
+#include <time.h>
+#include <unistd.h>
 
+#include "acl-util.h"
+#include "btrfs-util.h"
+#include "capability.h"
+#include "conf-files.h"
+#include "copy.h"
+#include "formats-util.h"
+#include "label.h"
 #include "log.h"
-#include "util.h"
 #include "macro.h"
 #include "missing.h"
 #include "mkdir.h"
 #include "path-util.h"
-#include "strv.h"
-#include "label.h"
-#include "set.h"
-#include "conf-files.h"
-#include "capability.h"
-#include "specifier.h"
-#include "build.h"
-#include "copy.h"
 #include "rm-rf.h"
 #include "selinux-util.h"
-#include "btrfs-util.h"
-#include "acl-util.h"
-#include "formats-util.h"
+#include "set.h"
+#include "specifier.h"
+#include "strv.h"
+#include "util.h"
 
 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
  * them in the file system. This is intended to be used to create
@@ -2090,9 +2089,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_CREATE:
                         arg_create = true;
index 82cbf95f1e974d6133cf8773bcabed445de712c7..3c1346fddb8e9ab9026c7756c829e73bf7f65d6d 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <stdbool.h>
 #include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <poll.h>
+#include <stdbool.h>
+#include <stddef.h>
 #include <string.h>
+#include <sys/inotify.h>
+#include <sys/signalfd.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <stddef.h>
-#include <poll.h>
-#include <sys/inotify.h>
 #include <unistd.h>
-#include <getopt.h>
-#include <sys/signalfd.h>
-#include <fcntl.h>
 
-#include "util.h"
+#include "ask-password-api.h"
+#include "conf-parser.h"
+#include "def.h"
 #include "mkdir.h"
 #include "path-util.h"
-#include "conf-parser.h"
-#include "utmp-wtmp.h"
+#include "process-util.h"
+#include "signal-util.h"
 #include "socket-util.h"
-#include "ask-password-api.h"
 #include "strv.h"
-#include "build.h"
-#include "def.h"
-#include "process-util.h"
 #include "terminal-util.h"
-#include "signal-util.h"
+#include "util.h"
+#include "utmp-wtmp.h"
 
 static enum {
         ACTION_LIST,
@@ -571,9 +570,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case ARG_LIST:
                         arg_action = ACTION_LIST;