From c2435b946f574880201cb41d989d8d63d4bbf87d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 22 Jan 2019 12:33:19 +0100 Subject: [PATCH] libblkid: remove dependence on libuuid Currently we use libuuid to print UUID only. This code is possible to replace by one snprintf(). It seems better to duplicate this one snprintf than force all distros to keep libuuid together with libblkid. Note, this scenario has been already supported on --disable-libuuid. Reported-by: Josh Triplett Signed-off-by: Karel Zak --- libblkid/blkid.pc.in | 1 - libblkid/src/Makemodule.am | 11 ----------- libblkid/src/blkidP.h | 4 +--- libblkid/src/probe.c | 8 -------- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/libblkid/blkid.pc.in b/libblkid/blkid.pc.in index 40ec8a9d77..3316c6be89 100644 --- a/libblkid/blkid.pc.in +++ b/libblkid/blkid.pc.in @@ -6,6 +6,5 @@ includedir=@includedir@ Name: blkid Description: Block device id library Version: @LIBBLKID_VERSION@ -Requires.private: uuid Cflags: -I${includedir}/blkid Libs: -L${libdir} -lblkid diff --git a/libblkid/src/Makemodule.am b/libblkid/src/Makemodule.am index 0ecb5579e9..c5d9426b19 100644 --- a/libblkid/src/Makemodule.am +++ b/libblkid/src/Makemodule.am @@ -126,11 +126,6 @@ libblkid_la_CFLAGS = \ -I$(ul_libblkid_incdir) \ -I$(top_srcdir)/libblkid/src -if BUILD_LIBUUID -libblkid_la_LIBADD += libuuid.la -libblkid_la_CFLAGS += -I$(ul_libuuid_incdir) -endif - libblkid_la_LDFLAGS = $(SOLIB_LDFLAGS) if HAVE_VSCRIPT libblkid_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(top_srcdir)/libblkid/src/libblkid.sym @@ -157,12 +152,6 @@ check_PROGRAMS += \ blkid_tests_cflags = -DTEST_PROGRAM $(libblkid_la_CFLAGS) blkid_tests_ldflags = blkid_tests_ldadd = libblkid.la - -if BUILD_LIBUUID -blkid_tests_ldflags += libuuid.la -blkid_tests_ldadd += $(LDADD) -endif - blkid_tests_ldflags += -static test_blkid_cache_SOURCES = libblkid/src/cache.c diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h index 2d272f856f..f9bbe00840 100644 --- a/libblkid/src/blkidP.h +++ b/libblkid/src/blkidP.h @@ -23,9 +23,7 @@ #include #include -#ifdef HAVE_LIBUUID -# include -#else +#ifndef UUID_STR_LEN # define UUID_STR_LEN 37 #endif diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index 96aecf38b8..7f0f0eaf54 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -1886,13 +1886,6 @@ struct blkid_prval *__blkid_probe_lookup_value(blkid_probe pr, const char *name) /* converts DCE UUID (uuid[16]) to human readable string * - the @len should be always 37 */ -#ifdef HAVE_LIBUUID -void blkid_unparse_uuid(const unsigned char *uuid, char *str, - size_t len __attribute__((__unused__))) -{ - uuid_unparse(uuid, str); -} -#else void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len) { snprintf(str, len, @@ -1903,7 +1896,6 @@ void blkid_unparse_uuid(const unsigned char *uuid, char *str, size_t len) uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14],uuid[15]); } -#endif /* like uuid_is_null() from libuuid, but works with arbitrary size of UUID */ int blkid_uuid_is_empty(const unsigned char *buf, size_t len) -- 2.47.3