Commit 6fcebb5a authored by Michael Terry's avatar Michael Terry

Drop uriutils for Soup.URI

Also, clean up AUTHORS and some licensing
parent c692e8da
...@@ -21,10 +21,6 @@ Files: po/*.po ...@@ -21,10 +21,6 @@ Files: po/*.po
Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd
License: GPL-3+ License: GPL-3+
Files: libdeja/uriutils.c libdeja/uriutils.h
Copyright: 2006–2007 Red Hat, Inc
License: GPL-3+
Files: deja-dup/nautilus/NautilusExtension.[ch] Files: deja-dup/nautilus/NautilusExtension.[ch]
Copyright: 2004–2005 Free Software Foundation, Inc. Copyright: 2004–2005 Free Software Foundation, Inc.
2009–2011 Michael Terry <mike@mterry.name> 2009–2011 Michael Terry <mike@mterry.name>
...@@ -35,18 +31,18 @@ Files: data/ui/server-hint.ui ...@@ -35,18 +31,18 @@ Files: data/ui/server-hint.ui
Copyright: 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com> Copyright: 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
License: LGPL-2.1+ License: LGPL-2.1+
Files: vapi/config.vapi Files: data/org.gnome.DejaDup.appdata.xml.in
Copyright: 2007–2008 Jaap Haitsma <jaap@haitsma.org> Copyright: 2017-2019 Michael Terry <mike@mterry.name>
License: GPL-3+ License: CC-BY-SA-4.0
Files: help/C/*.page Files: help/C/*.page
Copyright: 2010–2011,2016-2019 Michael Terry <mike@mterry.name> Copyright: 2010–2011,2016-2019 Michael Terry <mike@mterry.name>
2011-2015 Canonical Ltd 2011-2015 Canonical Ltd
License: CC-BY-SA-3.0 License: CC-BY-SA-4.0
Files: help/*.po Files: help/*.po
Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd Copyright: 2008–2019 Rosetta Contributors and Canonical Ltd
License: CC-BY-SA-3.0 License: CC-BY-SA-4.0
Files: data/icons/org.gnome.DejaDup.svg Files: data/icons/org.gnome.DejaDup.svg
Copyright: 2019 Jakub Steiner <jimmac@gmail.com> Copyright: 2019 Jakub Steiner <jimmac@gmail.com>
...@@ -54,7 +50,7 @@ License: CC-BY-SA-4.0 ...@@ -54,7 +50,7 @@ License: CC-BY-SA-4.0
Files: data/icons/org.gnome.DejaDup-symbolic.svg Files: data/icons/org.gnome.DejaDup-symbolic.svg
Copyright: 2012 Barbara Muraus <barbara.muraus@gmail.com> Copyright: 2012 Barbara Muraus <barbara.muraus@gmail.com>
License: CC-BY-SA-3.0 License: CC-BY-SA-4.0
Files: data/icons/deja-dup-cloud.svg Files: data/icons/deja-dup-cloud.svg
Copyright: None Copyright: None
...@@ -80,23 +76,6 @@ License: GPL-3+ ...@@ -80,23 +76,6 @@ License: GPL-3+
On Debian systems, the full text of the GNU General Public License On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file /usr/share/common-licenses/GPL-3. version 3 can be found in the file /usr/share/common-licenses/GPL-3.
License: LGPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the full text of the GNU Lesser General Public License
version 3 can be found in the file /usr/share/common-licenses/LGPL-3.
License: LGPL-2.1+ License: LGPL-2.1+
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by it under the terms of the GNU Lesser General Public License as published by
...@@ -112,22 +91,7 @@ License: LGPL-2.1+ ...@@ -112,22 +91,7 @@ License: LGPL-2.1+
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
. .
On Debian systems, the full text of the GNU Lesser General Public License On Debian systems, the full text of the GNU Lesser General Public License
version 3 can be found in the file /usr/share/common-licenses/LGPL-2.1. version 2.1 can be found in the file /usr/share/common-licenses/LGPL-2.1.
License: CC-BY-SA-3.0
You are free:
to Share (to copy, distribute and transmit the work) and
to Remix (to adapt the work) under the following conditions:
.
Attribution — You must attribute the work in the manner specified by the
author or licensor (but not in any way that suggests that they endorse you
or your use of the work).
.
Share Alike — If you alter, transform, or build upon this work, you may
distribute the resulting work only under the same, similar or a compatible
license.
.
For more information, see http://creativecommons.org/licenses/by-sa/3.0/
License: CC-BY-SA-4.0 License: CC-BY-SA-4.0
You are free: You are free:
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<email>mike@mterry.name</email> <email>mike@mterry.name</email>
<years>2010,2011</years> <years>2010,2011</years>
</credit> </credit>
<license href="http://creativecommons.org/licenses/by-sa/3.0/"><p>Creative Commons Attribution-Share Alike 3.0 Unported License</p></license> <license href="http://creativecommons.org/licenses/by-sa/4.0/"><p>Creative Commons Attribution-Share Alike 4.0 Unported License</p></license>
</info> </info>
<title>Backup Help</title> <title>Backup Help</title>
......
...@@ -572,7 +572,7 @@ public string get_file_desc(File file) ...@@ -572,7 +572,7 @@ public string get_file_desc(File file)
var desc = Path.get_basename(file.get_parse_name()); var desc = Path.get_basename(file.get_parse_name());
if (!file.is_native()) { if (!file.is_native()) {
var uri = DejaDupDecodedUri.decode_uri(file.get_uri()); var uri = new Soup.URI(file.get_uri());
if (uri != null && uri.host != null && uri.host != "") if (uri != null && uri.host != null && uri.host != "")
desc = _("%1$s on %2$s").printf(desc, uri.host); desc = _("%1$s on %2$s").printf(desc, uri.host);
} }
......
...@@ -44,12 +44,11 @@ libdeja = shared_library('deja', ...@@ -44,12 +44,11 @@ libdeja = shared_library('deja',
'RecursiveMove.vala', 'RecursiveMove.vala',
'RecursiveOp.vala', 'RecursiveOp.vala',
'ToolPlugin.vala', 'ToolPlugin.vala',
'uriutils.c',
'tools/duplicity/DuplicityInstance.vala', 'tools/duplicity/DuplicityInstance.vala',
'tools/duplicity/DuplicityJob.vala', 'tools/duplicity/DuplicityJob.vala',
'tools/duplicity/DuplicityPlugin.vala', 'tools/duplicity/DuplicityPlugin.vala',
], ],
vala_args: common_vflags + ['--pkg=uriutils'], vala_args: common_vflags,
c_args: common_cflags, c_args: common_cflags,
dependencies: [ dependencies: [
gio_dep, gio_dep,
......
/* -*- Mode: C; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
* This file is part of Déjà Dup (but originally grabbed from gvfs).
* Copyright (C) 2006-2007 Red Hat, Inc.
*
* Déjà Dup is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* Déjà Dup is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
#include "uriutils.h"
#include <string.h>
#include <stdlib.h>
void
deja_dup_decoded_uri_free (DejaDupDecodedUri *decoded)
{
if (decoded == NULL)
return;
g_free (decoded->scheme);
g_free (decoded->query);
g_free (decoded->fragment);
g_free (decoded->userinfo);
g_free (decoded->host);
g_free (decoded->path);
g_free (decoded);
}
DejaDupDecodedUri *
deja_dup_decoded_uri_new (void)
{
DejaDupDecodedUri *uri;
uri = g_new0 (DejaDupDecodedUri, 1);
uri->port = -1;
return uri;
}
DejaDupDecodedUri *
deja_dup_decoded_uri_decode_uri (const char *uri)
{
DejaDupDecodedUri *decoded;
const char *p, *in, *hier_part_start, *hier_part_end, *query_start, *fragment_start;
char *out;
char c;
/* From RFC 3986 Decodes:
* URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
*/
p = uri;
/* Decode scheme:
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
*/
if (!g_ascii_isalpha (*p))
return NULL;
while (1)
{
c = *p++;
if (c == ':')
break;
if (!(g_ascii_isalnum(c) ||
c == '+' ||
c == '-' ||
c == '.'))
return NULL;
}
decoded = deja_dup_decoded_uri_new ();
decoded->scheme = g_malloc (p - uri);
out = decoded->scheme;
for (in = uri; in < p - 1; in++)
*out++ = g_ascii_tolower (*in);
*out = 0;
hier_part_start = p;
query_start = strchr (p, '?');
if (query_start)
{
hier_part_end = query_start++;
fragment_start = strchr (query_start, '#');
if (fragment_start)
{
decoded->query = g_strndup (query_start, fragment_start - query_start);
decoded->fragment = g_strdup (fragment_start+1);
}
else
{
decoded->query = g_strdup (query_start);
decoded->fragment = NULL;
}
}
else
{
/* No query */
decoded->query = NULL;
fragment_start = strchr (p, '#');
if (fragment_start)
{
hier_part_end = fragment_start++;
decoded->fragment = g_strdup (fragment_start);
}
else
{
hier_part_end = p + strlen (p);
decoded->fragment = NULL;
}
}
/* 3:
hier-part = "//" authority path-abempty
/ path-absolute
/ path-rootless
/ path-empty
*/
if (hier_part_start[0] == '/' &&
hier_part_start[1] == '/')
{
const char *authority_start, *authority_end;
const char *userinfo_start, *userinfo_end;
const char *host_start, *host_end;
const char *port_start;
authority_start = hier_part_start + 2;
/* authority is always followed by / or nothing */
authority_end = memchr (authority_start, '/', hier_part_end - authority_start);
if (authority_end == NULL)
authority_end = hier_part_end;
/* 3.2:
authority = [ userinfo "@" ] host [ ":" port ]
*/
/* Look for the last so that any multiple @ signs are put in the username part.
* This is not quite correct, as @ should be escaped here, but this happens
* in practice, so lets handle it the "nicer" way at least. */
userinfo_end = g_strrstr_len (authority_start,
authority_end - authority_start, "@");
if (userinfo_end)
{
userinfo_start = authority_start;
decoded->userinfo = g_uri_unescape_segment (userinfo_start, userinfo_end, NULL);
if (decoded->userinfo == NULL)
{
deja_dup_decoded_uri_free (decoded);
return NULL;
}
host_start = userinfo_end + 1;
}
else
host_start = authority_start;
/* We should handle hostnames in brackets, as those are used by IPv6 URIs
* See http://tools.ietf.org/html/rfc2732 */
if (*host_start == '[')
{
char *s;
port_start = NULL;
host_end = memchr (host_start, ']', authority_end - host_start);
if (host_end == NULL)
{
deja_dup_decoded_uri_free (decoded);
return NULL;
}
/* Look for the start of the port,
* And we sure we don't have it start somewhere
* in the path section */
s = (char *) host_end;
while (1)
{
if (*s == '/')
{
port_start = NULL;
break;
}
else if (*s == ':')
{
port_start = s;
break;
}
else if (*s == '\0')
{
break;
}
s++;
}
}
else
{
port_start = memchr (host_start, ':', authority_end - host_start);
}
if (port_start)
{
host_end = port_start++;
decoded->port = atoi(port_start);
}
else
{
host_end = authority_end;
decoded->port = -1;
}
decoded->host = g_uri_unescape_segment (host_start, host_end, NULL);
hier_part_start = authority_end;
}
decoded->path = g_uri_unescape_segment (hier_part_start, hier_part_end, "/");
if (decoded->path == NULL)
{
deja_dup_decoded_uri_free (decoded);
return NULL;
}
return decoded;
}
char *
deja_dup_decoded_uri_encode_uri (DejaDupDecodedUri *decoded, gboolean allow_utf8)
{
GString *uri;
uri = g_string_new (NULL);
g_string_append (uri, decoded->scheme);
g_string_append (uri, "://");
if (decoded->host != NULL)
{
if (decoded->userinfo)
{
/* userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) */
g_string_append_uri_escaped (uri, decoded->userinfo,
G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO, allow_utf8);
g_string_append_c (uri, '@');
}
g_string_append_uri_escaped (uri, decoded->host,
/* Allowed unescaped in hostname / ip address */
G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":[]" ,
allow_utf8);
if (decoded->port != -1)
{
g_string_append_c (uri, ':');
g_string_append_printf (uri, "%d", decoded->port);
}
}
g_string_append_uri_escaped (uri, decoded->path, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, allow_utf8);
if (decoded->query)
{
g_string_append_c (uri, '?');
g_string_append (uri, decoded->query);
}
if (decoded->fragment)
{
g_string_append_c (uri, '#');
g_string_append (uri, decoded->fragment);
}
return g_string_free (uri, FALSE);
}
/* -*- Mode: C; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
* This file is part of Déjà Dup (but originally grabbed from gvfs).
* Copyright (C) 2006-2007 Red Hat, Inc.
*
* Déjà Dup is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* Déjà Dup is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef __URI_UTILS_H__
#define __URI_UTILS_H__
#include <glib.h>
G_BEGIN_DECLS
typedef struct {
char *scheme;
char *userinfo;
char *host;
int port; /* -1 => not in uri */
char *path;
char *query;
char *fragment;
} DejaDupDecodedUri;
char * deja_dup_decoded_uri_encode_uri (DejaDupDecodedUri *decoded,
gboolean allow_utf8);
void deja_dup_decoded_uri_free (DejaDupDecodedUri *decoded);
DejaDupDecodedUri *deja_dup_decoded_uri_decode_uri (const char *uri);
DejaDupDecodedUri *deja_dup_decoded_uri_new (void);
G_END_DECLS
#endif /* __URI_UTILS_H__ */
/* /*
Copyright (C) 2007,2008 Jaap Haitsma <jaap@haitsma.org> This file is part of Déjà Dup.
For copyright information, see AUTHORS.
Déjà Dup is free software: you can redistribute it and/or modify Déjà Dup is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
This file is part of Déjà Dup.
For copyright information, see AUTHORS.
Déjà Dup is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Déjà Dup is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
*/
/* goabackend-1.0 does not ship a vapi... */
[CCode (cprefix = "Goa", gir_namespace = "Goa", gir_version = "1.0", lower_case_cprefix = "goa_")]
namespace Goa {
[CCode (cheader_filename = "goabackend/goabackend.h", type_id = "goa_provider_get_type ()")]
public class Provider : GLib.Object {
[CCode (cname = "goa_provider_get_all")]
public static async bool get_all ([CCode (pos = 0)] out GLib.List<Goa.Provider> providers) throws GLib.Error;
public static Provider get_for_provider_type (string type);
public unowned string get_provider_type ();
public string get_provider_name (Goa.Object? object);
public GLib.Icon get_provider_icon (Goa.Object? object);
public ProviderFeatures get_provider_features ();
}
[CCode (cprefix = "GOA_PROVIDER_FEATURE_")]
[Flags]
public enum ProviderFeatures {
BRANDED,
MAIL,
CALENDAR,
CONTACTS,
CHAT,
DOCUMENTS,
PHOTOS,
FILES,
TICKETING,
READ_LATER,
PRINTERS,
MAPS,
MUSIC,
}
}
/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 2 -*- */
/*
This file is part of Déjà Dup.
For copyright information, see AUTHORS.
Déjà Dup is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Déjà Dup is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
*/
[Compact]
[CCode (cheader_filename = "uriutils.h", cprefix = "deja_dup_decoded_uri_", free_function = "deja_dup_decoded_uri_free")]
class DejaDupDecodedUri {
public DejaDupDecodedUri();
public static DejaDupDecodedUri decode_uri(string uri);
public string encode_uri(bool allow_utf8);
public string scheme;
public string userinfo;
public string host;
public int port; /* -1 => not in uri */
public string path;
public string query;
public string fragment;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment