[ostree] Use libglnx



commit 965a304a17ea64da1705dbfdca83210aa979ca36
Author: Colin Walters <walters verbum org>
Date:   Tue Feb 17 17:38:36 2015 -0500

    Use libglnx
    
    Starting down the path of not using libgsystem.  The main win here
    will be code sharing between ostree/rpm-ostree as well as going down
    the path of not using GFile * for local files.

 .gitignore                       |    1 +
 .gitmodules                      |    3 +++
 Makefile-libostree.am            |    4 ++--
 Makefile-ostree.am               |    4 ++--
 Makefile-otutil.am               |    2 +-
 Makefile.am                      |    6 ++++++
 autogen.sh                       |    8 +++++++-
 libglnx                          |    1 +
 src/libostree/ostree-core.c      |    3 ++-
 src/libotutil/ot-variant-utils.c |    2 +-
 src/libotutil/otutil.h           |    1 +
 src/ostree/ot-admin-functions.c  |    2 +-
 src/ostree/ot-main.c             |    4 +++-
 13 files changed, 31 insertions(+), 10 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f0a6679..00f5cfc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 # Standard C/Automake goo
 .deps
 .libs
+.dirstamp
 *.typelib
 *.la
 *.lo
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..e5084af
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "libglnx"]
+       path = libglnx
+       url = https://git.gnome.org/browse/libglnx
diff --git a/Makefile-libostree.am b/Makefile-libostree.am
index a8ba8bc..241b91d 100644
--- a/Makefile-libostree.am
+++ b/Makefile-libostree.am
@@ -106,10 +106,10 @@ libostree_1_la_SOURCES += \
        $(NULL)
 endif
 
-libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree \
+libostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree 
\
        $(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_DEP_LZMA_CFLAGS)
 libostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -export-symbols-regex '^ostree_'
-libostree_1_la_LIBADD = libotutil.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) 
$(OT_DEP_LZMA_LIBS)
+libostree_1_la_LIBADD = libotutil.la libglnx.la libostree-kernel-args.la $(OT_INTERNAL_GIO_UNIX_LIBS) 
$(OT_DEP_LZMA_LIBS)
 
 if USE_LIBARCHIVE
 libostree_1_la_CFLAGS += $(OT_DEP_LIBARCHIVE_CFLAGS)
diff --git a/Makefile-ostree.am b/Makefile-ostree.am
index 8aed75b..95cf677 100644
--- a/Makefile-ostree.am
+++ b/Makefile-ostree.am
@@ -75,9 +75,9 @@ ostree_SOURCES += \
 
 ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree 
-I$(srcdir)/src/ostree \
        $(NULL)
-ostree_bin_shared_ldadd = libotutil.la libostree-kernel-args.la libostree-1.la
+ostree_bin_shared_ldadd = libglnx.la libotutil.la libostree-kernel-args.la libostree-1.la
 
-ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS) -I$(srcdir)/libglnx
 ostree_LDADD = $(ostree_bin_shared_ldadd) $(OT_INTERNAL_GIO_UNIX_LIBS)
 
 if USE_LIBSOUP
diff --git a/Makefile-otutil.am b/Makefile-otutil.am
index ffd38e0..586f6d9 100644
--- a/Makefile-otutil.am
+++ b/Makefile-otutil.am
@@ -41,5 +41,5 @@ libotutil_la_SOURCES = \
        src/libotutil/otutil.c \
        src/libotutil/otutil.h \
        $(NULL)
-libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" 
$(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil 
-DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
 libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
diff --git a/Makefile.am b/Makefile.am
index e02177d..c2190c9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -46,6 +46,12 @@ GIRS =
 TYPELIBS = $(GIRS:.gir=.typelib)
 endif
 
+libglnx_srcpath := $(srcdir)/libglnx
+libglnx_cflags := $(OT_DEP_GIO_UNIX_CFLAGS) "-I$(libglnx_srcpath)"
+libglnx_libs := $(OT_DEP_GIO_UNIX_LIBS)
+include libglnx/Makefile-libglnx.am.inc
+noinst_LTLIBRARIES += libglnx.la
+
 include Makefile-otutil.am
 include Makefile-libostree.am
 include Makefile-ostree.am
diff --git a/autogen.sh b/autogen.sh
index fe690e9..cff4de6 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -28,7 +28,13 @@ else
         gtkdocize || exit $?
 fi
 
+cd $olddir
+if ! test -f libglnx/README.md; then
+    git submodule update --init
+fi
+# Workaround automake bug with subdir-objects and computed paths
+sed -e 's,$(libglnx_srcpath),'${srcdir}/libglnx, < libglnx/Makefile-libglnx.am 
libglnx/Makefile-libglnx.am.inc
+
 autoreconf --force --install --verbose
 
-cd $olddir
 test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/libglnx b/libglnx
new file mode 160000
index 0000000..20b507d
--- /dev/null
+++ b/libglnx
@@ -0,0 +1 @@
+Subproject commit 20b507de5c14df8da678d48f9028fe61340c390d
diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c
index 6a72251..9a4aa0f 100644
--- a/src/libostree/ostree-core.c
+++ b/src/libostree/ostree-core.c
@@ -31,6 +31,7 @@
 #include "ostree-chain-input-stream.h"
 #include "otutil.h"
 #include "libgsystem.h"
+#include "libglnx.h"
 
 #define ALIGN_VALUE(this, boundary) \
   (( ((unsigned long)(this)) + (((unsigned long)(boundary)) -1)) & (~(((unsigned long)(boundary))-1)))
@@ -209,7 +210,7 @@ file_header_new (GFileInfo         *file_info,
   guint32 mode;
   const char *symlink_target;
   GVariant *ret;
-  gs_unref_variant GVariant *tmp_xattrs = NULL;
+  g_autoptr(GVariant) tmp_xattrs = NULL;
 
   uid = g_file_info_get_attribute_uint32 (file_info, "unix::uid");
   gid = g_file_info_get_attribute_uint32 (file_info, "unix::gid");
diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c
index c855416..7aa4274 100644
--- a/src/libotutil/ot-variant-utils.c
+++ b/src/libotutil/ot-variant-utils.c
@@ -133,7 +133,7 @@ ot_util_variant_map (GFile              *src,
                      GError            **error)
 {
   gboolean ret = FALSE;
-  gs_unref_variant GVariant *ret_variant = NULL;
+  g_autoptr(GVariant) ret_variant = NULL;
   GMappedFile *mfile = NULL;
 
   mfile = gs_file_map_noatime (src, NULL, error);
diff --git a/src/libotutil/otutil.h b/src/libotutil/otutil.h
index c78a9c6..6d76459 100644
--- a/src/libotutil/otutil.h
+++ b/src/libotutil/otutil.h
@@ -26,6 +26,7 @@
 #include <libgsystem.h>
 #include <string.h> /* Yeah...let's just do that here. */
 #include <gsystem-local-alloc.h>
+#include <libglnx.h>
 
 #define ot_gobject_refz(o) (o ? g_object_ref (o) : o)
 
diff --git a/src/ostree/ot-admin-functions.c b/src/ostree/ot-admin-functions.c
index 36b9661..78ef8b1 100644
--- a/src/ostree/ot-admin-functions.c
+++ b/src/ostree/ot-admin-functions.c
@@ -61,7 +61,7 @@ ot_admin_require_booted_deployment_or_osname (OstreeSysroot       *sysroot,
 char *
 ot_admin_checksum_version (GVariant *checksum)
 {
-  gs_unref_variant GVariant *metadata = NULL;
+  g_autoptr(GVariant) metadata = NULL;
   const char *ret = NULL;
 
   metadata = g_variant_get_child_value (checksum, 0);
diff --git a/src/ostree/ot-main.c b/src/ostree/ot-main.c
index a69927d..c48a03c 100644
--- a/src/ostree/ot-main.c
+++ b/src/ostree/ot-main.c
@@ -27,6 +27,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <libglnx.h>
+
 #include "ostree.h"
 #include "ot-main.h"
 #include "otutil.h"
@@ -230,7 +232,7 @@ ostree_option_context_parse (GOptionContext *context,
                              GCancellable *cancellable,
                              GError **error)
 {
-  gs_unref_object OstreeRepo *repo = NULL;
+  glnx_unref_object OstreeRepo *repo = NULL;
   gboolean success = FALSE;
 
   /* Entries are listed in --help output in the order added.  We add the


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]