]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: remove dependence on libuuid
authorKarel Zak <kzak@redhat.com>
Tue, 22 Jan 2019 11:33:19 +0000 (12:33 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 22 Jan 2019 11:33:19 +0000 (12:33 +0100)
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 <josh@joshtriplett.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/blkid.pc.in
libblkid/src/Makemodule.am
libblkid/src/blkidP.h
libblkid/src/probe.c

index 40ec8a9d77e50ceaccad329092d3b60616893326..3316c6be890a82ddcb3e7fd7177099f39369fbc1 100644 (file)
@@ -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
index 0ecb5579e9e6fbd7eba1ae7df5a81e233b96157a..c5d9426b198f869916334180f21abcf4bbe234a5 100644 (file)
@@ -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
index 2d272f856f543e9914586e24026aadc345fc5e18..f9bbe008406f40e96da36bf5143b8bb9ea8e39db 100644 (file)
@@ -23,9 +23,7 @@
 #include <stdarg.h>
 #include <stdint.h>
 
-#ifdef HAVE_LIBUUID
-# include <uuid.h>
-#else
+#ifndef UUID_STR_LEN
 # define UUID_STR_LEN   37
 #endif
 
index 96aecf38b8e19cbde32112b1448b3ec0819af434..7f0f0eaf54d73b33a65f8922f234e28437968f6e 100644 (file)
@@ -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)