0.8.6
This commit is contained in:
parent
51f688d115
commit
e3ee79159f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/AppStream-0.8.4.tar.xz
|
||||
/AppStream-0.8.6.tar.xz
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
From a97eaf579067243592674ed7e8b1a87af3294bc8 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Klumpp <matthias@tenstral.net>
|
||||
Date: Tue, 29 Sep 2015 20:06:06 +0200
|
||||
Subject: [PATCH 3/5] trivial: Improve debug output when writing cache
|
||||
|
||||
---
|
||||
src/as-data-pool.c | 1 +
|
||||
src/xapian/database-write.cpp | 11 ++++++-----
|
||||
2 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/as-data-pool.c b/src/as-data-pool.c
|
||||
index 9812352..d2e5be2 100644
|
||||
--- a/src/as-data-pool.c
|
||||
+++ b/src/as-data-pool.c
|
||||
@@ -139,6 +139,7 @@ as_data_pool_add_new_component (AsDataPool *dpool, AsComponent *cpt)
|
||||
g_hash_table_replace (priv->cpt_table,
|
||||
g_strdup (cpt_id),
|
||||
g_object_ref (cpt));
|
||||
+ g_debug ("Replaced '%s' with data of higher priority.", cpt_id);
|
||||
} else {
|
||||
if ((!as_component_has_bundle (existing_cpt)) && (as_component_has_bundle (cpt))) {
|
||||
GHashTable *bundles;
|
||||
diff --git a/src/xapian/database-write.cpp b/src/xapian/database-write.cpp
|
||||
index b51d069..8272dd6 100644
|
||||
--- a/src/xapian/database-write.cpp
|
||||
+++ b/src/xapian/database-write.cpp
|
||||
@@ -85,12 +85,14 @@ DatabaseWrite::rebuild (GList *cpt_list)
|
||||
string db_locale;
|
||||
|
||||
// Create the rebuild directory
|
||||
- if (!as_utils_touch_dir (rebuild_path.c_str ()))
|
||||
+ if (!as_utils_touch_dir (rebuild_path.c_str ())) {
|
||||
+ g_warning ("Unable to create database rebuild directory.");
|
||||
return false;
|
||||
+ }
|
||||
|
||||
// check if old unrequired version of db still exists on filesystem
|
||||
if (g_file_test (old_path.c_str (), G_FILE_TEST_EXISTS)) {
|
||||
- g_warning ("Existing xapian old db was not previously cleaned: '%s'.", old_path.c_str ());
|
||||
+ g_warning ("Existing xapian old db was not cleaned previously: '%s'.", old_path.c_str ());
|
||||
as_utils_delete_dir_recursive (old_path.c_str ());
|
||||
}
|
||||
|
||||
@@ -128,14 +130,12 @@ DatabaseWrite::rebuild (GList *cpt_list)
|
||||
Xapian::Document doc;
|
||||
term_generator.set_document (doc);
|
||||
|
||||
- //! g_debug ("Adding component: %s", as_component_to_string (cpt));
|
||||
-
|
||||
doc.set_data (as_component_get_name (cpt));
|
||||
|
||||
// Package name
|
||||
gchar **pkgs = as_component_get_pkgnames (cpt);
|
||||
if (pkgs == NULL) {
|
||||
- g_warning ("Skipped component '%s' from inclusion into database: Does not have package names defined.",
|
||||
+ g_warning ("Skipped component '%s' from inclusion into database: Does not have package name(s) defined.",
|
||||
as_component_get_id (cpt));
|
||||
continue;
|
||||
}
|
||||
@@ -357,6 +357,7 @@ DatabaseWrite::rebuild (GList *cpt_list)
|
||||
doc.add_term ("AA" + docData);
|
||||
term_generator.index_text_without_positions (docData, WEIGHT_DESKTOP_NAME);
|
||||
|
||||
+ //! g_debug ("Adding component: %s", as_component_to_string (cpt));
|
||||
db.add_document (doc);
|
||||
|
||||
// infer database locale from single component
|
||||
--
|
||||
2.5.0
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
From 4d67e6dcce96ca6050fdc968dbf312e20ade4038 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Klumpp <matthias@tenstral.net>
|
||||
Date: Tue, 29 Sep 2015 20:12:04 +0200
|
||||
Subject: [PATCH 4/5] trivial: Formatting fixes
|
||||
|
||||
---
|
||||
src/xapian/database-cwrap.hpp | 44 +++++++++++++++++++++----------------------
|
||||
src/xapian/database-read.hpp | 20 ++++++++++----------
|
||||
src/xapian/database-write.hpp | 2 +-
|
||||
3 files changed, 33 insertions(+), 33 deletions(-)
|
||||
|
||||
diff --git a/src/xapian/database-cwrap.hpp b/src/xapian/database-cwrap.hpp
|
||||
index bf89c18..3975dcd 100644
|
||||
--- a/src/xapian/database-cwrap.hpp
|
||||
+++ b/src/xapian/database-cwrap.hpp
|
||||
@@ -1,6 +1,6 @@
|
||||
/* database-cwrap.hpp
|
||||
*
|
||||
- * Copyright (C) 2012-2014 Matthias Klumpp <matthias@tenstral.net>
|
||||
+ * Copyright (C) 2012-2015 Matthias Klumpp <matthias@tenstral.net>
|
||||
*
|
||||
* Licensed under the GNU Lesser General Public License Version 2.1
|
||||
*
|
||||
@@ -36,33 +36,33 @@ typedef struct XADatabaseWrite XADatabaseWrite;
|
||||
/* methods for database read access */
|
||||
|
||||
XADatabaseRead *xa_database_read_new ();
|
||||
-void xa_database_read_free (XADatabaseRead *db);
|
||||
+void xa_database_read_free (XADatabaseRead *db);
|
||||
|
||||
-gboolean xa_database_read_open (XADatabaseRead *db,
|
||||
- const gchar *db_path);
|
||||
-GPtrArray *xa_database_read_get_all_components (XADatabaseRead *db);
|
||||
-GPtrArray *xa_database_read_find_components (XADatabaseRead *db,
|
||||
- AsSearchQuery *query);
|
||||
-AsComponent *xa_database_read_get_component_by_id (XADatabaseRead *db,
|
||||
- const gchar *idname);
|
||||
-GPtrArray *xa_database_read_get_components_by_provides (XADatabaseRead *db,
|
||||
- AsProvidesKind kind,
|
||||
- const gchar *value,
|
||||
- const gchar *data);
|
||||
-GPtrArray *xa_database_read_get_components_by_kind (XADatabaseRead *db,
|
||||
- AsComponentKind kinds);
|
||||
+gboolean xa_database_read_open (XADatabaseRead *db,
|
||||
+ const gchar *db_path);
|
||||
+GPtrArray *xa_database_read_get_all_components (XADatabaseRead *db);
|
||||
+GPtrArray *xa_database_read_find_components (XADatabaseRead *db,
|
||||
+ AsSearchQuery *query);
|
||||
+AsComponent *xa_database_read_get_component_by_id (XADatabaseRead *db,
|
||||
+ const gchar *idname);
|
||||
+GPtrArray *xa_database_read_get_components_by_provides (XADatabaseRead *db,
|
||||
+ AsProvidesKind kind,
|
||||
+ const gchar *value,
|
||||
+ const gchar *data);
|
||||
+GPtrArray *xa_database_read_get_components_by_kind (XADatabaseRead *db,
|
||||
+ AsComponentKind kinds);
|
||||
|
||||
/* methods for database write access */
|
||||
|
||||
XADatabaseWrite *xa_database_write_new ();
|
||||
-void xa_database_write_free (XADatabaseWrite *db);
|
||||
+void xa_database_write_free (XADatabaseWrite *db);
|
||||
|
||||
-gboolean xa_database_write_initialize (XADatabaseWrite *db,
|
||||
- const gchar *db_path);
|
||||
-gboolean xa_database_write_add_component (XADatabaseWrite *db,
|
||||
- AsComponent *cpt);
|
||||
-gboolean xa_database_write_rebuild (XADatabaseWrite *db,
|
||||
- GList *cpt_list);
|
||||
+gboolean xa_database_write_initialize (XADatabaseWrite *db,
|
||||
+ const gchar *db_path);
|
||||
+gboolean xa_database_write_add_component (XADatabaseWrite *db,
|
||||
+ AsComponent *cpt);
|
||||
+gboolean xa_database_write_rebuild (XADatabaseWrite *db,
|
||||
+ GList *cpt_list);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
diff --git a/src/xapian/database-read.hpp b/src/xapian/database-read.hpp
|
||||
index 8a3cad0..255d3c4 100644
|
||||
--- a/src/xapian/database-read.hpp
|
||||
+++ b/src/xapian/database-read.hpp
|
||||
@@ -46,11 +46,11 @@ public:
|
||||
string getSchemaVersion ();
|
||||
string getLocale ();
|
||||
|
||||
- GPtrArray *getAllComponents ();
|
||||
- GPtrArray *findComponents (AsSearchQuery *asQuery);
|
||||
- AsComponent *getComponentById (const gchar *idname);
|
||||
- GPtrArray *getComponentsByProvides (AsProvidesKind kind, const gchar *value, const gchar *data);
|
||||
- GPtrArray *getComponentsByKind (AsComponentKind kinds);
|
||||
+ GPtrArray *getAllComponents ();
|
||||
+ GPtrArray *findComponents (AsSearchQuery *asQuery);
|
||||
+ AsComponent *getComponentById (const gchar *idname);
|
||||
+ GPtrArray *getComponentsByProvides (AsProvidesKind kind, const gchar *value, const gchar *data);
|
||||
+ GPtrArray *getComponentsByKind (AsComponentKind kinds);
|
||||
|
||||
private:
|
||||
Xapian::Database m_xapianDB;
|
||||
@@ -60,11 +60,11 @@ private:
|
||||
|
||||
AsComponent *docToComponent (Xapian::Document);
|
||||
|
||||
- Xapian::QueryParser newAppStreamParser ();
|
||||
- Xapian::Query addCategoryToQuery (Xapian::Query query, Xapian::Query category_query);
|
||||
- Xapian::Query getQueryForPkgNames (vector<string> pkgnames);
|
||||
- Xapian::Query getQueryForCategory (gchar *cat_id);
|
||||
- void appendSearchResults (Xapian::Enquire enquire, GPtrArray *cptArray);
|
||||
+ Xapian::QueryParser newAppStreamParser ();
|
||||
+ Xapian::Query addCategoryToQuery (Xapian::Query query, Xapian::Query category_query);
|
||||
+ Xapian::Query getQueryForPkgNames (vector<string> pkgnames);
|
||||
+ Xapian::Query getQueryForCategory (gchar *cat_id);
|
||||
+ void appendSearchResults (Xapian::Enquire enquire, GPtrArray *cptArray);
|
||||
vector<Xapian::Query> queryListFromSearchEntry (AsSearchQuery *asQuery);
|
||||
};
|
||||
|
||||
diff --git a/src/xapian/database-write.hpp b/src/xapian/database-write.hpp
|
||||
index 39547ca..15d7af0 100644
|
||||
--- a/src/xapian/database-write.hpp
|
||||
+++ b/src/xapian/database-write.hpp
|
||||
@@ -1,6 +1,6 @@
|
||||
/* database-write.hpp
|
||||
*
|
||||
- * Copyright (C) 2012-2013 Matthias Klumpp <matthias@tenstral.net>
|
||||
+ * Copyright (C) 2012-2014 Matthias Klumpp <matthias@tenstral.net>
|
||||
*
|
||||
* Licensed under the GNU Lesser General Public License Version 2.1
|
||||
*
|
||||
--
|
||||
2.5.0
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
From c09d1c1d6b75035ae617908ddcb81342cfdaad12 Mon Sep 17 00:00:00 2001
|
||||
From: Matthias Klumpp <matthias@tenstral.net>
|
||||
Date: Tue, 29 Sep 2015 20:25:09 +0200
|
||||
Subject: [PATCH 5/5] Don't stop processing completely, if XML file with errors
|
||||
is found
|
||||
|
||||
---
|
||||
src/as-data-pool.c | 8 +++-----
|
||||
src/as-metadata.c | 6 ++++--
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/as-data-pool.c b/src/as-data-pool.c
|
||||
index d2e5be2..d50be3f 100644
|
||||
--- a/src/as-data-pool.c
|
||||
+++ b/src/as-data-pool.c
|
||||
@@ -199,7 +199,7 @@ as_data_pool_read_asxml (AsDataPool *dpool)
|
||||
GPtrArray *components;
|
||||
guint i;
|
||||
GFile *infile;
|
||||
- gboolean ret = TRUE;
|
||||
+ gboolean ret;
|
||||
const gchar *content_type;
|
||||
AsMetadata *metad;
|
||||
GError *error = NULL;
|
||||
@@ -241,6 +241,7 @@ as_data_pool_read_asxml (AsDataPool *dpool)
|
||||
as_metadata_set_parser_mode (metad, AS_PARSER_MODE_DISTRO);
|
||||
as_metadata_set_locale (metad, priv->locale);
|
||||
|
||||
+ ret = TRUE;
|
||||
for (i = 0; i < xml_files->len; i++) {
|
||||
gchar *fname;
|
||||
GFileInfo *info = NULL;
|
||||
@@ -258,7 +259,7 @@ as_data_pool_read_asxml (AsDataPool *dpool)
|
||||
G_FILE_QUERY_INFO_NONE,
|
||||
NULL, NULL);
|
||||
if (info == NULL) {
|
||||
- g_debug ("No info for file '%s' found, file was skipped.", fname);
|
||||
+ g_debug ("No file-info for '%s' found, file was skipped.", fname);
|
||||
g_object_unref (infile);
|
||||
continue;
|
||||
}
|
||||
@@ -277,9 +278,6 @@ as_data_pool_read_asxml (AsDataPool *dpool)
|
||||
}
|
||||
g_object_unref (info);
|
||||
g_object_unref (infile);
|
||||
-
|
||||
- if (!ret)
|
||||
- break;
|
||||
}
|
||||
|
||||
components = as_metadata_get_components (metad);
|
||||
diff --git a/src/as-metadata.c b/src/as-metadata.c
|
||||
index 4c73d96..493d3f1 100644
|
||||
--- a/src/as-metadata.c
|
||||
+++ b/src/as-metadata.c
|
||||
@@ -917,12 +917,14 @@ as_metadata_process_document (AsMetadata *metad, const gchar* xmldoc_str, GError
|
||||
} else if (g_strcmp0 ((gchar*) root->name, "component") == 0) {
|
||||
as_metadata_set_parser_mode (metad, AS_PARSER_MODE_UPSTREAM);
|
||||
cpt = as_metadata_parse_component_node (metad, root, TRUE, error);
|
||||
- g_ptr_array_add (priv->cpts, cpt);
|
||||
+ if (cpt != NULL)
|
||||
+ g_ptr_array_add (priv->cpts, cpt);
|
||||
} else if (g_strcmp0 ((gchar*) root->name, "application") == 0) {
|
||||
as_metadata_set_parser_mode (metad, AS_PARSER_MODE_UPSTREAM);
|
||||
g_debug ("Parsing legacy AppStream metadata file.");
|
||||
cpt = as_metadata_parse_component_node (metad, root, TRUE, error);
|
||||
- g_ptr_array_add (priv->cpts, cpt);
|
||||
+ if (cpt != NULL)
|
||||
+ g_ptr_array_add (priv->cpts, cpt);
|
||||
} else {
|
||||
g_set_error_literal (error,
|
||||
AS_METADATA_ERROR,
|
||||
--
|
||||
2.5.0
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
|
||||
Summary: Utilities to generate, maintain and access the AppStream Xapian database
|
||||
Name: appstream
|
||||
Version: 0.8.4
|
||||
Release: 3%{?dist}
|
||||
Version: 0.8.6
|
||||
Release: 1%{?dist}
|
||||
|
||||
# lib LGPLv2+, tools GPLv2+
|
||||
License: GPLv2+ and LGPLv2+
|
||||
@ -13,9 +13,6 @@ URL: http://www.freedesktop.org/wiki/Distributions/AppStream/Software
|
||||
Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz
|
||||
|
||||
## upstream patches
|
||||
Patch3: 0003-trivial-Improve-debug-output-when-writing-cache.patch
|
||||
Patch4: 0004-trivial-Formatting-fixes.patch
|
||||
Patch5: 0005-Don-t-stop-processing-completely-if-XML-file-with-er.patch
|
||||
|
||||
## upstreamable patches
|
||||
|
||||
@ -25,8 +22,10 @@ BuildRequires: intltool
|
||||
BuildRequires: pkgconfig(gio-2.0) pkgconfig(gobject-introspection-1.0)
|
||||
BuildRequires: pkgconfig(libxml-2.0)
|
||||
BuildRequires: pkgconfig(packagekit-glib2)
|
||||
BuildRequires: pkgconfig(protobuf-lite)
|
||||
BuildRequires: pkgconfig(Qt5Core)
|
||||
BuildRequires: pkgconfig(yaml-0.1)
|
||||
BuildRequires: protobuf-compiler
|
||||
BuildRequires: xapian-core-devel
|
||||
BuildRequires: xmlto
|
||||
|
||||
@ -157,6 +156,9 @@ make test -C %{_target_platform} ARGS="--output-on-failure --timeout 300"
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Dec 13 2015 Rex Dieter <rdieter@fedoraproject.org> 0.8.6-1
|
||||
- 0.8.6
|
||||
|
||||
* Tue Sep 29 2015 Rex Dieter <rdieter@fedoraproject.org> 0.8.4-3
|
||||
- Don't abort hitting unknown appstream tags (#1267312)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user