When using dynamic remotes (LAN and USB), we cannot use their name with the common remote related ops (ostree_repo_remote_...) because ostree doesn't keep this type of remotes in its internal hash table. Unfortunately this means that we cannot access the URL of those remotes either (in order to e.g. set the right URL for those remotes in Flatpak). Since the URL is actually stored in a key file that belongs to the OstreeRemote, then we can simply allow users access to it through a getter. So this patch adds a method that allows to return the URL directly from the OstreeRemote without having to go through the OstreeRepo. The test-repo-finder-config is also updated by this patch to check if the URL is correct. Closes: #1353 Approved by: cgwalters
64 lines
1.8 KiB
C
64 lines
1.8 KiB
C
/*
|
|
* Copyright © 2011 Colin Walters <walters@verbum.org>
|
|
* Copyright © 2015 Red Hat, Inc.
|
|
* Copyright © 2017 Endless Mobile, Inc.
|
|
*
|
|
* This library 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 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library 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
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*
|
|
* Authors:
|
|
* - Colin Walters <walters@verbum.org>
|
|
* - Philip Withnall <withnall@endlessm.com>
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <gio/gio.h>
|
|
#include <glib.h>
|
|
#include <glib-object.h>
|
|
|
|
#include "ostree-types.h"
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/**
|
|
* OstreeRemote:
|
|
*
|
|
* This represents the configuration for a single remote repository. Currently,
|
|
* remotes can only be passed around as (reference counted) opaque handles. In
|
|
* future, more API may be added to create and interrogate them.
|
|
*
|
|
* Since: 2017.6
|
|
*/
|
|
#ifndef OSTREE_ENABLE_EXPERIMENTAL_API
|
|
/* This is in ostree-types.h otherwise */
|
|
typedef struct OstreeRemote OstreeRemote;
|
|
#endif
|
|
|
|
_OSTREE_PUBLIC
|
|
GType ostree_remote_get_type (void) G_GNUC_CONST;
|
|
_OSTREE_PUBLIC
|
|
OstreeRemote *ostree_remote_ref (OstreeRemote *remote);
|
|
_OSTREE_PUBLIC
|
|
void ostree_remote_unref (OstreeRemote *remote);
|
|
|
|
_OSTREE_PUBLIC
|
|
const gchar *ostree_remote_get_name (OstreeRemote *remote);
|
|
|
|
_OSTREE_PUBLIC
|
|
gchar *ostree_remote_get_url (OstreeRemote *remote);
|
|
|
|
G_END_DECLS
|