repo: Fix build without libsoup
Had a rare situation where I had no libsoup development files, so I took the opportunity to fix the build errors. Ugly, but works now. Would be nice if libsoup could be a hard dependency since we rarely ever test a configuration without it.
This commit is contained in:
parent
055b3aac32
commit
203d6ea65e
|
|
@ -21,7 +21,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ostree-repo.h"
|
#include "ostree-repo.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
#include "ostree-fetcher.h"
|
#include "ostree-fetcher.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|
@ -204,10 +207,12 @@ _ostree_repo_get_remote_option_inherit (OstreeRepo *self,
|
||||||
char **out_value,
|
char **out_value,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
OstreeFetcher *
|
OstreeFetcher *
|
||||||
_ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
_ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
||||||
const char *remote_name,
|
const char *remote_name,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
#endif
|
||||||
|
|
||||||
OstreeGpgVerifyResult *
|
OstreeGpgVerifyResult *
|
||||||
_ostree_repo_gpg_verify_with_metadata (OstreeRepo *self,
|
_ostree_repo_gpg_verify_with_metadata (OstreeRepo *self,
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,10 @@
|
||||||
#include "ostree-repo-file-enumerator.h"
|
#include "ostree-repo-file-enumerator.h"
|
||||||
#include "ostree-gpg-verifier.h"
|
#include "ostree-gpg-verifier.h"
|
||||||
#include "ostree-repo-static-delta-private.h"
|
#include "ostree-repo-static-delta-private.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
#include "ostree-metalink.h"
|
#include "ostree-metalink.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
|
@ -394,6 +397,7 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
OstreeFetcher *
|
OstreeFetcher *
|
||||||
_ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
_ostree_repo_remote_new_fetcher (OstreeRepo *self,
|
||||||
const char *remote_name,
|
const char *remote_name,
|
||||||
|
|
@ -494,6 +498,7 @@ out:
|
||||||
|
|
||||||
return fetcher;
|
return fetcher;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ostree_repo_finalize (GObject *object)
|
ostree_repo_finalize (GObject *object)
|
||||||
|
|
@ -1670,6 +1675,7 @@ out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
static gboolean
|
static gboolean
|
||||||
_ostree_preload_metadata_file (OstreeRepo *self,
|
_ostree_preload_metadata_file (OstreeRepo *self,
|
||||||
OstreeFetcher *fetcher,
|
OstreeFetcher *fetcher,
|
||||||
|
|
@ -1798,6 +1804,7 @@ repo_remote_fetch_summary (OstreeRepo *self,
|
||||||
soup_uri_free (base_uri);
|
soup_uri_free (base_uri);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ostree_repo_remote_fetch_summary:
|
* ostree_repo_remote_fetch_summary:
|
||||||
|
|
@ -1830,6 +1837,7 @@ ostree_repo_remote_fetch_summary (OstreeRepo *self,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LIBSOUP
|
||||||
g_autofree char *metalink_url_string = NULL;
|
g_autofree char *metalink_url_string = NULL;
|
||||||
g_autoptr(GBytes) summary = NULL;
|
g_autoptr(GBytes) summary = NULL;
|
||||||
g_autoptr(GBytes) signatures = NULL;
|
g_autoptr(GBytes) signatures = NULL;
|
||||||
|
|
@ -1898,6 +1906,11 @@ ostree_repo_remote_fetch_summary (OstreeRepo *self,
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
#else
|
||||||
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
||||||
|
"This version of ostree was built without libsoup, and cannot fetch over HTTP");
|
||||||
|
return FALSE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue