diff --git a/configure.ac b/configure.ac index 4831bcc4..558a590f 100644 --- a/configure.ac +++ b/configure.ac @@ -54,7 +54,7 @@ AM_PATH_GLIB_2_0 dnl When bumping the gio-unix-2.0 dependency (or glib-2.0 in general), dnl remember to bump GLIB_VERSION_MIN_REQUIRED and dnl GLIB_VERSION_MAX_ALLOWED in Makefile.am -GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0 libgsystem >= 2015.1" +GIO_DEPENDENCY="gio-unix-2.0 >= 2.40.0" PKG_CHECK_MODULES(OT_DEP_GIO_UNIX, $GIO_DEPENDENCY) dnl 5.1.0 is an arbitrary version here diff --git a/libglnx b/libglnx index 871617d5..4ae5e3be 160000 --- a/libglnx +++ b/libglnx @@ -1 +1 @@ -Subproject commit 871617d51984604e28483d959e37fd6ce4524b0e +Subproject commit 4ae5e3beaaa674abfabf7404ab6fafcc4ec547db diff --git a/packaging/ostree.spec.in b/packaging/ostree.spec.in index 2f07f0a8..eff0f353 100644 --- a/packaging/ostree.spec.in +++ b/packaging/ostree.spec.in @@ -15,7 +15,6 @@ BuildRequires: gtk-doc # Core requirements BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(libsoup-2.4) -BuildRequires: pkgconfig(libgsystem) BuildRequires: pkgconfig(e2p) # Extras BuildRequires: pkgconfig(libarchive) diff --git a/src/libotutil/ot-fs-utils.c b/src/libotutil/ot-fs-utils.c index 46a0405b..4575effe 100644 --- a/src/libotutil/ot-fs-utils.c +++ b/src/libotutil/ot-fs-utils.c @@ -21,7 +21,6 @@ #include "config.h" #include "ot-fs-utils.h" -#include "libgsystem.h" #include "libglnx.h" #include #include diff --git a/src/libotutil/ot-gio-utils.c b/src/libotutil/ot-gio-utils.c index a7fe74cf..683fa48e 100644 --- a/src/libotutil/ot-gio-utils.c +++ b/src/libotutil/ot-gio-utils.c @@ -463,3 +463,39 @@ ot_file_enumerator_iterate (GFileEnumerator *direnum, } #endif + +G_LOCK_DEFINE_STATIC (pathname_cache); + +/** + * ot_file_get_path_cached: + * + * Like g_file_get_path(), but returns a constant copy so callers + * don't need to free the result. + */ +const char * +ot_file_get_path_cached (GFile *file) +{ + const char *path; + static GQuark _file_path_quark = 0; + + if (G_UNLIKELY (_file_path_quark) == 0) + _file_path_quark = g_quark_from_static_string ("gsystem-file-path"); + + G_LOCK (pathname_cache); + + path = g_object_get_qdata ((GObject*)file, _file_path_quark); + if (!path) + { + path = g_file_get_path (file); + if (path == NULL) + { + G_UNLOCK (pathname_cache); + return NULL; + } + g_object_set_qdata_full ((GObject*)file, _file_path_quark, (char*)path, (GDestroyNotify)g_free); + } + + G_UNLOCK (pathname_cache); + + return path; +} diff --git a/src/libotutil/ot-gio-utils.h b/src/libotutil/ot-gio-utils.h index 030acac6..0d3c45d2 100644 --- a/src/libotutil/ot-gio-utils.h +++ b/src/libotutil/ot-gio-utils.h @@ -115,4 +115,14 @@ ot_file_enumerator_iterate (GFileEnumerator *direnum, #endif #define g_file_enumerator_iterate ot_file_enumerator_iterate +const char * +ot_file_get_path_cached (GFile *file); + +static inline +const char * +gs_file_get_path_cached (GFile *file) +{ + return ot_file_get_path_cached (file); +} + G_END_DECLS diff --git a/src/libotutil/otutil.h b/src/libotutil/otutil.h index 6790d8ff..ec516f65 100644 --- a/src/libotutil/otutil.h +++ b/src/libotutil/otutil.h @@ -23,9 +23,7 @@ #pragma once #include -#include #include /* Yeah...let's just do that here. */ -#include #include #define ot_gobject_refz(o) (o ? g_object_ref (o) : o) diff --git a/src/ostree/ot-editor.c b/src/ostree/ot-editor.c index 66c6e7be..bb0dd3c2 100644 --- a/src/ostree/ot-editor.c +++ b/src/ostree/ot-editor.c @@ -23,8 +23,8 @@ #include "config.h" #include "libglnx.h" +#include "otutil.h" #include "ot-editor.h" -#include "libgsystem.h" #include #include diff --git a/tests/ci-install.sh b/tests/ci-install.sh index ecd03b58..4aff39e9 100755 --- a/tests/ci-install.sh +++ b/tests/ci-install.sh @@ -31,25 +31,6 @@ case "$ci_distro" in ;; esac -case "$ci_suite" in - (jessie) - # Add alexl's Debian 8 backport repository to get libgsystem - # TODO: remove this when libgsystem is no longer needed - $sudo apt-get -y update - $sudo apt-get -y install apt-transport-https wget - wget -O - https://sdk.gnome.org/apt/debian/conf/alexl.gpg.key | $sudo apt-key add - - echo "deb [arch=amd64] https://sdk.gnome.org/apt/debian/ jessie main" | $sudo tee /etc/apt/sources.list.d/flatpak.list - ;; - - (trusty|xenial) - # Add alexl's Flatpak PPA, again to get libgsystem - # TODO: remove this when libgsystem is no longer needed - $sudo apt-get -y update - $sudo apt-get -y install software-properties-common - $sudo add-apt-repository --yes ppa:alexlarsson/flatpak - ;; -esac - case "$ci_distro" in (debian|ubuntu) # TODO: fetch this list from the Debian packaging git repository? @@ -77,7 +58,6 @@ case "$ci_distro" in libgirepository1.0-dev \ libglib2.0-dev \ libgpgme11-dev \ - libgsystem-dev \ liblzma-dev \ libmount-dev \ libselinux1-dev \ diff --git a/tests/test-checksum.c b/tests/test-checksum.c index e7fd7be4..9537804d 100644 --- a/tests/test-checksum.c +++ b/tests/test-checksum.c @@ -21,7 +21,6 @@ #include "config.h" #include "libglnx.h" -#include "libgsystem.h" #include #include #include diff --git a/tests/test-gpg-verify-result.c b/tests/test-gpg-verify-result.c index e2cb48a7..d2c1ff66 100644 --- a/tests/test-gpg-verify-result.c +++ b/tests/test-gpg-verify-result.c @@ -20,8 +20,8 @@ #include "config.h" -#include #include +#include "libglnx.h" #include "ostree-gpg-verify-result-private.h"