137 lines
4.7 KiB
Diff
137 lines
4.7 KiB
Diff
diff -Naur AppStream-1.0.2.orig/meson.build AppStream-1.0.2/meson.build
|
|
--- AppStream-1.0.2.orig/meson.build 2024-02-25 03:23:01.000000000 +0600
|
|
+++ AppStream-1.0.2/meson.build 2024-06-04 18:34:21.248471767 +0600
|
|
@@ -156,10 +156,10 @@
|
|
#
|
|
# Dependencies
|
|
#
|
|
-glib_dep = dependency('glib-2.0', version: '>= 2.62')
|
|
-gobject_dep = dependency('gobject-2.0', version: '>= 2.62')
|
|
-gio_dep = dependency('gio-2.0', version: '>= 2.62')
|
|
-curl_dep = dependency('libcurl', version: '>= 7.62')
|
|
+glib_dep = dependency('glib-2.0', version: '>= 2.56')
|
|
+gobject_dep = dependency('gobject-2.0', version: '>= 2.56')
|
|
+gio_dep = dependency('gio-2.0', version: '>= 2.56')
|
|
+curl_dep = dependency('libcurl', version: '>= 7.60')
|
|
xml2_dep = dependency('libxml-2.0')
|
|
yaml_dep = dependency('yaml-0.1')
|
|
xmlb_dep = dependency('xmlb', version: '>= 0.3.14',
|
|
@@ -179,7 +179,7 @@
|
|
if get_option ('gir')
|
|
# ensure we have a version of GIR that isn't broken with Meson
|
|
# (prior versions failed when any non-GObject library was linked)
|
|
- dependency('gobject-introspection-1.0', version: '>=1.56')
|
|
+ dependency('gobject-introspection-1.0', version: '>=1.54')
|
|
endif
|
|
|
|
stemmer_inc_dirs = include_directories()
|
|
diff -Naur AppStream-1.0.2.orig/src/as-release.c AppStream-1.0.2/src/as-release.c
|
|
--- AppStream-1.0.2.orig/src/as-release.c 2024-02-25 03:23:01.000000000 +0600
|
|
+++ AppStream-1.0.2/src/as-release.c 2024-06-04 18:54:18.132967181 +0600
|
|
@@ -362,13 +362,14 @@
|
|
as_release_set_timestamp (AsRelease *release, guint64 timestamp)
|
|
{
|
|
AsReleasePrivate *priv = GET_PRIVATE (release);
|
|
- g_autoptr(GDateTime) time = g_date_time_new_from_unix_utc (timestamp);
|
|
-
|
|
- g_return_if_fail (AS_IS_RELEASE (release));
|
|
+ GTimeVal time;
|
|
|
|
priv->timestamp = timestamp;
|
|
+ time.tv_sec = priv->timestamp;
|
|
+ time.tv_usec = 0;
|
|
+
|
|
g_free (priv->date);
|
|
- priv->date = g_date_time_format_iso8601 (time);
|
|
+ priv->date = g_time_val_to_iso8601 (&time);
|
|
}
|
|
|
|
/**
|
|
@@ -499,16 +500,15 @@
|
|
as_release_set_timestamp_eol (AsRelease *release, guint64 timestamp)
|
|
{
|
|
AsReleasePrivate *priv = GET_PRIVATE (release);
|
|
- g_autoptr(GDateTime) time = NULL;
|
|
-
|
|
- g_return_if_fail (AS_IS_RELEASE (release));
|
|
+ GTimeVal time;
|
|
|
|
if (timestamp == 0)
|
|
return;
|
|
|
|
- time = g_date_time_new_from_unix_utc (timestamp);
|
|
+ time.tv_sec = timestamp;
|
|
+ time.tv_usec = 0;
|
|
g_free (priv->date_eol);
|
|
- priv->date_eol = g_date_time_format_iso8601 (time);
|
|
+ priv->date_eol = g_time_val_to_iso8601 (&time);
|
|
}
|
|
|
|
/**
|
|
@@ -1031,9 +1031,10 @@
|
|
time_str = g_strdup_printf ("%" G_GUINT64_FORMAT, priv->timestamp);
|
|
as_xml_add_text_prop (subnode, "timestamp", time_str);
|
|
} else {
|
|
- g_autoptr(GDateTime)
|
|
- time = g_date_time_new_from_unix_utc (priv->timestamp);
|
|
- time_str = g_date_time_format_iso8601 (time);
|
|
+ GTimeVal time;
|
|
+ time.tv_sec = priv->timestamp;
|
|
+ time.tv_usec = 0;
|
|
+ time_str = g_time_val_to_iso8601 (&time);
|
|
as_xml_add_text_prop (subnode, "date", time_str);
|
|
}
|
|
}
|
|
@@ -1211,9 +1212,10 @@
|
|
if (as_context_get_style (ctx) == AS_FORMAT_STYLE_CATALOG) {
|
|
as_yaml_emit_entry_timestamp (emitter, "unix-timestamp", priv->timestamp);
|
|
} else {
|
|
- g_autoptr(GDateTime)
|
|
- time = g_date_time_new_from_unix_utc (priv->timestamp);
|
|
- time_str = g_date_time_format_iso8601 (time);
|
|
+ GTimeVal time;
|
|
+ time.tv_sec = priv->timestamp;
|
|
+ time.tv_usec = 0;
|
|
+ time_str = g_time_val_to_iso8601 (&time);
|
|
as_yaml_emit_entry (emitter, "date", time_str);
|
|
}
|
|
}
|
|
diff -Naur AppStream-1.0.2.orig/src/as-utils.c AppStream-1.0.2/src/as-utils.c
|
|
--- AppStream-1.0.2.orig/src/as-utils.c 2024-02-25 03:23:01.000000000 +0600
|
|
+++ AppStream-1.0.2/src/as-utils.c 2024-06-05 08:50:10.922528854 +0600
|
|
@@ -360,13 +360,14 @@
|
|
/**
|
|
* as_iso8601_to_datetime:
|
|
*
|
|
- * Helper function to work around a bug in g_date_time_new_from_iso8601.
|
|
+ * Helper function to work around a bug in g_time_val_from_iso8601.
|
|
* Can be dropped when the bug gets resolved upstream:
|
|
* https://bugzilla.gnome.org/show_bug.cgi?id=760983
|
|
**/
|
|
GDateTime *
|
|
as_iso8601_to_datetime (const gchar *iso_date)
|
|
{
|
|
+ GTimeVal tv;
|
|
guint dmy[] = { 0, 0, 0 };
|
|
|
|
/* nothing set */
|
|
@@ -374,14 +375,12 @@
|
|
return NULL;
|
|
|
|
/* try to parse complete ISO8601 date */
|
|
- if (g_strstr_len (iso_date, -1, "T") != NULL) {
|
|
- g_autoptr(GTimeZone) tz_utc = g_time_zone_new_utc ();
|
|
- GDateTime *res = g_date_time_new_from_iso8601 (iso_date, tz_utc);
|
|
- if (res != NULL)
|
|
- return res;
|
|
+ if (g_strstr_len (iso_date, -1, " ") != NULL) {
|
|
+ if (g_time_val_from_iso8601 (iso_date, &tv) && tv.tv_sec != 0)
|
|
+ return g_date_time_new_from_timeval_utc (&tv);
|
|
}
|
|
|
|
- /* g_date_time_new_from_iso8601() blows goats and won't
|
|
+ /* g_time_val_from_iso8601() blows goats and won't
|
|
* accept a valid ISO8601 formatted date without a
|
|
* time value - try and parse this case */
|
|
if (sscanf (iso_date, "%u-%u-%u", &dmy[0], &dmy[1], &dmy[2]) != 3)
|