[PackageKit-commit] packagekit: Branch 'master' - 19 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Wed May 7 16:17:30 PDT 2008
backends/alpm/pk-backend-alpm.c | 107 ++++++++++---
backends/apt/helpers/Makefile.am | 2
backends/apt/helpers/aptBackend.py | 4
backends/apt/helpers/install-file.py | 20 --
backends/apt/helpers/install-files.py | 21 ++
backends/apt/pk-backend-apt.c | 39 +++--
backends/apt2/aptDBUSBackend.py | 4
backends/apt2/pk-backend-apt2.c | 18 +-
backends/box/pk-backend-box.c | 44 ++---
backends/conary/helpers/Makefile.am | 6
backends/conary/helpers/install-packages.py | 18 ++
backends/conary/helpers/install.py | 18 --
backends/conary/helpers/remove-packages.py | 19 ++
backends/conary/helpers/remove.py | 19 --
backends/conary/helpers/update-packages.py | 18 ++
backends/conary/helpers/update.py | 18 --
backends/conary/pk-backend-conary.c | 40 +++--
backends/dummy/pk-backend-dummy.c | 26 +--
backends/opkg/pk-backend-opkg.c | 30 +--
backends/pisi/helpers/Makefile.am | 8 -
backends/pisi/helpers/install-file.py | 22 --
backends/pisi/helpers/install-files.py | 22 ++
backends/pisi/helpers/install-packages.py | 19 ++
backends/pisi/helpers/install.py | 19 --
backends/pisi/helpers/pisiBackend.py | 2
backends/pisi/helpers/remove-packages.py | 19 ++
backends/pisi/helpers/remove.py | 19 --
backends/pisi/helpers/update-packages.py | 19 ++
backends/pisi/helpers/update.py | 19 --
backends/pisi/pk-backend-pisi.c | 39 +++--
backends/poldek/pk-backend-poldek.c | 34 ++--
backends/smart/helpers/Makefile.am | 8 -
backends/smart/helpers/install-file.py | 21 --
backends/smart/helpers/install-files.py | 21 ++
backends/smart/helpers/install-packages.py | 20 ++
backends/smart/helpers/install.py | 20 --
backends/smart/helpers/remove-packages.py | 20 ++
backends/smart/helpers/remove.py | 20 --
backends/smart/helpers/smartBackend.py | 2
backends/smart/helpers/update-packages.py | 20 ++
backends/smart/helpers/update.py | 20 --
backends/smart/pk-backend-smart.c | 43 +++--
backends/test/pk-backend-test-dbus.c | 6
backends/test/pk-backend-test-fail.c | 20 +-
backends/test/pk-backend-test-nop.c | 6
backends/test/pk-backend-test-spawn.c | 6
backends/test/pk-backend-test-succeed.c | 18 +-
backends/test/pk-backend-test-thread.c | 6
backends/yum/helpers/Makefile.am | 8 -
backends/yum/helpers/install-file.py | 21 --
backends/yum/helpers/install-files.py | 21 ++
backends/yum/helpers/install-packages.py | 20 ++
backends/yum/helpers/install.py | 20 --
backends/yum/helpers/remove-packages.py | 24 +++
backends/yum/helpers/remove.py | 24 ---
backends/yum/helpers/update-packages.py | 21 ++
backends/yum/helpers/update.py | 21 --
backends/yum/helpers/yumBackend.py | 74 +++++----
backends/yum/pk-backend-yum.c | 43 +++--
backends/yum2/helpers/yumDBUSBackend.py | 8 -
backends/yum2/pk-backend-yum2.c | 26 +--
backends/zypp/pk-backend-zypp.cpp | 52 +++---
client/pk-console.c | 30 +--
contrib/gnome-packagekit.spec.in | 2
docs/html/pk-faq.html | 6
libpackagekit/pk-client.c | 216 ++++++++++++++++++----------
libpackagekit/pk-client.h | 21 ++
libpackagekit/pk-enum.c | 6
libpackagekit/pk-enum.h | 6
man/Makefile.am | 12 -
man/pkcon.sgml | 96 ------------
man/pkcon.xml | 80 ++++++++++
man/pkmon.sgml | 96 ------------
man/pkmon.xml | 80 ++++++++++
po/ru.po | 4
python/packagekit/backend.py | 10 -
python/packagekit/daemonBackend.py | 34 ++--
python/packagekit/frontend.py | 16 +-
src/pk-backend-dbus.c | 30 +--
src/pk-backend-dbus.h | 14 -
src/pk-backend.c | 78 ++++++++--
src/pk-backend.h | 29 ++-
src/pk-interface-transaction.xml | 12 -
src/pk-security-polkit.c | 8 -
src/pk-transaction.c | 151 +++++++++----------
src/pk-transaction.h | 12 -
86 files changed, 1338 insertions(+), 1083 deletions(-)
New commits:
commit db1c6789d3331eedcea9377b1ca0e95868336dc8
Author: Scott Reeves <sreeves at novell.com>
Date: Wed May 7 11:49:54 2008 -0600
fix build breakage after 'change some methods to accept more than one param'
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index e2f8cd1..ccaccf4 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -681,12 +681,12 @@ backend_install_files_thread (PkBackend *backend)
gchar **full_paths;
// check if file is really a rpm
- full_paths = pk_backend_get_string (backend, "full_paths");
- zypp::Pathname rpmPath (full_path);
+ full_paths = pk_backend_get_strv (backend, "full_paths");
+ zypp::Pathname rpmPath (full_paths[0]);
zypp::target::rpm::RpmHeader::constPtr rpmHeader = zypp::target::rpm::RpmHeader::readPackage (rpmPath, zypp::target::rpm::RpmHeader::NOSIGNATURE);
if (rpmHeader == NULL) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "%s is not valid rpm-File", full_path);
+ pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "%s is not valid rpm-File", full_paths[0]);
pk_backend_finished (backend);
return FALSE;
}
@@ -702,7 +702,7 @@ backend_install_files_thread (PkBackend *backend)
// copy the rpm into tmpdir
std::string tempDest = tmpDir.path ().asString () + "/" + rpmHeader->tag_name () + ".rpm";
- if (zypp::filesystem::copy (full_path, tempDest) != 0) {
+ if (zypp::filesystem::copy (full_paths[0], tempDest) != 0) {
pk_backend_error_code (backend, PK_ERROR_ENUM_LOCAL_INSTALL_FAILED, "Could not copy the rpm-file into the temp-dir");
pk_backend_finished (backend);
return FALSE;
@@ -783,7 +783,7 @@ backend_install_files_thread (PkBackend *backend)
* backend_install_files
*/
static void
-backend_install_files (PkBackend *backend, gboolean trusted, const gchar *full_paths)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
pk_backend_thread_create (backend, backend_install_files_thread);
}
@@ -933,7 +933,7 @@ backend_update_system (PkBackend *backend)
static gboolean
backend_install_packages_thread (PkBackend *backend)
{
- gchar *package_ids;
+ gchar **package_ids;
pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
pk_backend_set_percentage (backend, 0);
@@ -1012,7 +1012,7 @@ backend_install_packages_thread (PkBackend *backend)
* backend_install_packages:
*/
static void
-backend_install_packages (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
// For now, don't let the user cancel the install once it's started
pk_backend_set_allow_cancel (backend, FALSE);
@@ -1028,8 +1028,8 @@ backend_remove_packages_thread (PkBackend *backend)
pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE);
pk_backend_set_percentage (backend, 0);
- package_ids = pk_backend_get_string (backend, "package_ids");
- pi = pk_package_id_new_from_string (package_id[0]);
+ package_ids = pk_backend_get_strv (backend, "package_ids");
+ pi = pk_package_id_new_from_string (package_ids[0]);
if (pi == NULL) {
pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
pk_backend_finished (backend);
@@ -1093,7 +1093,7 @@ backend_remove_packages_thread (PkBackend *backend)
* backend_remove_packages:
*/
static void
-backend_remove_packages (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
pk_backend_set_uint (backend, "allow_deps", allow_deps == TRUE ? DEPS_ALLOW : DEPS_NO_ALLOW);
pk_backend_thread_create (backend, backend_remove_packages_thread);
commit 9165865079e16bcf8298cbc9a4939a3726207cb7
Merge: 277ff83... 3758ef3...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 19:28:52 2008 +0300
Merge branch 'master' of git+ssh://onestep_ua@git.packagekit.org/srv/git/PackageKit
commit 3758ef353f9671c076d63bb116f33d9726836bc3
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 17:28:22 2008 +0100
fix installing more than one local file with the spawned backends
diff --git a/backends/apt/helpers/install-files.py b/backends/apt/helpers/install-files.py
index 1a1ad5b..dfa024c 100755
--- a/backends/apt/helpers/install-files.py
+++ b/backends/apt/helpers/install-files.py
@@ -14,7 +14,8 @@ import sys
from aptBackend import PackageKitAptBackend
-files_to_inst = sys.argv[1]
+trusted = sys.argv[1]
+files_to_inst = sys.argv[2:]
backend = PackageKitAptBackend(sys.argv[1:])
-backend.install_files(files_to_inst)
+backend.install_files(trusted, files_to_inst)
sys.exit(0)
diff --git a/backends/pisi/helpers/install-files.py b/backends/pisi/helpers/install-files.py
index 9b0f25e..55d6531 100755
--- a/backends/pisi/helpers/install-files.py
+++ b/backends/pisi/helpers/install-files.py
@@ -15,8 +15,8 @@ import sys
import pisiBackend
trusted = sys.argv[1]
-file_to_insts = sys.argv[2]
+files_to_inst = sys.argv[2:]
backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
-backend.install_files(trusted, file_to_insts)
+backend.install_files(trusted, files_to_inst)
sys.exit()
diff --git a/backends/smart/helpers/install-files.py b/backends/smart/helpers/install-files.py
index a485323..560270c 100755
--- a/backends/smart/helpers/install-files.py
+++ b/backends/smart/helpers/install-files.py
@@ -15,7 +15,7 @@ import sys
from smartBackend import PackageKitSmartBackend
trusted = sys.argv[1]
-files_to_inst = sys.argv[2]
+files_to_inst = sys.argv[2:]
backend = PackageKitSmartBackend(sys.argv[1:])
backend.install_files(trusted, files_to_inst)
sys.exit(0)
diff --git a/backends/yum/helpers/install-files.py b/backends/yum/helpers/install-files.py
index 6448064..003f58b 100755
--- a/backends/yum/helpers/install-files.py
+++ b/backends/yum/helpers/install-files.py
@@ -15,7 +15,7 @@ import sys
from yumBackend import PackageKitYumBackend
trusted = sys.argv[1]
-files_to_inst = sys.argv[2]
+files_to_inst = sys.argv[2:]
backend = PackageKitYumBackend(sys.argv[1:])
backend.install_files(trusted, files_to_inst)
sys.exit(0)
commit 277ff8391fc0aabca9fe92d6490d9d3c65b279a1
Merge: 40851cf... c53e0f6...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 19:28:09 2008 +0300
Merge branch 'master' of git+ssh://onestep_ua@git.packagekit.org/srv/git/PackageKit
commit 40851cf027785d198b6e9941ca4b58bb28eee11a
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 19:27:56 2008 +0300
alpm: fixes related to new packagekit daemon, backend_install_files stuff moved to another thread
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index bb4611b..3270e42 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -890,36 +890,71 @@ backend_get_repo_list (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_files:
+ * backend_install_files_thread:
*/
-static void
-backend_install_files (PkBackend *backend, gboolean trusted, const gchar *paths)
+static gboolean
+backend_install_files_thread (PkBackend *backend)
{
- alpm_list_t *problems = NULL;
+ pk_backend_no_percentage_updates (backend);
+
+ gchar **full_paths = pk_backend_get_strv (backend, "full_paths");
+
+ /* create a new transaction */
if (alpm_trans_init (PM_TRANS_TYPE_ADD, 0, cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerror (pm_errno));
+ pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerrorlast ());
pk_backend_finished (backend);
- return;
+ return FALSE;
}
+ pk_debug ("alpm: %s", "transaction initialized");
- alpm_trans_addtarget ((char *) path);
+ /* add targets to the transaction */
+ int iterator;
+ for (iterator = 0; iterator < g_strv_length (full_paths); ++iterator) {
+ if (alpm_trans_addtarget (full_paths[iterator]) == -1) {
+ pk_warning ("alpm: %s", alpm_strerrorlast ());
+ pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerrorlast ());
+ alpm_trans_release ();
+ pk_backend_finished (backend);
+ return FALSE;
+ }
+ }
- if (alpm_trans_prepare (&problems) != 0) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerror (pm_errno));
- pk_backend_finished (backend);
+ alpm_list_t *data = NULL;
+
+ /* prepare transaction */
+ if (alpm_trans_prepare (&data) == -1) {
+ pk_warning ("alpm: %s", alpm_strerrorlast ());
+ pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerrorlast ());
alpm_trans_release ();
- return;
+ pk_backend_finished (backend);
+ return FALSE;
}
- if (alpm_trans_commit (&problems) != 0) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerror (pm_errno));
- pk_backend_finished (backend);
+ /* commit transaction */
+ if (alpm_trans_commit (&data) == -1) {
+ pk_warning ("alpm: %s", alpm_strerrorlast ());
+ pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerrorlast ());
alpm_trans_release ();
- return;
+ pk_backend_finished (backend);
+ return FALSE;
}
alpm_trans_release ();
+ pk_debug ("alpm: %s", "transaction released");
+
pk_backend_finished (backend);
+ return TRUE;
+}
+
+/**
+ * backend_install_files:
+ */
+static void
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
+{
+ pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
+
+ pk_backend_thread_create (backend, backend_install_files_thread);
}
/**
@@ -934,7 +969,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
*/
alpm_list_t *result = NULL;
alpm_list_t *problems = NULL;
- PkPackageId *id = pk_package_id_new_from_string (package_id);
+ PkPackageId *id = pk_package_id_new_from_string (package_ids[0]);
pmtransflag_t flags = 0;
GThread *progress = NULL;
@@ -989,7 +1024,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
return;
}
- pk_backend_package (backend, PK_INFO_ENUM_DOWNLOADING, package_id, "An HTML widget for GTK+ 2.0");
+ pk_backend_package (backend, PK_INFO_ENUM_DOWNLOADING, package_ids[0], "An HTML widget for GTK+ 2.0");
progress = g_thread_create (state_notify, (void *) backend, TRUE, NULL);
install_backend = backend;
diff --git a/man/Makefile.am b/man/Makefile.am
index 9371f6b..c6a7640 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -10,10 +10,10 @@ endif
if HAVE_DOCBOOK2MAN
pkcon.1: pkcon.xml
- xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? > /dev/null
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
pkmon.1: pkmon.xml
- xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? > /dev/null
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? &> /dev/null
endif
clean-local :
commit c53e0f69cc780a2d2bc1d5e8a13527e471a32e1d
Merge: 8946008... 7b3d382...
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 17:13:35 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit 7b3d382909f6121d1fc7ee31a717163f4aee4a57
Author: Grzegorz Dabrowski <gdx at o2.pl>
Date: Wed May 7 18:09:24 2008 +0000
[box] build fix
diff --git a/backends/box/pk-backend-box.c b/backends/box/pk-backend-box.c
index 1130df6..b7b8167 100644
--- a/backends/box/pk-backend-box.c
+++ b/backends/box/pk-backend-box.c
@@ -258,7 +258,7 @@ backend_install_files_thread (PkBackend *backend)
pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
- full_path = pk_backend_get_strv (backend, "full_paths");
+ full_paths = pk_backend_get_strv (backend, "full_paths");
result = box_package_install(full_paths[0], ROOT_DIRECTORY, common_progress, backend, FALSE);
pk_backend_finished (backend);
@@ -385,9 +385,9 @@ static gboolean
backend_remove_packages_thread (PkBackend *backend)
{
PkPackageId *pi;
- gchar *package_ids;
+ gchar **package_ids;
- package_ids = pk_backend_get_string (backend, "package_ids");
+ package_ids = pk_backend_get_strv (backend, "package_ids");
pi = pk_package_id_new_from_string (package_ids[0]);
if (pi == NULL) {
pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
commit 8946008b77093705e965510bc1317e550b646b6a
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 17:10:42 2008 +0100
improve some debugging strings to mention all of the package_id's
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index dca2075..07ffdee 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -1839,6 +1839,7 @@ void
pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
gchar **full_paths, DBusGMethodInvocation *context)
{
+ gchar *full_paths_temp;
gboolean ret;
GError *error;
gchar *sender;
@@ -1848,7 +1849,9 @@ pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("InstallFiles method called: %s (trusted %i)", full_paths[0], trusted);
+ full_paths_temp = pk_package_ids_to_text (full_paths, ", ");
+ pk_debug ("InstallFiles method called: %s (trusted %i)", full_paths_temp, trusted);
+ g_free (full_paths_temp);
/* not implemented yet */
if (transaction->priv->backend->desc->install_files == NULL) {
@@ -1912,12 +1915,14 @@ pk_transaction_install_packages (PkTransaction *transaction, gchar **package_ids
gboolean ret;
GError *error;
gchar *sender;
- gchar *package_id_temp;
+ gchar *package_ids_temp;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("method called: %s", package_ids[0]);
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
+ pk_debug ("InstallPackages method called: %s", package_ids_temp);
+ g_free (package_ids_temp);
/* not implemented yet */
if (transaction->priv->backend->desc->install_packages == NULL) {
@@ -1931,10 +1936,10 @@ pk_transaction_install_packages (PkTransaction *transaction, gchar **package_ids
/* check package_ids */
ret = pk_package_ids_check (package_ids);
if (ret == FALSE) {
- package_id_temp = pk_package_ids_to_text (package_ids, ", ");
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
- "The package id's '%s' are not valid", package_id_temp);
- g_free (package_id_temp);
+ "The package id's '%s' are not valid", package_ids_temp);
+ g_free (package_ids_temp);
dbus_g_method_return_error (context, error);
return;
}
@@ -2127,12 +2132,14 @@ pk_transaction_remove_packages (PkTransaction *transaction, gchar **package_ids,
gboolean ret;
GError *error;
gchar *sender;
- gchar *package_id_temp;
+ gchar *package_ids_temp;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("RemovePackages method called: %s, %i, %i", package_ids[0], allow_deps, autoremove);
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
+ pk_debug ("RemovePackages method called: %s, %i, %i", package_ids_temp, allow_deps, autoremove);
+ g_free (package_ids_temp);
/* not implemented yet */
if (transaction->priv->backend->desc->remove_packages == NULL) {
@@ -2146,10 +2153,10 @@ pk_transaction_remove_packages (PkTransaction *transaction, gchar **package_ids,
/* check package_ids */
ret = pk_package_ids_check (package_ids);
if (ret == FALSE) {
- package_id_temp = pk_package_ids_to_text (package_ids, ", ");
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
- "The package id's '%s' are not valid", package_id_temp);
- g_free (package_id_temp);
+ "The package id's '%s' are not valid", package_ids_temp);
+ g_free (package_ids_temp);
dbus_g_method_return_error (context, error);
return;
}
@@ -2715,7 +2722,7 @@ pk_transaction_update_packages (PkTransaction *transaction, gchar **package_ids,
gboolean ret;
GError *error;
gchar *sender;
- gchar *package_id_temp;
+ gchar *package_ids_temp;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
@@ -2734,10 +2741,10 @@ pk_transaction_update_packages (PkTransaction *transaction, gchar **package_ids,
/* check package_ids */
ret = pk_package_ids_check (package_ids);
if (ret == FALSE) {
- package_id_temp = pk_package_ids_to_text (package_ids, ", ");
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
- "The package id's '%s' are not valid", package_id_temp);
- g_free (package_id_temp);
+ "The package id's '%s' are not valid", package_ids_temp);
+ g_free (package_ids_temp);
dbus_g_method_return_error (context, error);
return;
}
commit 39df472faf2a1662a679f52b43f26fa50fdc08ec
Author: S.ÃaÄlar Onur <caglar at pardus.org.tr>
Date: Wed May 7 18:54:32 2008 +0300
PiSi: fix build breakage
diff --git a/backends/pisi/pk-backend-pisi.c b/backends/pisi/pk-backend-pisi.c
index 4e20e18..150b494 100644
--- a/backends/pisi/pk-backend-pisi.c
+++ b/backends/pisi/pk-backend-pisi.c
@@ -193,8 +193,8 @@ backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
gchar *package_ids_temp;
/* send the complete list as stdin */
- package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths, NULL);
+ package_ids_temp = pk_package_ids_to_text (full_paths, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -356,7 +356,7 @@ PK_BACKEND_OPTIONS (
backend_get_requires, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_files */
+ backend_install_files, /* install_files */
backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
commit 3767d69a855dfb1766990ab7fb21ab564d17430b
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 15:23:35 2008 +0100
fix permissions on the new files
diff --git a/backends/apt/helpers/install-files.py b/backends/apt/helpers/install-files.py
old mode 100644
new mode 100755
diff --git a/backends/conary/helpers/install-packages.py b/backends/conary/helpers/install-packages.py
old mode 100644
new mode 100755
diff --git a/backends/conary/helpers/remove-packages.py b/backends/conary/helpers/remove-packages.py
old mode 100644
new mode 100755
diff --git a/backends/conary/helpers/update-packages.py b/backends/conary/helpers/update-packages.py
old mode 100644
new mode 100755
diff --git a/backends/pisi/helpers/install-files.py b/backends/pisi/helpers/install-files.py
old mode 100644
new mode 100755
diff --git a/backends/pisi/helpers/install-packages.py b/backends/pisi/helpers/install-packages.py
old mode 100644
new mode 100755
diff --git a/backends/pisi/helpers/remove-packages.py b/backends/pisi/helpers/remove-packages.py
old mode 100644
new mode 100755
diff --git a/backends/pisi/helpers/update-packages.py b/backends/pisi/helpers/update-packages.py
old mode 100644
new mode 100755
diff --git a/backends/smart/helpers/install-files.py b/backends/smart/helpers/install-files.py
old mode 100644
new mode 100755
diff --git a/backends/smart/helpers/install-packages.py b/backends/smart/helpers/install-packages.py
old mode 100644
new mode 100755
diff --git a/backends/smart/helpers/remove-packages.py b/backends/smart/helpers/remove-packages.py
old mode 100644
new mode 100755
diff --git a/backends/smart/helpers/update-packages.py b/backends/smart/helpers/update-packages.py
old mode 100644
new mode 100755
diff --git a/backends/yum/helpers/install-files.py b/backends/yum/helpers/install-files.py
old mode 100644
new mode 100755
diff --git a/backends/yum/helpers/install-packages.py b/backends/yum/helpers/install-packages.py
old mode 100644
new mode 100755
diff --git a/backends/yum/helpers/remove-packages.py b/backends/yum/helpers/remove-packages.py
old mode 100644
new mode 100755
diff --git a/backends/yum/helpers/update-packages.py b/backends/yum/helpers/update-packages.py
old mode 100644
new mode 100755
commit 2fb74499e16aee66797634149dd6edb45b9112e0
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 15:21:03 2008 +0100
change some methods to accept more than one parameter
In line with the planned features for 0.2.1 [1] we'll be changing some
methods to let us do some cool new stuff in the client tools:
InstallPackage(s) -> InstallPackages(as)
RemovePackage(s) -> RemovePackages(as)
InstallFile(s) -> InstallFiles(as)
This means that each of these methods will be sent a string array
(char**) rather than a string (char*) - so you will have to modify your
backend to either:
* pass the strv to the underlying library and do those actions all at
once (clever library)
* iterate on all the objects processing each one (simple library)
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index e799c87..bb4611b 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -890,10 +890,10 @@ backend_get_repo_list (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *path)
+backend_install_files (PkBackend *backend, gboolean trusted, const gchar *paths)
{
alpm_list_t *problems = NULL;
if (alpm_trans_init (PM_TRANS_TYPE_ADD, 0, cb_trans_evt, cb_trans_conv, cb_trans_progress) == -1) {
@@ -923,10 +923,10 @@ backend_install_file (PkBackend *backend, gboolean trusted, const gchar *path)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
pk_debug ("hello %i", GPOINTER_TO_INT (backend));
/*
@@ -1061,12 +1061,12 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- PkPackageId *id = pk_package_id_new_from_string (package_id);
+ PkPackageId *id = pk_package_id_new_from_string (package_ids[0]);
pmtransflag_t flags = 0;
alpm_list_t *problems = NULL;
@@ -1242,7 +1242,7 @@ static void
backend_update_packages (PkBackend *backend, gchar **package_ids)
{
/* TODO: process the entire list */
- backend_install_package (backend, package_ids[0]);
+ backend_install_packages (backend, package_ids);
}
PK_BACKEND_OPTIONS (
@@ -1261,11 +1261,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/apt/helpers/Makefile.am b/backends/apt/helpers/Makefile.am
index d130747..0299df2 100644
--- a/backends/apt/helpers/Makefile.am
+++ b/backends/apt/helpers/Makefile.am
@@ -4,7 +4,7 @@ helperdir = $(datadir)/PackageKit/helpers/apt
NULL =
dist_helper_DATA = \
- install-file.py \
+ install-files.py \
search-name.py \
search-details.py \
search-group.py \
diff --git a/backends/apt/helpers/aptBackend.py b/backends/apt/helpers/aptBackend.py
index bd1025c..e5f78ca 100644
--- a/backends/apt/helpers/aptBackend.py
+++ b/backends/apt/helpers/aptBackend.py
@@ -446,9 +446,9 @@ class PackageKitAptBackend(PackageKitBaseBackend):
self.update_detail(package,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc)
- def install_file (self, inst_file):
+ def install_files (self, inst_files):
'''
- Implement the {backend}-install_file functionality
+ Implement the {backend}-install_files functionality
Install the package containing the inst_file file
'''
if not exists(inst_file):
diff --git a/backends/apt/helpers/install-file.py b/backends/apt/helpers/install-file.py
deleted file mode 100755
index c323bf9..0000000
--- a/backends/apt/helpers/install-file.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
-#
-# 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.
-
-import sys
-
-from aptBackend import PackageKitAptBackend
-
-file_to_inst = sys.argv[1]
-backend = PackageKitAptBackend(sys.argv[1:])
-backend.install_file(file_to_inst)
-sys.exit(0)
\ No newline at end of file
diff --git a/backends/apt/helpers/install-files.py b/backends/apt/helpers/install-files.py
new file mode 100644
index 0000000..1a1ad5b
--- /dev/null
+++ b/backends/apt/helpers/install-files.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
+#
+# 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.
+
+import sys
+
+from aptBackend import PackageKitAptBackend
+
+files_to_inst = sys.argv[1]
+backend = PackageKitAptBackend(sys.argv[1:])
+backend.install_files(files_to_inst)
+sys.exit(0)
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index 809fa4a..68bed36 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -129,11 +129,13 @@ backend_get_update_detail (PkBackend *backend, const gchar *package_id)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -141,7 +143,10 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -161,20 +166,25 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_spawn_helper (spawn, "remove.py", pk_backend_bool_to_text (allow_deps), package_id, NULL);
+ gchar *package_ids_temp;
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "remove-packages.py", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
+ g_free (package_ids_temp);
} */
/**
- * pk_backend_update_package:
+ * pk_backend_update_packages:
*/
static void
-backend_update_package (PkBackend *backend, const gchar *package_id)
+backend_update_packages (PkBackend *backend, gchar **package_id)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -182,7 +192,10 @@ backend_update_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "update.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "update-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -227,18 +240,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
NULL, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
NULL, /* get_files */
NULL, /* get_packages */
backend_get_repo_list, /* get_repo_list */
NULL, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- NULL, /* install_file */
- backend_install_package, /* install_package */
+ NULL, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- NULL, /* remove_package */
+ NULL, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/apt2/aptDBUSBackend.py b/backends/apt2/aptDBUSBackend.py
index 6c5454b..b7fc500 100755
--- a/backends/apt2/aptDBUSBackend.py
+++ b/backends/apt2/aptDBUSBackend.py
@@ -374,7 +374,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
@threaded
@locked
- def doRemovePackage(self, id, deps=True, auto=False):
+ def doRemovePackages(self, ids, deps=True, auto=False):
'''
Implement the {backend}-remove functionality
'''
@@ -415,7 +415,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
@threaded
@locked
- def doInstallPackage(self, id):
+ def doInstallPackages(self, ids):
'''
Implement the {backend}-install functionality
'''
diff --git a/backends/apt2/pk-backend-apt2.c b/backends/apt2/pk-backend-apt2.c
index c075d43..80f9afc 100644
--- a/backends/apt2/pk-backend-apt2.c
+++ b/backends/apt2/pk-backend-apt2.c
@@ -114,21 +114,21 @@ backend_update_system (PkBackend *backend)
}
/**
- * backend_install_package
+ * backend_install_packages
* */
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
- pk_backend_dbus_install_package (dbus, package_id);
+ pk_backend_dbus_install_packages (dbus, package_ids);
}
/**
- * backend_remove_package
+ * backend_remove_packages
* */
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_dbus_remove_package (dbus, package_id, allow_deps, autoremove);
+ pk_backend_dbus_remove_package (dbus, package_ids, allow_deps, autoremove);
}
/**
@@ -184,11 +184,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- NULL, /* install_file */
- backend_install_package, /* install_package */
+ NULL, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/box/pk-backend-box.c b/backends/box/pk-backend-box.c
index b38a62e..1130df6 100644
--- a/backends/box/pk-backend-box.c
+++ b/backends/box/pk-backend-box.c
@@ -200,7 +200,7 @@ backend_update_system_thread (PkBackend *backend)
}
static gboolean
-backend_install_package_thread (PkBackend *backend)
+backend_install_packages_thread (PkBackend *backend)
{
gboolean result;
PkPackageId *pi;
@@ -251,15 +251,15 @@ backend_update_packages_thread (PkBackend *backend)
}
static gboolean
-backend_install_file_thread (PkBackend *backend)
+backend_install_files_thread (PkBackend *backend)
{
gboolean result;
- const gchar *full_path;
+ gchar **full_paths;
pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
- full_path = pk_backend_get_string (backend, "full_path");
- result = box_package_install(full_path, ROOT_DIRECTORY, common_progress, backend, FALSE);
+ full_path = pk_backend_get_strv (backend, "full_paths");
+ result = box_package_install(full_paths[0], ROOT_DIRECTORY, common_progress, backend, FALSE);
pk_backend_finished (backend);
@@ -382,13 +382,13 @@ backend_get_depends_requires_thread (PkBackend *backend)
}
static gboolean
-backend_remove_package_thread (PkBackend *backend)
+backend_remove_packages_thread (PkBackend *backend)
{
PkPackageId *pi;
- const gchar *package_id;
+ gchar *package_ids;
- package_id = pk_backend_get_string (backend, "package_id");
- pi = pk_package_id_new_from_string (package_id);
+ package_ids = pk_backend_get_string (backend, "package_ids");
+ pi = pk_package_id_new_from_string (package_ids[0]);
if (pi == NULL) {
pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
@@ -494,10 +494,10 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
/* check network state */
if (!pk_backend_is_online (backend)) {
@@ -506,16 +506,16 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_thread_create (backend, backend_install_package_thread);
+ pk_backend_thread_create (backend, backend_install_packages_thread);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *file)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **files)
{
- pk_backend_thread_create (backend, backend_install_file_thread);
+ pk_backend_thread_create (backend, backend_install_files_thread);
}
/**
@@ -534,13 +534,13 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_id, gboolean allow_deps, gboolean autoremove)
{
pk_backend_set_uint (backend, "type", DEPS_ALLOW);
- pk_backend_thread_create (backend, backend_remove_package_thread);
+ pk_backend_thread_create (backend, backend_remove_packages_thread);
}
/**
@@ -667,18 +667,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
NULL, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
NULL, /* get_packages */
backend_get_repo_list, /* get_repo_list */
backend_get_requires, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/conary/helpers/Makefile.am b/backends/conary/helpers/Makefile.am
index 6fdd650..54b0691 100644
--- a/backends/conary/helpers/Makefile.am
+++ b/backends/conary/helpers/Makefile.am
@@ -10,10 +10,10 @@ dist_helper_DATA = \
get-requires.py \
get-updates.py \
get-update-detail.py \
- install.py \
- update.py \
+ install-packages.py \
+ update-packages.py \
refresh-cache.py \
- remove.py \
+ remove-packages.py \
resolve.py \
update-system.py \
get-details.py \
diff --git a/backends/conary/helpers/install-packages.py b/backends/conary/helpers/install-packages.py
new file mode 100644
index 0000000..338fafd
--- /dev/null
+++ b/backends/conary/helpers/install-packages.py
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
+#
+# 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.
+
+import sys
+from conaryBackend import PackageKitConaryBackend
+
+package = sys.argv[1]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.install_packages(package)
+sys.exit(0)
diff --git a/backends/conary/helpers/install.py b/backends/conary/helpers/install.py
deleted file mode 100755
index 5e5ead7..0000000
--- a/backends/conary/helpers/install.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
-#
-# 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.
-
-import sys
-from conaryBackend import PackageKitConaryBackend
-
-package = sys.argv[1]
-backend = PackageKitConaryBackend(sys.argv[1:])
-backend.install(package)
-sys.exit(0)
diff --git a/backends/conary/helpers/remove-packages.py b/backends/conary/helpers/remove-packages.py
new file mode 100644
index 0000000..ada7c41
--- /dev/null
+++ b/backends/conary/helpers/remove-packages.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
+#
+# 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.
+
+import sys
+from conaryBackend import PackageKitConaryBackend
+
+allowDeps = sys.argv[1]
+package = sys.argv[2]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.remove_packages(allowDeps, package)
+sys.exit(0)
diff --git a/backends/conary/helpers/remove.py b/backends/conary/helpers/remove.py
deleted file mode 100755
index 0dcef0f..0000000
--- a/backends/conary/helpers/remove.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
-#
-# 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.
-
-import sys
-from conaryBackend import PackageKitConaryBackend
-
-allowDeps = sys.argv[1]
-package = sys.argv[2]
-backend = PackageKitConaryBackend(sys.argv[1:])
-backend.remove(allowDeps, package)
-sys.exit(0)
diff --git a/backends/conary/helpers/update-packages.py b/backends/conary/helpers/update-packages.py
new file mode 100644
index 0000000..2269781
--- /dev/null
+++ b/backends/conary/helpers/update-packages.py
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
+#
+# 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.
+
+import sys
+from conaryBackend import PackageKitConaryBackend
+
+packages = sys.argv[1]
+backend = PackageKitConaryBackend(sys.argv[1:])
+backend.update_packages(packages)
+sys.exit(0)
diff --git a/backends/conary/helpers/update.py b/backends/conary/helpers/update.py
deleted file mode 100755
index 75b852a..0000000
--- a/backends/conary/helpers/update.py
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Ken VanDine <ken at vandine.org>
-#
-# 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.
-
-import sys
-from conaryBackend import PackageKitConaryBackend
-
-packages = sys.argv[1]
-backend = PackageKitConaryBackend(sys.argv[1:])
-backend.update(packages)
-sys.exit(0)
diff --git a/backends/conary/pk-backend-conary.c b/backends/conary/pk-backend-conary.c
index 68a1608..df08b1c 100644
--- a/backends/conary/pk-backend-conary.c
+++ b/backends/conary/pk-backend-conary.c
@@ -140,11 +140,13 @@ backend_get_update_detail (PkBackend *backend, const gchar *package_id)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -152,17 +154,24 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
/**
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, const gchar *full_paths)
{
- pk_backend_spawn_helper (spawn, "install-file.py", full_path, NULL);
+ gchar *package_ids_temp;
+
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", full_paths, NULL);
+ g_free (package_ids_temp);
}
*/
@@ -183,12 +192,17 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_spawn_helper (spawn, "remove.py", pk_backend_bool_to_text (allow_deps), package_id, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "remove-packages.py", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -221,7 +235,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "update-packages.py", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -262,11 +276,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- NULL, /* install_file */
- backend_install_package, /* install_package */
+ NULL, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index f15e959..49d4e5a 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -291,18 +291,18 @@ backend_install_timeout (gpointer data)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
const gchar *license_agreement;
const gchar *eula_id;
gboolean has_eula;
- if (pk_strequal (package_id, "vips-doc;7.12.4-2.fc8;noarch;linva")) {
+ if (pk_strequal (package_ids[0], "vips-doc;7.12.4-2.fc8;noarch;linva")) {
if (!_has_signature) {
- pk_backend_repo_signature_required (backend, package_id, "updates",
+ pk_backend_repo_signature_required (backend, package_ids[0], "updates",
"http://example.com/gpgkey",
"Test Key (Fedora) fedora at example.com",
"BB7576AC",
@@ -334,7 +334,7 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
"Captain: You know what you doing.\n"
"Captain: Move 'ZIG'.\n"
"Captain: For great justice.\n";
- pk_backend_eula_required (backend, eula_id, package_id,
+ pk_backend_eula_required (backend, eula_id, package_ids[0],
"CATS Inc.", license_agreement);
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_LICENSE_AGREEMENT,
"licence not installed so cannot install");
@@ -373,10 +373,10 @@ backend_install_signature (PkBackend *backend, PkSigTypeEnum type,
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
pk_backend_finished (backend);
}
@@ -442,10 +442,10 @@ backend_rollback (PkBackend *backend, const gchar *transaction_id)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE);
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "No network connection available");
@@ -782,18 +782,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
backend_cancel, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
backend_get_packages, /* get_packages */
backend_get_repo_list, /* get_repo_list */
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
backend_install_signature, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/opkg/pk-backend-opkg.c b/backends/opkg/pk-backend-opkg.c
index ce5677b..aa0b89d 100644
--- a/backends/opkg/pk-backend-opkg.c
+++ b/backends/opkg/pk-backend-opkg.c
@@ -334,13 +334,13 @@ backend_search_group (PkBackend *backend, PkFilterEnum filters, const gchar *sea
static gboolean
-backend_install_package_thread (PkBackend *backend)
+backend_install_packages_thread (PkBackend *backend)
{
PkPackageId *pi;
gint err;
- const gchar *package_id;
+ gchar *package_ids;
- package_id = pk_backend_get_string (backend, "pkid");
+ package_ids = pk_backend_get_string (backend, "package_ids");
pi = pk_package_id_new_from_string (package_id);
@@ -354,34 +354,34 @@ backend_install_package_thread (PkBackend *backend)
}
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_id)
{
pk_backend_no_percentage_updates (backend);
pk_backend_set_status (backend, PK_STATUS_ENUM_INSTALL);
pk_backend_set_string (backend, "pkid", package_id);
- pk_backend_thread_create (backend, backend_install_package_thread);
+ pk_backend_thread_create (backend, backend_install_packages_thread);
}
static gboolean
-backend_remove_package_thread (PkBackend *backend)
+backend_remove_packages_thread (PkBackend *backend)
{
PkPackageId *pi;
gint err;
- const gchar *package_id;
+ gchar **package_ids;
gboolean allow_deps;
gboolean autoremove;
gpointer *data;
data = pk_backend_get_pointer (backend, "remove-params");
- package_id = (gchar*) data[0];
+ package_ids = (gchar*) data[0];
allow_deps = GPOINTER_TO_INT (data[1]);
autoremove = GPOINTER_TO_INT (data[2]);
g_free (data);
- pi = pk_package_id_new_from_string (package_id);
+ pi = pk_package_id_new_from_string (package_ids[0]);
opkg_set_option (opkg, "autoremove", &autoremove);
opkg_set_option (opkg, "force_removal_of_dependent_packages", &allow_deps);
@@ -398,7 +398,7 @@ backend_remove_package_thread (PkBackend *backend)
}
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar *package_ids, gboolean allow_deps, gboolean autoremove)
{
gpointer *params;
@@ -408,13 +408,13 @@ backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean al
/* params is a small array we can pack our thread parameters into */
params = g_new0 (gpointer, 2);
- params[0] = g_strdup (package_id);
+ params[0] = g_strdupv (package_ids);
params[1] = GINT_TO_POINTER (allow_deps);
params[2] = GINT_TO_POINTER (autoremove);
pk_backend_set_pointer (backend, "remove-params", params);
- pk_backend_thread_create (backend, backend_remove_package_thread);
+ pk_backend_thread_create (backend, backend_remove_packages_thread);
}
@@ -571,11 +571,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- NULL, /* install_file */
- backend_install_package, /* install_package */
+ NULL, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/pisi/helpers/Makefile.am b/backends/pisi/helpers/Makefile.am
index fe0a9a6..aca9f54 100644
--- a/backends/pisi/helpers/Makefile.am
+++ b/backends/pisi/helpers/Makefile.am
@@ -10,17 +10,17 @@ dist_helper_DATA = \
get-repo-list.py \
get-requires.py \
get-updates.py \
- install-file.py \
- install.py \
+ install-files.py \
+ install-packages.py \
refresh-cache.py \
- remove.py \
+ remove-packages.py \
resolve.py \
repo-set-data.py \
search-details.py \
search-file.py \
search-group.py \
search-name.py \
- update.py \
+ update-packages.py \
update-system.py \
pisiBackend.py \
$(NULL)
diff --git a/backends/pisi/helpers/install-file.py b/backends/pisi/helpers/install-file.py
deleted file mode 100644
index a4811e0..0000000
--- a/backends/pisi/helpers/install-file.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
-#
-# 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.
-
-import sys
-
-import pisiBackend
-
-trusted = sys.argv[1]
-file_to_inst = sys.argv[2]
-backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
-backend.install_file(trusted, file_to_inst)
-
-sys.exit()
diff --git a/backends/pisi/helpers/install-files.py b/backends/pisi/helpers/install-files.py
new file mode 100644
index 0000000..9b0f25e
--- /dev/null
+++ b/backends/pisi/helpers/install-files.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
+#
+# 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.
+
+import sys
+
+import pisiBackend
+
+trusted = sys.argv[1]
+file_to_insts = sys.argv[2]
+backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
+backend.install_files(trusted, file_to_insts)
+
+sys.exit()
diff --git a/backends/pisi/helpers/install-packages.py b/backends/pisi/helpers/install-packages.py
new file mode 100644
index 0000000..ff2b478
--- /dev/null
+++ b/backends/pisi/helpers/install-packages.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
+#
+# 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.
+
+import sys
+import pisiBackend
+
+backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
+backend.install_packages(sys.argv[1])
+
+sys.exit()
diff --git a/backends/pisi/helpers/install.py b/backends/pisi/helpers/install.py
deleted file mode 100644
index f818ee7..0000000
--- a/backends/pisi/helpers/install.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
-#
-# 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.
-
-import sys
-import pisiBackend
-
-backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
-backend.install(sys.argv[1])
-
-sys.exit()
diff --git a/backends/pisi/helpers/pisiBackend.py b/backends/pisi/helpers/pisiBackend.py
index f64478f..22be04c 100644
--- a/backends/pisi/helpers/pisiBackend.py
+++ b/backends/pisi/helpers/pisiBackend.py
@@ -243,7 +243,7 @@ class PackageKitPisiBackend(PackageKitBaseBackend):
else:
self.package(id, INFO_NORMAL, pkg.summary)
- def install_file(self, trusted, file):
+ def install_files(self, trusted, files):
""" Installs given package into system"""
# FIXME: install progress
self.allow_cancel(False);
diff --git a/backends/pisi/helpers/remove-packages.py b/backends/pisi/helpers/remove-packages.py
new file mode 100644
index 0000000..98a3659
--- /dev/null
+++ b/backends/pisi/helpers/remove-packages.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
+#
+# 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.
+
+import sys
+import pisiBackend
+
+backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
+backend.remove_packages(sys.argv[1], sys.argv[2])
+
+sys.exit()
diff --git a/backends/pisi/helpers/remove.py b/backends/pisi/helpers/remove.py
deleted file mode 100644
index af5010f..0000000
--- a/backends/pisi/helpers/remove.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
-#
-# 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.
-
-import sys
-import pisiBackend
-
-backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
-backend.remove(sys.argv[1], sys.argv[2])
-
-sys.exit()
diff --git a/backends/pisi/helpers/update-packages.py b/backends/pisi/helpers/update-packages.py
new file mode 100644
index 0000000..4660588
--- /dev/null
+++ b/backends/pisi/helpers/update-packages.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
+#
+# 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.
+
+import sys
+import pisiBackend
+
+backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
+backend.update_packages(sys.argv[1])
+
+sys.exit()
diff --git a/backends/pisi/helpers/update.py b/backends/pisi/helpers/update.py
deleted file mode 100644
index 22ccf14..0000000
--- a/backends/pisi/helpers/update.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-#
-# Copyright (C) 2007 S.ÃaÄlar Onur <caglar at pardus.org.tr>
-#
-# 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.
-
-import sys
-import pisiBackend
-
-backend = pisiBackend.PackageKitPisiBackend(sys.argv[1:])
-backend.update(sys.argv[1])
-
-sys.exit()
diff --git a/backends/pisi/pk-backend-pisi.c b/backends/pisi/pk-backend-pisi.c
index 519deb7..4e20e18 100644
--- a/backends/pisi/pk-backend-pisi.c
+++ b/backends/pisi/pk-backend-pisi.c
@@ -164,11 +164,13 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -176,16 +178,24 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- pk_backend_spawn_helper (spawn, "install-file.py", pk_backend_bool_to_text (trusted), full_path, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -205,12 +215,17 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_spawn_helper (spawn, "remove.py", pk_backend_bool_to_text (allow_deps), package_id, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "remove-packages.py", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -341,11 +356,11 @@ PK_BACKEND_OPTIONS (
backend_get_requires, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_file, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index 3ad54e5..58731f1 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -1715,19 +1715,19 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static gboolean
-backend_install_package_thread (PkBackend *backend)
+backend_install_packages_thread (PkBackend *backend)
{
struct poldek_ts *ts;
struct poclidek_rcmd *rcmd;
gchar *command, *nvra;
struct vf_progress vf_progress;
- const gchar *package_id;
+ gchar **package_id;
pk_backend_set_uint (backend, "ts_type", TS_TYPE_ENUM_INSTALL);
- package_id = pk_backend_get_string (backend, "package_id");
+ package_ids = pk_backend_get_strv (backend, "package_ids");
setup_vf_progress (&vf_progress, backend);
@@ -1762,7 +1762,7 @@ backend_install_package_thread (PkBackend *backend)
}
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar *package_ids)
{
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install package when offline!");
@@ -1774,7 +1774,7 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
pb_error_clean ();
poldek_backend_percentage_data_create (backend);
- pk_backend_thread_create (backend, backend_install_package_thread);
+ pk_backend_thread_create (backend, backend_install_packages_thread);
}
/**
@@ -1853,17 +1853,17 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static gboolean
-backend_remove_package_thread (PkBackend *backend)
+backend_remove_packages_thread (PkBackend *backend)
{
struct poclidek_rcmd *rcmd;
struct poldek_ts *ts;
gchar *nvra, *command;
- const gchar *package_id;
+ gchar **package_ids;
- package_id = pk_backend_get_string (backend, "package_id");
+ package_ids = pk_backend_get_string (backend, "package_ids");
pb_load_packages (backend);
/* setup callbacks */
@@ -1872,7 +1872,7 @@ backend_remove_package_thread (PkBackend *backend)
ts = poldek_ts_new (ctx, 0);
rcmd = poclidek_rcmd_new (cctx, ts);
- nvra = poldek_get_nvra_from_package_id (package_id);
+ nvra = poldek_get_nvra_from_package_id (package_ids[0]);
command = g_strdup_printf ("uninstall %s", nvra);
pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
@@ -1893,11 +1893,11 @@ backend_remove_package_thread (PkBackend *backend)
}
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
poldek_backend_set_allow_cancel (backend, FALSE, TRUE);
pb_error_clean ();
- pk_backend_thread_create (backend, backend_remove_package_thread);
+ pk_backend_thread_create (backend, backend_remove_packages_thread);
}
/**
@@ -2222,18 +2222,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
backend_get_cancel, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
backend_get_packages, /* get_packages */
backend_get_repo_list, /* get_repo_list */
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- NULL, /* install_file */
- backend_install_package, /* install_package */
+ NULL, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/smart/helpers/Makefile.am b/backends/smart/helpers/Makefile.am
index f934aa9..bfcf035 100644
--- a/backends/smart/helpers/Makefile.am
+++ b/backends/smart/helpers/Makefile.am
@@ -9,16 +9,16 @@ dist_helper_DATA = \
get-files.py \
get-repo-list.py \
get-updates.py \
- install-file.py \
- install.py \
+ install-files.py \
+ install-packages.py \
refresh-cache.py \
- remove.py \
+ remove-packages.py \
repo-enable.py \
resolve.py \
search-name.py \
search-details.py \
smartBackend.py \
- update.py \
+ update-packages.py \
update-system.py \
$(NULL)
diff --git a/backends/smart/helpers/install-file.py b/backends/smart/helpers/install-file.py
deleted file mode 100755
index f2ae068..0000000
--- a/backends/smart/helpers/install-file.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
-#
-# 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.
-
-import sys
-
-from smartBackend import PackageKitSmartBackend
-
-trusted = sys.argv[1]
-file_to_inst = sys.argv[2]
-backend = PackageKitSmartBackend(sys.argv[1:])
-backend.install_file(trusted, file_to_inst)
-sys.exit(0)
diff --git a/backends/smart/helpers/install-files.py b/backends/smart/helpers/install-files.py
new file mode 100644
index 0000000..a485323
--- /dev/null
+++ b/backends/smart/helpers/install-files.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# 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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+trusted = sys.argv[1]
+files_to_inst = sys.argv[2]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.install_files(trusted, files_to_inst)
+sys.exit(0)
diff --git a/backends/smart/helpers/install-packages.py b/backends/smart/helpers/install-packages.py
new file mode 100644
index 0000000..d527e1c
--- /dev/null
+++ b/backends/smart/helpers/install-packages.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# 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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+package = sys.argv[1]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.install_packages(package)
+sys.exit(0)
diff --git a/backends/smart/helpers/install.py b/backends/smart/helpers/install.py
deleted file mode 100755
index d1c8c7b..0000000
--- a/backends/smart/helpers/install.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
-#
-# 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.
-
-import sys
-
-from smartBackend import PackageKitSmartBackend
-
-package = sys.argv[1]
-backend = PackageKitSmartBackend(sys.argv[1:])
-backend.install(package)
-sys.exit(0)
diff --git a/backends/smart/helpers/remove-packages.py b/backends/smart/helpers/remove-packages.py
new file mode 100644
index 0000000..393ae01
--- /dev/null
+++ b/backends/smart/helpers/remove-packages.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at redhat.com>
+#
+# 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.
+
+import sys
+import smartBackend
+
+
+backend = smartBackend.PackageKitSmartBackend(sys.argv[2:])
+backend.remove_packages(sys.argv[1], sys.argv[2])
+
+sys.exit()
diff --git a/backends/smart/helpers/remove.py b/backends/smart/helpers/remove.py
deleted file mode 100755
index d212f47..0000000
--- a/backends/smart/helpers/remove.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 James Bowes <jbowes at redhat.com>
-#
-# 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.
-
-import sys
-import smartBackend
-
-
-backend = smartBackend.PackageKitSmartBackend(sys.argv[2:])
-backend.remove(sys.argv[1], sys.argv[2])
-
-sys.exit()
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 5eca099..d95ce2a 100644
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -63,7 +63,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
self.ctrl.commitTransaction(trans, confirm=False)
@needs_cache
- def install_file(self, trusted, path):
+ def install_files(self, trusted, paths):
self.ctrl.addFileChannel(path)
self.ctrl.reloadChannels()
trans = smart.transaction.Transaction(self.ctrl.getCache(),
diff --git a/backends/smart/helpers/update-packages.py b/backends/smart/helpers/update-packages.py
new file mode 100644
index 0000000..40fa46c
--- /dev/null
+++ b/backends/smart/helpers/update-packages.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
+#
+# 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.
+
+import sys
+
+from smartBackend import PackageKitSmartBackend
+
+packages = sys.argv[1]
+backend = PackageKitSmartBackend(sys.argv[1:])
+backend.update_packages(packages)
+sys.exit(0)
diff --git a/backends/smart/helpers/update.py b/backends/smart/helpers/update.py
deleted file mode 100755
index efbd5a1..0000000
--- a/backends/smart/helpers/update.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 James Bowes <jbowes at dangerouslyinc.com>
-#
-# 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.
-
-import sys
-
-from smartBackend import PackageKitSmartBackend
-
-package = sys.argv[1]
-backend = PackageKitSmartBackend(sys.argv[1:])
-backend.update(package)
-sys.exit(0)
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 297ca4e..007212c 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -94,11 +94,13 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -106,16 +108,24 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- pk_backend_spawn_helper (spawn, "install-file.py", pk_backend_bool_to_text (trusted), full_path, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -135,13 +145,18 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
/* FIXME: Use allow_deps and autoremove */
- pk_backend_spawn_helper (spawn, "remove.py", package_id, NULL);
+ pk_backend_spawn_helper (spawn, "remove-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -198,7 +213,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "update-packages.py", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -245,18 +260,18 @@ PK_BACKEND_OPTIONS (
NULL, /* get_filters */
NULL, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
NULL, /* get_packages */
backend_get_repo_list, /* get_repo_list */
NULL, /* get_requires */
NULL, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/test/pk-backend-test-dbus.c b/backends/test/pk-backend-test-dbus.c
index 3968122..5dfea32 100644
--- a/backends/test/pk-backend-test-dbus.c
+++ b/backends/test/pk-backend-test-dbus.c
@@ -89,11 +89,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- NULL, /* install_file */
- NULL, /* install_package */
+ NULL, /* install_files */
+ NULL, /* install_packages */
NULL, /* install_signature */
NULL, /* refresh_cache */
- NULL, /* remove_package */
+ NULL, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/test/pk-backend-test-fail.c b/backends/test/pk-backend-test-fail.c
index 5dc6ad8..b429c1b 100644
--- a/backends/test/pk-backend-test-fail.c
+++ b/backends/test/pk-backend-test-fail.c
@@ -130,19 +130,19 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_id)
{
pk_backend_finished (backend);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
pk_backend_finished (backend);
}
@@ -157,10 +157,10 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
pk_backend_finished (backend);
}
@@ -252,18 +252,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
backend_cancel, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
NULL, /* get_packages */
NULL, /* get_repo_list */
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/test/pk-backend-test-nop.c b/backends/test/pk-backend-test-nop.c
index 568573f..3526fa5 100644
--- a/backends/test/pk-backend-test-nop.c
+++ b/backends/test/pk-backend-test-nop.c
@@ -39,11 +39,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- NULL, /* install_file */
- NULL, /* install_package */
+ NULL, /* install_files */
+ NULL, /* install_packages */
NULL, /* install_signature */
NULL, /* refresh_cache */
- NULL, /* remove_package */
+ NULL, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/test/pk-backend-test-spawn.c b/backends/test/pk-backend-test-spawn.c
index 33edecd..2958c05 100644
--- a/backends/test/pk-backend-test-spawn.c
+++ b/backends/test/pk-backend-test-spawn.c
@@ -80,11 +80,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- NULL, /* install_file */
- NULL, /* install_package */
+ NULL, /* install_files */
+ NULL, /* install_packages */
NULL, /* install_signature */
NULL, /* refresh_cache */
- NULL, /* remove_package */
+ NULL, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/test/pk-backend-test-succeed.c b/backends/test/pk-backend-test-succeed.c
index 0d133d4..17cdc6e 100644
--- a/backends/test/pk-backend-test-succeed.c
+++ b/backends/test/pk-backend-test-succeed.c
@@ -127,10 +127,10 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
pk_backend_finished (backend);
}
@@ -146,10 +146,10 @@ backend_install_signature (PkBackend *backend, PkSigTypeEnum type,
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
pk_backend_finished (backend);
}
@@ -164,10 +164,10 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
pk_backend_finished (backend);
}
@@ -328,11 +328,11 @@ PK_BACKEND_OPTIONS (
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
backend_install_signature, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/test/pk-backend-test-thread.c b/backends/test/pk-backend-test-thread.c
index f67c997..46ee862 100644
--- a/backends/test/pk-backend-test-thread.c
+++ b/backends/test/pk-backend-test-thread.c
@@ -152,11 +152,11 @@ PK_BACKEND_OPTIONS (
NULL, /* get_requires */
NULL, /* get_update_detail */
NULL, /* get_updates */
- NULL, /* install_file */
- NULL, /* install_package */
+ NULL, /* install_files */
+ NULL, /* install_packages */
NULL, /* install_signature */
NULL, /* refresh_cache */
- NULL, /* remove_package */
+ NULL, /* remove_packages */
NULL, /* repo_enable */
NULL, /* repo_set_data */
NULL, /* resolve */
diff --git a/backends/yum/helpers/Makefile.am b/backends/yum/helpers/Makefile.am
index 1def7fc..ae73353 100644
--- a/backends/yum/helpers/Makefile.am
+++ b/backends/yum/helpers/Makefile.am
@@ -18,11 +18,11 @@ dist_helper_DATA = \
repo-enable.py \
repo-set-data.py \
get-update-detail.py \
- install.py \
- remove.py \
+ install-packages.py \
+ remove-packages.py \
resolve.py \
- update.py \
- install-file.py \
+ update-packages.py \
+ install-files.py \
refresh-cache.py \
what-provides.py \
update-system.py \
diff --git a/backends/yum/helpers/install-file.py b/backends/yum/helpers/install-file.py
deleted file mode 100755
index 506ce5a..0000000
--- a/backends/yum/helpers/install-file.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
-#
-# 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.
-
-import sys
-
-from yumBackend import PackageKitYumBackend
-
-trusted = sys.argv[1]
-file_to_inst = sys.argv[2]
-backend = PackageKitYumBackend(sys.argv[1:])
-backend.install_file(trusted, file_to_inst)
-sys.exit(0)
diff --git a/backends/yum/helpers/install-files.py b/backends/yum/helpers/install-files.py
new file mode 100644
index 0000000..6448064
--- /dev/null
+++ b/backends/yum/helpers/install-files.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
+#
+# 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.
+
+import sys
+
+from yumBackend import PackageKitYumBackend
+
+trusted = sys.argv[1]
+files_to_inst = sys.argv[2]
+backend = PackageKitYumBackend(sys.argv[1:])
+backend.install_files(trusted, files_to_inst)
+sys.exit(0)
diff --git a/backends/yum/helpers/install-packages.py b/backends/yum/helpers/install-packages.py
new file mode 100644
index 0000000..35e1111
--- /dev/null
+++ b/backends/yum/helpers/install-packages.py
@@ -0,0 +1,20 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
+#
+# 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.
+
+import sys
+
+from yumBackend import PackageKitYumBackend
+
+packages = sys.argv[1:]
+backend = PackageKitYumBackend(sys.argv[1:])
+backend.install_packages(packages)
+sys.exit(0)
diff --git a/backends/yum/helpers/install.py b/backends/yum/helpers/install.py
deleted file mode 100755
index 86e3caa..0000000
--- a/backends/yum/helpers/install.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
-#
-# 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.
-
-import sys
-
-from yumBackend import PackageKitYumBackend
-
-packages = sys.argv[1:]
-backend = PackageKitYumBackend(sys.argv[1:])
-backend.install(packages)
-sys.exit(0)
\ No newline at end of file
diff --git a/backends/yum/helpers/remove-packages.py b/backends/yum/helpers/remove-packages.py
new file mode 100644
index 0000000..4bec79c
--- /dev/null
+++ b/backends/yum/helpers/remove-packages.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+#
+# 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.
+
+
+import sys
+
+from yumBackend import PackageKitYumBackend
+
+allowdeps = sys.argv[1]
+package = sys.argv[2]
+
+backend = PackageKitYumBackend(sys.argv[1:])
+backend.remove_packages(allowdeps, package)
+backend.unLock()
+
+sys.exit(0)
diff --git a/backends/yum/helpers/remove.py b/backends/yum/helpers/remove.py
deleted file mode 100755
index 4e360d3..0000000
--- a/backends/yum/helpers/remove.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-#
-# 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.
-
-
-import sys
-
-from yumBackend import PackageKitYumBackend
-
-allowdeps = sys.argv[1]
-package = sys.argv[2]
-
-backend = PackageKitYumBackend(sys.argv[1:])
-backend.remove(allowdeps, package)
-backend.unLock()
-
-sys.exit(0)
diff --git a/backends/yum/helpers/update-packages.py b/backends/yum/helpers/update-packages.py
new file mode 100644
index 0000000..16f1441
--- /dev/null
+++ b/backends/yum/helpers/update-packages.py
@@ -0,0 +1,21 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
+# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
+#
+# 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.
+
+import sys
+
+from yumBackend import PackageKitYumBackend
+
+packages = sys.argv[1:]
+backend = PackageKitYumBackend(sys.argv[1:])
+backend.update_packages(packages)
+backend.unLock()
+sys.exit(0)
diff --git a/backends/yum/helpers/update.py b/backends/yum/helpers/update.py
deleted file mode 100755
index f0b7dc1..0000000
--- a/backends/yum/helpers/update.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/usr/bin/python
-#
-# Copyright (C) 2007 Richard Hughes <richard at hughsie.com>
-# Copyright (C) 2007 Red Hat Inc, Seth Vidal <skvidal at fedoraproject.org>
-#
-# 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.
-
-import sys
-
-from yumBackend import PackageKitYumBackend
-
-packages = sys.argv[1:]
-backend = PackageKitYumBackend(sys.argv[1:])
-backend.update(packages)
-backend.unLock()
-sys.exit(0)
\ No newline at end of file
diff --git a/backends/yum/helpers/yumBackend.py b/backends/yum/helpers/yumBackend.py
index d434006..f76e27c 100644
--- a/backends/yum/helpers/yumBackend.py
+++ b/backends/yum/helpers/yumBackend.py
@@ -882,9 +882,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
break
@handle_repo_error
- def install(self,packages):
+ def install_packages(self,packages):
'''
- Implement the {backend}-install functionality
+ Implement the {backend}-install-packages functionality
This will only work with yum 3.2.4 or higher
'''
self._check_init()
@@ -914,15 +914,16 @@ class PackageKitYumBackend(PackageKitBaseBackend):
if newest.EVR > po.EVR:
self.message(MESSAGE_WARNING,"A newer version of %s is available online." % po.name)
- def install_file (self,trusted,inst_file):
+ def install_files (self,trusted,inst_files):
'''
- Implement the {backend}-install_file functionality
+ Implement the {backend}-install-files functionality
Install the package containing the inst_file file
Needed to be implemented in a sub class
'''
- if inst_file.endswith('.src.rpm'):
- self.error(ERROR_CANNOT_INSTALL_SOURCE_PACKAGE,'Backend will not install a src rpm file')
- return
+ for inst_file in inst_files:
+ if inst_file.endswith('.src.rpm'):
+ self.error(ERROR_CANNOT_INSTALL_SOURCE_PACKAGE,'Backend will not install a src rpm file')
+ return
self._check_init()
self.allow_cancel(False);
self.percentage(0)
@@ -938,26 +939,33 @@ class PackageKitYumBackend(PackageKitBaseBackend):
# self.yumbase.installLocal fails for unsigned packages when self.yumbase.conf.gpgcheck=1
# This means we don't run runYumTransaction, and don't get the GPG failure in
# PackageKitYumBase(_checkSignatures) -- so we check here
- po = YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=inst_file)
- try:
- self.yumbase._checkSignatures([po], None)
- except yum.Errors.YumGPGCheckError,e:
- self.error(ERROR_MISSING_GPG_SIGNATURE,str(e))
+ for inst_file in inst_files:
+ po = YumLocalPackage(ts=self.yumbase.rpmdb.readOnlyTS(), filename=inst_file)
+ try:
+ self.yumbase._checkSignatures([po], None)
+ except yum.Errors.YumGPGCheckError,e:
+ self.error(ERROR_MISSING_GPG_SIGNATURE,str(e))
else:
self.yumbase.conf.gpgcheck=0
- if not self._check_local_file(inst_file):
- return
-
+ # common checks copied from yum
+ for inst_file in inst_files:
+ if not self._check_local_file(inst_file):
+ return
+
+ txmbrs = []
try:
- txmbr = self.yumbase.installLocal(inst_file)
- if txmbr:
- self._checkForNewer(txmbr[0].po)
- # Added the package to the transaction set
- if len(self.yumbase.tsInfo) > 0:
- self._runYumTransaction()
- else:
- self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
+ for inst_file in inst_files:
+ txmbr = self.yumbase.installLocal(inst_file)
+ if txmbr:
+ txmbrs.extend(txmbr)
+ self._checkForNewer(txmbr[0].po)
+ # Added the package to the transaction set
+ else:
+ self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
+ if len(self.yumbase.tsInfo) == 0:
+ self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % " or ".join(inst_files))
+ self._runYumTransaction()
except yum.Errors.InstallError,e:
self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
@@ -969,14 +977,16 @@ class PackageKitYumBackend(PackageKitBaseBackend):
for repo in self.yumbase.repos.listEnabled():
repo.disable()
- txmbr = self.yumbase.installLocal(inst_file)
- if txmbr:
- if len(self.yumbase.tsInfo) > 0:
- if not self.yumbase.tsInfo.pkgSack:
- self.yumbase.tsInfo.pkgSack = MetaSack()
- self._runYumTransaction()
- else:
- self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
+ for inst_file in inst_files:
+ txmbr = self.yumbase.installLocal(inst_file)
+ if txmbr:
+ txmbrs.extend(txmbr)
+ if len(self.yumbase.tsInfo) > 0:
+ if not self.yumbase.tsInfo.pkgSack:
+ self.yumbase.tsInfo.pkgSack = MetaSack()
+ self._runYumTransaction()
+ else:
+ self.error(ERROR_LOCAL_INSTALL_FAILED,"Can't install %s" % inst_file)
except yum.Errors.InstallError,e:
self.error(ERROR_LOCAL_INSTALL_FAILED,str(e))
@@ -1005,7 +1015,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
return True
- def update(self,packages):
+ def update_packages(self,packages):
'''
Implement the {backend}-install functionality
This will only work with yum 3.2.4 or higher
diff --git a/backends/yum/pk-backend-yum.c b/backends/yum/pk-backend-yum.c
index b65870b..69e2701 100644
--- a/backends/yum/pk-backend-yum.c
+++ b/backends/yum/pk-backend-yum.c
@@ -187,11 +187,13 @@ backend_get_update_detail (PkBackend *backend, const gchar *package_id)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
+ gchar *package_ids_temp;
+
/* check network state */
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -199,16 +201,24 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_spawn_helper (spawn, "install.py", package_id, NULL);
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- pk_backend_spawn_helper (spawn, "install-file.py", pk_backend_bool_to_text (trusted), full_path, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (full_paths, "|");
+ pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -241,12 +251,17 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_spawn_helper (spawn, "remove.py", pk_backend_bool_to_text (allow_deps), package_id, NULL);
+ gchar *package_ids_temp;
+
+ /* send the complete list as stdin */
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, "remove-packages.py", pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
+ g_free (package_ids_temp);
}
/**
@@ -315,7 +330,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "update.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, "update-packages.py", package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -397,18 +412,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
backend_cancel, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
backend_get_packages, /* get_packages */
backend_get_repo_list, /* get_repo_list */
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
backend_install_signature, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
index 0a5acad..9cfed94 100755
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ b/backends/yum2/helpers/yumDBUSBackend.py
@@ -789,7 +789,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
@threaded
@async
- def doInstallPackage(self, package):
+ def doInstallPackages(self, packages):
'''
Implement the {backend}-install functionality
This will only work with yum 3.2.4 or higher
@@ -830,9 +830,9 @@ class PackageKitYumBackend(PackageKitBaseBackend):
@threaded
@async
- def doInstallFile (self, inst_file):
+ def doInstallFiles (self, inst_files):
'''
- Implement the {backend}-install_file functionality
+ Implement the {backend}-install_files functionality
Install the package containing the inst_file file
Needed to be implemented in a sub class
'''
@@ -934,7 +934,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
@threaded
@async
- def doRemovePackage(self, package, allowdep, autoremove):
+ def doRemovePackages(self, packages, allowdep, autoremove):
'''
Implement the {backend}-remove functionality
'''
diff --git a/backends/yum2/pk-backend-yum2.c b/backends/yum2/pk-backend-yum2.c
index e2fbef5..1fd0f44 100644
--- a/backends/yum2/pk-backend-yum2.c
+++ b/backends/yum2/pk-backend-yum2.c
@@ -154,10 +154,10 @@ backend_get_update_detail (PkBackend *backend, const gchar *package_id)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, gchar **package_ids)
{
/* check network state */
if (!pk_backend_is_online (backend)) {
@@ -166,16 +166,16 @@ backend_install_package (PkBackend *backend, const gchar *package_id)
return;
}
- pk_backend_dbus_install_package (dbus, package_id);
+ pk_backend_dbus_install_packages (dbus, package_ids);
}
/**
- * backend_install_file:
+ * backend_install_files:
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- pk_backend_dbus_install_file (dbus, trusted, full_path);
+ pk_backend_dbus_install_files (dbus, trusted, full_paths);
}
/**
@@ -195,12 +195,12 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
}
/**
- * pk_backend_remove_package:
+ * pk_backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
- pk_backend_dbus_remove_package (dbus, package_id, allow_deps, autoremove);
+ pk_backend_dbus_remove_packages (dbus, package_ids, allow_deps, autoremove);
}
/**
@@ -318,18 +318,18 @@ PK_BACKEND_OPTIONS (
backend_get_filters, /* get_filters */
backend_cancel, /* cancel */
backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
+ backend_get_details, /* get_details */
backend_get_files, /* get_files */
NULL, /* get_packages */
backend_get_repo_list, /* get_repo_list */
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index c92489b..e2f8cd1 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -676,12 +676,12 @@ backend_get_updates (PkBackend *backend, PkFilterEnum filters)
}
static gboolean
-backend_install_file_thread (PkBackend *backend)
+backend_install_files_thread (PkBackend *backend)
{
- const gchar *full_path;
+ gchar **full_paths;
// check if file is really a rpm
- full_path = pk_backend_get_string (backend, "full_path");
+ full_paths = pk_backend_get_string (backend, "full_paths");
zypp::Pathname rpmPath (full_path);
zypp::target::rpm::RpmHeader::constPtr rpmHeader = zypp::target::rpm::RpmHeader::readPackage (rpmPath, zypp::target::rpm::RpmHeader::NOSIGNATURE);
@@ -780,12 +780,12 @@ backend_install_file_thread (PkBackend *backend)
}
/**
- * backend_install_file
+ * backend_install_files
*/
static void
-backend_install_file (PkBackend *backend, gboolean trusted, const gchar *full_path)
+backend_install_files (PkBackend *backend, gboolean trusted, const gchar *full_paths)
{
- pk_backend_thread_create (backend, backend_install_file_thread);
+ pk_backend_thread_create (backend, backend_install_files_thread);
}
static gboolean
@@ -931,15 +931,15 @@ backend_update_system (PkBackend *backend)
}
static gboolean
-backend_install_package_thread (PkBackend *backend)
+backend_install_packages_thread (PkBackend *backend)
{
- const gchar *package_id;
+ gchar *package_ids;
pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
pk_backend_set_percentage (backend, 0);
- package_id = pk_backend_get_string (backend, "package_id");
- PkPackageId *pi = pk_package_id_new_from_string (package_id);
+ package_ids = pk_backend_get_strv (backend, "package_id");
+ PkPackageId *pi = pk_package_id_new_from_string (package_ids[0]);
if (pi == NULL) {
pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
pk_backend_finished (backend);
@@ -1009,27 +1009,27 @@ backend_install_package_thread (PkBackend *backend)
}
/**
- * backend_install_package:
+ * backend_install_packages:
*/
static void
-backend_install_package (PkBackend *backend, const gchar *package_id)
+backend_install_packages (PkBackend *backend, const gchar *package_id)
{
// For now, don't let the user cancel the install once it's started
pk_backend_set_allow_cancel (backend, FALSE);
- pk_backend_thread_create (backend, backend_install_package_thread);
+ pk_backend_thread_create (backend, backend_install_packages_thread);
}
static gboolean
-backend_remove_package_thread (PkBackend *backend)
+backend_remove_packages_thread (PkBackend *backend)
{
- const gchar *package_id;
+ gchar **package_ids;
PkPackageId *pi;
pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE);
pk_backend_set_percentage (backend, 0);
- package_id = pk_backend_get_string (backend, "package_id");
- pi = pk_package_id_new_from_string (package_id);
+ package_ids = pk_backend_get_string (backend, "package_ids");
+ pi = pk_package_id_new_from_string (package_id[0]);
if (pi == NULL) {
pk_backend_error_code (backend, PK_ERROR_ENUM_PACKAGE_ID_INVALID, "invalid package id");
pk_backend_finished (backend);
@@ -1090,13 +1090,13 @@ backend_remove_package_thread (PkBackend *backend)
}
/**
- * backend_remove_package:
+ * backend_remove_packages:
*/
static void
-backend_remove_package (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+backend_remove_packages (PkBackend *backend, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
{
pk_backend_set_uint (backend, "allow_deps", allow_deps == TRUE ? DEPS_ALLOW : DEPS_NO_ALLOW);
- pk_backend_thread_create (backend, backend_remove_package_thread);
+ pk_backend_thread_create (backend, backend_remove_packages_thread);
}
/**
@@ -1635,11 +1635,11 @@ extern "C" PK_BACKEND_OPTIONS (
backend_get_requires, /* get_requires */
backend_get_update_detail, /* get_update_detail */
backend_get_updates, /* get_updates */
- backend_install_file, /* install_file */
- backend_install_package, /* install_package */
+ backend_install_files, /* install_files */
+ backend_install_packages, /* install_packages */
NULL, /* install_signature */
backend_refresh_cache, /* refresh_cache */
- backend_remove_package, /* remove_package */
+ backend_remove_packages, /* remove_packages */
backend_repo_enable, /* repo_enable */
backend_repo_set_data, /* repo_set_data */
backend_resolve, /* resolve */
diff --git a/client/pk-console.c b/client/pk-console.c
index 62ad8dd..8f69068 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -54,7 +54,7 @@ static gchar *filename = NULL;
static PkControl *control = NULL;
static PkClient *client = NULL;
static PkClient *client_task = NULL;
-static PkClient *client_install_file = NULL;
+static PkClient *client_install_files = NULL;
static PkClient *client_signature = NULL;
typedef struct {
@@ -379,10 +379,10 @@ pk_console_signature_finished_cb (PkClient *client_signature, PkExitEnum exit, g
}
/**
- * pk_console_install_file_finished_cb:
+ * pk_console_install_files_finished_cb:
**/
static void
-pk_console_install_file_finished_cb (PkClient *client_signature, PkExitEnum exit, guint runtime, gpointer data)
+pk_console_install_files_finished_cb (PkClient *client_signature, PkExitEnum exit, guint runtime, gpointer data)
{
g_main_loop_quit (loop);
}
@@ -429,7 +429,7 @@ pk_console_finished_cb (PkClient *client, PkExitEnum exit, guint runtime, gpoint
g_print ("%s\n", _("An application restart is required"));
}
- if (role == PK_ROLE_ENUM_INSTALL_FILE &&
+ if (role == PK_ROLE_ENUM_INSTALL_FILES &&
exit == PK_EXIT_ENUM_FAILED && need_requeue) {
pk_warning ("waiting for second install file to finish");
return;
@@ -836,11 +836,11 @@ pk_console_error_code_cb (PkClient *client, PkErrorCodeEnum error_code, const gc
}
/* do we need to do the untrusted action */
- if (role == PK_ROLE_ENUM_INSTALL_FILE &&
+ if (role == PK_ROLE_ENUM_INSTALL_FILES &&
error_code == PK_ERROR_ENUM_MISSING_GPG_SIGNATURE && trusted) {
pk_debug ("need to try again with trusted FALSE");
trusted = FALSE;
- ret = pk_client_install_file (client_install_file, trusted, filename, &error);
+ ret = pk_client_install_file (client_install_files, trusted, filename, &error);
/* we succeeded, so wait for the requeue */
if (!ret) {
pk_warning ("failed to install file second time: %s", error->message);
@@ -1073,14 +1073,14 @@ pk_console_get_summary (PkRoleEnum roles)
pk_enums_contain (roles, PK_ROLE_ENUM_SEARCH_FILE)) {
g_string_append_printf (string, " %s\n", "search [name|details|group|file] [data]");
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_PACKAGE) ||
- pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_FILE)) {
- g_string_append_printf (string, " %s\n", "install [package|file]");
+ if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_PACKAGES) ||
+ pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_FILES)) {
+ g_string_append_printf (string, " %s\n", "install [packages|files]");
}
if (pk_enums_contain (roles, PK_ROLE_ENUM_INSTALL_SIGNATURE)) {
g_string_append_printf (string, " %s\n", "install-sig [type] [key_id] [package_id]");
}
- if (pk_enums_contain (roles, PK_ROLE_ENUM_REMOVE_PACKAGE)) {
+ if (pk_enums_contain (roles, PK_ROLE_ENUM_REMOVE_PACKAGES)) {
g_string_append_printf (string, " %s\n", "remove [package]");
}
if (pk_enums_contain (roles, PK_ROLE_ENUM_UPDATE_SYSTEM) ||
@@ -1256,10 +1256,10 @@ main (int argc, char *argv[])
g_signal_connect (client_task, "finished",
G_CALLBACK (pk_console_finished_cb), NULL);
- client_install_file = pk_client_new ();
- g_signal_connect (client_install_file, "finished",
- G_CALLBACK (pk_console_install_file_finished_cb), NULL);
- g_signal_connect (client_install_file, "error-code",
+ client_install_files = pk_client_new ();
+ g_signal_connect (client_install_files, "finished",
+ G_CALLBACK (pk_console_install_files_finished_cb), NULL);
+ g_signal_connect (client_install_files, "error-code",
G_CALLBACK (pk_console_error_code_cb), NULL);
client_signature = pk_client_new ();
@@ -1529,7 +1529,7 @@ out:
g_object_unref (control);
g_object_unref (client);
g_object_unref (client_task);
- g_object_unref (client_install_file);
+ g_object_unref (client_install_files);
g_object_unref (client_signature);
return 0;
diff --git a/docs/html/pk-faq.html b/docs/html/pk-faq.html
index e88a4e4..a25e2b7 100644
--- a/docs/html/pk-faq.html
+++ b/docs/html/pk-faq.html
@@ -184,7 +184,7 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
-<td><b>InstallPackage</b></td>
+<td><b>InstallPackages</b></td>
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- apt2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- alpm -->
@@ -199,7 +199,7 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
-<td><b>InstallFile</b></td>
+<td><b>InstallFiles</b></td>
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- alpm -->
@@ -214,7 +214,7 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
-<td><b>RemovePackage</b></td>
+<td><b>RemovePackages</b></td>
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- apt -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- apt2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- alpm -->
diff --git a/libpackagekit/pk-client.c b/libpackagekit/pk-client.c
index 5dcd696..2653157 100644
--- a/libpackagekit/pk-client.c
+++ b/libpackagekit/pk-client.c
@@ -90,6 +90,7 @@ struct _PkClientPrivate
gchar *cached_transaction_id;
gchar *cached_key_id;
gchar *cached_full_path;
+ gchar **cached_full_paths;
gchar *cached_search;
PkProvidesEnum cached_provides;
PkFilterEnum cached_filters;
@@ -1871,12 +1872,12 @@ pk_client_get_files (PkClient *client, const gchar *package_id, GError **error)
}
/**
- * pk_client_remove_package_action:
+ * pk_client_remove_packages_action:
**/
static gboolean
-pk_client_remove_package_action (PkClient *client, const gchar *package_id,
- gboolean allow_deps, gboolean autoremove,
- GError **error)
+pk_client_remove_packages_action (PkClient *client, gchar **package_ids,
+ gboolean allow_deps, gboolean autoremove,
+ GError **error)
{
gboolean ret;
@@ -1888,8 +1889,8 @@ pk_client_remove_package_action (PkClient *client, const gchar *package_id,
pk_client_error_set (error, PK_CLIENT_ERROR_NO_TID, "No proxy for transaction");
return FALSE;
}
- ret = dbus_g_proxy_call (client->priv->proxy, "RemovePackage", error,
- G_TYPE_STRING, package_id,
+ ret = dbus_g_proxy_call (client->priv->proxy, "RemovePackages", error,
+ G_TYPE_STRV, package_ids,
G_TYPE_BOOLEAN, allow_deps,
G_TYPE_BOOLEAN, autoremove,
G_TYPE_INVALID, G_TYPE_INVALID);
@@ -1897,9 +1898,9 @@ pk_client_remove_package_action (PkClient *client, const gchar *package_id,
}
/**
- * pk_client_remove_package:
+ * pk_client_remove_packages:
* @client: a valid #PkClient instance
- * @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
+ * @package_ids: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
* @allow_deps: if other dependant packages are allowed to be removed from the computer
* @autoremove: if other packages installed at the same time should be tried to remove
* @error: a %GError to put the error code and message in, or %NULL
@@ -1911,20 +1912,23 @@ pk_client_remove_package_action (PkClient *client, const gchar *package_id,
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_remove_package (PkClient *client, const gchar *package_id, gboolean allow_deps,
+pk_client_remove_packages (PkClient *client, gchar **package_ids, gboolean allow_deps,
gboolean autoremove, GError **error)
{
gboolean ret;
+ gchar *package_ids_temp;
GError *error_pk = NULL; /* we can't use the same error as we might be NULL */
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (package_id != NULL, FALSE);
+ g_return_val_if_fail (package_ids != NULL, FALSE);
- /* check the PackageID here to avoid a round trip if invalid */
- ret = pk_package_id_check (package_id);
+ /* check the PackageIDs here to avoid a round trip if invalid */
+ ret = pk_package_ids_check (package_ids);
if (!ret) {
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
pk_client_error_set (error, PK_CLIENT_ERROR_INVALID_PACKAGEID,
- "package_id '%s' is not valid", package_id);
+ "package_ids '%s' are not valid", package_ids_temp);
+ g_free (package_ids_temp);
return FALSE;
}
@@ -1935,13 +1939,13 @@ pk_client_remove_package (PkClient *client, const gchar *package_id, gboolean al
}
/* save this so we can re-issue it */
- client->priv->role = PK_ROLE_ENUM_REMOVE_PACKAGE;
+ client->priv->role = PK_ROLE_ENUM_REMOVE_PACKAGES;
client->priv->cached_allow_deps = allow_deps;
client->priv->cached_autoremove = autoremove;
- client->priv->cached_package_id = g_strdup (package_id);
+ client->priv->cached_package_ids = g_strdupv (package_ids);
/* hopefully do the operation first time */
- ret = pk_client_remove_package_action (client, package_id, allow_deps, autoremove, &error_pk);
+ ret = pk_client_remove_packages_action (client, package_ids, allow_deps, autoremove, &error_pk);
/* we were refused by policy */
if (!ret && pk_polkit_client_error_denied_by_policy (error_pk)) {
@@ -1950,7 +1954,7 @@ pk_client_remove_package (PkClient *client, const gchar *package_id, gboolean al
/* clear old error */
g_clear_error (&error_pk);
/* retry the action now we have got auth */
- ret = pk_client_remove_package_action (client, package_id, allow_deps, autoremove, &error_pk);
+ ret = pk_client_remove_packages_action (client, package_ids, allow_deps, autoremove, &error_pk);
}
}
/* we failed one of these, return the error to the user */
@@ -2061,7 +2065,7 @@ pk_client_refresh_cache (PkClient *client, gboolean force, GError **error)
* pk_client_install_package_action:
**/
static gboolean
-pk_client_install_package_action (PkClient *client, const gchar *package_id, GError **error)
+pk_client_install_package_action (PkClient *client, gchar **package_ids, GError **error)
{
gboolean ret;
@@ -2073,16 +2077,16 @@ pk_client_install_package_action (PkClient *client, const gchar *package_id, GEr
pk_client_error_set (error, PK_CLIENT_ERROR_NO_TID, "No proxy for transaction");
return FALSE;
}
- ret = dbus_g_proxy_call (client->priv->proxy, "InstallPackage", error,
- G_TYPE_STRING, package_id,
+ ret = dbus_g_proxy_call (client->priv->proxy, "InstallPackages", error,
+ G_TYPE_STRV, package_ids,
G_TYPE_INVALID, G_TYPE_INVALID);
return ret;
}
/**
- * pk_client_install_package:
+ * pk_client_install_packages:
* @client: a valid #PkClient instance
- * @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
+ * @package_ids: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
* @error: a %GError to put the error code and message in, or %NULL
*
* Install a package of the newest and most correct version.
@@ -2090,19 +2094,22 @@ pk_client_install_package_action (PkClient *client, const gchar *package_id, GEr
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_install_package (PkClient *client, const gchar *package_id, GError **error)
+pk_client_install_packages (PkClient *client, gchar **package_ids, GError **error)
{
gboolean ret;
+ gchar *package_ids_temp;
GError *error_pk = NULL; /* we can't use the same error as we might be NULL */
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (package_id != NULL, FALSE);
+ g_return_val_if_fail (package_ids != NULL, FALSE);
- /* check the PackageID here to avoid a round trip if invalid */
- ret = pk_package_id_check (package_id);
+ /* check the PackageIDs here to avoid a round trip if invalid */
+ ret = pk_package_ids_check (package_ids);
if (!ret) {
+ package_ids_temp = pk_package_ids_to_text (package_ids, ", ");
pk_client_error_set (error, PK_CLIENT_ERROR_INVALID_PACKAGEID,
- "package_id '%s' is not valid", package_id);
+ "package_ids '%s' are not valid", package_ids_temp);
+ g_free (package_ids_temp);
return FALSE;
}
@@ -2113,11 +2120,11 @@ pk_client_install_package (PkClient *client, const gchar *package_id, GError **e
}
/* save this so we can re-issue it */
- client->priv->role = PK_ROLE_ENUM_INSTALL_PACKAGE;
- client->priv->cached_package_id = g_strdup (package_id);
+ client->priv->role = PK_ROLE_ENUM_INSTALL_PACKAGES;
+ client->priv->cached_package_ids = g_strdupv (package_ids);
/* hopefully do the operation first time */
- ret = pk_client_install_package_action (client, package_id, &error_pk);
+ ret = pk_client_install_package_action (client, package_ids, &error_pk);
/* we were refused by policy */
if (!ret && pk_polkit_client_error_denied_by_policy (error_pk)) {
@@ -2126,7 +2133,7 @@ pk_client_install_package (PkClient *client, const gchar *package_id, GError **e
/* clear old error */
g_clear_error (&error_pk);
/* retry the action now we have got auth */
- ret = pk_client_install_package_action (client, package_id, &error_pk);
+ ret = pk_client_install_package_action (client, package_ids, &error_pk);
}
}
/* we failed one of these, return the error to the user */
@@ -2271,7 +2278,7 @@ pk_client_update_packages_action (PkClient *client, gchar **package_ids, GError
}
/**
- * pk_client_update_packages_strv:
+ * pk_client_update_packages:
* @client: a valid #PkClient instance
* @package_ids: an array of package_id structures such as "gnome-power-manager;0.0.1;i386;fedora"
* @error: a %GError to put the error code and message in, or %NULL
@@ -2281,7 +2288,7 @@ pk_client_update_packages_action (PkClient *client, gchar **package_ids, GError
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_update_packages_strv (PkClient *client, gchar **package_ids, GError **error)
+pk_client_update_packages (PkClient *client, gchar **package_ids, GError **error)
{
gboolean ret;
gchar *package_ids_temp;
@@ -2347,60 +2354,107 @@ pk_client_update_packages_strv (PkClient *client, gchar **package_ids, GError **
}
/**
- * pk_client_update_packages:
+ * pk_client_update_package:
* @client: a valid #PkClient instance
+ * @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
* @error: a %GError to put the error code and message in, or %NULL
- * @package_id: an array of package_id structures such as "gnome-power-manager;0.0.1;i386;fedora"
- * @...: NULL terminated list
*
- * Update specific packages to the newest available versions.
+ * Update a specific package to the newest available version.
*
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_update_packages (PkClient *client, GError **error, const gchar *package_id, ...)
+pk_client_update_package (PkClient *client, const gchar *package_id, GError **error)
{
- va_list args;
gchar **package_ids;
gboolean ret;
-
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
g_return_val_if_fail (package_id != NULL, FALSE);
- /* process the valist */
- va_start (args, package_id);
- package_ids = pk_package_ids_from_va_list (package_id, &args);
- va_end (args);
+ package_ids = g_strsplit (package_id, "|", 1);
+ ret = pk_client_update_packages (client, package_ids, error);
+ g_strfreev (package_ids);
+ return ret;
+}
+
+/**
+ * pk_client_install_package:
+ * @client: a valid #PkClient instance
+ * @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
+ * @error: a %GError to put the error code and message in, or %NULL
+ *
+ * Install a specific package.
+ *
+ * Return value: %TRUE if the daemon queued the transaction
+ **/
+gboolean
+pk_client_install_package (PkClient *client, const gchar *package_id, GError **error)
+{
+ gchar **package_ids;
+ gboolean ret;
+ g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (package_id != NULL, FALSE);
- ret = pk_client_update_packages_strv (client, package_ids, error);
+ package_ids = g_strsplit (package_id, "|", 1);
+ ret = pk_client_install_packages (client, package_ids, error);
g_strfreev (package_ids);
return ret;
}
/**
- * pk_client_update_package:
+ * pk_client_install_file:
* @client: a valid #PkClient instance
* @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
* @error: a %GError to put the error code and message in, or %NULL
*
- * Update a specific package to the newest available version.
+ * Install a specific package.
*
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_update_package (PkClient *client, const gchar *package_id, GError **error)
+pk_client_install_file (PkClient *client, gboolean trusted, const gchar *file_rel, GError **error)
+{
+ gchar **files_rel;
+ gboolean ret;
+ g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
+ g_return_val_if_fail (file_rel != NULL, FALSE);
+
+ files_rel = g_strsplit (file_rel, "|", 1);
+ ret = pk_client_install_files (client, trusted, files_rel, error);
+ g_strfreev (files_rel);
+ return ret;
+}
+
+/**
+ * pk_client_remove_package:
+ * @client: a valid #PkClient instance
+ * @package_id: a package_id structure such as "gnome-power-manager;0.0.1;i386;fedora"
+ * @error: a %GError to put the error code and message in, or %NULL
+ *
+ * Remove a specific package.
+ *
+ * Return value: %TRUE if the daemon queued the transaction
+ **/
+gboolean
+pk_client_remove_package (PkClient *client, const gchar *package_id, gboolean allow_deps,
+ gboolean autoremove, GError **error)
{
+ gchar **package_ids;
+ gboolean ret;
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
g_return_val_if_fail (package_id != NULL, FALSE);
- return pk_client_update_packages (client, error, package_id, NULL);
+ package_ids = g_strsplit (package_id, "|", 1);
+ ret = pk_client_remove_packages (client, package_ids, allow_deps, autoremove, error);
+ g_strfreev (package_ids);
+ return ret;
}
/**
- * pk_client_install_file_action:
+ * pk_client_install_files_action:
**/
static gboolean
-pk_client_install_file_action (PkClient *client, gboolean trusted, const gchar *file, GError **error)
+pk_client_install_files_action (PkClient *client, gboolean trusted, gchar **files, GError **error)
{
gboolean ret;
@@ -2412,9 +2466,9 @@ pk_client_install_file_action (PkClient *client, gboolean trusted, const gchar *
pk_client_error_set (error, PK_CLIENT_ERROR_NO_TID, "No proxy for transaction");
return FALSE;
}
- ret = dbus_g_proxy_call (client->priv->proxy, "InstallFile", error,
+ ret = dbus_g_proxy_call (client->priv->proxy, "InstallFiles", error,
G_TYPE_BOOLEAN, trusted,
- G_TYPE_STRING, file,
+ G_TYPE_STRV, files,
G_TYPE_INVALID, G_TYPE_INVALID);
return ret;
}
@@ -2447,10 +2501,10 @@ pk_resolve_local_path (const gchar *rel_path)
}
/**
- * pk_client_install_file:
+ * pk_client_install_files:
* @client: a valid #PkClient instance
* @trusted: if untrused actions should be allowed
- * @file_rel: a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm"
+ * @files_rel: a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm"
* @error: a %GError to put the error code and message in, or %NULL
*
* Install a file locally, and get the deps from the repositories.
@@ -2459,14 +2513,17 @@ pk_resolve_local_path (const gchar *rel_path)
* Return value: %TRUE if the daemon queued the transaction
**/
gboolean
-pk_client_install_file (PkClient *client, gboolean trusted, const gchar *file_rel, GError **error)
+pk_client_install_files (PkClient *client, gboolean trusted, gchar **files_rel, GError **error)
{
+ guint i;
+ guint length;
gboolean ret;
+ gchar **files;
gchar *file;
GError *error_pk = NULL; /* we can't use the same error as we might be NULL */
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- g_return_val_if_fail (file_rel != NULL, FALSE);
+ g_return_val_if_fail (files_rel != NULL, FALSE);
/* get and set a new ID */
ret = pk_client_allocate_transaction_id (client, error);
@@ -2474,17 +2531,28 @@ pk_client_install_file (PkClient *client, gboolean trusted, const gchar *file_re
return FALSE;
}
- /* resolve to an absolute path */
- file = pk_resolve_local_path (file_rel);
- pk_debug ("resolved %s to %s", file_rel, file);
+ /* convert all the relative paths to absolute ones */
+ files = g_strdupv (files_rel);
+ length = g_strv_length (files);
+ for (i=0; i<length; i++) {
+ file = pk_resolve_local_path (files[i]);
+ /* only replace if different */
+ if (!pk_strequal (file, files[i])) {
+ pk_debug ("resolved %s to %s", files[i], file);
+ /* replace */
+ g_free (files[i]);
+ files[i] = g_strdup (file);
+ }
+ g_free (file);
+ }
/* save this so we can re-issue it */
- client->priv->role = PK_ROLE_ENUM_INSTALL_FILE;
+ client->priv->role = PK_ROLE_ENUM_INSTALL_FILES;
client->priv->cached_trusted = trusted;
- client->priv->cached_full_path = g_strdup (file);
+ client->priv->cached_full_paths = g_strdupv (files);
/* hopefully do the operation first time */
- ret = pk_client_install_file_action (client, trusted, file, &error_pk);
+ ret = pk_client_install_files_action (client, trusted, files, &error_pk);
/* we were refused by policy */
if (!ret && pk_polkit_client_error_denied_by_policy (error_pk)) {
@@ -2493,7 +2561,7 @@ pk_client_install_file (PkClient *client, gboolean trusted, const gchar *file_re
/* clear old error */
g_clear_error (&error_pk);
/* retry the action now we have got auth */
- ret = pk_client_install_file_action (client, trusted, file, &error_pk);
+ ret = pk_client_install_files_action (client, trusted, files, &error_pk);
}
}
/* we failed one of these, return the error to the user */
@@ -2512,7 +2580,7 @@ pk_client_install_file (PkClient *client, gboolean trusted, const gchar *file_re
}
}
- g_free (file);
+ g_strfreev (files);
return ret;
}
@@ -2961,18 +3029,18 @@ pk_client_requeue (PkClient *client, GError **error)
ret = pk_client_search_group (client, priv->cached_filters, priv->cached_search, error);
} else if (priv->role == PK_ROLE_ENUM_SEARCH_NAME) {
ret = pk_client_search_name (client, priv->cached_filters, priv->cached_search, error);
- } else if (priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE) {
- ret = pk_client_install_package (client, priv->cached_package_id, error);
- } else if (priv->role == PK_ROLE_ENUM_INSTALL_FILE) {
- ret = pk_client_install_file (client, priv->cached_trusted, priv->cached_full_path, error);
+ } else if (priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
+ ret = pk_client_install_packages (client, priv->cached_package_ids, error);
+ } else if (priv->role == PK_ROLE_ENUM_INSTALL_FILES) {
+ ret = pk_client_install_files (client, priv->cached_trusted, priv->cached_full_paths, error);
} else if (priv->role == PK_ROLE_ENUM_INSTALL_SIGNATURE) {
ret = pk_client_install_signature (client, PK_SIGTYPE_ENUM_GPG, priv->cached_key_id, priv->cached_package_id, error);
} else if (priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
ret = pk_client_refresh_cache (client, priv->cached_force, error);
- } else if (priv->role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
- ret = pk_client_remove_package (client, priv->cached_package_id, priv->cached_allow_deps, priv->cached_autoremove, error);
+ } else if (priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
+ ret = pk_client_remove_packages (client, priv->cached_package_ids, priv->cached_allow_deps, priv->cached_autoremove, error);
} else if (priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
- ret = pk_client_update_packages_strv (client, priv->cached_package_ids, error);
+ ret = pk_client_update_packages (client, priv->cached_package_ids, error);
} else if (priv->role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
ret = pk_client_update_system (client, error);
} else if (priv->role == PK_ROLE_ENUM_GET_REPO_LIST) {
@@ -3471,6 +3539,7 @@ pk_client_reset (PkClient *client, GError **error)
g_free (client->priv->cached_full_path);
g_free (client->priv->cached_search);
g_strfreev (client->priv->cached_package_ids);
+ g_strfreev (client->priv->cached_full_paths);
/* we need to do this now we have multiple paths */
pk_client_disconnect_proxy (client);
@@ -3480,6 +3549,7 @@ pk_client_reset (PkClient *client, GError **error)
client->priv->cached_key_id = NULL;
client->priv->cached_transaction_id = NULL;
client->priv->cached_full_path = NULL;
+ client->priv->cached_full_paths = NULL;
client->priv->cached_search = NULL;
client->priv->cached_package_ids = NULL;
client->priv->cached_filters = PK_FILTER_ENUM_UNKNOWN;
@@ -3514,6 +3584,7 @@ pk_client_init (PkClient *client)
client->priv->cached_transaction_id = NULL;
client->priv->cached_key_id = NULL;
client->priv->cached_full_path = NULL;
+ client->priv->cached_full_paths = NULL;
client->priv->cached_search = NULL;
client->priv->cached_provides = PK_PROVIDES_ENUM_UNKNOWN;
client->priv->cached_filters = PK_FILTER_ENUM_UNKNOWN;
@@ -3628,6 +3699,7 @@ pk_client_finalize (GObject *object)
g_free (client->priv->cached_search);
g_free (client->priv->tid);
g_strfreev (client->priv->cached_package_ids);
+ g_strfreev (client->priv->cached_full_paths);
/* clear the loop, if we were using it */
if (client->priv->synchronous) {
diff --git a/libpackagekit/pk-client.h b/libpackagekit/pk-client.h
index 9d39081..2b1d1a2 100644
--- a/libpackagekit/pk-client.h
+++ b/libpackagekit/pk-client.h
@@ -253,7 +253,7 @@ gboolean pk_client_what_provides (PkClient *client,
const gchar *search,
GError **error)
G_GNUC_WARN_UNUSED_RESULT;
-gboolean pk_client_get_details (PkClient *client,
+gboolean pk_client_get_details (PkClient *client,
const gchar *package_id,
GError **error);
gboolean pk_client_get_files (PkClient *client,
@@ -266,6 +266,12 @@ gboolean pk_client_remove_package (PkClient *client,
gboolean autoremove,
GError **error)
G_GNUC_WARN_UNUSED_RESULT;
+gboolean pk_client_remove_packages (PkClient *client,
+ gchar **package_ids,
+ gboolean allow_deps,
+ gboolean autoremove,
+ GError **error)
+ G_GNUC_WARN_UNUSED_RESULT;
gboolean pk_client_refresh_cache (PkClient *client,
gboolean force,
GError **error)
@@ -274,6 +280,10 @@ gboolean pk_client_install_package (PkClient *client,
const gchar *package_id,
GError **error)
G_GNUC_WARN_UNUSED_RESULT;
+gboolean pk_client_install_packages (PkClient *client,
+ gchar **package_ids,
+ GError **error)
+ G_GNUC_WARN_UNUSED_RESULT;
gboolean pk_client_install_signature (PkClient *client,
PkSigTypeEnum type,
const gchar *key_id,
@@ -285,13 +295,14 @@ gboolean pk_client_update_package (PkClient *client,
GError **error)
G_GNUC_WARN_UNUSED_RESULT;
gboolean pk_client_update_packages (PkClient *client,
- GError **error,
- const gchar *package_id, ...)
- G_GNUC_WARN_UNUSED_RESULT;
-gboolean pk_client_update_packages_strv (PkClient *client,
gchar **package_ids,
GError **error)
G_GNUC_WARN_UNUSED_RESULT;
+gboolean pk_client_install_files (PkClient *client,
+ gboolean trusted,
+ gchar **files_rel,
+ GError **error)
+ G_GNUC_WARN_UNUSED_RESULT;
gboolean pk_client_install_file (PkClient *client,
gboolean trusted,
const gchar *file_rel,
diff --git a/libpackagekit/pk-enum.c b/libpackagekit/pk-enum.c
index fd558a9..b5b6ac3 100644
--- a/libpackagekit/pk-enum.c
+++ b/libpackagekit/pk-enum.c
@@ -91,11 +91,11 @@ static PkEnumMatch enum_role[] = {
{PK_ROLE_ENUM_GET_REQUIRES, "get-requires"},
{PK_ROLE_ENUM_GET_UPDATE_DETAIL, "get-update-detail"},
{PK_ROLE_ENUM_GET_UPDATES, "get-updates"},
- {PK_ROLE_ENUM_INSTALL_FILE, "install-file"},
- {PK_ROLE_ENUM_INSTALL_PACKAGE, "install-package"},
+ {PK_ROLE_ENUM_INSTALL_FILES, "install-files"},
+ {PK_ROLE_ENUM_INSTALL_PACKAGES, "install-packages"},
{PK_ROLE_ENUM_INSTALL_SIGNATURE, "install-signature"},
{PK_ROLE_ENUM_REFRESH_CACHE, "refresh-cache"},
- {PK_ROLE_ENUM_REMOVE_PACKAGE, "remove-package"},
+ {PK_ROLE_ENUM_REMOVE_PACKAGES, "remove-packages"},
{PK_ROLE_ENUM_REPO_ENABLE, "repo-enable"},
{PK_ROLE_ENUM_REPO_SET_DATA, "repo-set-data"},
{PK_ROLE_ENUM_RESOLVE, "resolve"},
diff --git a/libpackagekit/pk-enum.h b/libpackagekit/pk-enum.h
index 3501897..33e8a91 100644
--- a/libpackagekit/pk-enum.h
+++ b/libpackagekit/pk-enum.h
@@ -60,11 +60,11 @@ typedef enum {
PK_ROLE_ENUM_GET_REQUIRES = 1 << 6,
PK_ROLE_ENUM_GET_UPDATE_DETAIL = 1 << 7,
PK_ROLE_ENUM_GET_UPDATES = 1 << 8,
- PK_ROLE_ENUM_INSTALL_FILE = 1 << 9,
- PK_ROLE_ENUM_INSTALL_PACKAGE = 1 << 10,
+ PK_ROLE_ENUM_INSTALL_FILES = 1 << 9,
+ PK_ROLE_ENUM_INSTALL_PACKAGES = 1 << 10,
PK_ROLE_ENUM_INSTALL_SIGNATURE = 1 << 11,
PK_ROLE_ENUM_REFRESH_CACHE = 1 << 12,
- PK_ROLE_ENUM_REMOVE_PACKAGE = 1 << 13,
+ PK_ROLE_ENUM_REMOVE_PACKAGES = 1 << 13,
PK_ROLE_ENUM_REPO_ENABLE = 1 << 14,
PK_ROLE_ENUM_REPO_SET_DATA = 1 << 15,
PK_ROLE_ENUM_RESOLVE = 1 << 16,
diff --git a/python/packagekit/backend.py b/python/packagekit/backend.py
index 268f58b..e701e23 100644
--- a/python/packagekit/backend.py
+++ b/python/packagekit/backend.py
@@ -353,16 +353,16 @@ class PackageKitBaseBackend:
'''
self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
- def install(self, package):
+ def install_packages(self, packages):
'''
Implement the {backend}-install functionality
Needed to be implemented in a sub class
'''
self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
- def install_file (self, trusted, inst_file):
+ def install_files (self, trusted, inst_files):
'''
- Implement the {backend}-install_file functionality
+ Implement the {backend}-install_files functionality
Install the package containing the inst_file file
Needed to be implemented in a sub class
'''
@@ -383,14 +383,14 @@ class PackageKitBaseBackend:
'''
self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
- def remove(self, allowdep, package):
+ def remove_packages(self, allowdep, packages):
'''
Implement the {backend}-remove functionality
Needed to be implemented in a sub class
'''
self.error(ERROR_NOT_SUPPORTED,"This function is not implemented in this backend")
- def update(self, package):
+ def update_packages(self, package):
'''
Implement the {backend}-update functionality
Needed to be implemented in a sub class
diff --git a/python/packagekit/daemonBackend.py b/python/packagekit/daemonBackend.py
index 96163a5..3711f01 100644
--- a/python/packagekit/daemonBackend.py
+++ b/python/packagekit/daemonBackend.py
@@ -584,15 +584,15 @@ class PackageKitBaseBackend(dbus.service.Object):
self.Finished(EXIT_FAILED)
@dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
- in_signature='s', out_signature='')
- def InstallPackage(self, package):
+ in_signature='as', out_signature='')
+ def InstallPackages(self, packages):
'''
Implement the {backend}-install functionality
'''
- pklog.info("InstallPackage(%s)" % package)
- self.doInstallPackage(package)
+ pklog.info("InstallPackages(%s)" % ", ".join(packages))
+ self.doInstallPackages(packages)
- def doInstallPackage(self, package):
+ def doInstallPackages(self, packages):
'''
Should be replaced in the corresponding backend sub class
'''
@@ -601,16 +601,16 @@ class PackageKitBaseBackend(dbus.service.Object):
self.Finished(EXIT_FAILED)
@dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
- in_signature='bs', out_signature='')
- def InstallFile (self, trusted, inst_file):
+ in_signature='bas', out_signature='')
+ def InstallFiles (self, trusted, full_paths):
'''
- Implement the {backend}-install_file functionality
- Install the package containing the inst_file file
+ Implement the {backend}-install_files functionality
+ Install the package containing the full_paths file
'''
- pklog.info("InstallFile(%i,%s)" % (trusted,inst_file))
- self.doInstallFile(trusted,inst_file)
+ pklog.info("InstallFiles(%i,%s)" % (trusted,full_paths))
+ self.doInstallFiles(trusted,full_paths)
- def doInstallFile(self, inst_file):
+ def doInstallFiles(self, full_paths):
'''
Should be replaced in the corresponding backend sub class
'''
@@ -653,15 +653,15 @@ class PackageKitBaseBackend(dbus.service.Object):
self.Finished(EXIT_FAILED)
@dbus.service.method(PACKAGEKIT_DBUS_INTERFACE,
- in_signature='sbb', out_signature='')
- def RemovePackage(self, package, allowdep, autoremove):
+ in_signature='asbb', out_signature='')
+ def RemovePackages(self, packages, allowdep, autoremove):
'''
Implement the {backend}-remove functionality
'''
- pklog.info("RemovePackage(%s, %s, %s)" % (package, allowdep, autoremove))
- self.doRemovePackage(package, allowdep, autoremove)
+ pklog.info("RemovePackages(%s, %s, %s)" % (package[0], allowdep, autoremove))
+ self.doRemovePackages(package, allowdep, autoremove)
- def doRemovePackage(self, package, allowdep, autoremove):
+ def doRemovePackages(self, packages, allowdep, autoremove):
'''
Should be replaced in the corresponding backend sub class
'''
diff --git a/python/packagekit/frontend.py b/python/packagekit/frontend.py
index 3226248..ea2b42e 100644
--- a/python/packagekit/frontend.py
+++ b/python/packagekit/frontend.py
@@ -272,39 +272,39 @@ class PackageKit(PackageKitDbusInterface):
@dbusException
@job_id
- def RemovePackage(self,package_id,allow_deps=False ):
+ def RemovePackages(self,package_ids,allow_deps=False ):
"""
Removes a package.
Asynchronous
"""
- return self.pk_iface.RemovePackage(self.tid(),package_id,allow_deps)
+ return self.pk_iface.RemovePackages(self.tid(),package_ids,allow_deps)
@dbusException
@job_id
- def InstallPackage(self,package_id):
+ def InstallPackages(self,package_ids):
"""
Installs a package.
Asynchronous
"""
- return self.pk_iface.InstallPackage(self.tid(),package_id)
+ return self.pk_iface.InstallPackages(self.tid(),package_ids)
@dbusException
@job_id
- def UpdatePackage(self,package_id):
+ def UpdatePackages(self,package_ids):
"""
Updates a package.
Asynchronous
"""
- return self.pk_iface.UpdatePackage(self.tid(),package_id)
+ return self.pk_iface.UpdatePackages(self.tid(),package_ids)
@dbusException
@job_id
- def InstallFile(self,full_path):
+ def InstallFiles(self,full_paths):
"""
Installs a package which provides given file?
Asynchronous
"""
- return self.pk_iface.InstallFile(self.tid(),full_path)
+ return self.pk_iface.InstallFiles(self.tid(),full_paths)
@dbusException
@job_id
diff --git a/src/pk-backend-dbus.c b/src/pk-backend-dbus.c
index 59baf63..b06e584 100644
--- a/src/pk-backend-dbus.c
+++ b/src/pk-backend-dbus.c
@@ -1106,22 +1106,22 @@ pk_backend_dbus_get_files (PkBackendDbus *backend_dbus, const gchar *package_id)
}
/**
- * pk_backend_dbus_remove_package:
+ * pk_backend_dbus_remove_packages:
**/
gboolean
-pk_backend_dbus_remove_package (PkBackendDbus *backend_dbus, const gchar *package_id, gboolean allow_deps, gboolean autoremove)
+pk_backend_dbus_remove_packages (PkBackendDbus *backend_dbus, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
{
gboolean ret;
GError *error = NULL;
g_return_val_if_fail (PK_IS_BACKEND_DBUS (backend_dbus), FALSE);
g_return_val_if_fail (backend_dbus->priv->proxy != NULL, FALSE);
- g_return_val_if_fail (package_id != NULL, FALSE);
+ g_return_val_if_fail (package_ids != NULL, FALSE);
/* new sync method call */
pk_backend_dbus_time_reset (backend_dbus);
- ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "RemovePackage", &error,
- G_TYPE_STRING, package_id,
+ ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "RemovePackages", &error,
+ G_TYPE_STRV, package_ids,
G_TYPE_BOOLEAN, allow_deps,
G_TYPE_BOOLEAN, autoremove,
G_TYPE_INVALID, G_TYPE_INVALID);
@@ -1138,22 +1138,22 @@ pk_backend_dbus_remove_package (PkBackendDbus *backend_dbus, const gchar *packag
}
/**
- * pk_backend_dbus_install_package:
+ * pk_backend_dbus_install_packages:
**/
gboolean
-pk_backend_dbus_install_package (PkBackendDbus *backend_dbus, const gchar *package_id)
+pk_backend_dbus_install_packages (PkBackendDbus *backend_dbus, gchar **package_ids)
{
gboolean ret;
GError *error = NULL;
g_return_val_if_fail (PK_IS_BACKEND_DBUS (backend_dbus), FALSE);
g_return_val_if_fail (backend_dbus->priv->proxy != NULL, FALSE);
- g_return_val_if_fail (package_id != NULL, FALSE);
+ g_return_val_if_fail (package_ids != NULL, FALSE);
/* new sync method call */
pk_backend_dbus_time_reset (backend_dbus);
- ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "InstallPackage", &error,
- G_TYPE_STRING, package_id,
+ ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "InstallPackages", &error,
+ G_TYPE_STRV, package_ids,
G_TYPE_INVALID, G_TYPE_INVALID);
if (error != NULL) {
pk_warning ("%s", error->message);
@@ -1198,23 +1198,23 @@ pk_backend_dbus_update_packages (PkBackendDbus *backend_dbus, gchar **package_id
}
/**
- * pk_backend_dbus_install_file:
+ * pk_backend_dbus_install_files:
**/
gboolean
-pk_backend_dbus_install_file (PkBackendDbus *backend_dbus, gboolean trusted, const gchar *full_path)
+pk_backend_dbus_install_files (PkBackendDbus *backend_dbus, gboolean trusted, gchar **full_paths)
{
gboolean ret;
GError *error = NULL;
g_return_val_if_fail (PK_IS_BACKEND_DBUS (backend_dbus), FALSE);
g_return_val_if_fail (backend_dbus->priv->proxy != NULL, FALSE);
- g_return_val_if_fail (full_path != NULL, FALSE);
+ g_return_val_if_fail (full_paths != NULL, FALSE);
/* new sync method call */
pk_backend_dbus_time_reset (backend_dbus);
- ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "InstallFile", &error,
+ ret = dbus_g_proxy_call (backend_dbus->priv->proxy, "InstallFiles", &error,
G_TYPE_BOOLEAN, trusted,
- G_TYPE_STRING, full_path,
+ G_TYPE_STRV, full_paths,
G_TYPE_INVALID, G_TYPE_INVALID);
if (error != NULL) {
pk_warning ("%s", error->message);
diff --git a/src/pk-backend-dbus.h b/src/pk-backend-dbus.h
index c890313..1e8c151 100644
--- a/src/pk-backend-dbus.h
+++ b/src/pk-backend-dbus.h
@@ -95,21 +95,21 @@ gboolean pk_backend_dbus_get_requires (PkBackendDbus *backend_dbus,
gboolean recursive);
gboolean pk_backend_dbus_get_update_detail (PkBackendDbus *backend_dbus,
const gchar *package_id);
-gboolean pk_backend_dbus_get_details (PkBackendDbus *backend_dbus,
+gboolean pk_backend_dbus_get_details (PkBackendDbus *backend_dbus,
const gchar *package_id);
gboolean pk_backend_dbus_get_files (PkBackendDbus *backend_dbus,
const gchar *package_id);
-gboolean pk_backend_dbus_remove_package (PkBackendDbus *backend_dbus,
- const gchar *package_id,
+gboolean pk_backend_dbus_remove_packages (PkBackendDbus *backend_dbus,
+ gchar **package_ids,
gboolean allow_deps,
gboolean autoremove);
-gboolean pk_backend_dbus_install_package (PkBackendDbus *backend_dbus,
- const gchar *package_id);
+gboolean pk_backend_dbus_install_packages (PkBackendDbus *backend_dbus,
+ gchar **package_ids);
gboolean pk_backend_dbus_update_packages (PkBackendDbus *backend_dbus,
gchar **package_ids);
-gboolean pk_backend_dbus_install_file (PkBackendDbus *backend_dbus,
+gboolean pk_backend_dbus_install_files (PkBackendDbus *backend_dbus,
gboolean trusted,
- const gchar *full_path);
+ gchar **full_paths);
gboolean pk_backend_dbus_service_pack (PkBackendDbus *backend_dbus,
const gchar *location,
gboolean enabled);
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 4ea8d2c..225c488 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -208,17 +208,17 @@ pk_backend_get_actions (PkBackend *backend)
if (desc->get_update_detail != NULL) {
pk_enums_add (roles, PK_ROLE_ENUM_GET_UPDATE_DETAIL);
}
- if (desc->install_package != NULL) {
- pk_enums_add (roles, PK_ROLE_ENUM_INSTALL_PACKAGE);
+ if (desc->install_packages != NULL) {
+ pk_enums_add (roles, PK_ROLE_ENUM_INSTALL_PACKAGES);
}
- if (desc->install_file != NULL) {
- pk_enums_add (roles, PK_ROLE_ENUM_INSTALL_FILE);
+ if (desc->install_files != NULL) {
+ pk_enums_add (roles, PK_ROLE_ENUM_INSTALL_FILES);
}
if (desc->refresh_cache != NULL) {
pk_enums_add (roles, PK_ROLE_ENUM_REFRESH_CACHE);
}
- if (desc->remove_package != NULL) {
- pk_enums_add (roles, PK_ROLE_ENUM_REMOVE_PACKAGE);
+ if (desc->remove_packages != NULL) {
+ pk_enums_add (roles, PK_ROLE_ENUM_REMOVE_PACKAGES);
}
if (desc->resolve != NULL) {
pk_enums_add (roles, PK_ROLE_ENUM_RESOLVE);
@@ -1459,8 +1459,8 @@ pk_backend_finished (PkBackend *backend)
/* check we got a Package() else the UI will suck */
if (!backend->priv->set_error &&
!backend->priv->has_sent_package &&
- (backend->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE ||
- backend->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGE ||
+ (backend->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES ||
+ backend->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES ||
backend->priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES)) {
pk_backend_message (backend, PK_MESSAGE_ENUM_DAEMON,
"Backends need to send a Package() for this role!");
diff --git a/src/pk-backend.h b/src/pk-backend.h
index ea725f9..95b7fa8 100644
--- a/src/pk-backend.h
+++ b/src/pk-backend.h
@@ -201,19 +201,19 @@ typedef struct {
const gchar *package_id);
void (*get_updates) (PkBackend *backend,
PkFilterEnum filters);
- void (*install_file) (PkBackend *backend,
+ void (*install_files) (PkBackend *backend,
gboolean trusted,
- const gchar *full_path);
- void (*install_package) (PkBackend *backend,
- const gchar *package_id);
+ gchar **full_paths);
+ void (*install_packages) (PkBackend *backend,
+ gchar **package_ids);
void (*install_signature) (PkBackend *backend,
PkSigTypeEnum type,
const gchar *key_id,
const gchar *package_id);
void (*refresh_cache) (PkBackend *backend,
gboolean force);
- void (*remove_package) (PkBackend *backend,
- const gchar *package_id,
+ void (*remove_packages) (PkBackend *backend,
+ gchar **package_ids,
gboolean allow_deps,
gboolean autoremove);
void (*repo_enable) (PkBackend *backend,
@@ -255,8 +255,8 @@ typedef struct {
#define PK_BACKEND_OPTIONS(description, author, initialize, destroy, get_filters, get_groups, cancel, \
get_depends, get_details, get_files, get_packages, get_repo_list, get_requires, \
- get_update_detail, get_updates, install_file, install_package, \
- install_signature, refresh_cache, remove_package, repo_enable, \
+ get_update_detail, get_updates, install_files, install_packages, \
+ install_signature, refresh_cache, remove_packages, repo_enable, \
repo_set_data, resolve, rollback, search_details, search_file, search_group, \
search_name, service_pack, update_packages, update_system, what_provides) \
G_MODULE_EXPORT const PkBackendDesc pk_backend_desc = { \
@@ -268,18 +268,18 @@ typedef struct {
get_groups, \
cancel, \
get_depends, \
- get_details, \
+ get_details, \
get_files, \
get_packages, \
get_repo_list, \
get_requires, \
get_update_detail, \
get_updates, \
- install_file, \
- install_package, \
+ install_files, \
+ install_packages, \
install_signature, \
refresh_cache, \
- remove_package, \
+ remove_packages, \
repo_enable, \
repo_set_data, \
resolve, \
diff --git a/src/pk-interface-transaction.xml b/src/pk-interface-transaction.xml
index b29d752..35f0892 100644
--- a/src/pk-interface-transaction.xml
+++ b/src/pk-interface-transaction.xml
@@ -66,14 +66,14 @@
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="s" name="filter" direction="in"/>
</method>
- <method name="InstallFile">
+ <method name="InstallFiles">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="b" name="trusted" direction="in"/>
- <arg type="s" name="full_path" direction="in"/>
+ <arg type="as" name="full_paths" direction="in"/>
</method>
- <method name="InstallPackage">
+ <method name="InstallPackages">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="package_id" direction="in"/>
+ <arg type="as" name="package_ids" direction="in"/>
</method>
<method name="InstallSignature">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
@@ -88,9 +88,9 @@
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg type="b" name="force" direction="in"/>
</method>
- <method name="RemovePackage">
+ <method name="RemovePackages">
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
- <arg type="s" name="package_id" direction="in"/>
+ <arg type="as" name="package_ids" direction="in"/>
<arg type="b" name="allow_deps" direction="in"/>
<arg type="b" name="autoremove" direction="in"/>
</method>
diff --git a/src/pk-security-polkit.c b/src/pk-security-polkit.c
index e0f1c51..9abf992 100644
--- a/src/pk-security-polkit.c
+++ b/src/pk-security-polkit.c
@@ -109,13 +109,13 @@ pk_security_role_to_action (PkSecurity *security, gboolean trusted, PkRoleEnum r
policy = "org.freedesktop.packagekit.update-package";
} else if (role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
policy = "org.freedesktop.packagekit.update-system";
- } else if (role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
+ } else if (role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
policy = "org.freedesktop.packagekit.remove";
- } else if (role == PK_ROLE_ENUM_INSTALL_PACKAGE) {
+ } else if (role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
policy = "org.freedesktop.packagekit.install";
- } else if (role == PK_ROLE_ENUM_INSTALL_FILE && trusted) {
+ } else if (role == PK_ROLE_ENUM_INSTALL_FILES && trusted) {
policy = "org.freedesktop.packagekit.localinstall-trusted";
- } else if (role == PK_ROLE_ENUM_INSTALL_FILE && !trusted) {
+ } else if (role == PK_ROLE_ENUM_INSTALL_FILES && !trusted) {
policy = "org.freedesktop.packagekit.localinstall-untrusted";
} else if (role == PK_ROLE_ENUM_INSTALL_SIGNATURE) {
policy = "org.freedesktop.packagekit.install-signature";
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index ca3ac75..dca2075 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -99,6 +99,7 @@ struct PkTransactionPrivate
gchar **cached_package_ids;
gchar *cached_transaction_id;
gchar *cached_full_path;
+ gchar **cached_full_paths;
PkFilterEnum cached_filters;
gchar *cached_search;
gchar *cached_repo_id;
@@ -453,8 +454,8 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
/* add to the database if we are going to log it */
if (transaction->priv->role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
transaction->priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES ||
- transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE ||
- transaction->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
+ transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES ||
+ transaction->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
packages = pk_package_list_get_string (transaction->priv->package_list);
if (pk_strzero (packages) == FALSE) {
pk_transaction_db_set_data (transaction->priv->transaction_db, transaction->priv->tid, packages);
@@ -549,7 +550,7 @@ pk_transaction_package_cb (PkBackend *backend, PkInfoEnum info, const gchar *pac
/* check the backend is doing the right thing */
if (transaction->priv->role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
- transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE ||
+ transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES ||
transaction->priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
if (info == PK_INFO_ENUM_INSTALLED) {
pk_backend_message (transaction->priv->backend, PK_MESSAGE_ENUM_DAEMON,
@@ -807,6 +808,7 @@ pk_transaction_set_running (PkTransaction *transaction)
pk_backend_set_uint (priv->backend, "filters", priv->cached_filters);
pk_backend_set_uint (priv->backend, "provides", priv->cached_provides);
pk_backend_set_strv (priv->backend, "package_ids", priv->cached_package_ids);
+ pk_backend_set_strv (priv->backend, "full_paths", priv->cached_full_paths);
pk_backend_set_string (priv->backend, "package_id", priv->cached_package_id);
pk_backend_set_string (priv->backend, "transaction_id", priv->cached_transaction_id);
pk_backend_set_string (priv->backend, "full_path", priv->cached_full_path);
@@ -848,18 +850,18 @@ pk_transaction_set_running (PkTransaction *transaction)
desc->search_group (priv->backend, priv->cached_filters, priv->cached_search);
} else if (priv->role == PK_ROLE_ENUM_SEARCH_NAME) {
desc->search_name (priv->backend,priv->cached_filters,priv->cached_search);
- } else if (priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE) {
- desc->install_package (priv->backend, priv->cached_package_id);
- } else if (priv->role == PK_ROLE_ENUM_INSTALL_FILE) {
- desc->install_file (priv->backend, priv->cached_trusted, priv->cached_full_path);
+ } else if (priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
+ desc->install_packages (priv->backend, priv->cached_package_ids);
+ } else if (priv->role == PK_ROLE_ENUM_INSTALL_FILES) {
+ desc->install_files (priv->backend, priv->cached_trusted, priv->cached_full_paths);
} else if (priv->role == PK_ROLE_ENUM_INSTALL_SIGNATURE) {
desc->install_signature (priv->backend, PK_SIGTYPE_ENUM_GPG, priv->cached_key_id, priv->cached_package_id);
} else if (priv->role == PK_ROLE_ENUM_SERVICE_PACK) {
desc->service_pack (priv->backend, priv->cached_full_path, priv->cached_enabled);
} else if (priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
desc->refresh_cache (priv->backend, priv->cached_force);
- } else if (priv->role == PK_ROLE_ENUM_REMOVE_PACKAGE) {
- desc->remove_package (priv->backend, priv->cached_package_id, priv->cached_allow_deps, priv->cached_autoremove);
+ } else if (priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
+ desc->remove_packages (priv->backend, priv->cached_package_ids, priv->cached_allow_deps, priv->cached_autoremove);
} else if (priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
desc->update_packages (priv->backend, priv->cached_package_ids);
} else if (priv->role == PK_ROLE_ENUM_UPDATE_SYSTEM) {
@@ -941,8 +943,8 @@ pk_transaction_commit (PkTransaction *transaction)
/* only save into the database for useful stuff */
if (transaction->priv->role == PK_ROLE_ENUM_UPDATE_SYSTEM ||
- transaction->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGE ||
- transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGE ||
+ transaction->priv->role == PK_ROLE_ENUM_REMOVE_PACKAGES ||
+ transaction->priv->role == PK_ROLE_ENUM_INSTALL_PACKAGES ||
transaction->priv->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
/* add to database */
pk_transaction_db_add (transaction->priv->transaction_db, transaction->priv->tid);
@@ -1831,23 +1833,25 @@ pk_transaction_get_updates (PkTransaction *transaction, const gchar *filter, DBu
}
/**
- * pk_transaction_install_file:
+ * pk_transaction_install_files:
**/
void
-pk_transaction_install_file (PkTransaction *transaction, gboolean trusted,
- const gchar *full_path, DBusGMethodInvocation *context)
+pk_transaction_install_files (PkTransaction *transaction, gboolean trusted,
+ gchar **full_paths, DBusGMethodInvocation *context)
{
gboolean ret;
GError *error;
gchar *sender;
+ guint length;
+ guint i;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("InstallFile method called: %s (trusted %i)", full_path, trusted);
+ pk_debug ("InstallFiles method called: %s (trusted %i)", full_paths[0], trusted);
/* not implemented yet */
- if (transaction->priv->backend->desc->install_file == NULL) {
+ if (transaction->priv->backend->desc->install_files == NULL) {
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NOT_SUPPORTED,
"Operation not yet supported by backend");
pk_transaction_list_remove (transaction->priv->transaction_list, transaction);
@@ -1855,18 +1859,21 @@ pk_transaction_install_file (PkTransaction *transaction, gboolean trusted,
return;
}
- /* check file exists */
- ret = g_file_test (full_path, G_FILE_TEST_EXISTS);
- if (!ret) {
- error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NO_SUCH_FILE,
- "No such file '%s'", full_path);
- dbus_g_method_return_error (context, error);
- return;
+ /* check all files exists */
+ length = g_strv_length (full_paths);
+ for (i=0; i<length; i++) {
+ ret = g_file_test (full_paths[i], G_FILE_TEST_EXISTS);
+ if (!ret) {
+ error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NO_SUCH_FILE,
+ "No such file '%s'", full_paths[i]);
+ dbus_g_method_return_error (context, error);
+ return;
+ }
}
/* check if the action is allowed from this client - if not, set an error */
sender = dbus_g_method_get_sender (context);
- ret = pk_transaction_action_is_allowed (transaction, sender, trusted, PK_ROLE_ENUM_INSTALL_FILE, &error);
+ ret = pk_transaction_action_is_allowed (transaction, sender, trusted, PK_ROLE_ENUM_INSTALL_FILES, &error);
g_free (sender);
if (!ret) {
dbus_g_method_return_error (context, error);
@@ -1878,9 +1885,9 @@ pk_transaction_install_file (PkTransaction *transaction, gboolean trusted,
/* save so we can run later */
transaction->priv->cached_trusted = trusted;
- transaction->priv->cached_full_path = g_strdup (full_path);
+ transaction->priv->cached_full_paths = g_strdupv (full_paths);
transaction->priv->status = PK_STATUS_ENUM_WAIT;
- pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_FILE);
+ pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_FILES);
/* try to commit this */
ret = pk_transaction_commit (transaction);
@@ -1896,23 +1903,24 @@ pk_transaction_install_file (PkTransaction *transaction, gboolean trusted,
}
/**
- * pk_transaction_install_package:
+ * pk_transaction_install_packages:
**/
void
-pk_transaction_install_package (PkTransaction *transaction, const gchar *package_id,
- DBusGMethodInvocation *context)
+pk_transaction_install_packages (PkTransaction *transaction, gchar **package_ids,
+ DBusGMethodInvocation *context)
{
gboolean ret;
GError *error;
gchar *sender;
+ gchar *package_id_temp;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("method called: %s", package_id);
+ pk_debug ("method called: %s", package_ids[0]);
/* not implemented yet */
- if (transaction->priv->backend->desc->install_package == NULL) {
+ if (transaction->priv->backend->desc->install_packages == NULL) {
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NOT_SUPPORTED,
"Operation not yet supported by backend");
pk_transaction_list_remove (transaction->priv->transaction_list, transaction);
@@ -1920,27 +1928,20 @@ pk_transaction_install_package (PkTransaction *transaction, const gchar *package
return;
}
- /* check for sanity */
- ret = pk_strvalidate (package_id);
- if (!ret) {
- error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INPUT_INVALID,
- "Invalid input passed to daemon");
- dbus_g_method_return_error (context, error);
- return;
- }
-
- /* check package_id */
- ret = pk_package_id_check (package_id);
- if (!ret) {
+ /* check package_ids */
+ ret = pk_package_ids_check (package_ids);
+ if (ret == FALSE) {
+ package_id_temp = pk_package_ids_to_text (package_ids, ", ");
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
- "The package id '%s' is not valid", package_id);
+ "The package id's '%s' are not valid", package_id_temp);
+ g_free (package_id_temp);
dbus_g_method_return_error (context, error);
return;
}
/* check if the action is allowed from this client - if not, set an error */
sender = dbus_g_method_get_sender (context);
- ret = pk_transaction_action_is_allowed (transaction, sender, FALSE, PK_ROLE_ENUM_INSTALL_PACKAGE, &error);
+ ret = pk_transaction_action_is_allowed (transaction, sender, FALSE, PK_ROLE_ENUM_INSTALL_PACKAGES, &error);
g_free (sender);
if (!ret) {
dbus_g_method_return_error (context, error);
@@ -1951,9 +1952,9 @@ pk_transaction_install_package (PkTransaction *transaction, const gchar *package
pk_transaction_set_dbus_name (transaction, dbus_g_method_get_sender (context));
/* save so we can run later */
- transaction->priv->cached_package_id = g_strdup (package_id);
+ transaction->priv->cached_package_ids = g_strdupv (package_ids);
transaction->priv->status = PK_STATUS_ENUM_WAIT;
- pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_PACKAGE);
+ pk_transaction_set_role (transaction, PK_ROLE_ENUM_INSTALL_PACKAGES);
/* try to commit this */
ret = pk_transaction_commit (transaction);
@@ -2116,24 +2117,25 @@ pk_transaction_refresh_cache (PkTransaction *transaction, gboolean force, DBusGM
}
/**
- * pk_transaction_remove_package:
+ * pk_transaction_remove_packages:
**/
void
-pk_transaction_remove_package (PkTransaction *transaction, const gchar *package_id,
- gboolean allow_deps, gboolean autoremove,
- DBusGMethodInvocation *context)
+pk_transaction_remove_packages (PkTransaction *transaction, gchar **package_ids,
+ gboolean allow_deps, gboolean autoremove,
+ DBusGMethodInvocation *context)
{
gboolean ret;
GError *error;
gchar *sender;
+ gchar *package_id_temp;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
- pk_debug ("RemovePackage method called: %s, %i, %i", package_id, allow_deps, autoremove);
+ pk_debug ("RemovePackages method called: %s, %i, %i", package_ids[0], allow_deps, autoremove);
/* not implemented yet */
- if (transaction->priv->backend->desc->remove_package == NULL) {
+ if (transaction->priv->backend->desc->remove_packages == NULL) {
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_NOT_SUPPORTED,
"Operation not yet supported by backend");
pk_transaction_list_remove (transaction->priv->transaction_list, transaction);
@@ -2141,27 +2143,20 @@ pk_transaction_remove_package (PkTransaction *transaction, const gchar *package_
return;
}
- /* check for sanity */
- ret = pk_strvalidate (package_id);
- if (!ret) {
- error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INPUT_INVALID,
- "Invalid input passed to daemon");
- dbus_g_method_return_error (context, error);
- return;
- }
-
- /* check package_id */
- ret = pk_package_id_check (package_id);
- if (!ret) {
+ /* check package_ids */
+ ret = pk_package_ids_check (package_ids);
+ if (ret == FALSE) {
+ package_id_temp = pk_package_ids_to_text (package_ids, ", ");
error = g_error_new (PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_PACKAGE_ID_INVALID,
- "The package id '%s' is not valid", package_id);
+ "The package id's '%s' are not valid", package_id_temp);
+ g_free (package_id_temp);
dbus_g_method_return_error (context, error);
return;
}
/* check if the action is allowed from this client - if not, set an error */
sender = dbus_g_method_get_sender (context);
- ret = pk_transaction_action_is_allowed (transaction, sender, FALSE, PK_ROLE_ENUM_REMOVE_PACKAGE, &error);
+ ret = pk_transaction_action_is_allowed (transaction, sender, FALSE, PK_ROLE_ENUM_REMOVE_PACKAGES, &error);
g_free (sender);
if (!ret) {
dbus_g_method_return_error (context, error);
@@ -2173,9 +2168,9 @@ pk_transaction_remove_package (PkTransaction *transaction, const gchar *package_
/* save so we can run later */
transaction->priv->cached_allow_deps = allow_deps;
- transaction->priv->cached_package_id = g_strdup (package_id);
+ transaction->priv->cached_package_ids = g_strdupv (package_ids);
transaction->priv->status = PK_STATUS_ENUM_WAIT;
- pk_transaction_set_role (transaction, PK_ROLE_ENUM_REMOVE_PACKAGE);
+ pk_transaction_set_role (transaction, PK_ROLE_ENUM_REMOVE_PACKAGES);
/* try to commit this */
ret = pk_transaction_commit (transaction);
@@ -2736,7 +2731,7 @@ pk_transaction_update_packages (PkTransaction *transaction, gchar **package_ids,
return;
}
- /* check package_id */
+ /* check package_ids */
ret = pk_package_ids_check (package_ids);
if (ret == FALSE) {
package_id_temp = pk_package_ids_to_text (package_ids, ", ");
@@ -3019,6 +3014,7 @@ pk_transaction_init (PkTransaction *transaction)
transaction->priv->cached_package_ids = NULL;
transaction->priv->cached_transaction_id = NULL;
transaction->priv->cached_full_path = NULL;
+ transaction->priv->cached_full_paths = NULL;
transaction->priv->cached_filters = PK_FILTER_ENUM_NONE;
transaction->priv->cached_search = NULL;
transaction->priv->cached_repo_id = NULL;
diff --git a/src/pk-transaction.h b/src/pk-transaction.h
index 12c56e4..e287cb4 100644
--- a/src/pk-transaction.h
+++ b/src/pk-transaction.h
@@ -150,12 +150,12 @@ void pk_transaction_get_update_detail (PkTransaction *transaction,
void pk_transaction_get_updates (PkTransaction *transaction,
const gchar *filter,
DBusGMethodInvocation *context);
-void pk_transaction_install_file (PkTransaction *transaction,
+void pk_transaction_install_files (PkTransaction *transaction,
gboolean trusted,
- const gchar *full_path,
+ gchar **full_paths,
DBusGMethodInvocation *context);
-void pk_transaction_install_package (PkTransaction *transaction,
- const gchar *package_id,
+void pk_transaction_install_packages (PkTransaction *transaction,
+ gchar **package_ids,
DBusGMethodInvocation *context);
void pk_transaction_install_signature (PkTransaction *transaction,
const gchar *sig_type,
@@ -168,8 +168,8 @@ gboolean pk_transaction_is_caller_active (PkTransaction *transaction,
void pk_transaction_refresh_cache (PkTransaction *transaction,
gboolean force,
DBusGMethodInvocation *context);
-void pk_transaction_remove_package (PkTransaction *transaction,
- const gchar *package_id,
+void pk_transaction_remove_packages (PkTransaction *transaction,
+ gchar **package_ids,
gboolean allow_deps,
gboolean autoremove,
DBusGMethodInvocation *context);
commit ab8928213a946855270e5ba1ab229b157da90990
Merge: f70b54c... 4af8aff...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 16:53:51 2008 +0300
Merge branch 'master' of git+ssh://onestep_ua@git.packagekit.org/srv/git/PackageKit
commit f70b54c27e1568f522d47fc7c64ad0f8f29d5c7c
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 16:53:29 2008 +0300
docs: fix manpage build, make it cross-distro
diff --git a/man/Makefile.am b/man/Makefile.am
index 4160a76..9371f6b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -10,10 +10,10 @@ endif
if HAVE_DOCBOOK2MAN
pkcon.1: pkcon.xml
- docbook2man $? > /dev/null
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? > /dev/null
pkmon.1: pkmon.xml
- docbook2man $? > /dev/null
+ xsltproc http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $? > /dev/null
endif
clean-local :
commit 4af8aff74c3ff63dbc73fe6d198db68d58812753
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 14:33:45 2008 +0100
add pk_backend_set_array so we can save trivial data arrays in the backend without having to worry about deallocation on cancel
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 6e0a9ae..4ea8d2c 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -108,6 +108,7 @@ struct _PkBackendPrivate
GHashTable *hash_string;
GHashTable *hash_strv;
GHashTable *hash_pointer;
+ GHashTable *hash_array;
};
G_DEFINE_TYPE (PkBackend, pk_backend, G_TYPE_OBJECT)
@@ -308,6 +309,32 @@ pk_backend_set_strv (PkBackend *backend, const gchar *key, gchar **data)
}
/**
+ * pk_backend_set_array:
+ **/
+gboolean
+pk_backend_set_array (PkBackend *backend, const gchar *key, GPtrArray *data)
+{
+ gpointer value;
+ g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
+ g_return_val_if_fail (key != NULL, FALSE);
+
+ /* valid, but do nothing */
+ if (data == NULL) {
+ return FALSE;
+ }
+
+ /* does already exist? */
+ value = g_hash_table_lookup (backend->priv->hash_array, (gpointer) key);
+ if (value != NULL) {
+ pk_warning ("already set data for %s", key);
+ return FALSE;
+ }
+ pk_debug ("saving %p for %s", data, key);
+ g_hash_table_insert (backend->priv->hash_array, g_strdup (key), (gpointer) data);
+ return TRUE;
+}
+
+/**
* pk_backend_set_uint:
**/
gboolean
@@ -385,7 +412,7 @@ pk_backend_get_string (PkBackend *backend, const gchar *key)
value = g_hash_table_lookup (backend->priv->hash_string, (gpointer) key);
if (value == NULL) {
pk_warning ("not set data for %s", key);
- return FALSE;
+ return NULL;
}
return (const gchar *) value;
}
@@ -404,12 +431,31 @@ pk_backend_get_strv (PkBackend *backend, const gchar *key)
value = g_hash_table_lookup (backend->priv->hash_strv, (gpointer) key);
if (value == NULL) {
pk_warning ("not set data for %s", key);
- return FALSE;
+ return NULL;
}
return (gchar **) value;
}
/**
+ * pk_backend_get_array:
+ **/
+GPtrArray *
+pk_backend_get_array (PkBackend *backend, const gchar *key)
+{
+ gpointer value;
+ g_return_val_if_fail (PK_IS_BACKEND (backend), NULL);
+ g_return_val_if_fail (key != NULL, NULL);
+
+ /* does already exist? */
+ value = g_hash_table_lookup (backend->priv->hash_array, (gpointer) key);
+ if (value == NULL) {
+ pk_warning ("not set data for %s", key);
+ return NULL;
+ }
+ return (GPtrArray *) value;
+}
+
+/**
* pk_backend_get_uint:
**/
uint
@@ -1365,6 +1411,7 @@ pk_backend_finished_delay (gpointer data)
g_hash_table_remove_all (backend->priv->hash_pointer);
g_hash_table_remove_all (backend->priv->hash_string);
g_hash_table_remove_all (backend->priv->hash_strv);
+ g_hash_table_remove_all (backend->priv->hash_array);
pk_debug ("emit finished %i", backend->priv->exit);
g_signal_emit (backend, signals [PK_BACKEND_FINISHED], 0, backend->priv->exit);
@@ -1650,6 +1697,7 @@ pk_backend_finalize (GObject *object)
g_hash_table_unref (backend->priv->hash_string);
g_hash_table_unref (backend->priv->hash_strv);
g_hash_table_unref (backend->priv->hash_pointer);
+ g_hash_table_unref (backend->priv->hash_array);
if (backend->priv->handle != NULL) {
g_module_close (backend->priv->handle);
@@ -1789,6 +1837,15 @@ pk_backend_reset (PkBackend *backend)
}
/**
+ * pk_free_ptr_array:
+ **/
+static void
+pk_free_ptr_array (gpointer data)
+{
+ g_ptr_array_free ((GPtrArray *) data, TRUE);
+}
+
+/**
* pk_backend_init:
**/
static void
@@ -1810,6 +1867,7 @@ pk_backend_init (PkBackend *backend)
backend->priv->hash_string = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
backend->priv->hash_strv = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_strfreev);
backend->priv->hash_pointer = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
+ backend->priv->hash_array = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, pk_free_ptr_array);
/* monitor config files for changes */
backend->priv->file_monitor = pk_file_monitor_new ();
diff --git a/src/pk-backend.h b/src/pk-backend.h
index d5ad15d..ea725f9 100644
--- a/src/pk-backend.h
+++ b/src/pk-backend.h
@@ -121,6 +121,9 @@ gboolean pk_backend_eula_required (PkBackend *backend,
const gchar *license_agreement);
/* set backend instance data */
+gboolean pk_backend_set_array (PkBackend *backend,
+ const gchar *key,
+ GPtrArray *data);
gboolean pk_backend_set_string (PkBackend *backend,
const gchar *key,
const gchar *data);
@@ -140,6 +143,8 @@ gboolean pk_backend_set_pointer (PkBackend *backend,
/* get backend instance data */
const gchar *pk_backend_get_string (PkBackend *backend,
const gchar *key);
+GPtrArray *pk_backend_get_array (PkBackend *backend,
+ const gchar *key);
gchar **pk_backend_get_strv (PkBackend *backend,
const gchar *key);
guint pk_backend_get_uint (PkBackend *backend,
commit c37667061dd40b55b6a598cf38d9989279d577a4
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 13:19:35 2008 +0300
docs: changed 'sgml' to 'xml' in comments
diff --git a/man/pkcon.xml b/man/pkcon.xml
index 11f27c1..f550f59 100644
--- a/man/pkcon.xml
+++ b/man/pkcon.xml
@@ -3,11 +3,11 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.sgml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
-manpage.1: manpage.sgml
+manpage.1: manpage.xml
docbook-to-man $< > $@
The docbook-to-man binary is found in the docbook-to-man package.
diff --git a/man/pkmon.xml b/man/pkmon.xml
index 7699627..7e50a16 100644
--- a/man/pkmon.xml
+++ b/man/pkmon.xml
@@ -3,11 +3,11 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.sgml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+ page: `docbook-to-man manpage.xml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.xml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
-manpage.1: manpage.sgml
+manpage.1: manpage.xml
docbook-to-man $< > $@
The docbook-to-man binary is found in the docbook-to-man package.
commit 02e7197561b335b3c79ca5f20c0ed1060af17790
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 12:46:53 2008 +0300
alpm: added more group mapping; docs: converted manpage input files from SGML to XML
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index ffe9b98..e799c87 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -702,9 +702,27 @@ backend_initialize (PkBackend *backend)
g_hash_table_insert (group_mapping, "compiz-fusion-kde", "desktop-kde");
g_hash_table_insert (group_mapping, "lxde", "desktop-other");
g_hash_table_insert (group_mapping, "rox-desktop", "desktop-other");
+ g_hash_table_insert (group_mapping, "e17-cvs", "desktop-other");
+ g_hash_table_insert (group_mapping, "e17-extra-cvs", "desktop-other");
+ g_hash_table_insert (group_mapping, "e17-libs-cvs", "desktop-other");
g_hash_table_insert (group_mapping, "xfce4", "desktop-xfce");
g_hash_table_insert (group_mapping, "xfce4-goodies", "desktop-xfce");
+ g_hash_table_insert (group_mapping, "bmp-io-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "bmp-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "bmp-visualization-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "gstreamer0.10-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "ladspa-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "pvr", "multimedia");
+ g_hash_table_insert (group_mapping, "mythtv-extras", "multimedia");
+ g_hash_table_insert (group_mapping, "xmms-effect-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "xmms-io-plugins", "multimedia");
+ g_hash_table_insert (group_mapping, "xmms-plugins", "multimedia");
g_hash_table_insert (group_mapping, "base-devel", "programming");
+ g_hash_table_insert (group_mapping, "texlive-lang", "publishing");
+ g_hash_table_insert (group_mapping, "texlive-lang-doc", "publishing");
+ g_hash_table_insert (group_mapping, "texlive-most", "publishing");
+ g_hash_table_insert (group_mapping, "texlive-most-doc", "publishing");
+ g_hash_table_insert (group_mapping, "texlive-most-svn", "publishing");
g_hash_table_insert (group_mapping, "base", "system");
pk_debug ("alpm: ready to go");
@@ -735,8 +753,10 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_DESKTOP_KDE |
PK_GROUP_ENUM_DESKTOP_OTHER |
PK_GROUP_ENUM_DESKTOP_XFCE |
+ PK_GROUP_ENUM_MULTIMEDIA |
PK_GROUP_ENUM_OTHER |
PK_GROUP_ENUM_PROGRAMMING |
+ PK_GROUP_ENUM_PUBLISHING |
PK_GROUP_ENUM_SYSTEM);
}
diff --git a/man/Makefile.am b/man/Makefile.am
index 27b73bc..4160a76 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,6 +1,6 @@
EXTRA_DIST = \
- pkcon.sgml \
- pkmon.sgml
+ pkcon.xml \
+ pkmon.xml
if HAVE_DOCBOOK2MAN
man_MANS = \
@@ -9,10 +9,10 @@ man_MANS = \
endif
if HAVE_DOCBOOK2MAN
-pkcon.1: pkcon.sgml
+pkcon.1: pkcon.xml
docbook2man $? > /dev/null
-pkmon.1: pkmon.sgml
+pkmon.1: pkmon.xml
docbook2man $? > /dev/null
endif
diff --git a/man/pkcon.sgml b/man/pkcon.sgml
deleted file mode 100644
index 44469bc..0000000
--- a/man/pkcon.sgml
+++ /dev/null
@@ -1,96 +0,0 @@
-<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.sgml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.sgml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.sgml
- docbook-to-man $< > $@
-
- The docbook-to-man binary is found in the docbook-to-man package.
- Please remember that if you create the nroff version in one of the
- debian/rules file targets (such as build), you will need to include
- docbook-to-man in your Build-Depends control field.
- -->
-
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY date "<date>29 March,2006</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
- <!ENTITY package "pkcon">
- <!ENTITY gnu "<acronym>GNU</acronym>">
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <address>
- <email>richard at hughsie.com</email>;
- </address>
- <author>
- <firstname>Richard</firstname>
- <surname>Hughes</surname>
- </author>
- <copyright>
- <year>2007</year>
- <holder>Richard Hughes</holder>
- </copyright>
- &date;
- </refentryinfo>
- <refmeta>
- <refentrytitle>pkcon</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>&package;</refname>
- <refpurpose>PackageKit console client</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>&package;</command>
- <arg><option>search</option></arg>
- <arg><option>debug install</option></arg>
- <arg><option>remove</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- This manual page documents briefly the <command>&package;</command> command.
- </para>
- <para>
- <command>&package;</command> is the command line client for PackageKit.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>pkmon (1).</para>
- <para>
- The programs are documented fully on http://www.packagekit.org.
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
- </para>
- </refsect1>
-</refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:2
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-default-dtd-file:nil
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->
-
diff --git a/man/pkcon.xml b/man/pkcon.xml
new file mode 100644
index 0000000..11f27c1
--- /dev/null
+++ b/man/pkcon.xml
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.sgml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>29 March,2006</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pkcon">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <address>
+ <email>richard at hughsie.com</email>;
+ </address>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ </author>
+ <copyright>
+ <year>2007</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pkcon</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>PackageKit console client</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>search</option></arg>
+ <arg><option>debug install</option></arg>
+ <arg><option>remove</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for PackageKit.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>pkmon (1).</para>
+ <para>
+ The programs are documented fully on http://www.packagekit.org.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
diff --git a/man/pkmon.sgml b/man/pkmon.sgml
deleted file mode 100644
index e71aa79..0000000
--- a/man/pkmon.sgml
+++ /dev/null
@@ -1,96 +0,0 @@
-<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
-
-<!-- Process this file with docbook-to-man to generate an nroff manual
- page: `docbook-to-man manpage.sgml > manpage.1'. You may view
- the manual page with: `docbook-to-man manpage.sgml | nroff -man |
- less'. A typical entry in a Makefile or Makefile.am is:
-
-manpage.1: manpage.sgml
- docbook-to-man $< > $@
-
- The docbook-to-man binary is found in the docbook-to-man package.
- Please remember that if you create the nroff version in one of the
- debian/rules file targets (such as build), you will need to include
- docbook-to-man in your Build-Depends control field.
- -->
-
- <!-- Please adjust the date whenever revising the manpage. -->
- <!ENTITY date "<date>29 March,2006</date>">
- <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
- allowed: see man(7), man(1). -->
- <!ENTITY package "pkmon">
- <!ENTITY gnu "<acronym>GNU</acronym>">
- <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
-]>
-
-<refentry>
- <refentryinfo>
- <address>
- <email>richard at hughsie.com</email>;
- </address>
- <author>
- <firstname>Richard</firstname>
- <surname>Hughes</surname>
- </author>
- <copyright>
- <year>2007</year>
- <holder>Richard Hughes</holder>
- </copyright>
- &date;
- </refentryinfo>
- <refmeta>
- <refentrytitle>pkmon</refentrytitle>
- <manvolnum>1</manvolnum>
- </refmeta>
- <refnamediv>
- <refname>&package;</refname>
- <refpurpose>PackageKit console client</refpurpose>
- </refnamediv>
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>&package;</command>
- <arg><option>search</option></arg>
- <arg><option>debug install</option></arg>
- <arg><option>remove</option></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>DESCRIPTION</title>
- <para>
- This manual page documents briefly the <command>&package;</command> command.
- </para>
- <para>
- <command>&package;</command> is the command line client for PackageKit.
- </para>
- </refsect1>
- <refsect1>
- <title>SEE ALSO</title>
- <para>pkcon (1).</para>
- <para>
- The programs are documented fully on http://www.packagekit.org.
- </para>
- </refsect1>
- <refsect1>
- <title>AUTHOR</title>
- <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
- </para>
- </refsect1>
-</refentry>
-
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:2
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-default-dtd-file:nil
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->
-
diff --git a/man/pkmon.xml b/man/pkmon.xml
new file mode 100644
index 0000000..7699627
--- /dev/null
+++ b/man/pkmon.xml
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.sgml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+ docbook-to-man $< > $@
+
+ The docbook-to-man binary is found in the docbook-to-man package.
+ Please remember that if you create the nroff version in one of the
+ debian/rules file targets (such as build), you will need to include
+ docbook-to-man in your Build-Depends control field.
+ -->
+
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY date "<date>29 March,2006</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY package "pkmon">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+ <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <address>
+ <email>richard at hughsie.com</email>;
+ </address>
+ <author>
+ <firstname>Richard</firstname>
+ <surname>Hughes</surname>
+ </author>
+ <copyright>
+ <year>2007</year>
+ <holder>Richard Hughes</holder>
+ </copyright>
+ &date;
+ </refentryinfo>
+ <refmeta>
+ <refentrytitle>pkmon</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+ <refnamediv>
+ <refname>&package;</refname>
+ <refpurpose>PackageKit console client</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&package;</command>
+ <arg><option>search</option></arg>
+ <arg><option>debug install</option></arg>
+ <arg><option>remove</option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+ <para>
+ This manual page documents briefly the <command>&package;</command> command.
+ </para>
+ <para>
+ <command>&package;</command> is the command line client for PackageKit.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+ <para>pkcon (1).</para>
+ <para>
+ The programs are documented fully on http://www.packagekit.org.
+ </para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+ <para>This manual page was written by Richard Hughes <email>richard at hughsie.com</email>.
+ </para>
+ </refsect1>
+</refentry>
commit 07eb35487002f68d5a5e7af808c1ae2b2e1f1077
Merge: c6027bd... 5d85b4c...
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 00:22:10 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit c6027bd88b9aac8b912038e95d5bf193c6e332f0
Author: Richard Hughes <richard at hughsie.com>
Date: Wed May 7 00:21:35 2008 +0100
trvial: correct the fedora spec file
diff --git a/contrib/gnome-packagekit.spec.in b/contrib/gnome-packagekit.spec.in
index ca6afb7..a97fc3b 100644
--- a/contrib/gnome-packagekit.spec.in
+++ b/contrib/gnome-packagekit.spec.in
@@ -65,7 +65,7 @@ make install DESTDIR=$RPM_BUILD_ROOT
unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
install %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/system-install-packages
-install %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/man/man1/system-install-packages.1.gz
+install -m 0644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/man/man1/system-install-packages.1.gz
desktop-file-install --delete-original \
--dir=$RPM_BUILD_ROOT%{_sysconfdir}/xdg/autostart/ \
commit 5d85b4ca31d1e690df1315c946adc75d75978d14
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date: Wed May 7 02:09:46 2008 +0300
ru.po: fixed a typo
diff --git a/po/ru.po b/po/ru.po
index d41cf42..80c61d4 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -284,12 +284,12 @@ msgstr "УкажиÑе Ð¸Ð¼Ñ Ð¿Ð°ÐºÐµÑа Ð´Ð»Ñ Ð¿Ð¾ÐºÐ°Ð·Ð°"
#: ../client/pk-console.c:1316 ../client/pk-console.c:1323
#, c-format
msgid "You need to specify a repo name"
-msgstr "УкажиÑе Ð¸Ð¼Ñ ÑепозиÑаÑиÑ"
+msgstr "УкажиÑе Ð¸Ð¼Ñ ÑепозиÑоÑиÑ"
#: ../client/pk-console.c:1330
#, c-format
msgid "You need to specify a repo name/parameter and value"
-msgstr "УкажиÑе имÑ/паÑамеÑÑ Ð¸ знаÑение ÑепозиÑаÑиÑ"
+msgstr "УкажиÑе имÑ/паÑамеÑÑ Ð¸ знаÑение ÑепозиÑоÑиÑ"
#: ../client/pk-console.c:1343
#, c-format
More information about the PackageKit-commit
mailing list