From 79c333899d318bf9b1eec3837833c7f0229d1906 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 1 Sep 2019 14:11:51 +0200 Subject: Move some application specific stuff out of libutil This commit does the following: - canonicalize_name is moved to libfstree - source_date_epoch is only used inside libfstree, so it's also moved over and can later be completely internalized - print_version is moved over to sqfshelper. Mainly so it doesn't end up in libsquashfs.so for no sane reason. Signed-off-by: David Oberhollenzer --- lib/sqfshelper/print_version.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 lib/sqfshelper/print_version.c (limited to 'lib/sqfshelper') diff --git a/lib/sqfshelper/print_version.c b/lib/sqfshelper/print_version.c new file mode 100644 index 0000000..b23e2bd --- /dev/null +++ b/lib/sqfshelper/print_version.c @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-3.0-or-later */ +/* + * print_version.c + * + * Copyright (C) 2019 David Oberhollenzer + */ +#include "config.h" + +#include "util.h" + +#include + +#define LICENSE_SHORT "GPLv3+" +#define LICENSE_LONG "GNU GPL version 3 or later" +#define LICENSE_URL "https://gnu.org/licenses/gpl.html" + +extern char *__progname; + +static const char *version_string = +"%s (%s) %s\n" +"Copyright (c) 2019 David Oberhollenzer et al\n" +"License " LICENSE_SHORT ": " LICENSE_LONG " <" LICENSE_URL ">.\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n"; + +void print_version(void) +{ + printf(version_string, __progname, PACKAGE_NAME, PACKAGE_VERSION); +} -- cgit v1.2.3