[apper] upstream fixes, mostly appstream related
Rex Dieter
rdieter at fedoraproject.org
Thu Jul 17 14:55:51 UTC 2014
commit 1bb3dde32b8ca8262dab2bed7a760c285dbb52f5
Author: Rex Dieter <rdieter at math.unl.edu>
Date: Thu Jul 17 09:56:02 2014 -0500
upstream fixes, mostly appstream related
...rivial-Don-t-use-deprecated-AppStream-API.patch | 39 +++
0007-Fix-compilation-again.patch | 264 ++++++++++++++++++++
...-developer_name-tag-to-AppStream-metadata.patch | 24 ++
0014-Adjust-to-AppStream-0.7-API-change.patch | 36 +++
apper.spec | 6 +-
5 files changed, 368 insertions(+), 1 deletions(-)
---
diff --git a/0005-trivial-Don-t-use-deprecated-AppStream-API.patch b/0005-trivial-Don-t-use-deprecated-AppStream-API.patch
new file mode 100644
index 0000000..e8deb2e
--- /dev/null
+++ b/0005-trivial-Don-t-use-deprecated-AppStream-API.patch
@@ -0,0 +1,39 @@
+From 6daea708d76302c282e20511f2b77e1bac093fb3 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Mon, 12 May 2014 19:29:17 +0200
+Subject: [PATCH 05/17] trivial: Don't use deprecated AppStream API
+
+---
+ libapper/AppStream.cpp | 2 +-
+ libapper/CMakeLists.txt | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libapper/AppStream.cpp b/libapper/AppStream.cpp
+index 4c12c18..65f4853 100644
+--- a/libapper/AppStream.cpp
++++ b/libapper/AppStream.cpp
+@@ -95,7 +95,7 @@ bool AppStream::open()
+ QString pkgName = QString::fromUtf8(as_component_get_pkgname(cpt));
+
+ // Desktop file
+- app.id = QString::fromUtf8(as_component_get_idname(cpt));
++ app.id = QString::fromUtf8(as_component_get_id(cpt));
+
+ // Summary
+ app.summary = QString::fromUtf8(as_component_get_summary(cpt));
+diff --git a/libapper/CMakeLists.txt b/libapper/CMakeLists.txt
+index 0c0fd0d..3e4db83 100644
+--- a/libapper/CMakeLists.txt
++++ b/libapper/CMakeLists.txt
+@@ -33,7 +33,7 @@ set(libapper_SRCS
+
+ if(APPSTREAM)
+ pkg_check_modules(GLIB2 REQUIRED glib-2.0>=2.36)
+- pkg_check_modules(APPSTREAM REQUIRED appstream>=0.6)
++ pkg_check_modules(APPSTREAM REQUIRED appstream>=0.6.2)
+
+ set(libapper_SRCS ${libapper_SRCS} AppStream.cpp)
+ endif()
+--
+1.9.3
+
diff --git a/0007-Fix-compilation-again.patch b/0007-Fix-compilation-again.patch
new file mode 100644
index 0000000..d3c010b
--- /dev/null
+++ b/0007-Fix-compilation-again.patch
@@ -0,0 +1,264 @@
+From 99de7068da018df4dfd490f8e8751e8532699589 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Tue, 20 May 2014 01:57:03 +0200
+Subject: [PATCH 07/17] Fix compilation again
+
+* Drop RepairSystem(), no longer supported by PackageKit
+* Adjust to AppStream-based Listaller API
+---
+ AppSetup/CMakeLists.txt | 5 ++++-
+ AppSetup/SetupWizard.cpp | 10 ++++++----
+ AppSetup/main.cpp | 4 ++--
+ Apper/BackendDetails.cpp | 1 -
+ Apper/BackendDetails.ui | 32 +++++++++++---------------------
+ apperd/TransactionWatcher.cpp | 7 +++----
+ libapper/PkIcons.cpp | 1 -
+ libapper/PkStrings.cpp | 8 ++------
+ 8 files changed, 28 insertions(+), 40 deletions(-)
+
+diff --git a/AppSetup/CMakeLists.txt b/AppSetup/CMakeLists.txt
+index 05ed512..b4561ac 100644
+--- a/AppSetup/CMakeLists.txt
++++ b/AppSetup/CMakeLists.txt
+@@ -1,11 +1,13 @@
+ pkg_check_modules(GLIB2 REQUIRED glib-2.0>=2.36)
+-pkg_check_modules(LISTALLER REQUIRED listaller-glib>=0.5.7)
++pkg_check_modules(LISTALLER REQUIRED listaller-glib>=0.5.8)
++pkg_check_modules(APPSTREAM REQUIRED appstream>=0.6.2)
+ pkg_check_modules(GEE REQUIRED gee-1.0>=0.6)
+
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}
+ ${GLIB2_INCLUDE_DIR}
+ ${GEE_INCLUDE_DIRS}
+ ${LISTALLER_INCLUDE_DIRS}
++ ${APPSTREAM_INCLUDE_DIRS}
+ )
+
+ set(AppSetup_SRCS main.cpp
+@@ -28,6 +30,7 @@ target_link_libraries(apper-appsetup
+ ${KDE4_KDEUI_LIBS}
+ ${GLIB2_LIBRARIES}
+ ${LISTALLER_LIBRARIES}
++ ${APPSTREAM_LIBRARIES}
+ apper
+ )
+
+diff --git a/AppSetup/SetupWizard.cpp b/AppSetup/SetupWizard.cpp
+index 91008b7..94392e9 100644
+--- a/AppSetup/SetupWizard.cpp
++++ b/AppSetup/SetupWizard.cpp
+@@ -18,6 +18,7 @@
+ * Boston, MA 02110-1301, USA.
+ */
+
++#include <listaller.h>
+ #include "SetupWizard.h"
+ #include "ui_SetupWizard.h"
+
+@@ -31,7 +32,6 @@
+ #include <KDebug>
+ #include <KMessageBox>
+ #include <KGlobalSettings>
+-#include <listaller.h>
+
+ #include "InfoWidget.h"
+ #include "SimplePage.h"
+@@ -82,7 +82,8 @@ void on_lisetup_status_changed(GObject *sender, ListallerStatusItem *status, Set
+ ListallerStatusEnum statusType = listaller_status_item_get_status(status);
+
+ if (statusType == LISTALLER_STATUS_ENUM_INSTALLATION_FINISHED) {
+- QString appName = QString::fromUtf8(listaller_app_item_get_full_name(d->appID));
++ AsComponent *info = listaller_app_item_get_info (d->appID);
++ QString appName = QString::fromUtf8(as_component_get_name (info));
+ d->infoPage->reset();
+ d->infoPage->setWindowTitle(i18n("Installation finished!"));
+ d->infoPage->setDescription(i18n("%1 has been installed successfully!", appName));
+@@ -183,7 +184,8 @@ bool SetupWizard::constructWizardLayout()
+ return false;
+ }
+
+- QString appName = listaller_app_item_get_full_name(d->appID);
++ AsComponent *info = listaller_app_item_get_info (d->appID);
++ QString appName = as_component_get_name(info);
+
+ // Welcome page
+ SimplePage *introP = new SimplePage(this);
+@@ -257,7 +259,7 @@ bool SetupWizard::constructWizardLayout()
+ SimplePage *descP = new SimplePage(this);
+ descP->setTitle(i18n("Application description"));
+ descP->setDescription(i18n("Description"));
+- descP->setDetails(listaller_app_item_get_description(d->appID));
++ descP->setDetails(as_component_get_description(info));
+ ui->stackedWidget->addWidget(descP);
+ d->preparationPageCount++;
+
+diff --git a/AppSetup/main.cpp b/AppSetup/main.cpp
+index ea9e74a..b42d2eb 100644
+--- a/AppSetup/main.cpp
++++ b/AppSetup/main.cpp
+@@ -18,14 +18,14 @@
+ * Boston, MA 02110-1301, USA.
+ */
+
++#include <glib-object.h>
++#include <listaller.h>
+ #include <KAboutData>
+ #include <KCmdLineArgs>
+ #include <KDebug>
+ #include <KApplication>
+ #include <KMessageBox>
+ #include <QFileInfo>
+-#include <glib-object.h>
+-#include <listaller.h>
+
+ #include "SetupWizard.h"
+
+diff --git a/Apper/BackendDetails.cpp b/Apper/BackendDetails.cpp
+index 54638d1..6826a11 100644
+--- a/Apper/BackendDetails.cpp
++++ b/Apper/BackendDetails.cpp
+@@ -77,7 +77,6 @@ BackendDetails::BackendDetails(QWidget *parent) :
+ ui->whatProvidesCB->setChecked(actions & Transaction::RoleWhatProvides);
+ ui->getPackagesCB->setChecked(actions & Transaction::RoleGetPackages);
+ ui->repairSystemCB->setChecked(actions & Transaction::RoleRepairSystem);
+- ui->upgradeSystemCB->setChecked(actions & Transaction::RoleUpgradeSystem);
+
+ // FILTERS - Setup filters
+ Transaction::Filters filters = Daemon::global()->filters();
+diff --git a/Apper/BackendDetails.ui b/Apper/BackendDetails.ui
+index 85d7338..1157f4b 100644
+--- a/Apper/BackendDetails.ui
++++ b/Apper/BackendDetails.ui
+@@ -7,7 +7,7 @@
+ <x>0</x>
+ <y>0</y>
+ <width>552</width>
+- <height>462</height>
++ <height>509</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+@@ -287,26 +287,6 @@
+ </property>
+ </widget>
+ </item>
+- <item row="6" column="3">
+- <widget class="QCheckBox" name="repairSystemCB">
+- <property name="enabled">
+- <bool>false</bool>
+- </property>
+- <property name="text">
+- <string>Repair System</string>
+- </property>
+- </widget>
+- </item>
+- <item row="5" column="3">
+- <widget class="QCheckBox" name="upgradeSystemCB">
+- <property name="enabled">
+- <bool>false</bool>
+- </property>
+- <property name="text">
+- <string>Upgrade System</string>
+- </property>
+- </widget>
+- </item>
+ <item row="4" column="3">
+ <widget class="QCheckBox" name="getPackagesCB">
+ <property name="enabled">
+@@ -357,6 +337,16 @@
+ </property>
+ </widget>
+ </item>
++ <item row="5" column="3">
++ <widget class="QCheckBox" name="repairSystemCB">
++ <property name="enabled">
++ <bool>false</bool>
++ </property>
++ <property name="text">
++ <string>Repair System</string>
++ </property>
++ </widget>
++ </item>
+ </layout>
+ </widget>
+ </item>
+diff --git a/apperd/TransactionWatcher.cpp b/apperd/TransactionWatcher.cpp
+index 23ded5c..95a0768 100644
+--- a/apperd/TransactionWatcher.cpp
++++ b/apperd/TransactionWatcher.cpp
+@@ -91,7 +91,7 @@ void TransactionWatcher::watchTransaction(const QDBusObjectPath &tid, bool inter
+ this, SLOT(finished(PackageKit::Transaction::Exit)));
+
+ // Store the transaction id
+- m_transactions[tid] = transaction;
++ m_transactions[tid] = transaction;
+ } else {
+ transaction = m_transactions[tid];
+
+@@ -112,8 +112,7 @@ void TransactionWatcher::transactionReady()
+ (role == Transaction::RoleInstallPackages ||
+ role == Transaction::RoleInstallFiles ||
+ role == Transaction::RoleRemovePackages ||
+- role == Transaction::RoleUpdatePackages ||
+- role == Transaction::RoleUpgradeSystem)) {
++ role == Transaction::RoleUpdatePackages)) {
+ // AVOID showing messages and restart requires when
+ // the user was just simulating an instalation
+ connect(transaction, SIGNAL(message(PackageKit::Transaction::Message,QString)),
+@@ -153,7 +152,7 @@ void TransactionWatcher::finished(PackageKit::Transaction::Exit exit)
+ {
+ // check if the transaction emitted any require restart
+ Transaction *transaction = qobject_cast<Transaction*>(sender());
+- QDBusObjectPath tid = transaction->tid();
++ QDBusObjectPath tid = transaction->tid();
+ transaction->disconnect(this);
+ m_transactions.remove(tid);
+ m_transactionJob.remove(tid);
+diff --git a/libapper/PkIcons.cpp b/libapper/PkIcons.cpp
+index b0eb4ec..a1237ce 100644
+--- a/libapper/PkIcons.cpp
++++ b/libapper/PkIcons.cpp
+@@ -206,7 +206,6 @@ QString PkIcons::actionIconName(Transaction::Role role)
+ case Transaction::RoleSearchGroup : return "search-package";
+ case Transaction::RoleSearchName : return "search-package";
+ case Transaction::RoleUpdatePackages : return "package-update";
+- case Transaction::RoleUpgradeSystem : return "distro-upgrade";//TODO
+ case Transaction::RoleWhatProvides : return "search-package";
+ case Transaction::RoleRepairSystem : return "package-rollback";
+ }
+diff --git a/libapper/PkStrings.cpp b/libapper/PkStrings.cpp
+index ece1cdf..ada20ce 100644
+--- a/libapper/PkStrings.cpp
++++ b/libapper/PkStrings.cpp
+@@ -262,8 +262,6 @@ QString PkStrings::action(Transaction::Role role, Transaction::TransactionFlags
+ return i18nc("The role of the transaction, in present tense", "Getting categories");
+ case Transaction::RoleGetOldTransactions :
+ return i18nc("The role of the transaction, in present tense", "Getting old transactions");
+- case Transaction::RoleUpgradeSystem :
+- return i18nc("The role of the transaction, in present tense", "Upgrading system");
+ case Transaction::RoleRepairSystem :
+ return i18nc("The role of the transaction, in present tense", "Repairing system");
+ case Transaction::RoleRepoRemove:
+@@ -336,8 +334,6 @@ QString PkStrings::actionPast(Transaction::Role action)
+ return i18nc("The role of the transaction, in past tense", "Got categories");
+ case Transaction::RoleGetOldTransactions :
+ return i18nc("The role of the transaction, in past tense", "Got old transactions");
+- case Transaction::RoleUpgradeSystem :
+- return i18nc("The role of the transaction, in past tense", "Upgraded system");
+ case Transaction::RoleRepairSystem:
+ return i18nc("The role of the transaction, in past tense", "Repaired system");
+ case Transaction::RoleRepoRemove:
+@@ -853,8 +849,8 @@ QString PkStrings::packageQuantity(bool updates, int packages, int selected)
+ "1 Update", "%1 Updates",
+ packages);
+ } else {
+- return i18nc("Type of update, in the case it's just an update", "%1, %2",
+- i18ncp("Part of: %1 Updates, %1 Selected", "%1 Update", "%1 Updates", packages),
++ return i18nc("Type of update, in the case it's just an update", "%1, %2",
++ i18ncp("Part of: %1 Updates, %1 Selected", "%1 Update", "%1 Updates", packages),
+ i18ncp("Part of: %1 Updates, %1 Selected", "%1 Selected", "%1 Selected", selected));
+ }
+ } else {
+--
+1.9.3
+
diff --git a/0013-Add-developer_name-tag-to-AppStream-metadata.patch b/0013-Add-developer_name-tag-to-AppStream-metadata.patch
new file mode 100644
index 0000000..9c66bfb
--- /dev/null
+++ b/0013-Add-developer_name-tag-to-AppStream-metadata.patch
@@ -0,0 +1,24 @@
+From 115874b0314223c35c7275345315df24e62571a8 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Wed, 9 Jul 2014 18:25:19 +0200
+Subject: [PATCH 13/17] Add developer_name tag to AppStream metadata
+
+---
+ Apper/apper.appdata.xml | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Apper/apper.appdata.xml b/Apper/apper.appdata.xml
+index 60400fc..fb4e7c2 100644
+--- a/Apper/apper.appdata.xml
++++ b/Apper/apper.appdata.xml
+@@ -203,6 +203,7 @@
+ <url type="homepage">https://projects.kde.org/projects/extragear/sysadmin/apper/</url>
+ <url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&product=apper</url>
+ <project_group>KDE</project_group>
++ <developer_name>The KDE Community</developer_name>
+ <provides>
+ <binary>apper</binary>
+ </provides>
+--
+1.9.3
+
diff --git a/0014-Adjust-to-AppStream-0.7-API-change.patch b/0014-Adjust-to-AppStream-0.7-API-change.patch
new file mode 100644
index 0000000..99482b7
--- /dev/null
+++ b/0014-Adjust-to-AppStream-0.7-API-change.patch
@@ -0,0 +1,36 @@
+From 4c728a349a926ef13b38a6def909e27d01113a99 Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias at tenstral.net>
+Date: Mon, 14 Jul 2014 17:30:17 +0200
+Subject: [PATCH 14/17] Adjust to AppStream 0.7 API change
+
+---
+ libapper/AppStream.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/libapper/AppStream.cpp b/libapper/AppStream.cpp
+index 65f4853..4507f0a 100644
+--- a/libapper/AppStream.cpp
++++ b/libapper/AppStream.cpp
+@@ -82,6 +82,7 @@ bool AppStream::open()
+ AsComponent *cpt;
+ GPtrArray *sshot_array;
+ AsScreenshot *sshot;
++ gchar **pkgs;
+ cpt = (AsComponent*) g_ptr_array_index(cptArray, i);
+ // we only want desktop apps at time
+ if (as_component_get_kind (cpt) != AS_COMPONENT_KIND_DESKTOP_APP)
+@@ -92,7 +93,10 @@ bool AppStream::open()
+ app.name = QString::fromUtf8(as_component_get_name(cpt));
+
+ // Package name
+- QString pkgName = QString::fromUtf8(as_component_get_pkgname(cpt));
++ pkgs = as_component_get_pkgnames(cpt);
++ QString pkgName;
++ if (pkgs != NULL)
++ pkgName = QString::fromUtf8(pkgs[0]);
+
+ // Desktop file
+ app.id = QString::fromUtf8(as_component_get_id(cpt));
+--
+1.9.3
+
diff --git a/apper.spec b/apper.spec
index f3e0d3b..cc4ad94 100644
--- a/apper.spec
+++ b/apper.spec
@@ -22,6 +22,10 @@ URL: http://kde-apps.org/content/show.php/Apper?content=84745
Source10: 01-fedora-org.packagekit.updater.js
## upstream patches
+Patch105: 0005-trivial-Don-t-use-deprecated-AppStream-API.patch
+Patch107: 0007-Fix-compilation-again.patch
+Patch113: 0013-Add-developer_name-tag-to-AppStream-metadata.patch
+Patch114: 0014-Adjust-to-AppStream-0.7-API-change.patch
Obsoletes: kpackagekit < 0.7.0
Provides: kpackagekit = %{version}-%{release}
@@ -55,7 +59,7 @@ KDE interface for PackageKit.
%prep
-%setup -q
+%autosetup -p1
%build
More information about the scm-commits
mailing list