19020 Commits

Author SHA1 Message Date
Arthur Demchenkov
4d0f79e023 Add unit test for flags validation 2018-11-01 10:49:31 +00:00
Arthur Demchenkov
6f8a12ca0f gobject/genums.c: fix flags validation
gint -> glong conversion causes flags to be invalid if the highest bit
is set.

Closes #1572
2018-11-01 10:49:31 +00:00
Ondrej Holy
2daebb93fb Merge branch '326-trash-symlinks-glib-2-58' into 'glib-2-58'
glocalfile: Fix access::can-trash if parent is symlink (backport to glib-2-58)

See merge request GNOME/glib!431
2018-10-31 07:23:04 +00:00
Ondrej Holy
aa5b7206e0 glocalfile: Use MAXSYMLINKS when following symlinks
Currently, readlink() is used only 12 times when expanding symlinks.
However, kernel uses 40 for this purpose and it is defined as MAXSYMLINKS.
Use that constant if available, or 40. See:
https://github.com/torvalds/linux/include/linux/namei.h.
2018-10-30 11:47:23 +00:00
Ondrej Holy
012646ce6b glocalfile: Return NULL if symlink expansion fails
find_mountpoint_for() uses current file in case of error, because
get_parent() returns NULL for error, but also if parent doesn't exist.
Return "." from get_parent() if parent doesn't exist in order to
differentiate the error state.
2018-10-30 11:47:23 +00:00
Ondrej Holy
92f7592ec0 glocalfile: Add test case for symlink expansion
Test symlink expansion in find_mountpoint_for() function over
 _g_local_file_find_topdir_for(). find_mount_for() is crucial for many
of glocalfile.c functionality (e.g. to determine correct trash location)
and symlink expansion has to work properly.

https://gitlab.gnome.org/GNOME/glib/issues/1522
2018-10-30 11:47:23 +00:00
Ondrej Holy
d565484a6a glocalfile: Fix bug uri in trash test
Fix typo in g_test_bug_base and move g_test_bug in the concrete test.
2018-10-30 11:47:23 +00:00
Ondrej Holy
e573582293 glocalfile: Fix access::can-trash if parent is symlink
G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH can be set to a wrong value if
its parent dir is a symlink. This is because the find_mountpoint_for()
function tries to find mountpoint for a filepath and expands symlinks
only in parent dirs. But in this case the path is already parent dir
and needs to be expanded first...

Closes: https://gitlab.gnome.org/GNOME/glib/issues/1522
2018-10-30 11:47:23 +00:00
Philip Withnall
fdf91511b7 Merge branch '373-month-names-glib-2-58' into 'glib-2-58'
tests: Update month name check for Lithuanian locale (backport to glib-2-58)

See merge request GNOME/glib!427
2018-10-29 23:36:46 +00:00
Emmanuele Bassi
bf51470ade tests: Update month name check for Lithuanian locale
Update the abbreviated month name in the test to match the GNU libc
translation, coming from CLDR.

Fixes #1562
2018-10-29 22:24:45 +00:00
Philip Withnall
1211c4503b Merge branch '2-58-339-key-file-free-fix' into 'glib-2-58'
Backport “gkeyfile: remain usable after g_key_file_free()” to glib-2-58

See merge request GNOME/glib!367
2018-10-29 22:21:04 +00:00
Fabio Tomat
aa56c0f9e9 Update Friulian translation 2018-10-27 11:04:33 +00:00
Matej Urbančič
604248b026 Updated Slovenian translation 2018-10-25 21:35:36 +02:00
Marco Trevisan
4f14e614fa Merge branch 'gdbus-peer-again' into 'master'
gdbus-peer: Make sure to not include objectmanager-gen.c source

See merge request GNOME/glib!416

(cherry picked from commit 4d48e020278b6be64ba84be7b8ab388f5ff2b358)

7c70bef8 gdbus-peer: Make sure to not include objectmanager-gen.c source
2018-10-25 12:35:04 +00:00
Philip Withnall
c5ea31846f Merge branch 'objectmanager-src-dep' into 'master'
gio, tests: ensure objectmanager sources are generated

See merge request GNOME/glib!414

(cherry picked from commit 5263b54a06d6289cf8bbaa7870e1eed8b4cd8626)

11e4fcca gio, tests: ensure objectmanager sources are generated
2018-10-25 12:32:28 +00:00
Matej Urbančič
17519e039f Updated Slovenian translation 2018-10-23 16:34:02 +02:00
Simon McVittie
f86cdf7d11 Merge branch 'backports-glib-2-58' into 'glib-2-58'
A couple of minor glib-2-58 backports

See merge request GNOME/glib!409
2018-10-23 10:05:56 +00:00
Philip Withnall
1161ac3bdb Merge branch 'wip/oholy/bind-mounts-stable' into 'glib-2-58'
gunixmounts: Filter out mounts with device path that was repeated

See merge request GNOME/glib!365
2018-10-23 01:53:30 +00:00
Colin Walters
452eb1df01 build-sys: Pass CFLAGS to $(DTRACE)
Fedora is using https://fedoraproject.org/wiki/Changes/Annobin
to try to ensure that all objects are built with hardening flags.
Pass down `CFLAGS` to ensure the SystemTap objects use them.
2018-10-23 14:28:14 +13:00
Fabrice Fontaine
57efb14f05 grefcount: add missing gatomic.h
Without gatomic.h, build fails on:
In file included from garcbox.c:24:0:
garcbox.c: In function ‘g_atomic_rc_box_acquire’:
grefcount.h:101:13: error: implicit declaration of function ‘g_atomic_int_get’; did you mean ‘__atomic_store’? [-Werror=implicit-function-declaration]
     (void) (g_atomic_int_get (rc) == G_MAXINT ? 0 : g_atomic_int_inc ((rc))); \
             ^
garcbox.c:292:3: note: in expansion of macro ‘g_atomic_ref_count_inc’
   g_atomic_ref_count_inc (&real_box->ref_count);

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-10-23 14:26:40 +13:00
Xavier Claessens
a03083ee17 Meson: Fix linking of gdbus-peer test 2018-10-19 10:34:02 -04:00
Xavier Claessens
dcc12e0311 Merge branch 'cherry-pick-5c22b2dd' into 'glib-2-58'
Merge branch '1bit-emufutex-slow' into 'master'

See merge request GNOME/glib!408
2018-10-19 14:04:34 +00:00
Xavier Claessens
4aca783bd7 Merge branch '1bit-emufutex-slow' into 'master'
meson: Mark 1bit-emufutex test as slow

See merge request GNOME/glib!406

(cherry picked from commit 5c22b2ddde21c9080d1a9a090e1945f7a1d4c5f2)

442b54f0 meson: Mark 1bit-emufutex test as slow
2018-10-19 13:37:58 +00:00
Xavier Claessens
8c6ec7615c Merge branch '1543-glib-2-58-backports' into 'glib-2-58'
Resolve "Backport recent Meson/pkg-config/test fixes to glib-2-58"

See merge request GNOME/glib!392
2018-10-19 13:37:17 +00:00
Ondrej Holy
ed88b23fdf gunixmounts: Filter out mounts with device path that was repeated
libmount-based implementation doesn't filter out mounts with device
path that was repeated as it is done with mntent-based implementation.
It causes problems to our volume monitors which are not able to handle
multiple mounts for one device path properly without additional API.
Let's filter out the same mounts as are filtered out with mntent-based
implementation.

This is intended only for stable branches to prevent current issues.

https://gitlab.gnome.org/GNOME/glib/issues/1271
2018-10-17 14:29:45 +02:00
Simon McVittie
34a3ba72c9 m4macros: Fix detection of glib-2.0 alone
We unconditionally appended ">= $min_glib_version" to the modules to
look for, even though we had already included
"glib-2.0 >= $min_glib_version" in our list. When requesting additional
modules, this was fine, for example

    AM_PATH_GLIB_2_0([2.58], [:], [:], [gobject gio])

ended up asking pkg-config for

    glib-2.0 >= 2.58 gobject-2.0 gio-2.0 >= 2.58

which is redundant (since they all share a version number) but
otherwise OK.

However,

    AM_PATH_GLIB_2_0([2.58], [:], [:], [])

ended up asking pkg-config for

    glib-2.0 >= 2.58 >= 2.58

which is not OK; the second ">=" was parsed as a bizarrely-named package
to check for, and obviously few people have ">=.pc" installed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Fixes: 4bb16f48 "m4macros: Allow information from pkg-config to be overridden"
2018-10-11 10:19:52 -04:00
Simon McVittie
19c9081773 m4macros: Allow information from pkg-config to be overridden
By using PKG_CHECK_VAR, we declare $GLIB_COMPILE_SCHEMAS,
$GLIB_GENMARSHAL, $GOBJECT_QUERY, $GLIB_MKENUMS and
$GLIB_COMPILE_RESOURCES as Autoconf "precious variables" with AC_ARG_VAR,
similar to $PKG_CONFIG and $CC, so that they can be put on a configure
command line:

    ./configure GLIB_COMPILE_RESOURCES=my-glib-compile-resources

If they are set to a non-empty value, PKG_CHECK_VAR will use that
instead of auto-detecting from pkg-config, so that builders can
override them, for example when cross-compiling.

Similarly, use the standard PKG_CHECK_MODULES macro to get GLib's CFLAGS
and LIBS.

It's possible that most of the rest of each macro can also disappear,
but for the moment I've given them the benefit of the doubt.

This does result in printing "checking for GLIB" twice (once for
PKG_CHECK_MODULES and once for GLib's custom checks), but if you're
using Autotools, you probably don't have a strong objection to overly
verbose output.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-11 10:19:52 -04:00
Simon McVittie
55b17dccfc Autotools: Move libmount from Libs.private to Requires.private
libmount depends on libblkid, so if we statically link a trivial
executable to GIO, we need to pull in both libmount and libblkid.
Linking with -lmount is not enough to achieve that, but recursing
into mount.pc is.

This makes the Autotools build a bit more like the Meson build,
which already puts mount in Requires.private.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 20:37:49 -04:00
Simon McVittie
c9f5eefa10 Autotools: Always run glib-genmarshal, even if cross-compiling
glib-genmarshal is now written in Python rather than C, so we can
always run it directly, even if we're cross-compiling for an
architecture whose binaries we can't run. This matches the behaviour
of the Meson build system.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1546
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908334
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 20:37:24 -04:00
Ryan Schmidt
6f3241f010 Fix build failure on systems without spawn.h 2018-10-10 13:51:07 -04:00
Simon McVittie
d757bd84d1 Meson: Extract objects from convenience libraries to link them
This avoids the convenience library being treated as though it was
an installed static library (objects not included in the dependent
static library, and convenience library being listed in the pkg-config
metadata), both of which would make static linking impossible.
This is a workaround for meson not having
https://github.com/mesonbuild/meson/pull/3939 merged yet.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1536
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
c733f161a1 Tests: Mark printf wrappers with G_GNUC_PRINTF
If we tell clang that we're passing the arguments on to a compatible
printf call, it can see that we're doing it right, and won't warn us
about -Wformat-nonliteral. This follows up from commit abac67c0.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Xavier Claessens
067d4b47c4 Meson: appinfo tests are racy if run in parallel 2018-10-10 13:51:07 -04:00
Simon McVittie
41bd74dfa4 Generate gtester-report from .in file
Previously, it was installed unmodified by the Meson build system.

We don't need to define @bindir@, because gtester-report never
actually referred to it. We also don't need a definition of
GTESTER_REPORT for use by GLib itself, because its last use was removed
in 2013 (https://bugzilla.gnome.org/show_bug.cgi?id=709995).

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1544
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
e704c23c21 Spelling: Fix spelling of "interpreted"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
6c806c2a60 Spelling: avoid the "allows to" pattern
This is detected by Debian's Lintian tool, which suggests
"allows one to" as a replacement. I've rephrased the documentation
in question to avoid both of those.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
31d2273163 Spelling: Fix spelling of "unknown"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
cc3d955536 Spelling: Fix spelling of "constructed"
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
ff2b5d3383 Spelling: Fix spelling of "similarly"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
a915c7b3dd Spelling: Fix a common en_FR spelling of "information"
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:07 -04:00
Simon McVittie
8e62a5d4ad Spelling: fix spelling of specify
Detected by Debian's Lintian tool.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:06 -04:00
Simon McVittie
419d823977 Spelling: fix "every time"
Detected by Debian's Lintian tool.

Also fix the spelling of "linking" in one error message.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:06 -04:00
Xavier Claessens
ae5bca2394 Meson: Do not run tests/refcount with --tap
This is a partial revert of a change introduced in cbc7fbbf7.
2018-10-10 13:51:06 -04:00
Simon McVittie
59f8519ba9 meson: Run build-time tests with --tap where supported
This makes it easier to debug test failures, by ensuring that g_debug()
and g_test_message() are printed as TAP diagnostics.

Fixes: https://gitlab.gnome.org/GNOME/glib/issues/1528
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:06 -04:00
Xavier Claessens
7723eba45e Meson: Install timeloop-closure test 2018-10-10 13:51:06 -04:00
Xavier Claessens
2c5bc252dd Meson: doc: fix cross references 2018-10-10 13:51:06 -04:00
Xavier Claessens
ac7534fe10 Meson: Run in TAP mode installed tests that support it 2018-10-10 13:51:06 -04:00
Xavier Claessens
aa02dac84f Meson: define G_HAVE_GROWING_STACK to 0 or 1 2018-10-10 13:51:06 -04:00
Simon McVittie
9cde3b2709 Remove unnecessary +x permissions
None of these files starts with a #! line, and they are not native
binary executables, so if a user attempts to execute them as a program,
Unix shells will run them as /bin/sh scripts. This is not going to end
well, since none of them are shell scripts (the gio bash completion
is for bash, which is not a lowest-common-denominator POSIX shell, and
in any case is designed to be sourced rather than executed).

Fixes: #1539
Signed-off-by: Simon McVittie <smcv@collabora.com>
2018-10-10 13:51:06 -04:00
Xavier Claessens
5038346035 Tests: Fix -Wformat-nonliteral causing build failure with clang 2018-10-10 13:51:06 -04:00