[gnome-software/wip/rancell/apt] Allow free-but-unspecified SPDX tokens
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/wip/rancell/apt] Allow free-but-unspecified SPDX tokens
- Date: Tue, 12 Apr 2016 09:59:45 +0000 (UTC)
commit fb42d4b78f437ba75873de037b19b96b2f2b7285
Author: Richard Hughes <richard hughsie com>
Date: Thu Apr 7 14:23:48 2016 +0100
Allow free-but-unspecified SPDX tokens
We also allow custom URLs for tags, for example:
@LicenseRef-free=http://www.ubuntu.com/about/about-ubuntu/licensing
Based on a patch by Robert Ancell, many thanks.
src/gs-app.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 07524e6..f26abb9 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -1357,12 +1357,20 @@ gs_app_set_license (GsApp *app, GsAppQuality quality, const gchar *licence)
continue;
}
- /* Ubuntu licensing */
- if (g_strcmp0 (tokens[i], "@LicenseRef-ubuntu") == 0) {
- const gchar *url = "http://www.ubuntu.com/about/about-ubuntu/licensing";
+ /* free software, license unspecified */
+ if (g_str_has_prefix (tokens[i], "@LicenseRef-free") == 0) {
+ const gchar *url = "http://www.gnu.org/philosophy/free-sw.en.html";
+ gchar *tmp;
+
+ /* we support putting a custom URL in the
+ * token string, e.g. @LicenseRef-free=http://ubuntu.com */
+ tmp = g_strstr_len (tokens[i], -1, "=");
+ if (tmp != NULL)
+ url = tmp + 1;
g_string_append_printf (urld,
"<a href=\"%s\">%s</a>",
- url, _("Open Source"));
+ /* TRANSLATORS: see GNU page */
+ url, _("Free Software"));
continue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]