]> err.no Git - util-linux/commitdiff
blkid: start to use ABI versioning
authorKarel Zak <kzak@redhat.com>
Tue, 10 Feb 2009 16:20:11 +0000 (17:20 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 13 Feb 2009 10:36:59 +0000 (11:36 +0100)
The library ABI and API is backwardly compatible, so it does not
make sense to change the library SONAME. This patch adds a symbol
versioning, naming paradigm is:

BLKID_<maj>.<min>

The original libblkid from e2fsprogs uses "1.0" as a .so version and
"libblkid.1" as a SONAME for all time (at least according to stuff in
/lib/libblkid*)

And the original library is without symbols versioning. It means that
many private functions are exported to applications ;-(

Note that the original blkid_get_library_version() returns
E2FSPROGS_VERSION. The version in util-linux-ng returns BLKID_VERSION
which is <maj>.<min>.<rel>. The <maj>.<min> is the same version as we
use for ABI. This concept seems less confusing than mix a library
version and package version.

Summary:

OLD (e2fsprogs):
  ABI versioning:              -none-
  SONAME:                      libblkid.1
  .so version:                 libblkid.so.1.0
  blkid_get_library_version(): @E2FSPROGS_VERSION@ (e.g. 1.41.1)

NEW (util-linux-ng):
  ABI versioning:              BLKID_<maj>.<min>
  SONAME:                      libblkid.1
  .so version:                 libblkid.so.<maj.<min> (e.g. 1.41)
  blkid_get_library_version(): @BLKID_VERSION@ (e.g. 1.41.1)

  (BLKID_VERSION = <maj>.<min>.<rel>)

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
libs/blkid/bin/blkid.c
libs/blkid/src/blkid.sym

index 2af03d9db7f704fd4eea0d687b872db5b84ff5f4..dc8374de083cf0e985f701c07282ace8aa16c6dd 100644 (file)
@@ -10,12 +10,13 @@ AC_CONFIG_SRCDIR(mount/mount.c)
 
 AC_PREFIX_DEFAULT([/usr])
 
-dnl libblkid version definition
-dnl -----------------------------
+dnl blkid version definition (the library SONAME is
+dnl "libblkid.so.$BLKID_VERSION_MAJOR", see blkid/Makefile.am)
+dnl ----------------------------------------------------------
 BLKID_VERSION_MAJOR=1
-BLKID_VERSION_MINOR=41
+BLKID_VERSION_MINOR=42
 BLKID_VERSION_RELEASE=0
-BLKID_DATE="10-Jul-2008"
+BLKID_DATE="10-Feb-2009"
 
 BLKID_VERSION=$BLKID_VERSION_MAJOR.$BLKID_VERSION_MINOR.$BLKID_VERSION_RELEASE
 
index 3d29d03cb5f04849403f88656cd393338b9c5a2b..f0852e45e648d4a7bef6c7acee9af02d2aaec24c 100644 (file)
@@ -44,7 +44,8 @@ const char *progname = "blkid";
 
 static void print_version(FILE *out)
 {
-       fprintf(out, "%s %s (%s)\n", progname, BLKID_VERSION, BLKID_DATE);
+       fprintf(out, "%s from %s (libblkid %s, %s)\n",
+               progname, PACKAGE_STRING, BLKID_VERSION, BLKID_DATE);
 }
 
 static void usage(int error)
index 26ecfe582ea76f0f355e59640dc45e048188065b..e08df0f523e2620aeceb722370fa6f22397d0065 100644 (file)
@@ -1,4 +1,13 @@
-{ global:
+/*
+ * The symbol versioning ensures that a new application requiring symbol foo()
+ * can't run with old libblkid.so not providing foo() - the global SONAME
+ * version info can't enforce this since we never change the SONAME.
+ *
+ * The original libblkid (.so version 1.0) from e2fsprogs does not to use
+ * symbol versioning -- all the original symbols are in BLKID_1.0 now.
+ */
+BLKID_1.0 {
+global:
        blkid_dev_devname;
        blkid_dev_has_tag;
        blkid_dev_iterate_begin;
@@ -6,12 +15,7 @@
        blkid_dev_next;
        blkid_devno_to_devname;
        blkid_dev_set_search;
-       blkid_do_probe;
-       blkid_do_safeprobe;
-       blkid_encode_string;
-       blkid_evaluate_spec;
        blkid_find_dev_with_tag;
-       blkid_free_probe;
        blkid_gc_cache;
        blkid_get_cache;
        blkid_get_dev;
        blkid_get_library_version;
        blkid_get_tag_value;
        blkid_known_fstype;
-       blkid_new_probe;
        blkid_parse_tag_string;
        blkid_parse_version_string;
        blkid_probe_all;
        blkid_probe_all_new;
+       blkid_put_cache;
+       blkid_tag_iterate_begin;
+       blkid_tag_iterate_end;
+       blkid_tag_next;
+       blkid_verify;
+local:
+       *;
+};
+
+
+/*
+ * util-linux-ng version(s)
+ */
+BLKID_1.42 {
+global:
+       blkid_do_probe;
+       blkid_do_safeprobe;
+       blkid_encode_string;
+       blkid_evaluate_spec;
+       blkid_free_probe;
+       blkid_new_probe;
+       blkid_probe_all;
+       blkid_probe_all_new;
        blkid_probe_filter_types;
        blkid_probe_filter_usage;
        blkid_probe_get_value;
        blkid_probe_reset_filter;
        blkid_probe_set_device;
        blkid_probe_set_request;
-       blkid_put_cache;
        blkid_reset_probe;
        blkid_safe_string;
        blkid_send_uevent;
-       blkid_tag_iterate_begin;
-       blkid_tag_iterate_end;
-       blkid_tag_next;
-       blkid_verify;
-local:
-       *;
-};
+} BLKID_1.0;
+