summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-10-07 09:13:26 +0100
committerRichard Hughes <richard@hughsie.com>2015-10-07 09:13:26 +0100
commit8e4c8c8073d954b811ef334bcfc678c05f78bddb (patch)
treed481a1946b8dde20d371a21a585484561a79c530
parentcecd3652cb1bdb99a4bffcc74ed6aeb18dfb4600 (diff)
downloadappstream-glib-8e4c8c8073d954b811ef334bcfc678c05f78bddb.tar.gz
f
-rw-r--r--libappstream-glib/Makefile.am2
-rw-r--r--libappstream-glib/appstream-glib.h1
-rw-r--r--libappstream-glib/appstream-glib.pc.in4
-rw-r--r--libappstream-glib/as-store-cab.c14
-rw-r--r--libappstream-glib/as-store-cab.h2
-rw-r--r--libappstream-glib/as-store.c24
-rw-r--r--libappstream-glib/as-store.h4
7 files changed, 23 insertions, 28 deletions
diff --git a/libappstream-glib/Makefile.am b/libappstream-glib/Makefile.am
index e44da48..de46acc 100644
--- a/libappstream-glib/Makefile.am
+++ b/libappstream-glib/Makefile.am
@@ -82,7 +82,6 @@ libappstream_glib_include_HEADERS = \
as-release.h \
as-screenshot.h \
as-store.h \
- as-store-cab.h \
as-tag.h \
as-utils.h \
as-version.h
@@ -122,6 +121,7 @@ libappstream_glib_la_SOURCES = \
as-screenshot-private.h \
as-store.c \
as-store-cab.c \
+ as-store-cab.h \
as-tag.c \
as-utils.c \
as-utils-private.h \
diff --git a/libappstream-glib/appstream-glib.h b/libappstream-glib/appstream-glib.h
index 2f5e6a3..4c5945c 100644
--- a/libappstream-glib/appstream-glib.h
+++ b/libappstream-glib/appstream-glib.h
@@ -38,7 +38,6 @@
#include <as-release.h>
#include <as-screenshot.h>
#include <as-store.h>
-#include <as-store-cab.h>
#include <as-tag.h>
#include <as-version.h>
#include <as-utils.h>
diff --git a/libappstream-glib/appstream-glib.pc.in b/libappstream-glib/appstream-glib.pc.in
index f757c7d..caf82ab 100644
--- a/libappstream-glib/appstream-glib.pc.in
+++ b/libappstream-glib/appstream-glib.pc.in
@@ -6,8 +6,8 @@ includedir=@includedir@
Name: appstream-glib
Description: Objects and helper methods to help reading and writing AppStream metadata
Version: @VERSION@
-Requires.private: libarchive
-Requires: glib-2.0, gobject-2.0, gdk-pixbuf-2.0, libgcab-1.0
+Requires.private: libarchive, libgcab-1.0
+Requires: glib-2.0, gobject-2.0, gdk-pixbuf-2.0
Libs: -L${libdir} -lappstream-glib
Cflags: -I${includedir}/libappstream-glib
diff --git a/libappstream-glib/as-store-cab.c b/libappstream-glib/as-store-cab.c
index f09e779..0684e97 100644
--- a/libappstream-glib/as-store-cab.c
+++ b/libappstream-glib/as-store-cab.c
@@ -252,18 +252,18 @@ as_store_cab_from_stream (AsStore *store,
}
/**
- * as_store_cab_from_data:
+ * as_store_cab_from_bytes:
**/
gboolean
-as_store_cab_from_data (AsStore *store,
- GBytes *data,
- GCancellable *cancellable,
- GError **error)
+as_store_cab_from_bytes (AsStore *store,
+ GBytes *bytes,
+ GCancellable *cancellable,
+ GError **error)
{
g_autoptr(GInputStream) input_stream = NULL;
- input_stream = g_memory_input_stream_new_from_bytes (data);
+ input_stream = g_memory_input_stream_new_from_bytes (bytes);
return as_store_cab_from_stream (store, input_stream,
- g_bytes_get_size (data),
+ g_bytes_get_size (bytes),
cancellable, error);
}
diff --git a/libappstream-glib/as-store-cab.h b/libappstream-glib/as-store-cab.h
index a6f3672..474e9eb 100644
--- a/libappstream-glib/as-store-cab.h
+++ b/libappstream-glib/as-store-cab.h
@@ -37,7 +37,7 @@ gboolean as_store_cab_from_file (AsStore *store,
GFile *file,
GCancellable *cancellable,
GError **error);
-gboolean as_store_cab_from_data (AsStore *store,
+gboolean as_store_cab_from_bytes (AsStore *store,
GBytes *bytes,
GCancellable *cancellable,
GError **error);
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index 709cb34..6b6618f 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -1227,31 +1227,27 @@ as_store_from_file (AsStore *store,
}
/**
- * as_store_from_data:
+ * as_store_from_bytes:
* @store: a #AsStore instance.
- * @file: a #GFile.
- * @icon_root: the icon path, or %NULL for the default.
+ * @bytes: a #GBytes.
* @cancellable: a #GCancellable.
* @error: A #GError or %NULL.
*
- * Parses an AppStream XML or DEP-11 YAML file and adds any valid applications
- * to the store.
- *
- * If the root node does not have a 'origin' attribute, then the method
- * as_store_set_origin() should be called *before* this function if cached
- * icons are required.
+ * Parses an appstream store presented as an archive. This is typically
+ * a .cab file containing firmware files.
*
* Returns: %TRUE for success
*
* Since: 0.5.2
**/
gboolean
-as_store_from_data (AsStore *store,
- GFile *file,
- GCancellable *cancellable,
- GError **error)
+as_store_from_bytes (AsStore *store,
+ GBytes *bytes,
+ GCancellable *cancellable,
+ GError **error)
{
- return TRUE;
+ /* lets assume this is a .cab file for now */
+ return as_store_cab_from_bytes (store, bytes, cancellable, error);
}
/**
diff --git a/libappstream-glib/as-store.h b/libappstream-glib/as-store.h
index c3b8941..4847c0d 100644
--- a/libappstream-glib/as-store.h
+++ b/libappstream-glib/as-store.h
@@ -131,8 +131,8 @@ gboolean as_store_from_file (AsStore *store,
const gchar *icon_root,
GCancellable *cancellable,
GError **error);
-gboolean as_store_from_data (AsStore *store,
- GBytes *data,
+gboolean as_store_from_bytes (AsStore *store,
+ GBytes *bytes,
GCancellable *cancellable,
GError **error);
gboolean as_store_from_xml (AsStore *store,