[PackageKit-commit] packagekit: Branch 'master' - 9 commits

Richard Hughes hughsient at kemper.freedesktop.org
Thu Jun 5 12:05:12 PDT 2008


 NEWS                                |  113 ++++++++++++++++++++++++++++++++
 RELEASE                             |   40 ++++++-----
 backends/alpm/pk-backend-alpm.c     |  125 +++++++++++++++++++++++++-----------
 backends/poldek/pk-backend-poldek.c |   19 ++++-
 client/pk-console.c                 |    2 
 configure.ac                        |    2 
 docs/html/pk-download.html          |    1 
 docs/spec/pk-methods.xml            |   53 ++++++++-------
 8 files changed, 274 insertions(+), 81 deletions(-)

New commits:
commit 4e1ef3a02d30b6f39e36f81e0a2cc5989ad4fb3a
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Thu Jun 5 14:33:16 2008 -0400

    Update release with typo fixes, new step, and new version #s.

diff --git a/RELEASE b/RELEASE
index ef8e5bb..896f644 100644
--- a/RELEASE
+++ b/RELEASE
@@ -3,7 +3,7 @@ PackageKit Release Notes
 1. Write NEWS entries for PackageKit and gnome-packagekit in the same
    format as usual. Ignore any trivial commits.
 
-$git-shortlog GNOME_PACKAGEKIT_0_2_1.. | grep -v trivial > NEWS.new
+$ git-shortlog GNOME_PACKAGEKIT_0_2_2.. | grep -v trivial > NEWS.new
 
 2. Add download date to docs/html/pk-download.html, save file.
 
@@ -11,40 +11,44 @@ $git-shortlog GNOME_PACKAGEKIT_0_2_1.. | grep -v trivial > NEWS.new
 
 4. Commit changes in PackageKit git:
 
-$git commit -a -m "Release version 0.2.2"
-$git tag -a -f -m "Release 0.2.2" PACKAGEKIT_0_2_2
-$git push --tags
-$git push
+$ git commit -a -m "Release version 0.2.3"
+$ git tag -a -f -m "Release 0.2.3" PACKAGEKIT_0_2_3
+$ git push --tags
+$ git push
 
 5. Commit changes in gnome-packagekit git:
 
-$git commit -a -m "Release version 0.2.2"
-$git-tag GNOME_PACKAGEKIT_0_2_2
-$git push --tags
-$git push
+$ git commit -a -m "Release version 0.2.3"
+$ git-tag GNOME_PACKAGEKIT_0_2_3
+$ git push --tags
+$ git push
 
-6. Upload both tarballs to:
+6. run 'make dist-gzip' in both the PackageKit and gnome-packagekit dirs.
 
-$scp *.tar.gz packagekit.org/srv/www/html/releases/
+7. Upload both tarballs to:
 
-7. Do post release version bump in configure.ac
+$ scp *.tar.gz packagekit.org:/srv/www/html/releases/
 
-8. Commit changes in both projects:
+8. Do post release version bump in configure.ac
 
-$git commit -a -m "post release version bump"
-$git push
+9. Commit changes in both projects:
 
-9. Send an email to packagekit at lists.freedesktop.org
+$ git commit -a -m "post release version bump"
+$ git push
+
+10. Send an email to packagekit at lists.freedesktop.org
 
 =================================================
-Subject: PackageKit and gnome-packagekit 0.2.2 released!
+Subject: PackageKit and gnome-packagekit 0.2.3 released!
 
-Today I released PackageKit and gnome-packagekit 0.2.2.
+Today I released PackageKit and gnome-packagekit 0.2.3.
 
 PackageKit release notes: http://gitweb.freedesktop.org/?p=packagekit.git;a=blob;f=NEWS
+
 gnome-packagekit release notes: http://gitweb.freedesktop.org/?p=users/hughsient/gnome-packagekit.git;a=blob;f=NEWS
 
 Tarballs available here: http://www.packagekit.org/releases/
+
 Thanks to all those who made this possible.
 =================================================
 
commit fe15f32cdd15fbb0d552dd416cde57cd93fb32cd
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Thu Jun 5 14:12:40 2008 -0400

    post release version bump

diff --git a/configure.ac b/configure.ac
index 7510b03..938d5c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 AC_PREREQ(2.52)
 
-AC_INIT(PackageKit, 0.2.2)
+AC_INIT(PackageKit, 0.2.3)
 AC_CONFIG_SRCDIR(src)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 AM_CONFIG_HEADER(config.h)
commit a49f499f3859082fbf615864055c70451ab92abb
Author: Robin Norwood <rnorwood at redhat.com>
Date:   Thu Jun 5 13:21:58 2008 -0400

    Release version 0.2.2

diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index d276a05..01c28eb 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -62,6 +62,7 @@ Released versions are found on
 <tr><td>0.1.11</td><td></td><td>2008-04-05</td></tr>
 <tr><td>0.2.0</td><td></td><td>2008-05-06</td></tr>
 <tr><td>0.2.1</td><td></td><td>2008-05-09</td></tr>
+<tr><td>0.2.2</td><td></td><td>2008-06-05</td></tr>
 </table>
 
 <h2>Dependencies</h2>
commit b0aa7d8a09b0f22597e8f645de2ef3fac7634ea5
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Jun 5 18:16:52 2008 +0100

    trivial: add new NEWS file for the release

diff --git a/NEWS b/NEWS
index fd15b29..ba896d2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,116 @@
+Version 0.2.2
+~~~~~~~~~~~~~
+Released: 2008-06-05
+
+* Backends:
+ - alpm: fixed backend_remove_packages (Valeriy Lyasotskiy)
+ - apt: Replace the apt backend by the apt2 one, since the former one is deprecated (Sebastian Heinlein)
+ - apt2: Always perform a normal upgrade instead of dist-upgrade in doUpdateSystem (Sebastian Heinlein)
+ - apt2: do not segfault if xapian is not available. Perform a  test during init (Sebastian Heinlein)
+ - apt2: implement GetPackages (Sebastian Heinlein)
+ - apt2: Update the FAQ to represent the GetPackages support (Sebastian Heinlein)
+ - apt2: Implement resolve. Update documentation accordingly (Sebastian Heinlein)
+ - apt2: Fix RemovePackages in the daemon backend (Sebastian Heinlein)
+ - apt2: Fix doRemovePackages and doInstallPackages (Sebastian Heinlein)
+ - apt2: use the async wrapper from the daemonDBus instead of our own (Sebastian Heinlein)
+ - dummy: add subpercentage support into the dummy backend when installing packages (Richard Hughes)
+ - dummy: add an multiline example (Richard Hughes)
+ - urpmi: Added perl_packagekit perl modules (Aurelien Lefebvre)
+ - urpmi: Added get-updates method (Aurelien Lefebvre)
+ - urpmi: Added get-update-detail.pl (Aurelien Lefebvre)
+ - urpmi: Added refresh-cache.pl to URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added install-packages.pl in URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added remove-packages method to URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added get-groups method in URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added search-group method to URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added get_filters method in URPMI backend (Aurelien Lefebvre)
+ - urpmi: Added get-packages method for urpmi backend (Aurelien Lefebvre)
+ - urpmi: Added get-requires method for urpmi backend (Aurelien Lefebvre)
+ - urpmi: Added search-details method for urpmi backend (Aurelien Lefebvre)
+ - urpmi: Added search-file method in urpmi backend (Aurelien Lefebvre)
+ - urpmi: Added resolve method for urpmi backend (Aurelien Lefebvre)
+ - urpmi: Added update-packages method in urpmi backend (Aurelien Lefebvre)
+ - urpmi: Fix a bug when package description contains a tab (Aurelien Lefebvre)
+ - urpmi: Another fix in get-details when xml_info_file doest not exists (Aurelien Lefebvre)
+ - opkg: Adding group message to get-details (I-Fan, Chen)
+ - opkg: support new error handling from libopkg (Thomas Wood)
+ - opkg: send status and package signals during progress updates (Thomas Wood)
+ - opkg: support multiple packages in install and remove (Thomas Wood)
+ - opkg: update error checking for install and update methods (Thomas Wood)
+ - opkg: update to use new package corrupt error enum (Thomas Wood)
+ - poldek: implement WhatProvides (Marcin Banasiak)
+ - poldek: implement GetGroups. Now user can search group (Marcin Banasiak)
+ - poldek: recognize and set correct PkInfoEnum for security updates (Marcin Banasiak)
+ - poldek: fix crash in Resolve method (Marcin Banasiak)
+ - poldek: fix RemovePackages to remove more than one package (Marcin Banasiak)
+ - poldek: fix InstallPackages to install more than one package (Marcin Banasiak)
+ - yum: backport the skip broken stuff from yum2 to improve the interaction a little (Richard Hughes)
+ - yum: only attempt to install .rpm files rather than all types of packages (Richard Hughes)
+ - yum: correct the name of remove_packages as this won't have worked for a little while (Richard Hughes)
+ - yum: convert ';' chars in update description in to ','. Fixes rh#447347 (Richard Hughes)
+ - yum: improve the 'Missing Dependency:' detailed output a smidgin (Richard Hughes)
+ - yum: be more specific when we specify a package to yumbase. Fixes rh#447767 (Richard Hughes)
+ - yum: when we searchNevra make sure we pass in the arch to try to fix rh#447957 (Richard Hughes)
+ - yum: fallback to i686 for i386 arch packages to prevent warning the user (Richard Hughes)
+ - yum2: fix RemovePackages to work with more than one package_id (Richard Hughes)
+ - yum2: fix reporting of details from yumbase, just like we did for the yum backend (Richard Hughes)
+ - yum: Clean up a couple of error messages (Robin Norwood)
+ - yum: Fix exception name (Robin Norwood)
+ - yum: keyData['fingerprint'] is a method, not a string (Robin Norwood)
+ - yum: Convert fingerprint into hex (Robin Norwood)
+ - yum: We never want to show self.txt (Robin Norwood)
+ - zypp: rotate logs #BNC390339 (Stefan Haas)
+ - zypp: fixed #BNC392435 (Stefan Haas)
+ - zypp: added copyright stuff again (Stefan Haas)
+ - zypp: added source filter support (Stefan Haas)
+ - zypp: require libzypp 4.25.0 (Stefan Haas)
+ - zypp: Fix transaction db path to use current dir when using --enable-local (Duncan Mac-Vicar P)
+ - zypp: remove the localised text that crept into the backend (Richard Hughes)
+
+* Translations
+ - Updated German translation (Fabian Affolter)
+ - Initial Hungarian translation (Peter Sulyok)
+ - Updated Polish translation (Piotr DrÄ…g)
+
+* New features:
+ - Add pk_package_item_copy() and allow freeing a NULL PkPackageItem without going boom (Richard Hughes)
+ - Allow setting 101 for backends for sub-percentages (Richard Hughes)
+ - Add pk_package_list_add_item() and pk_package_list_contains_item() (Richard Hughes)
+ - Allow passing environment parameters to pk_spawn_argv (Richard Hughes)
+ - Add support for http and ftp proxy servers in the daemon (Richard Hughes)
+ - Allow adding and removing multiple packages at one time with pkcon (Richard Hughes)
+ - Add the source filter (Richard Hughes)
+ - Allow proxy_http and proxy_ftp to be NULL in the DBUS backend (Richard Hughes)
+ - Add another convenience function, pk_strreplace() (Richard Hughes)
+ - Add some notes on howto do the release, as Robin is going to do the next one (Richard Hughes)
+ - Add pk_package_list_add_list() convenience function (Richard Hughes)
+ - Add pk_client_get_package_list() (Richard Hughes)
+ - Babysit the DBUS backends and do Init() again it when they crash (Richard Hughes)
+ - Add API to PkPackageList to enable sorting by package_id, summary or PkInfoEnum (Richard Hughes)
+ - Add Rice BSD license (Robin Norwood)
+ - Add Qhull license (Robin Norwood)
+ - Add a new error enum for corrupt packages (Thomas Wood)
+
+* Bugfixes:
+ - Use pk_client_install_packages() in pkcon (Marcin Banasiak)
+ - Add some updated copyright attributions (Richard Hughes)
+ - Fix a backtrace when we use refresh-packagekit.py with an old daemon. Fixes rh#446331 (Richard Hughes)
+ - Ignore duplicate Package() calls from backends (Richard Hughes)
+ - Make sure we reset the resolve client before we try to reuse it (Richard Hughes)
+ - Make the get-actions, get-filters and get-groups output prettier (Richard Hughes)
+ - Actually check for NM before we try to use it in the networking code (Richard Hughes)
+ - Support RefusedByPolicy on the base interface too (Richard Hughes)
+ - Only try to install local files if they are files, not files or folders (Richard Hughes)
+ - Ref and unref the PkClient in pk_client_finished_cb() if we do unref in ::finished (Richard Hughes)
+ - Newline is a valid char, else the update descriptions look bad (Richard Hughes)
+ - Preventative fix as in theory we could do ::Finished and then Wait:: (Richard Hughes)
+ - Don't ignore ::Finished() if we warn the user (Richard Hughes)
+ - If the transaction has been queued but not run, just remove from the list (Richard Hughes)
+ - If we've finished the transaction, don't allow it to be cancelled -- (Richard Hughes)
+ - In PkClient don't do a NULL dereference when we try to set an error when not reset (Richard Hughes)
+ - Fix a compile warning (S.Çağlar Onur)
+ - Remove "nonzero MTU" check and skip "loopback" interface checking (S.Çağlar Onur)
+
 Version 0.2.1
 ~~~~~~~~~~~~~
 Released: 2008-05-09
commit c22d6fbad4ee47396b186c59b6bc287482d27b78
Merge: c4f6ebc... a9b0f8f...
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date:   Thu Jun 5 19:27:21 2008 +0300

    Merge branch 'master' of git+ssh://onestep_ua@git.packagekit.org/srv/git/PackageKit

commit c4f6ebcaf4430d980e86d50ea4e455a88df11285
Author: Valeriy Lyasotskiy <onestep at ukr.net>
Date:   Thu Jun 5 19:27:05 2008 +0300

    fixed backend_remove_packages

diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 45e7a44..77a2dca 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -43,11 +43,11 @@
 #include <string.h>
 #include <ctype.h>
 
-static int progress_percentage;
-static int subprogress_percentage;
-PkBackend *install_backend = NULL;
+int progress_percentage;
+int subprogress_percentage;
+PkBackend *backend_instance = NULL;
 
-static GHashTable *group_mapping;
+GHashTable *group_mapping;
 
 typedef struct _PackageSource
 {
@@ -62,10 +62,30 @@ package_source_free (PackageSource *source)
 	alpm_pkg_free (source->pkg);
 }
 
+gchar *
+pkg_to_package_id_str (pmpkg_t *pkg, gchar *repo)
+{
+	gchar *arch = (gchar *) alpm_pkg_get_arch (pkg);
+	if (arch == NULL)
+		arch = "unknown";
+
+	return pk_package_id_build (alpm_pkg_get_name (pkg), alpm_pkg_get_version (pkg), arch, repo);
+}
+
 void
 cb_trans_evt (pmtransevt_t event, void *data1, void *data2)
 {
-	// TODO: Add code here
+	// TODO: Add more code here
+	gchar *package_id_str;
+
+	switch (event) {
+		case PM_TRANS_EVT_REMOVE_DONE:
+			package_id_str = pkg_to_package_id_str (data1, "local");
+			pk_backend_package (backend_instance, PK_INFO_ENUM_REMOVING, package_id_str, alpm_pkg_get_desc (data1));
+			g_free (package_id_str);
+			break;
+		default: pk_debug ("alpm: event happened, id=%i", event);
+	}
 }
 
 void
@@ -77,7 +97,8 @@ cb_trans_conv (pmtransconv_t conv, void *data1, void *data2, void *data3, int *r
 void
 cb_trans_progress (pmtransprog_t event, const char *pkgname, int percent, int howmany, int remain)
 {
-	pk_debug ("alpm: percentage is %i", percent);
+	// This is too verbose
+	// pk_debug ("alpm: percentage is %i", percent);
 	// pk_backend_set_percentage ((PkBackend *) install_backend, percent);
 }
 
@@ -178,21 +199,21 @@ add_package (PkBackend *backend, PackageSource *package)
 {
 	pk_debug ("add_package: hi, package_name=%s", alpm_pkg_get_name(package->pkg));
 
-	PkInfoEnum info;
-	gchar *pkg_string;
 	gchar *arch = (gchar *) alpm_pkg_get_arch (package->pkg);
-
 	if (arch == NULL)
 		arch = "unknown";
 
-	pkg_string = pk_package_id_build (alpm_pkg_get_name (package->pkg), alpm_pkg_get_version (package->pkg), arch, package->repo);
+	gchar *package_id_str = pkg_to_package_id_str (package->pkg, package->repo);
+
+	PkInfoEnum info;
 	if (package->installed)
 		info = PK_INFO_ENUM_INSTALLED;
 	else
 		info = PK_INFO_ENUM_AVAILABLE;
-	pk_backend_package (backend, info, pkg_string, alpm_pkg_get_desc (package->pkg));
 
-	g_free(pkg_string);
+	pk_backend_package (backend, info, package_id_str, alpm_pkg_get_desc (package->pkg));
+
+	g_free(package_id_str);
 }
 
 static void
@@ -668,6 +689,9 @@ parse_config (const char *file, const char *givensection, pmdb_t * const givendb
 static void
 backend_initialize (PkBackend *backend)
 {
+	// initialize backend_instance for use in callback functions
+	backend_instance = backend;
+
 	pk_debug ("alpm: hi!");
 
 	if (alpm_initialize () == -1) {
@@ -952,7 +976,7 @@ backend_install_files_thread (PkBackend *backend)
 static void
 backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
 {
-	pk_backend_set_status (backend, PK_STATUS_ENUM_REFRESH_CACHE);
+	pk_backend_set_status (backend, PK_STATUS_ENUM_INSTALL);
 
 	pk_backend_thread_create (backend, backend_install_files_thread);
 }
@@ -1027,7 +1051,6 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
 	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;
 
 	if (alpm_trans_commit (&problems) != 0) {
 		pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, alpm_strerror (pm_errno));
@@ -1096,46 +1119,78 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
 }
 
 /**
- * backend_remove_packages:
+ * backend_remove_packages_thread:
  */
-static void
-backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
+static gboolean
+backend_remove_packages_thread (PkBackend *backend)
 {
-	PkPackageId *id = pk_package_id_new_from_string (package_ids[0]);
-	pmtransflag_t flags = 0;
-	alpm_list_t *problems = NULL;
+	pk_backend_set_percentage (backend, PK_BACKEND_PERCENTAGE_INVALID);
+
+	gchar **package_ids = pk_backend_get_strv (backend, "package_ids");
+	gboolean allow_deps = pk_backend_get_bool (backend, "allow_deps");
 
+	pmtransflag_t flags = 0;
 	if (allow_deps)
 		flags |= PM_TRANS_FLAG_CASCADE;
 
+	/* create a new transaction */
 	if (alpm_trans_init (PM_TRANS_TYPE_REMOVE, flags, 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);
-		pk_package_id_free (id);
-		return;
+		return FALSE;
 	}
+	pk_debug ("alpm: %s", "transaction initialized");
 
-	alpm_trans_addtarget (id->name);
+	/* add targets to the transaction */
+	int iterator;
+	for (iterator = 0; iterator < g_strv_length (package_ids); ++iterator) {
+		PkPackageId *package_id = pk_package_id_new_from_string (package_ids[iterator]);
+		if (alpm_trans_addtarget (package_id->name) == -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;
+		}
+		pk_package_id_free (package_id);
+	}
 
-	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 ();
-		pk_package_id_free (id);
-		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 ();
-		pk_package_id_free (id);
-		return;
+		pk_backend_finished (backend);
+		return FALSE;
 	}
 
-	pk_package_id_free (id);
 	alpm_trans_release ();
+	pk_debug ("alpm: %s", "transaction released");
+
 	pk_backend_finished (backend);
+	return TRUE;
+}
+
+/**
+ * backend_remove_packages:
+ */
+static void
+backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
+{
+	pk_backend_set_status (backend, PK_STATUS_ENUM_REMOVE);
+
+	pk_backend_thread_create (backend, backend_remove_packages_thread);
 }
 
 /**
commit a9b0f8f94145292a7795eec2266056983c03491f
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Jun 5 15:35:26 2008 +0100

    trivial: correct some mistakes in the reference documentation

diff --git a/docs/spec/pk-methods.xml b/docs/spec/pk-methods.xml
index 3a359d1..e791c6b 100644
--- a/docs/spec/pk-methods.xml
+++ b/docs/spec/pk-methods.xml
@@ -243,7 +243,7 @@
   </sect1>
 
   <sect1 id="methods-install-package">
-    <title>Install Package</title>
+    <title>Install Packages</title>
     <para>
       The installer should always install extra packages automatically
       as the use could call GetDepends prior to the install if a confirmation
@@ -262,18 +262,13 @@
         </thead>
         <tbody>
           <row>
-            <entry><literal>package_id</literal></entry>
-            <entry>A single, valid, package ID.</entry>
+            <entry><literal>package_ids</literal></entry>
+            <entry>An array of package IDs.</entry>
           </row>
         </tbody>
       </tgroup>
     </informaltable>
     <para>
-      This should search for files.
-      This should allow an application to find out what package owns
-      a file on the system.
-    </para>
-    <para>
       This method typically emits
       <literal>Progress</literal>,
       <literal>Status</literal> and
@@ -290,7 +285,7 @@
   </sect1>
 
   <sect1 id="methods-install-file">
-    <title>Install File</title>
+    <title>Install Files</title>
     <para>
       The installer should always install extra packages automatically
       as the use could call GetDepends prior to the install if a confirmation
@@ -309,8 +304,8 @@
         </thead>
         <tbody>
           <row>
-            <entry><literal>full_path</literal></entry>
-            <entry>A full path and filename to a single package.</entry>
+            <entry><literal>full_paths</literal></entry>
+            <entry>An array of full path and filenames to packages.</entry>
           </row>
         </tbody>
       </tgroup>
@@ -370,7 +365,7 @@
   </sect1>
 
   <sect1 id="methods-remove">
-    <title>Remove Package</title>
+    <title>Remove Packages</title>
     <para>
       The arguments are:
     </para>
@@ -384,16 +379,30 @@
         </thead>
         <tbody>
           <row>
+            <entry><literal>package_ids</literal></entry>
+            <entry>An array of package IDs.</entry>
+          </row>
+          <row>
             <entry><literal>allow_deps</literal></entry>
             <entry>
-              Either "yes" or "no". If yes allow other packages to be
-              removed with the package, but "no" should cause the script
-              to abort if other packages are dependant on the package.
+              Either <literal>true</literal> or <literal>false</literal>.
+              If <literal>true</literal> allow other packages to be removed with the package,
+              but <literal>false</literal> should cause the script to abort if other packages
+              are dependant on the package.
             </entry>
           </row>
           <row>
-            <entry><literal>package_id</literal></entry>
-            <entry>A single, valid, package ID.</entry>
+            <entry><literal>auto_remove</literal></entry>
+            <entry>
+              Either <literal>true</literal> or <literal>false</literal>.
+              This option is only really interesting on embedded devices with a limited amount of
+              flash storage.
+              It suggests to the packagekit backend that dependencies installed at the same time as
+              the package should also be removed if they are not required by anything else.
+              For instance, if you install OpenOffice, it might download libneon as a dependency.
+              When <literal>auto_remove</literal> is set to true, and you remove OpenOffice then
+              libneon will also get removed automatically.
+            </entry>
           </row>
         </tbody>
       </tgroup>
@@ -445,7 +454,7 @@
           <row>
             <entry><literal>recursive</literal></entry>
             <entry>
-              Either "yes" or "no". If yes then the requirements should be
+              Either <literal>true</literal> or <literal>false</literal>. If yes then the requirements should be
               returned for all packages returned.
               This means if gnome-power-manager depends on NetworkManager
               and NetworkManager depends on HAL, then GetDepends on
@@ -630,7 +639,7 @@
           <row>
             <entry><literal>recursive</literal></entry>
             <entry>
-              Either "yes" or "no". If yes then the requirements should be
+              Either <literal>true</literal> or <literal>false</literal>. If yes then the requirements should be
               returned for all packages returned.
               This means if gnome-power-manager depends on NetworkManager
               and NetworkManager depends on HAL, then GetRequires on
@@ -722,7 +731,7 @@
   </sect1>
 
   <sect1 id="methods-update">
-    <title>Update Package</title>
+    <title>Update Packages</title>
     <para>
       The installer should always update extra packages automatically.
     </para>
@@ -739,8 +748,8 @@
         </thead>
         <tbody>
           <row>
-            <entry><literal>package_id</literal></entry>
-            <entry>A single, valid, package ID.</entry>
+            <entry><literal>package_ids</literal></entry>
+            <entry>An array of package IDs.</entry>
           </row>
         </tbody>
       </tgroup>
commit e1043977c3f3e38af525943cab026cb70b8b8664
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Thu Jun 5 12:40:34 2008 +0200

    bugfix: use pk_client_install_packages() as now we can install multiple packages at once

diff --git a/client/pk-console.c b/client/pk-console.c
index ec93978..c0c1e3c 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -613,7 +613,7 @@ pk_console_install_stuff (PkClient *client, gchar **packages, GError **error)
 			goto out;
 		}
 
-		ret = pk_client_install_package (client, package_id, error);
+		ret = pk_client_install_packages (client, package_ids, error);
 		if (!ret) {
 			pk_warning ("failed to install packages");
 			goto out;
commit d35b172feefc698595262f24e9f71fe0f3e3d1a4
Author: Marcin Banasiak <megabajt at pld-linux.org>
Date:   Thu Jun 5 12:02:50 2008 +0200

    poldek: fix InstallPackages to install more than one package

diff --git a/backends/poldek/pk-backend-poldek.c b/backends/poldek/pk-backend-poldek.c
index a021fba..efe1c74 100644
--- a/backends/poldek/pk-backend-poldek.c
+++ b/backends/poldek/pk-backend-poldek.c
@@ -2026,9 +2026,11 @@ backend_install_packages_thread (PkBackend *backend)
 {
 	struct poldek_ts	*ts;
 	struct poclidek_rcmd	*rcmd;
-	gchar			*command, *nvra;
+	gchar			*command;
 	struct vf_progress	vf_progress;
 	gchar **package_ids;
+	GString *cmd;
+	gint i;
 
 	pk_backend_set_uint (backend, "ts_type", TS_TYPE_ENUM_INSTALL);
 	package_ids = pk_backend_get_strv (backend, "package_ids");
@@ -2043,8 +2045,18 @@ backend_install_packages_thread (PkBackend *backend)
 	ts = poldek_ts_new (ctx, 0);
 	rcmd = poclidek_rcmd_new (cctx, ts);
 
-	nvra = poldek_get_nvra_from_package_id (package_ids[0]);
-	command = g_strdup_printf ("install %s", nvra);
+	cmd = g_string_new ("install ");
+
+	/* prepare command */
+	for (i = 0; i < g_strv_length (package_ids); i++) {
+		gchar	*nvra = poldek_get_nvra_from_package_id (package_ids[i]);
+
+		g_string_append_printf (cmd, "%s ", nvra);
+
+		g_free (nvra);
+	}
+
+	command = g_string_free (cmd, FALSE);
 
 	pk_backend_set_status (backend, PK_STATUS_ENUM_DEP_RESOLVE);
 
@@ -2053,7 +2065,6 @@ backend_install_packages_thread (PkBackend *backend)
 	else
 		pb_error_check (backend);
 
-	g_free (nvra);
 	g_free (command);
 
 	poldek_ts_free (ts);


More information about the PackageKit-commit mailing list