diff options
| -rw-r--r-- | meta-gnome/recipes-gnome/gthumb/gthumb/283c9483afd1215378c8b9871f51cd61770e53e7.patch | 49 | ||||
| -rw-r--r-- | meta-gnome/recipes-gnome/gthumb/gthumb_3.12.7.bb (renamed from meta-gnome/recipes-gnome/gthumb/gthumb_3.12.6.bb) | 3 |
2 files changed, 1 insertions, 51 deletions
diff --git a/meta-gnome/recipes-gnome/gthumb/gthumb/283c9483afd1215378c8b9871f51cd61770e53e7.patch b/meta-gnome/recipes-gnome/gthumb/gthumb/283c9483afd1215378c8b9871f51cd61770e53e7.patch deleted file mode 100644 index c2dbce0c14..0000000000 --- a/meta-gnome/recipes-gnome/gthumb/gthumb/283c9483afd1215378c8b9871f51cd61770e53e7.patch +++ /dev/null | |||
| @@ -1,49 +0,0 @@ | |||
| 1 | From b48e34c436eb59877b0fe75ba3bf724c0de4dc36 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pino Toscano <toscano.pino@tiscali.it> | ||
| 3 | Date: Sat, 7 Sep 2024 09:40:49 +0200 | ||
| 4 | Subject: [PATCH] migrate-catalogs: properly use time_t for localtime() | ||
| 5 | |||
| 6 | Commit ed219c771bc0c63e1a7847e44c81f43223454eac changed the type of the | ||
| 7 | 'date' variable from 'time_t' to 'long', to ensure the right type is | ||
| 8 | handled by sscanf(). The problem is that, in case 'time_t' is not the | ||
| 9 | same as 'long', the wrong pointer is passed to localtime(), and more | ||
| 10 | strict build flags (such as the defaults of GCC 14) cause the build to | ||
| 11 | fail on such setups. | ||
| 12 | |||
| 13 | The ideal fix in this case would be to switch back the 'date' variable | ||
| 14 | to 'time_t' and use the right format specifier for it in sscanf(); | ||
| 15 | however, since this is an helper to convert very old format, this | ||
| 16 | additional code is not much worth it. Hence, use a simpler fix: in case | ||
| 17 | a date timestamp was read from the file, set it to a new 'time_t' | ||
| 18 | variable which is then used for localtime(). Since 'time_t' is big at | ||
| 19 | least as much as 'long', there is no precision/value loss. | ||
| 20 | |||
| 21 | There should be no behaviour change. | ||
| 22 | |||
| 23 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/gthumb/-/commit/283c9483afd1215378c8b9871f51cd61770e53e7] | ||
| 24 | --- | ||
| 25 | gthumb/main-migrate-catalogs.c | 3 ++- | ||
| 26 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 27 | |||
| 28 | diff --git a/gthumb/main-migrate-catalogs.c b/gthumb/main-migrate-catalogs.c | ||
| 29 | index 75f5cb11d..e194ed19f 100644 | ||
| 30 | --- a/gthumb/main-migrate-catalogs.c | ||
| 31 | +++ b/gthumb/main-migrate-catalogs.c | ||
| 32 | @@ -308,12 +308,13 @@ migration_for_each_file (GFile *file, | ||
| 33 | sscanf (line, "%d", &date_scope); | ||
| 34 | |||
| 35 | if ((date > 0) && (date_scope >= 1) && (date_scope <= 3)) { | ||
| 36 | + time_t date_as_time = date; | ||
| 37 | struct tm *tm; | ||
| 38 | GthDateTime *dt; | ||
| 39 | char *exif_date; | ||
| 40 | char *op; | ||
| 41 | |||
| 42 | - tm = localtime (&date); | ||
| 43 | + tm = localtime (&date_as_time); | ||
| 44 | dt = gth_datetime_new (); | ||
| 45 | gth_datetime_from_struct_tm (dt, tm); | ||
| 46 | exif_date = gth_datetime_to_exif_date (dt); | ||
| 47 | -- | ||
| 48 | GitLab | ||
| 49 | |||
diff --git a/meta-gnome/recipes-gnome/gthumb/gthumb_3.12.6.bb b/meta-gnome/recipes-gnome/gthumb/gthumb_3.12.7.bb index 8917178582..ed5382035f 100644 --- a/meta-gnome/recipes-gnome/gthumb/gthumb_3.12.6.bb +++ b/meta-gnome/recipes-gnome/gthumb/gthumb_3.12.7.bb | |||
| @@ -28,7 +28,6 @@ EXTRA_OEMESON += "-Dwebservices=false -Dlibsecret=false" | |||
| 28 | 28 | ||
| 29 | inherit gnomebase gnome-help gsettings itstool mime-xdg | 29 | inherit gnomebase gnome-help gsettings itstool mime-xdg |
| 30 | 30 | ||
| 31 | SRC_URI += "file://283c9483afd1215378c8b9871f51cd61770e53e7.patch" | 31 | SRC_URI[archive.sha256sum] = "ee12d24cf231010241f758d6c95b9d53a7381278fa76b6a518b3d09b371efaec" |
| 32 | SRC_URI[archive.sha256sum] = "608770c6c8e73073a1d404b65bd1b761e1ac5dc25e70130ff072488fa92f5c33" | ||
| 33 | 32 | ||
| 34 | FILES:${PN} += "${datadir}/metainfo" | 33 | FILES:${PN} += "${datadir}/metainfo" |
