=== added file 'debian/.gitignore' --- debian/.gitignore 1970-01-01 00:00:00 +0000 +++ debian/.gitignore 2017-02-13 17:11:16 +0000 @@ -0,0 +1,3 @@ +*~ +tmp +.directory === modified file 'debian/changelog' --- debian/changelog 2017-02-13 17:11:10 +0000 +++ debian/changelog 2017-02-13 17:18:01 +0000 @@ -1,12 +1,16 @@ -packagekit (1.1.4-3ubuntu1) zesty; urgency=medium - - * Merge with Debian; remaining changes: - + Add break on packagekit-plugin-click <= 0.3 - * Dropped changes: - + Add virtual packagekit-system-interface - - Nothing uses this anymore - - -- Jeremy Bicha Wed, 23 Nov 2016 16:22:44 -0500 +packagekit (1.1.5-1ubuntu1) UNRELEASED; urgency=medium + + * Sync with Debian (LP: #1664303). Remaining change: + - Add Breaks: packagekit-plugin-click (Closes: #852085) + + -- Jeremy Bicha Sat, 21 Jan 2017 20:35:30 +0000 + +packagekit (1.1.5-1) unstable; urgency=medium + + * New upstream version: 1.1.5 + * Drop all patches: Applied upstream + + -- Matthias Klumpp Fri, 20 Jan 2017 20:48:52 +0100 packagekit (1.1.4-3) unstable; urgency=medium === modified file 'debian/control' --- debian/control 2017-02-13 17:11:10 +0000 +++ debian/control 2017-02-13 17:11:16 +0000 @@ -5,7 +5,7 @@ XSBC-Original-Maintainer: Matthias Klumpp Uploaders: Julian Andres Klode Vcs-Git: https://anonscm.debian.org/git/pkg-packagekit/packagekit.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-packagekit/packagekit.git +Vcs-Browser: https://anonscm.debian.org/git/pkg-packagekit/packagekit.git Build-Depends: autoconf-archive, bash-completion, debhelper (>= 9.0.0), === removed file 'debian/patches/01_toinstall-aptcompliant.patch' --- debian/patches/01_toinstall-aptcompliant.patch 2017-02-13 17:11:10 +0000 +++ debian/patches/01_toinstall-aptcompliant.patch 1970-01-01 00:00:00 +0000 @@ -1,291 +0,0 @@ -From 9600c78d2001b267f5e57a088d4fcdc181679b87 Mon Sep 17 00:00:00 2001 -From: Harald Sitter -Date: Tue, 20 Sep 2016 11:58:53 +0200 -Subject: aptcc: make toinstall more apt compliant - -new arguments: autoInst and preserveAuto - -apt's markInstall can automatically try to resolve dependencies (incl. -recommends if applicable) without having the resolver deal with broken -dependencies at all. to that end it will mark dependencies of $package as -auto-install which gives them a slightly lower resolution score and the -auto flag (so they can be autoremoved). -To facilitate its use, the interface now calls toinstall twice: once -without autoInst to only mark explicitly wanted packages, and a second time -with autoInst to then also mark all needed dependencies. This is -specifically meant to allow or-relationships to resolve as desired. - -e.g. -``` -Package: foobar -Depends: foo|bar -``` -with `pkcon install foobar bar` will explicitly mark foobar and bar and -thus prevent foo from getting autoinstalled. - -In update scenarios it is hard to tell whether a user wants a package to be -installed or updated. In particular whether or not a package is meant to -be installed according to the user would prevent them from being -autoremoved. A user may however run `pkcon update foo` to update foo, not -because she actually thinks foo is needed or useful. To prevent -unintentionally losing the auto flag on updates, the backend now -always preserves the flag when updates are requested. Conversely on -installs we default to not having the auto flag. - -fixes #153 -fixes #151 -fixes #145 - ---- - backends/aptcc/pk-backend-aptcc.cpp | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - ---- a/backends/aptcc/pk-backend-aptcc.cpp -+++ b/backends/aptcc/pk-backend-aptcc.cpp -@@ -2,6 +2,7 @@ - * - * Copyright (C) 2007-2008 Richard Hughes - * Copyright (C) 2009-2016 Daniel Nicoletti -+ * 2016 Harald Sitter - * - * Licensed under the GNU General Public License Version 2 - * -@@ -860,17 +861,16 @@ - } - - pk_backend_job_set_status(job, PK_STATUS_ENUM_QUERY); -- PkgList installPkgs, removePkgs; -+ PkgList installPkgs, removePkgs, updatePkgs; - - if (!fixBroken) { - // Resolve the given packages - if (role == PK_ROLE_ENUM_REMOVE_PACKAGES) { - removePkgs = apt->resolvePackageIds(package_ids); -- } else if (role == PK_ROLE_ENUM_INSTALL_PACKAGES || -- role == PK_ROLE_ENUM_UPDATE_PACKAGES) { -- // Updates are like installs for the purposes of resolution, we -- // want to install the updates essentially. -+ } else if (role == PK_ROLE_ENUM_INSTALL_PACKAGES) { - installPkgs = apt->resolvePackageIds(package_ids); -+ } else if (role == PK_ROLE_ENUM_UPDATE_PACKAGES) { -+ updatePkgs = apt->resolvePackageIds(package_ids); - } else if (role == PK_ROLE_ENUM_INSTALL_FILES) { - installPkgs = apt->resolveLocalFiles(full_paths); - } else { -@@ -880,7 +880,7 @@ - return; - } - -- if (removePkgs.size() == 0 && installPkgs.size() == 0) { -+ if (removePkgs.size() == 0 && installPkgs.size() == 0 && updatePkgs.size() == 0) { - pk_backend_job_error_code(job, - PK_ERROR_ENUM_PACKAGE_NOT_FOUND, - "Could not find package(s)"); -@@ -889,12 +889,12 @@ - } - - // Install/Update/Remove packages, or just simulate -- bool ret; -- ret = apt->runTransaction(installPkgs, -- removePkgs, -- fixBroken, -- transaction_flags, -- autoremove); -+ bool ret = apt->runTransaction(installPkgs, -+ removePkgs, -+ updatePkgs, -+ fixBroken, -+ transaction_flags, -+ autoremove); - if (!ret) { - // Print transaction errors - g_debug("AptIntf::runTransaction() failed: %i", _error->PendingError()); -@@ -1053,6 +1053,7 @@ - bool ret; - ret = apt->runTransaction(PkgList(), - removePkgs, -+ PkgList(), - false, - transaction_flags, - false); ---- a/backends/aptcc/apt-intf.cpp -+++ b/backends/aptcc/apt-intf.cpp -@@ -4,6 +4,7 @@ - * Copyright (c) 2004 Michael Vogt - * 2009-2016 Daniel Nicoletti - * 2012-2015 Matthias Klumpp -+ * 2016 Harald Sitter - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -351,19 +352,21 @@ - } - } - -- // This filter is more complex so we filter it after the list has shrink -+ // This filter is more complex so we filter it after the list has shrunk - if (pk_bitfield_contain(filters, PK_FILTER_ENUM_DOWNLOADED) && ret.size() > 0) { - PkgList downloaded; - - pkgProblemResolver Fix(*m_cache); - { - pkgDepCache::ActionGroup group(*m_cache); -- for (const pkgCache::VerIterator &ver : ret) { -- if (m_cancel) { -- break; -- } -+ for (auto autoInst : { true, false }) { -+ for (const pkgCache::VerIterator &ver : ret) { -+ if (m_cancel) { -+ break; -+ } - -- m_cache->tryToInstall(Fix, ver, false); -+ m_cache->tryToInstall(Fix, ver, false, autoInst, false); -+ } - } - } - -@@ -2157,7 +2160,8 @@ - return ret; - } - --bool AptIntf::runTransaction(const PkgList &install, const PkgList &remove, bool fixBroken, PkBitfield flags, bool autoremove) -+bool AptIntf::runTransaction(const PkgList &install, const PkgList &remove, const PkgList &update, -+ bool fixBroken, PkBitfield flags, bool autoremove) - { - //cout << "runTransaction" << simulate << remove << endl; - -@@ -2174,16 +2178,28 @@ - - pkgProblemResolver Fix(*m_cache); - -+ // TODO: could use std::bind an have a generic operation array iff toRemove had the same -+ // signature -+ -+ struct Operation { -+ const PkgList &list; -+ const bool preserveAuto; -+ }; -+ - // new scope for the ActionGroup - { - pkgDepCache::ActionGroup group(*m_cache); -- for (const pkgCache::VerIterator &verIt : install) { -- if (m_cancel) { -- break; -- } - -- if (!m_cache->tryToInstall(Fix, verIt, BrokenFix)) { -- return false; -+ for (auto op : { Operation { install, false }, Operation { update, true } }) { -+ for (auto autoInst : { false, true }) { -+ for (const pkgCache::VerIterator &verIt : op.list) { -+ if (m_cancel) { -+ break; -+ } -+ if (!m_cache->tryToInstall(Fix, verIt, BrokenFix, autoInst, op.preserveAuto)) { -+ return false; -+ } -+ } - } - } - ---- a/backends/aptcc/apt-intf.h -+++ b/backends/aptcc/apt-intf.h -@@ -3,6 +3,7 @@ - * Copyright (c) 1999-2002, 2004-2005, 2007-2008 Daniel Burrows - * Copyright (c) 2009-2016 Daniel Nicoletti - * 2012 Matthias Klumpp -+ * 2016 Harald Sitter - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -83,15 +84,17 @@ - void markAutoInstalled(const PkgList &pkgs); - - /** -- * runs a transaction to install/remove/update packages -- * - for install and update, \p remove should be set to false -- * - if you are going to remove, \p remove should be true -- * - if you don't want to actually install/update/remove -- * \p simulate should be true, in this case packages with -- * what's going to happen will be emitted. -+ * runs a transaction to install/remove/update packages -+ * @param install List of packages to install -+ * @param remove List of packages to remove -+ * @param update List of packages to update -+ * @param fixBroken whether to automatically fix broken packages -+ * @param flags operation flags as per public API -+ * @param autoremove whether to autoremove dangling packages - */ - bool runTransaction(const PkgList &install, - const PkgList &remove, -+ const PkgList &update, - bool fixBroken, - PkBitfield flags, - bool autoremove); ---- a/backends/aptcc/apt-cache-file.cpp -+++ b/backends/aptcc/apt-cache-file.cpp -@@ -2,6 +2,7 @@ - * - * Copyright (c) 2012 Daniel Nicoletti - * Copyright (c) 2012 Matthias Klumpp -+ * Copyright (c) 2016 Harald Sitter - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -455,7 +456,9 @@ - - bool AptCacheFile::tryToInstall(pkgProblemResolver &Fix, - const pkgCache::VerIterator &ver, -- bool BrokenFix) -+ bool BrokenFix, -+ bool autoInst, -+ bool preserveAuto) - { - pkgCache::PkgIterator Pkg = ver.ParentPkg(); - -@@ -471,12 +474,20 @@ - return false; - } - -+ // On updates we want to always preserve the autoflag as updates are usually -+ // non-indicative of whether or not the user explicitly wants this package to be -+ // installed or simply wants it to be updated. -+ const bool fromUser = preserveAuto ? !(State.Flags & pkgCache::Flag::Auto) : true; -+ // FIXME: this is ignoring the return value. OTOH the return value means little to us -+ // since we run markinstall twice, once without autoinst and once with. -+ // We probably should change the return value behavior and have the callee decide whether to -+ // error out or call us agian with autoinst. This however is further complicated by us -+ // having protected, so we'd have to lift protection before this? -+ GetDepCache()->MarkInstall(Pkg, autoInst, 0, fromUser); -+ // Protect against further resolver changes. - Fix.Clear(Pkg); - Fix.Protect(Pkg); - -- // Install it -- GetDepCache()->MarkInstall(Pkg, false); -- - return true; - } - ---- a/backends/aptcc/apt-cache-file.h -+++ b/backends/aptcc/apt-cache-file.h -@@ -2,6 +2,7 @@ - * - * Copyright (c) 2012 Daniel Nicoletti - * Copyright (c) 2012 Matthias Klumpp -+ * Copyright (c) 2016 Harald Sitter - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -@@ -129,7 +130,7 @@ - - bool tryToInstall(pkgProblemResolver &Fix, - const pkgCache::VerIterator &ver, -- bool BrokenFix); -+ bool BrokenFix, bool autoInst, bool preserveAuto); - - void tryToRemove(pkgProblemResolver &Fix, - const pkgCache::VerIterator &ver); === removed file 'debian/patches/02_aptcc-exclude-held.patch' --- debian/patches/02_aptcc-exclude-held.patch 2017-02-13 17:11:10 +0000 +++ debian/patches/02_aptcc-exclude-held.patch 1970-01-01 00:00:00 +0000 @@ -1,54 +0,0 @@ -From bcab7062a61fc5df9bf424805d9450006ce1404c Mon Sep 17 00:00:00 2001 -From: Harald Sitter -Date: Tue, 20 Sep 2016 14:44:05 +0200 -Subject: aptcc: exclude held packages from update list - -We can not accurately represent apt's held concept in PackageKit so to -mimic the intended behavior we simply exclude held packages from the -update listing. `pkcon update` and friends will not call update on held -packages, making them functionally held at their current version. -This has the added benefit that manually calling update -on the package will, just like install, break the version hold as the user -had to explicitly request the update (similar to apt's behavior on this). - ---- - backends/aptcc/apt-cache-file.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/backends/aptcc/apt-cache-file.cpp -+++ b/backends/aptcc/apt-cache-file.cpp -@@ -481,7 +481,7 @@ - // FIXME: this is ignoring the return value. OTOH the return value means little to us - // since we run markinstall twice, once without autoinst and once with. - // We probably should change the return value behavior and have the callee decide whether to -- // error out or call us agian with autoinst. This however is further complicated by us -+ // error out or call us again with autoinst. This however is further complicated by us - // having protected, so we'd have to lift protection before this? - GetDepCache()->MarkInstall(Pkg, autoInst, 0, fromUser); - // Protect against further resolver changes. ---- a/backends/aptcc/apt-intf.cpp -+++ b/backends/aptcc/apt-intf.cpp -@@ -1289,14 +1289,20 @@ - } - - for (pkgCache::PkgIterator pkg = (*m_cache)->PkgBegin(); !pkg.end(); ++pkg) { -- if ((*m_cache)[pkg].Upgrade() == true && (*m_cache)[pkg].NewInstall() == false) { -+ const auto &state = (*m_cache)[pkg]; -+ if (pkg->SelectedState == pkgCache::State::Hold) { -+ // We pretend held packages are not upgradable at all since we can't represent -+ // the concept of holds in PackageKit. -+ // https://github.com/hughsie/PackageKit/issues/120 -+ continue; -+ } else if (state.Upgrade() == true && state.NewInstall() == false) { - const pkgCache::VerIterator &ver = m_cache->findCandidateVer(pkg); - if (!ver.end()) { - updates.push_back(ver); - } -- } else if ((*m_cache)[pkg].Upgradable() == true && -+ } else if (state.Upgradable() == true && - pkg->CurrentVer != 0 && -- (*m_cache)[pkg].Delete() == false) { -+ state.Delete() == false) { - const pkgCache::VerIterator &ver = m_cache->findCandidateVer(pkg); - if (!ver.end()) { - blocked.push_back(ver); === removed file 'debian/patches/03_aptcc-add-missing-file.patch' --- debian/patches/03_aptcc-add-missing-file.patch 2017-02-13 17:11:10 +0000 +++ debian/patches/03_aptcc-add-missing-file.patch 1970-01-01 00:00:00 +0000 @@ -1,71 +0,0 @@ -commit f99a0ffa16f804478715ea6af79720720b85e785 -Author: Matthias Klumpp -Date: Tue Sep 20 16:28:28 2016 +0200 - - Add missing file - -diff --git a/backends/aptcc/deb-file.h b/backends/aptcc/deb-file.h -new file mode 100644 -index 0000000..795ecf1 ---- /dev/null -+++ b/backends/aptcc/deb-file.h -@@ -0,0 +1,59 @@ -+/* deb-file.h -+ * -+ * Copyright (c) 2011-2016 Daniel Nicoletti -+ * 2012 Matthias Klumpp -+ * -+ * Licensed under the GNU General Public License Version 2 -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program 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 General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ */ -+ -+#ifndef DEB_FILE_H -+#define DEB_FILE_H -+ -+#include -+ -+using std::string; -+ -+class DebFile -+{ -+ // typedef int user_tag_reference; -+public: -+ DebFile(const string &filename); -+ virtual ~DebFile(); -+ bool isValid() const; -+ -+ string packageName() const; -+ string sourcePackage() const; -+ string version() const; -+ string architecture() const; -+ string summary() const; -+ string description() const; -+ string conflicts() const; -+ std::vector files() const; -+ -+ // THIS should be moved to AptIntf class -+ bool check(); -+ string errorMsg() const; -+ -+private: -+ debDebFile::MemControlExtract *m_extractor; -+ pkgTagSection m_controlData; -+ string m_errorMsg; -+ std::vector m_files; -+ bool m_isValid = false; -+}; -+ -+#endif === removed file 'debian/patches/04_reject-zero-length-search.patch' --- debian/patches/04_reject-zero-length-search.patch 2017-02-13 17:11:10 +0000 +++ debian/patches/04_reject-zero-length-search.patch 1970-01-01 00:00:00 +0000 @@ -1,31 +0,0 @@ -From 27b927c0a7aa12a9ca3ada5dfa7a6f2b6b4deb9e Mon Sep 17 00:00:00 2001 -From: Richard Hughes -Date: Wed, 19 Oct 2016 20:34:40 +0100 -Subject: [PATCH] Check for a zero-length search string before passing to - backends - -Some backends can't cope with this (cough, aptcc, cough) and explode. -This is probably not what the user wants, so return an error to the client if -this is attempted. ---- - src/pk-transaction.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/pk-transaction.c b/src/pk-transaction.c -index fe6ec9f..4f0cc2b 100644 ---- a/src/pk-transaction.c -+++ b/src/pk-transaction.c -@@ -2195,6 +2195,13 @@ pk_transaction_strvalidate (const gchar *text, GError **error) - - /* maximum size is 1024 */ - length = pk_strlen (text, 1024); -+ if (length == 0) { -+ g_set_error_literal (error, -+ PK_TRANSACTION_ERROR, -+ PK_TRANSACTION_ERROR_INPUT_INVALID, -+ "Invalid input passed to daemon: zero length string"); -+ return FALSE; -+ } - if (length > 1024) { - g_set_error (error, PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INPUT_INVALID, - "Invalid input passed to daemon: input too long: %u", length); === modified file 'debian/patches/series' --- debian/patches/series 2017-02-13 17:11:10 +0000 +++ debian/patches/series 2017-02-13 17:11:16 +0000 @@ -1,6 +1,2 @@ vendor-debian.diff policy.diff -01_toinstall-aptcompliant.patch -02_aptcc-exclude-held.patch -03_aptcc-add-missing-file.patch -04_reject-zero-length-search.patch === modified file 'debian/patches/ubuntu.series' --- debian/patches/ubuntu.series 2017-02-13 17:11:10 +0000 +++ debian/patches/ubuntu.series 2017-02-13 17:11:16 +0000 @@ -1,6 +1,2 @@ vendor-ubuntu.diff policy.diff -01_toinstall-aptcompliant.patch -02_aptcc-exclude-held.patch -03_aptcc-add-missing-file.patch -04_reject-zero-length-search.patch === added file 'debian/source/local-options' --- debian/source/local-options 1970-01-01 00:00:00 +0000 +++ debian/source/local-options 2017-02-13 17:11:16 +0000 @@ -0,0 +1,2 @@ +unapply-patches +abort-on-upstream-changes