Hello community, here is the log from the commit of package appstream-glib for openSUSE:Factory checked in at 2015-12-09 20:35:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/appstream-glib (Old) and /work/SRC/openSUSE:Factory/.appstream-glib.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "appstream-glib" Changes: -------- --- /work/SRC/openSUSE:Factory/appstream-glib/appstream-glib.changes 2015-11-23 07:30:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.appstream-glib.new/appstream-glib.changes 2015-12-09 22:12:22.000000000 +0100 @@ -1,0 +2,18 @@ +Wed Nov 25 20:17:28 UTC 2015 - [email protected] + +- Update to version 0.5.4: + + New Features: Add as_utils_version_from_uint16(). + + Bugfixes: Generate GUID values according to RFC4122. +- Add pkgconfig(uuid) BuildRequires: New dependency. + +------------------------------------------------------------------- +Tue Nov 17 17:13:46 UTC 2015 - [email protected] + +- Update to version 0.5.3: + + trivial: post release version bump. + + trivial: Sync example spec file with downstream. + + Strip Win32 and Linux paths when decompressing firmware. + + Return the correct error when the desktop file has no + [Desktop Entry] group. + +------------------------------------------------------------------- Old: ---- appstream-glib-0.5.2.tar.xz New: ---- appstream-glib-0.5.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ appstream-glib.spec ++++++ --- /var/tmp/diff_new_pack.AEJEmO/_old 2015-12-09 22:12:23.000000000 +0100 +++ /var/tmp/diff_new_pack.AEJEmO/_new 2015-12-09 22:12:23.000000000 +0100 @@ -20,7 +20,7 @@ %define _build_from_vcs 1 Name: appstream-glib -Version: 0.5.2 +Version: 0.5.4 Release: 0 Summary: AppStream Abstraction Library License: LGPL-2.1+ @@ -53,6 +53,7 @@ BuildRequires: pkgconfig(libsoup-2.4) >= 2.24 BuildRequires: pkgconfig(rpm) BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(uuid) Requires: gcab # Required in order to be able to convert .svg icons Requires: gdk-pixbuf-loader-rsvg ++++++ _service ++++++ --- /var/tmp/diff_new_pack.AEJEmO/_old 2015-12-09 22:12:23.000000000 +0100 +++ /var/tmp/diff_new_pack.AEJEmO/_new 2015-12-09 22:12:23.000000000 +0100 @@ -2,9 +2,9 @@ <service name="tar_scm" mode="disabled"> <param name="url">https://github.com/hughsie/appstream-glib.git</param> <param name="scm">git</param> - <param name="versionformat">0.5.2</param> + <param name="versionformat">0.5.4</param> <param name="changesgenerate">enable</param> - <param name="revision">refs/tags/appstream_glib_0_5_2</param> + <param name="revision">refs/tags/appstream_glib_0_5_4</param> </service> <service name="recompress" mode="disabled"> <param name="file">*.tar</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.AEJEmO/_old 2015-12-09 22:12:23.000000000 +0100 +++ /var/tmp/diff_new_pack.AEJEmO/_new 2015-12-09 22:12:23.000000000 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/hughsie/appstream-glib.git</param> - <param name="changesrevision">81a27888453403788605787546bb698a2c836952</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">33f99b7c8591c4c663facc6c7a1ce0fc97a2d7a4</param></service></servicedata> \ No newline at end of file ++++++ appstream-glib-0.5.2.tar.xz -> appstream-glib-0.5.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/NEWS new/appstream-glib-0.5.4/NEWS --- old/appstream-glib-0.5.2/NEWS 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/NEWS 2015-11-25 21:17:28.000000000 +0100 @@ -1,3 +1,21 @@ +Version 0.5.4 +~~~~~~~~~~~~~ +Released: 2015-11-18 + +New Features: + - Add as_utils_version_from_uint16() (Richard Hughes) + +Bugfixes: + - Generate GUID values according to RFC4122 (Richard Hughes) + +Version 0.5.3 +~~~~~~~~~~~~~ +Released: 2015-11-05 + +Bugfixes: + - Return the correct error when the desktop file has no group (Richard Hughes) + - Strip Win32 and Linux paths when decompressing firmware (Richard Hughes) + Version 0.5.2 ~~~~~~~~~~~~~ Released: 2015-10-27 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/RELEASE new/appstream-glib-0.5.4/RELEASE --- old/appstream-glib-0.5.2/RELEASE 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/RELEASE 2015-11-25 21:17:28.000000000 +0100 @@ -2,10 +2,10 @@ 1. Write NEWS entries for appstream_glib in the same format as usual. -git shortlog appstream_glib_0_5_1.. | grep -i -v trivial | grep -v Merge > NEWS.new +git shortlog appstream_glib_0_5_3.. | grep -i -v trivial | grep -v Merge > NEWS.new -------------------------------------------------------------------------------- -Version 0.5.2 +Version 0.5.4 ~~~~~~~~~~~~~ Released: 2015-xx-xx @@ -29,8 +29,8 @@ 4. Commit changes in git: -git commit -a -m "Release version 0.5.2" -git tag -s -f -m "Release 0.5.2" appstream_glib_0_5_2 +git commit -a -m "Release version 0.5.4" +git tag -s -f -m "Release 0.5.4" appstream_glib_0_5_4 <gpg password> git push --tags git push diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/client/as-util.c new/appstream-glib-0.5.4/client/as-util.c --- old/appstream-glib-0.5.2/client/as-util.c 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/client/as-util.c 2015-11-25 21:17:28.000000000 +0100 @@ -3436,6 +3436,27 @@ } /** + * as_util_generate_guid: + **/ +static gboolean +as_util_generate_guid (AsUtilPrivate *priv, gchar **values, GError **error) +{ + g_autofree gchar *guid = NULL; + + /* check args */ + if (g_strv_length (values) != 1) { + g_set_error_literal (error, + AS_ERROR, + AS_ERROR_INVALID_ARGUMENTS, + "Not enough arguments, expected STRING"); + return FALSE; + } + guid = as_utils_guid_from_string (values[0]); + g_print ("%s\n", guid); + return TRUE; +} + +/** * as_util_compare: **/ static gboolean @@ -3884,6 +3905,12 @@ /* TRANSLATORS: command description */ _("Compare the contents of two AppStream files"), as_util_compare); + as_util_add (priv->cmd_array, + "generate-guid", + NULL, + /* TRANSLATORS: command description */ + _("Generate a GUID from an input string"), + as_util_generate_guid); /* sort by command name */ g_ptr_array_sort (priv->cmd_array, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/configure.ac new/appstream-glib-0.5.4/configure.ac --- old/appstream-glib-0.5.2/configure.ac 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/configure.ac 2015-11-25 21:17:28.000000000 +0100 @@ -2,7 +2,7 @@ m4_define([as_major_version], [0]) m4_define([as_minor_version], [5]) -m4_define([as_micro_version], [2]) +m4_define([as_micro_version], [4]) m4_define([as_version], [as_major_version.as_minor_version.as_micro_version]) @@ -128,6 +128,7 @@ AM_CONDITIONAL(HAVE_GPERF, [test x$GPERF != xno]) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.45.8 gio-2.0 gobject-2.0 gthread-2.0 gio-unix-2.0 gmodule-2.0) +PKG_CHECK_MODULES(UUID, uuid) PKG_CHECK_MODULES(LIBARCHIVE, libarchive) PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.51.92) PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0 >= 2.31.5) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/contrib/libappstream-glib.spec.in new/appstream-glib-0.5.4/contrib/libappstream-glib.spec.in --- old/appstream-glib-0.5.2/contrib/libappstream-glib.spec.in 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/contrib/libappstream-glib.spec.in 2015-11-25 21:17:28.000000000 +0100 @@ -21,6 +21,7 @@ BuildRequires: gettext BuildRequires: intltool BuildRequires: libgcab1-devel +BuildRequires: libuuid-devel # for the builder component BuildRequires: fontconfig-devel @@ -98,7 +99,8 @@ %postun builder -p /sbin/ldconfig %files -f appstream-glib.lang -%doc README.md AUTHORS NEWS COPYING +%license COPYING +%doc README.md AUTHORS NEWS %{_libdir}/libappstream-glib.so.8* %{_libdir}/girepository-1.0/*.typelib %{_bindir}/appstream-util @@ -117,7 +119,7 @@ %{_datadir}/installed-tests/appstream-glib/*.test %files builder -%doc COPYING +%license COPYING %{_bindir}/appstream-builder %{_datadir}/bash-completion/completions/appstream-builder %{_libdir}/asb-plugins-%{as_plugin_version}/*.so @@ -125,7 +127,7 @@ %{_mandir}/man1/appstream-builder.1.gz %files builder-devel -%doc COPYING +%license COPYING %{_libdir}/libappstream-builder.so %{_libdir}/pkgconfig/appstream-builder.pc %dir %{_includedir}/libappstream-builder diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/Makefile.am new/appstream-glib-0.5.4/libappstream-glib/Makefile.am --- old/appstream-glib-0.5.2/libappstream-glib/Makefile.am 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/Makefile.am 2015-11-25 21:17:28.000000000 +0100 @@ -11,6 +11,7 @@ $(GDKPIXBUF_CFLAGS) \ $(LIBARCHIVE_CFLAGS) \ $(SOUP_CFLAGS) \ + $(UUID_CFLAGS) \ $(YAML_CFLAGS) \ -I$(top_srcdir)/libappstream-glib \ -I$(top_builddir)/libappstream-glib \ @@ -148,6 +149,7 @@ $(GDKPIXBUF_LIBS) \ $(LIBARCHIVE_LIBS) \ $(SOUP_LIBS) \ + $(UUID_LIBS) \ $(YAML_LIBS) libappstream_glib_la_LDFLAGS = \ @@ -168,6 +170,7 @@ $(GDKPIXBUF_LIBS) \ $(LIBARCHIVE_LIBS) \ $(SOUP_LIBS) \ + $(UUID_LIBS) \ $(YAML_LIBS) \ $(lib_LTLIBRARIES) as_self_test_CFLAGS = $(WARNINGFLAGS_C) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/appstream-glib.pc.in new/appstream-glib-0.5.4/libappstream-glib/appstream-glib.pc.in --- old/appstream-glib-0.5.2/libappstream-glib/appstream-glib.pc.in 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/appstream-glib.pc.in 2015-11-25 21:17:28.000000000 +0100 @@ -6,7 +6,7 @@ Name: appstream-glib Description: Objects and helper methods to help reading and writing AppStream metadata Version: @VERSION@ -Requires.private: libarchive, libgcab-1.0 +Requires.private: libarchive, libgcab-1.0, uuid Requires: glib-2.0, gobject-2.0, gdk-pixbuf-2.0 Libs: -L${libdir} -lappstream-glib Cflags: -I${includedir}/libappstream-glib diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/as-app-desktop.c new/appstream-glib-0.5.4/libappstream-glib/as-app-desktop.c --- old/appstream-glib-0.5.2/libappstream-glib/as-app-desktop.c 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/as-app-desktop.c 2015-11-25 21:17:28.000000000 +0100 @@ -411,6 +411,16 @@ return FALSE; } + /* check this is a valid desktop file */ + if (!g_key_file_has_group (kf, G_KEY_FILE_DESKTOP_GROUP)) { + g_set_error (error, + AS_APP_ERROR, + AS_APP_ERROR_INVALID_TYPE, + "Not a desktop file: no [%s]", + G_KEY_FILE_DESKTOP_GROUP); + return FALSE; + } + /* create app */ app_id = g_path_get_basename (desktop_file); as_app_set_id_kind (app, AS_ID_KIND_DESKTOP); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/as-self-test.c new/appstream-glib-0.5.4/libappstream-glib/as-self-test.c --- old/appstream-glib-0.5.2/libappstream-glib/as-self-test.c 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/as-self-test.c 2015-11-25 21:17:28.000000000 +0100 @@ -3336,7 +3336,8 @@ static void as_test_utils_guid_func (void) { - g_autofree gchar *guid = NULL; + g_autofree gchar *guid1 = NULL; + g_autofree gchar *guid2 = NULL; /* invalid */ g_assert (!as_utils_guid_is_valid (NULL)); @@ -3349,8 +3350,10 @@ g_assert (as_utils_guid_is_valid ("1ff60ab2-3905-06a1-b476-0371f00c9e9b")); /* make valid */ - guid = as_utils_guid_from_string ("0x8086:0x0406"); - g_assert_cmpstr (guid, ==, "1ff60ab2-3905-06a1-b476-0371f00c9e9b"); + guid1 = as_utils_guid_from_string ("python.org"); + g_assert_cmpstr (guid1, ==, "886313e1-3b8a-5372-9b90-0c9aee199e5d"); + guid2 = as_utils_guid_from_string ("8086:0406"); + g_assert_cmpstr (guid2, ==, "1fbd1f2c-80f4-5d7c-a6ad-35c7b9bd5486"); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/as-store-cab.c new/appstream-glib-0.5.4/libappstream-glib/as-store-cab.c --- old/appstream-glib-0.5.2/libappstream-glib/as-store-cab.c 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/as-store-cab.c 2015-11-25 21:17:28.000000000 +0100 @@ -39,14 +39,21 @@ as_store_cab_cb (GCabFile *file, gpointer user_data) { GPtrArray *filelist = (GPtrArray *) user_data; - gchar *fn; + const gchar *fn; + gchar *tmp; - /* only accept UNIX paths */ - fn = g_strdup (gcab_file_get_name (file)); - g_strdelimit (fn, "\\", '/'); + /* strip Windows or Linux paths */ + fn = gcab_file_get_name (file); + tmp = g_strrstr (fn, "\\"); + if (tmp == NULL) + tmp = g_strrstr (fn, "/"); + if (tmp != NULL) { + g_debug ("removed path prefix for %s", fn); + fn = tmp + 1; + } gcab_file_set_extract_name (file, fn); - g_ptr_array_add (filelist, fn); + g_ptr_array_add (filelist, g_strdup (fn)); return TRUE; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/as-utils.c new/appstream-glib-0.5.4/libappstream-glib/as-utils.c --- old/appstream-glib-0.5.2/libappstream-glib/as-utils.c 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/as-utils.c 2015-11-25 21:17:28.000000000 +0100 @@ -38,6 +38,7 @@ #include <archive.h> #include <libsoup/soup.h> #include <stdlib.h> +#include <uuid.h> #include "as-app.h" #include "as-enums.h" @@ -1592,20 +1593,6 @@ } /** - * as_utils_guid_is_xdigit: - **/ -static gboolean -as_utils_guid_is_xdigit (const gchar *str) -{ - guint i; - for (i = 0; str[i] != '\0'; i++) { - if (!g_ascii_isxdigit (str[i])) - return FALSE; - } - return TRUE; -} - -/** * as_utils_guid_is_valid: * @guid: string to check * @@ -1618,32 +1605,28 @@ gboolean as_utils_guid_is_valid (const gchar *guid) { - g_auto(GStrv) split = NULL; + gint rc; + uuid_t uu; if (guid == NULL) return FALSE; - split = g_strsplit (guid, "-", -1); - if (g_strv_length (split) != 5) - return FALSE; - if (strlen (split[0]) != 8 || !as_utils_guid_is_xdigit (split[0])) - return FALSE; - if (strlen (split[1]) != 4 || !as_utils_guid_is_xdigit (split[1])) - return FALSE; - if (strlen (split[2]) != 4 || !as_utils_guid_is_xdigit (split[2])) - return FALSE; - if (strlen (split[3]) != 4 || !as_utils_guid_is_xdigit (split[3])) - return FALSE; - if (strlen (split[4]) != 12 || !as_utils_guid_is_xdigit (split[4])) - return FALSE; - return TRUE; + rc = uuid_parse (guid, uu); + return rc == 0; } /** * as_utils_guid_from_string: * @str: A source string to use as a key * - * Returns a GUID for a given string. This uses SHA1 and some string - * modification so even small differences in the @str will produce radically - * different GUID return values. + * Returns a GUID for a given string. This uses a hash and so even small + * differences in the @str will produce radically different return values. + * + * The implementation is taken from RFC4122, Section 4.1.3; specifically + * using a type-5 SHA-1 hash with a DNS namespace. + * The same result can be obtained with this simple python program: + * + * #!/usr/bin/python + * import uuid + * print uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') * * Returns: A new GUID, or %NULL if the string was invalid * @@ -1652,15 +1635,39 @@ gchar * as_utils_guid_from_string (const gchar *str) { - gchar *tmp; - tmp = g_compute_checksum_for_string (G_CHECKSUM_SHA1, str, -1); - tmp[8] = '-'; - tmp[13] = '-'; - tmp[18] = '-'; - tmp[23] = '-'; - tmp[36] = '\0'; - g_assert (as_utils_guid_is_valid (tmp)); - return tmp; + const gchar *namespace_id = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; + gchar guid_new[37]; /* 36 plus NUL */ + gsize digestlen = 20; + guint8 hash[20]; + gint rc; + uuid_t uu_namespace; + uuid_t uu_new; + g_autoptr(GChecksum) csum = NULL; + + /* invalid */ + if (str == NULL) + return NULL; + + /* convert the namespace to binary */ + rc = uuid_parse (namespace_id, uu_namespace); + g_assert (rc == 0); + + /* hash the namespace and then the string */ + csum = g_checksum_new (G_CHECKSUM_SHA1); + g_checksum_update (csum, (guchar *) uu_namespace, 16); + g_checksum_update (csum, (guchar *) str, strlen(str)); + g_checksum_get_digest (csum, hash, &digestlen); + + /* copy most parts of the hash 1:1 */ + memcpy(uu_new, hash, 16); + + /* set specific bits according to Section 4.1.3 */ + uu_new[6] = (guint8) ((uu_new[6] & 0x0f) | (5 << 4)); + uu_new[8] = (guint8) ((uu_new[8] & 0x3f) | 0x80); + + /* return as a string */ + uuid_unparse (uu_new, guid_new); + return g_strdup (guid_new); } /** @@ -1689,6 +1696,25 @@ (val >> 8) & 0xff, val & 0xff); } + +/** + * as_utils_version_from_uint16: + * @val: A uint16le version number + * @flags: flags used for formatting, e.g. %AS_VERSION_PARSE_FLAG_USE_TRIPLET + * + * Returns a dotted decimal version string from a 16 bit number. + * + * Returns: A version number, e.g. "1.3" + * + * Since: 0.5.2 + **/ +gchar * +as_utils_version_from_uint16 (guint16 val, AsVersionParseFlag flags) +{ + return g_strdup_printf ("%i.%i", + (val >> 8) & 0xff, + val & 0xff); +} /** * as_utils_version_parse: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appstream-glib-0.5.2/libappstream-glib/as-utils.h new/appstream-glib-0.5.4/libappstream-glib/as-utils.h --- old/appstream-glib-0.5.2/libappstream-glib/as-utils.h 2015-11-02 12:00:29.000000000 +0100 +++ new/appstream-glib-0.5.4/libappstream-glib/as-utils.h 2015-11-25 21:17:28.000000000 +0100 @@ -165,6 +165,8 @@ gchar *as_utils_guid_from_string (const gchar *str); gchar *as_utils_version_from_uint32 (guint32 val, AsVersionParseFlag flags); +gchar *as_utils_version_from_uint16 (guint16 val, + AsVersionParseFlag flags); gchar *as_utils_version_parse (const gchar *version); G_END_DECLS
