Date: Friday, June 2, 2017 @ 12:16:57
  Author: eworm
Revision: 233411

archrelease: copy trunk to community-i686, community-x86_64

Added:
  packagekit/repos/community-i686/0001-alpm-hooks.patch
    (from rev 233410, packagekit/trunk/0001-alpm-hooks.patch)
  packagekit/repos/community-i686/PKGBUILD
    (from rev 233410, packagekit/trunk/PKGBUILD)
  packagekit/repos/community-x86_64/0001-alpm-hooks.patch
    (from rev 233410, packagekit/trunk/0001-alpm-hooks.patch)
  packagekit/repos/community-x86_64/PKGBUILD
    (from rev 233410, packagekit/trunk/PKGBUILD)
Deleted:
  packagekit/repos/community-i686/PKGBUILD
  packagekit/repos/community-x86_64/PKGBUILD

----------------------------------------+
 /PKGBUILD                              |  130 +++++++++++++++++
 community-i686/0001-alpm-hooks.patch   |  235 +++++++++++++++++++++++++++++++
 community-i686/PKGBUILD                |   57 -------
 community-x86_64/0001-alpm-hooks.patch |  235 +++++++++++++++++++++++++++++++
 community-x86_64/PKGBUILD              |   57 -------
 5 files changed, 600 insertions(+), 114 deletions(-)

Copied: packagekit/repos/community-i686/0001-alpm-hooks.patch (from rev 233410, 
packagekit/trunk/0001-alpm-hooks.patch)
===================================================================
--- community-i686/0001-alpm-hooks.patch                                (rev 0)
+++ community-i686/0001-alpm-hooks.patch        2017-06-02 12:16:57 UTC (rev 
233411)
@@ -0,0 +1,235 @@
+From 826e8e12424260d50834f1beb8ecd2ad8eed3618 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Mon, 15 May 2017 23:26:41 +0200
+Subject: [PATCH 1/4] Add new status "Running hooks"
+---
+ lib/packagekit-glib2/pk-console-shared.c | 4 ++++
+ lib/packagekit-glib2/pk-enum.h           | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/lib/packagekit-glib2/pk-console-shared.c 
b/lib/packagekit-glib2/pk-console-shared.c
+index d61f3a13e..5810e160a 100644
+--- a/lib/packagekit-glib2/pk-console-shared.c
++++ b/lib/packagekit-glib2/pk-console-shared.c
+@@ -324,6 +324,10 @@ pk_status_enum_to_localised_text (PkStatusEnum status)
+               /* TRANSLATORS: transaction state, we are copying package files 
before or after the transaction */
+               text = _("Copying files");
+               break;
++      case PK_STATUS_ENUM_RUN_HOOK:
++              /* TRANSLATORS: transaction state, we are running hooks before 
or after the transaction */
++              text = _("Running hooks");
++              break;
+       default:
+               g_warning ("status unrecognised: %s", pk_status_enum_to_string 
(status));
+       }
+diff --git a/lib/packagekit-glib2/pk-enum.h b/lib/packagekit-glib2/pk-enum.h
+index 4bf93df51..b52690f44 100644
+--- a/lib/packagekit-glib2/pk-enum.h
++++ b/lib/packagekit-glib2/pk-enum.h
+@@ -143,6 +143,7 @@ typedef enum {
+       PK_STATUS_ENUM_CHECK_EXECUTABLE_FILES,
+       PK_STATUS_ENUM_CHECK_LIBRARIES,
+       PK_STATUS_ENUM_COPY_FILES,
++      PK_STATUS_ENUM_RUN_HOOK,
+       PK_STATUS_ENUM_LAST
+ } PkStatusEnum;
+ 
+From 91d6a48511818840addb7ad06efea209c57717e7 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Tue, 23 May 2017 12:21:46 +0200
+Subject: [PATCH 2/4] alpm: use enum for upgrade/reinstall/downgrade
+---
+ backends/alpm/pk-alpm-transaction.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index 54bf8e6c4..674bb9d93 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -550,17 +550,17 @@ pk_alpm_transaction_upgrade_done (PkBackendJob *job, 
alpm_pkg_t *pkg,
+       const gchar *name, *pre, *post;
+ 
+       g_return_if_fail (pkg != NULL);
+-      g_return_if_fail (old != NULL || direction == 0);
++      g_return_if_fail (old != NULL || direction == ALPM_PACKAGE_REINSTALL);
+ 
+       name = alpm_pkg_get_name (pkg);
+-      if (direction != 0)
++      if (direction != ALPM_PACKAGE_REINSTALL)
+               pre = alpm_pkg_get_version (old);
+       post = alpm_pkg_get_version (pkg);
+ 
+-      if (direction > 0) {
++      if (direction == ALPM_PACKAGE_UPGRADE) {
+               alpm_logaction (priv->alpm, PK_LOG_PREFIX, "upgraded %s (%s -> 
%s)\n",
+                               name, pre, post);
+-      } else if (direction < 0) {
++      } else if (direction == ALPM_PACKAGE_DOWNGRADE) {
+               alpm_logaction (priv->alpm, PK_LOG_PREFIX,
+                               "downgraded %s (%s -> %s)\n", name, pre, post);
+       } else {
+@@ -569,7 +569,7 @@ pk_alpm_transaction_upgrade_done (PkBackendJob *job, 
alpm_pkg_t *pkg,
+       }
+       pk_alpm_pkg_emit (job, pkg, PK_INFO_ENUM_FINISHED);
+ 
+-      if (direction != 0)
++      if (direction != ALPM_PACKAGE_REINSTALL)
+               pk_alpm_transaction_process_new_optdepends (pkg, old);
+       pk_alpm_transaction_output_end ();
+ }
+@@ -665,13 +665,13 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+                                       pk_alpm_transaction_remove_done (job, 
e->oldpkg);
+                                       break;
+                               case ALPM_PACKAGE_UPGRADE:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, 1);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_UPGRADE);
+                                       break;
+                               case ALPM_PACKAGE_DOWNGRADE:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, -1);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_DOWNGRADE);
+                                       break;
+                               case ALPM_PACKAGE_REINSTALL:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, 0);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_REINSTALL);
+                                       break;
+                       }
+               }
+From e88e481ddd8a0dbf53d14d3336d220a7bd437f00 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Mon, 15 May 2017 23:46:56 +0200
+Subject: [PATCH 3/4] alpm: clean up status, add handling for hooks
+---
+ backends/alpm/pk-alpm-transaction.c | 43 +++++++++++++++++++++++++++----------
+ 1 file changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index 674bb9d93..a87a008a8 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -394,6 +394,12 @@ pk_alpm_transaction_dep_resolve (PkBackendJob *job)
+ }
+ 
+ static void
++pk_alpm_transaction_hook (PkBackendJob *job)
++{
++      pk_backend_job_set_status (job, PK_STATUS_ENUM_RUN_HOOK);
++}
++
++static void
+ pk_alpm_transaction_test_commit (PkBackendJob *job)
+ {
+       pk_backend_job_set_status (job, PK_STATUS_ENUM_TEST_COMMIT);
+@@ -630,10 +636,10 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_RESOLVEDEPS_START:
+               pk_alpm_transaction_dep_resolve (job);
+               break;
+-      case ALPM_EVENT_FILECONFLICTS_START:
+-      case ALPM_EVENT_INTERCONFLICTS_START:
+       case ALPM_EVENT_DELTA_INTEGRITY_START:
+       case ALPM_EVENT_DISKSPACE_START:
++      case ALPM_EVENT_FILECONFLICTS_START:
++      case ALPM_EVENT_INTERCONFLICTS_START:
+               pk_alpm_transaction_test_commit (job);
+               break;
+       case ALPM_EVENT_PACKAGE_OPERATION_START:
+@@ -690,6 +696,7 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_SCRIPTLET_INFO:
+               pk_alpm_transaction_output (((alpm_event_scriptlet_info_t *) 
event)->line);
+               break;
++      case ALPM_EVENT_KEY_DOWNLOAD_START:
+       case ALPM_EVENT_RETRIEVE_START:
+               pk_alpm_transaction_download (job);
+               break;
+@@ -700,21 +707,35 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+                       pk_alpm_transaction_optdepend_removal (job, e->pkg, 
e->optdep);
+               }
+               break;
++      case ALPM_EVENT_HOOK_START:
++              pk_alpm_transaction_hook (job);
++              break;
+       case ALPM_EVENT_CHECKDEPS_DONE:
+-      case ALPM_EVENT_FILECONFLICTS_DONE:
+-      case ALPM_EVENT_RESOLVEDEPS_DONE:
+-      case ALPM_EVENT_INTERCONFLICTS_DONE:
+-      case ALPM_EVENT_INTEGRITY_DONE:
+-      case ALPM_EVENT_LOAD_DONE:
++      case ALPM_EVENT_DATABASE_MISSING:
+       case ALPM_EVENT_DELTA_INTEGRITY_DONE:
+-      case ALPM_EVENT_DELTA_PATCHES_DONE:
+       case ALPM_EVENT_DELTA_PATCH_DONE:
++      case ALPM_EVENT_DELTA_PATCHES_DONE:
+       case ALPM_EVENT_DELTA_PATCH_FAILED:
+       case ALPM_EVENT_DISKSPACE_DONE:
+-      case ALPM_EVENT_DATABASE_MISSING:
+-      case ALPM_EVENT_KEYRING_DONE:
+-      case ALPM_EVENT_KEY_DOWNLOAD_START:
++      case ALPM_EVENT_FILECONFLICTS_DONE:
++      case ALPM_EVENT_HOOK_DONE:
++      case ALPM_EVENT_HOOK_RUN_DONE:
++      case ALPM_EVENT_HOOK_RUN_START:
++      case ALPM_EVENT_INTEGRITY_DONE:
++      case ALPM_EVENT_INTERCONFLICTS_DONE:
+       case ALPM_EVENT_KEY_DOWNLOAD_DONE:
++      case ALPM_EVENT_KEYRING_DONE:
++      case ALPM_EVENT_LOAD_DONE:
++      case ALPM_EVENT_PACNEW_CREATED:
++      case ALPM_EVENT_PACSAVE_CREATED:
++      case ALPM_EVENT_PKGDOWNLOAD_DONE:
++      case ALPM_EVENT_PKGDOWNLOAD_FAILED:
++      case ALPM_EVENT_PKGDOWNLOAD_START:
++      case ALPM_EVENT_RESOLVEDEPS_DONE:
++      case ALPM_EVENT_RETRIEVE_DONE:
++      case ALPM_EVENT_RETRIEVE_FAILED:
++      case ALPM_EVENT_TRANSACTION_DONE:
++      case ALPM_EVENT_TRANSACTION_START:
+               /* ignored */
+               break;
+ 
+From b2cdf195068cda12a2c5df1fcc29884ac6dab527 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Tue, 23 May 2017 14:27:54 +0200
+Subject: [PATCH 4/4] alpm: calculate progress for hooks
+---
+ backends/alpm/pk-alpm-transaction.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index a87a008a8..e8e513229 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -397,6 +397,17 @@ static void
+ pk_alpm_transaction_hook (PkBackendJob *job)
+ {
+       pk_backend_job_set_status (job, PK_STATUS_ENUM_RUN_HOOK);
++      pk_backend_job_set_percentage (job, 0);
++}
++
++static void
++pk_alpm_transaction_hook_run (PkBackendJob *job, alpm_event_hook_run_t * 
event)
++{
++      /* Every hook runs a single command, so there is no progress.
++         Instead calculate the progress from total and finished hooks. */
++      pk_backend_job_set_percentage (job, 100 * event->position / 
event->total);
++      syslog (LOG_DAEMON | LOG_WARNING, "Hook %s (%s) complete (%zu of %zu)",
++              event->name, event->desc, event->position, event->total);
+ }
+ 
+ static void
+@@ -710,6 +721,9 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_HOOK_START:
+               pk_alpm_transaction_hook (job);
+               break;
++      case ALPM_EVENT_HOOK_RUN_DONE:
++              pk_alpm_transaction_hook_run (job, (alpm_event_hook_run_t 
*)event);
++              break;
+       case ALPM_EVENT_CHECKDEPS_DONE:
+       case ALPM_EVENT_DATABASE_MISSING:
+       case ALPM_EVENT_DELTA_INTEGRITY_DONE:
+@@ -719,7 +733,6 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_DISKSPACE_DONE:
+       case ALPM_EVENT_FILECONFLICTS_DONE:
+       case ALPM_EVENT_HOOK_DONE:
+-      case ALPM_EVENT_HOOK_RUN_DONE:
+       case ALPM_EVENT_HOOK_RUN_START:
+       case ALPM_EVENT_INTEGRITY_DONE:
+       case ALPM_EVENT_INTERCONFLICTS_DONE:

Deleted: community-i686/PKGBUILD
===================================================================
--- community-i686/PKGBUILD     2017-06-02 12:16:54 UTC (rev 233410)
+++ community-i686/PKGBUILD     2017-06-02 12:16:57 UTC (rev 233411)
@@ -1,57 +0,0 @@
-# $Id$
-# Maintainer: Christian Hesse <[email protected]>
-# Contributor: Jonathan Conder <[email protected]>
-
-pkgname='packagekit'
-pkgver=1.1.5
-pkgrel=1
-pkgdesc='A system designed to make installation and updates of packages easier'
-arch=('i686' 'x86_64')
-url='http://www.packagekit.org/'
-license=('GPL')
-depends=('dbus-glib' 'pacman>=5.0.0' 'polkit' 'shared-mime-info' 'sqlite')
-makedepends=('gobject-introspection' 'gtk-doc' 'intltool'
-       'networkmanager' 'bash-completion' 'vala' 'autoconf-archive')
-optdepends=('networkmanager: detect connection status'
-       'bash-completion: command completion in bash')
-backup=('var/lib/PackageKit/transactions.db'
-       'etc/PackageKit/alpm.d/pacman.conf'
-       'etc/PackageKit/alpm.d/repos.list')
-validpgpkeys=(
-       '163EB50119225DB3DF8F49EA17ACBA8DFA970E17'      # Richard Hughes 
<[email protected]>
-       'EC60AABDF42AAE8FB062640480858FA38F62AF74')     # Kalev Lember 
<[email protected]>
-source=("https://www.freedesktop.org/software/PackageKit/releases/PackageKit-${pkgver}.tar.xz"{,.asc})
-sha256sums=('50f448ced5b460bd79ba0c97e9fe080153eaeecad909eee108284e3f5fc7b70c'
-            'SKIP')
-
-build() {
-       cd "${srcdir}/PackageKit-${pkgver}"
-
-       ./autogen.sh --prefix=/usr \
-               --sysconfdir=/etc \
-               --localstatedir=/var \
-               --libexecdir=/usr/lib/PackageKit \
-               --with-dbus-sys=/usr/share/dbus-1/system.d \
-               --disable-static \
-               --disable-gtk-doc \
-               --disable-local \
-               --disable-browser-plugin \
-               --disable-gstreamer-plugin \
-               --disable-gtk-module \
-               --disable-command-not-found \
-               --disable-cron \
-               --disable-dummy \
-               --enable-alpm
-       make
-}
-
-package() {
-       cd "${srcdir}/PackageKit-${pkgver}"
-
-       # install directory with root owner, polkit group and
-       # correct permission
-       install -d -o root -g 102 -m 750 "${pkgdir}/usr/share/polkit-1/rules.d"
-
-       make DESTDIR="${pkgdir}" install
-}
-

Copied: packagekit/repos/community-i686/PKGBUILD (from rev 233410, 
packagekit/trunk/PKGBUILD)
===================================================================
--- community-i686/PKGBUILD                             (rev 0)
+++ community-i686/PKGBUILD     2017-06-02 12:16:57 UTC (rev 233411)
@@ -0,0 +1,65 @@
+# $Id$
+# Maintainer: Christian Hesse <[email protected]>
+# Contributor: Jonathan Conder <[email protected]>
+
+pkgname='packagekit'
+pkgver=1.1.5
+pkgrel=2
+pkgdesc='A system designed to make installation and updates of packages easier'
+arch=('i686' 'x86_64')
+url='http://www.packagekit.org/'
+license=('GPL')
+depends=('dbus-glib' 'pacman>=5.0.0' 'polkit' 'shared-mime-info' 'sqlite')
+makedepends=('gobject-introspection' 'gtk-doc' 'intltool'
+       'networkmanager' 'bash-completion' 'vala' 'autoconf-archive')
+optdepends=('networkmanager: detect connection status'
+       'bash-completion: command completion in bash')
+backup=('var/lib/PackageKit/transactions.db'
+       'etc/PackageKit/alpm.d/pacman.conf'
+       'etc/PackageKit/alpm.d/repos.list')
+validpgpkeys=(
+       '163EB50119225DB3DF8F49EA17ACBA8DFA970E17'      # Richard Hughes 
<[email protected]>
+       'EC60AABDF42AAE8FB062640480858FA38F62AF74')     # Kalev Lember 
<[email protected]>
+source=("https://www.freedesktop.org/software/PackageKit/releases/PackageKit-${pkgver}.tar.xz"{,.asc}
+       '0001-alpm-hooks.patch')
+sha256sums=('50f448ced5b460bd79ba0c97e9fe080153eaeecad909eee108284e3f5fc7b70c'
+            'SKIP'
+            '8fab87aae67dba198cb5e090c3b4e2f7a5e3725995274d2f255aec2bacf1d3d4')
+
+prepare() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       patch -Np1 < "${srcdir}"/0001-alpm-hooks.patch
+}
+
+build() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       ./autogen.sh --prefix=/usr \
+               --sysconfdir=/etc \
+               --localstatedir=/var \
+               --libexecdir=/usr/lib/PackageKit \
+               --with-dbus-sys=/usr/share/dbus-1/system.d \
+               --disable-static \
+               --disable-gtk-doc \
+               --disable-local \
+               --disable-browser-plugin \
+               --disable-gstreamer-plugin \
+               --disable-gtk-module \
+               --disable-command-not-found \
+               --disable-cron \
+               --disable-dummy \
+               --enable-alpm
+       make
+}
+
+package() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       # install directory with root owner, polkit group and
+       # correct permission
+       install -d -o root -g 102 -m 750 "${pkgdir}/usr/share/polkit-1/rules.d"
+
+       make DESTDIR="${pkgdir}" install
+}
+

Copied: packagekit/repos/community-x86_64/0001-alpm-hooks.patch (from rev 
233410, packagekit/trunk/0001-alpm-hooks.patch)
===================================================================
--- community-x86_64/0001-alpm-hooks.patch                              (rev 0)
+++ community-x86_64/0001-alpm-hooks.patch      2017-06-02 12:16:57 UTC (rev 
233411)
@@ -0,0 +1,235 @@
+From 826e8e12424260d50834f1beb8ecd2ad8eed3618 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Mon, 15 May 2017 23:26:41 +0200
+Subject: [PATCH 1/4] Add new status "Running hooks"
+---
+ lib/packagekit-glib2/pk-console-shared.c | 4 ++++
+ lib/packagekit-glib2/pk-enum.h           | 1 +
+ 2 files changed, 5 insertions(+)
+
+diff --git a/lib/packagekit-glib2/pk-console-shared.c 
b/lib/packagekit-glib2/pk-console-shared.c
+index d61f3a13e..5810e160a 100644
+--- a/lib/packagekit-glib2/pk-console-shared.c
++++ b/lib/packagekit-glib2/pk-console-shared.c
+@@ -324,6 +324,10 @@ pk_status_enum_to_localised_text (PkStatusEnum status)
+               /* TRANSLATORS: transaction state, we are copying package files 
before or after the transaction */
+               text = _("Copying files");
+               break;
++      case PK_STATUS_ENUM_RUN_HOOK:
++              /* TRANSLATORS: transaction state, we are running hooks before 
or after the transaction */
++              text = _("Running hooks");
++              break;
+       default:
+               g_warning ("status unrecognised: %s", pk_status_enum_to_string 
(status));
+       }
+diff --git a/lib/packagekit-glib2/pk-enum.h b/lib/packagekit-glib2/pk-enum.h
+index 4bf93df51..b52690f44 100644
+--- a/lib/packagekit-glib2/pk-enum.h
++++ b/lib/packagekit-glib2/pk-enum.h
+@@ -143,6 +143,7 @@ typedef enum {
+       PK_STATUS_ENUM_CHECK_EXECUTABLE_FILES,
+       PK_STATUS_ENUM_CHECK_LIBRARIES,
+       PK_STATUS_ENUM_COPY_FILES,
++      PK_STATUS_ENUM_RUN_HOOK,
+       PK_STATUS_ENUM_LAST
+ } PkStatusEnum;
+ 
+From 91d6a48511818840addb7ad06efea209c57717e7 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Tue, 23 May 2017 12:21:46 +0200
+Subject: [PATCH 2/4] alpm: use enum for upgrade/reinstall/downgrade
+---
+ backends/alpm/pk-alpm-transaction.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index 54bf8e6c4..674bb9d93 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -550,17 +550,17 @@ pk_alpm_transaction_upgrade_done (PkBackendJob *job, 
alpm_pkg_t *pkg,
+       const gchar *name, *pre, *post;
+ 
+       g_return_if_fail (pkg != NULL);
+-      g_return_if_fail (old != NULL || direction == 0);
++      g_return_if_fail (old != NULL || direction == ALPM_PACKAGE_REINSTALL);
+ 
+       name = alpm_pkg_get_name (pkg);
+-      if (direction != 0)
++      if (direction != ALPM_PACKAGE_REINSTALL)
+               pre = alpm_pkg_get_version (old);
+       post = alpm_pkg_get_version (pkg);
+ 
+-      if (direction > 0) {
++      if (direction == ALPM_PACKAGE_UPGRADE) {
+               alpm_logaction (priv->alpm, PK_LOG_PREFIX, "upgraded %s (%s -> 
%s)\n",
+                               name, pre, post);
+-      } else if (direction < 0) {
++      } else if (direction == ALPM_PACKAGE_DOWNGRADE) {
+               alpm_logaction (priv->alpm, PK_LOG_PREFIX,
+                               "downgraded %s (%s -> %s)\n", name, pre, post);
+       } else {
+@@ -569,7 +569,7 @@ pk_alpm_transaction_upgrade_done (PkBackendJob *job, 
alpm_pkg_t *pkg,
+       }
+       pk_alpm_pkg_emit (job, pkg, PK_INFO_ENUM_FINISHED);
+ 
+-      if (direction != 0)
++      if (direction != ALPM_PACKAGE_REINSTALL)
+               pk_alpm_transaction_process_new_optdepends (pkg, old);
+       pk_alpm_transaction_output_end ();
+ }
+@@ -665,13 +665,13 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+                                       pk_alpm_transaction_remove_done (job, 
e->oldpkg);
+                                       break;
+                               case ALPM_PACKAGE_UPGRADE:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, 1);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_UPGRADE);
+                                       break;
+                               case ALPM_PACKAGE_DOWNGRADE:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, -1);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_DOWNGRADE);
+                                       break;
+                               case ALPM_PACKAGE_REINSTALL:
+-                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, 0);
++                                      pk_alpm_transaction_upgrade_done (job, 
e->newpkg, e->oldpkg, ALPM_PACKAGE_REINSTALL);
+                                       break;
+                       }
+               }
+From e88e481ddd8a0dbf53d14d3336d220a7bd437f00 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Mon, 15 May 2017 23:46:56 +0200
+Subject: [PATCH 3/4] alpm: clean up status, add handling for hooks
+---
+ backends/alpm/pk-alpm-transaction.c | 43 +++++++++++++++++++++++++++----------
+ 1 file changed, 32 insertions(+), 11 deletions(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index 674bb9d93..a87a008a8 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -394,6 +394,12 @@ pk_alpm_transaction_dep_resolve (PkBackendJob *job)
+ }
+ 
+ static void
++pk_alpm_transaction_hook (PkBackendJob *job)
++{
++      pk_backend_job_set_status (job, PK_STATUS_ENUM_RUN_HOOK);
++}
++
++static void
+ pk_alpm_transaction_test_commit (PkBackendJob *job)
+ {
+       pk_backend_job_set_status (job, PK_STATUS_ENUM_TEST_COMMIT);
+@@ -630,10 +636,10 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_RESOLVEDEPS_START:
+               pk_alpm_transaction_dep_resolve (job);
+               break;
+-      case ALPM_EVENT_FILECONFLICTS_START:
+-      case ALPM_EVENT_INTERCONFLICTS_START:
+       case ALPM_EVENT_DELTA_INTEGRITY_START:
+       case ALPM_EVENT_DISKSPACE_START:
++      case ALPM_EVENT_FILECONFLICTS_START:
++      case ALPM_EVENT_INTERCONFLICTS_START:
+               pk_alpm_transaction_test_commit (job);
+               break;
+       case ALPM_EVENT_PACKAGE_OPERATION_START:
+@@ -690,6 +696,7 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_SCRIPTLET_INFO:
+               pk_alpm_transaction_output (((alpm_event_scriptlet_info_t *) 
event)->line);
+               break;
++      case ALPM_EVENT_KEY_DOWNLOAD_START:
+       case ALPM_EVENT_RETRIEVE_START:
+               pk_alpm_transaction_download (job);
+               break;
+@@ -700,21 +707,35 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+                       pk_alpm_transaction_optdepend_removal (job, e->pkg, 
e->optdep);
+               }
+               break;
++      case ALPM_EVENT_HOOK_START:
++              pk_alpm_transaction_hook (job);
++              break;
+       case ALPM_EVENT_CHECKDEPS_DONE:
+-      case ALPM_EVENT_FILECONFLICTS_DONE:
+-      case ALPM_EVENT_RESOLVEDEPS_DONE:
+-      case ALPM_EVENT_INTERCONFLICTS_DONE:
+-      case ALPM_EVENT_INTEGRITY_DONE:
+-      case ALPM_EVENT_LOAD_DONE:
++      case ALPM_EVENT_DATABASE_MISSING:
+       case ALPM_EVENT_DELTA_INTEGRITY_DONE:
+-      case ALPM_EVENT_DELTA_PATCHES_DONE:
+       case ALPM_EVENT_DELTA_PATCH_DONE:
++      case ALPM_EVENT_DELTA_PATCHES_DONE:
+       case ALPM_EVENT_DELTA_PATCH_FAILED:
+       case ALPM_EVENT_DISKSPACE_DONE:
+-      case ALPM_EVENT_DATABASE_MISSING:
+-      case ALPM_EVENT_KEYRING_DONE:
+-      case ALPM_EVENT_KEY_DOWNLOAD_START:
++      case ALPM_EVENT_FILECONFLICTS_DONE:
++      case ALPM_EVENT_HOOK_DONE:
++      case ALPM_EVENT_HOOK_RUN_DONE:
++      case ALPM_EVENT_HOOK_RUN_START:
++      case ALPM_EVENT_INTEGRITY_DONE:
++      case ALPM_EVENT_INTERCONFLICTS_DONE:
+       case ALPM_EVENT_KEY_DOWNLOAD_DONE:
++      case ALPM_EVENT_KEYRING_DONE:
++      case ALPM_EVENT_LOAD_DONE:
++      case ALPM_EVENT_PACNEW_CREATED:
++      case ALPM_EVENT_PACSAVE_CREATED:
++      case ALPM_EVENT_PKGDOWNLOAD_DONE:
++      case ALPM_EVENT_PKGDOWNLOAD_FAILED:
++      case ALPM_EVENT_PKGDOWNLOAD_START:
++      case ALPM_EVENT_RESOLVEDEPS_DONE:
++      case ALPM_EVENT_RETRIEVE_DONE:
++      case ALPM_EVENT_RETRIEVE_FAILED:
++      case ALPM_EVENT_TRANSACTION_DONE:
++      case ALPM_EVENT_TRANSACTION_START:
+               /* ignored */
+               break;
+ 
+From b2cdf195068cda12a2c5df1fcc29884ac6dab527 Mon Sep 17 00:00:00 2001
+From: Christian Hesse <[email protected]>
+Date: Tue, 23 May 2017 14:27:54 +0200
+Subject: [PATCH 4/4] alpm: calculate progress for hooks
+---
+ backends/alpm/pk-alpm-transaction.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/backends/alpm/pk-alpm-transaction.c 
b/backends/alpm/pk-alpm-transaction.c
+index a87a008a8..e8e513229 100644
+--- a/backends/alpm/pk-alpm-transaction.c
++++ b/backends/alpm/pk-alpm-transaction.c
+@@ -397,6 +397,17 @@ static void
+ pk_alpm_transaction_hook (PkBackendJob *job)
+ {
+       pk_backend_job_set_status (job, PK_STATUS_ENUM_RUN_HOOK);
++      pk_backend_job_set_percentage (job, 0);
++}
++
++static void
++pk_alpm_transaction_hook_run (PkBackendJob *job, alpm_event_hook_run_t * 
event)
++{
++      /* Every hook runs a single command, so there is no progress.
++         Instead calculate the progress from total and finished hooks. */
++      pk_backend_job_set_percentage (job, 100 * event->position / 
event->total);
++      syslog (LOG_DAEMON | LOG_WARNING, "Hook %s (%s) complete (%zu of %zu)",
++              event->name, event->desc, event->position, event->total);
+ }
+ 
+ static void
+@@ -710,6 +721,9 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_HOOK_START:
+               pk_alpm_transaction_hook (job);
+               break;
++      case ALPM_EVENT_HOOK_RUN_DONE:
++              pk_alpm_transaction_hook_run (job, (alpm_event_hook_run_t 
*)event);
++              break;
+       case ALPM_EVENT_CHECKDEPS_DONE:
+       case ALPM_EVENT_DATABASE_MISSING:
+       case ALPM_EVENT_DELTA_INTEGRITY_DONE:
+@@ -719,7 +733,6 @@ pk_alpm_transaction_event_cb (alpm_event_t *event)
+       case ALPM_EVENT_DISKSPACE_DONE:
+       case ALPM_EVENT_FILECONFLICTS_DONE:
+       case ALPM_EVENT_HOOK_DONE:
+-      case ALPM_EVENT_HOOK_RUN_DONE:
+       case ALPM_EVENT_HOOK_RUN_START:
+       case ALPM_EVENT_INTEGRITY_DONE:
+       case ALPM_EVENT_INTERCONFLICTS_DONE:

Deleted: community-x86_64/PKGBUILD
===================================================================
--- community-x86_64/PKGBUILD   2017-06-02 12:16:54 UTC (rev 233410)
+++ community-x86_64/PKGBUILD   2017-06-02 12:16:57 UTC (rev 233411)
@@ -1,57 +0,0 @@
-# $Id$
-# Maintainer: Christian Hesse <[email protected]>
-# Contributor: Jonathan Conder <[email protected]>
-
-pkgname='packagekit'
-pkgver=1.1.5
-pkgrel=1
-pkgdesc='A system designed to make installation and updates of packages easier'
-arch=('i686' 'x86_64')
-url='http://www.packagekit.org/'
-license=('GPL')
-depends=('dbus-glib' 'pacman>=5.0.0' 'polkit' 'shared-mime-info' 'sqlite')
-makedepends=('gobject-introspection' 'gtk-doc' 'intltool'
-       'networkmanager' 'bash-completion' 'vala' 'autoconf-archive')
-optdepends=('networkmanager: detect connection status'
-       'bash-completion: command completion in bash')
-backup=('var/lib/PackageKit/transactions.db'
-       'etc/PackageKit/alpm.d/pacman.conf'
-       'etc/PackageKit/alpm.d/repos.list')
-validpgpkeys=(
-       '163EB50119225DB3DF8F49EA17ACBA8DFA970E17'      # Richard Hughes 
<[email protected]>
-       'EC60AABDF42AAE8FB062640480858FA38F62AF74')     # Kalev Lember 
<[email protected]>
-source=("https://www.freedesktop.org/software/PackageKit/releases/PackageKit-${pkgver}.tar.xz"{,.asc})
-sha256sums=('50f448ced5b460bd79ba0c97e9fe080153eaeecad909eee108284e3f5fc7b70c'
-            'SKIP')
-
-build() {
-       cd "${srcdir}/PackageKit-${pkgver}"
-
-       ./autogen.sh --prefix=/usr \
-               --sysconfdir=/etc \
-               --localstatedir=/var \
-               --libexecdir=/usr/lib/PackageKit \
-               --with-dbus-sys=/usr/share/dbus-1/system.d \
-               --disable-static \
-               --disable-gtk-doc \
-               --disable-local \
-               --disable-browser-plugin \
-               --disable-gstreamer-plugin \
-               --disable-gtk-module \
-               --disable-command-not-found \
-               --disable-cron \
-               --disable-dummy \
-               --enable-alpm
-       make
-}
-
-package() {
-       cd "${srcdir}/PackageKit-${pkgver}"
-
-       # install directory with root owner, polkit group and
-       # correct permission
-       install -d -o root -g 102 -m 750 "${pkgdir}/usr/share/polkit-1/rules.d"
-
-       make DESTDIR="${pkgdir}" install
-}
-

Copied: packagekit/repos/community-x86_64/PKGBUILD (from rev 233410, 
packagekit/trunk/PKGBUILD)
===================================================================
--- community-x86_64/PKGBUILD                           (rev 0)
+++ community-x86_64/PKGBUILD   2017-06-02 12:16:57 UTC (rev 233411)
@@ -0,0 +1,65 @@
+# $Id$
+# Maintainer: Christian Hesse <[email protected]>
+# Contributor: Jonathan Conder <[email protected]>
+
+pkgname='packagekit'
+pkgver=1.1.5
+pkgrel=2
+pkgdesc='A system designed to make installation and updates of packages easier'
+arch=('i686' 'x86_64')
+url='http://www.packagekit.org/'
+license=('GPL')
+depends=('dbus-glib' 'pacman>=5.0.0' 'polkit' 'shared-mime-info' 'sqlite')
+makedepends=('gobject-introspection' 'gtk-doc' 'intltool'
+       'networkmanager' 'bash-completion' 'vala' 'autoconf-archive')
+optdepends=('networkmanager: detect connection status'
+       'bash-completion: command completion in bash')
+backup=('var/lib/PackageKit/transactions.db'
+       'etc/PackageKit/alpm.d/pacman.conf'
+       'etc/PackageKit/alpm.d/repos.list')
+validpgpkeys=(
+       '163EB50119225DB3DF8F49EA17ACBA8DFA970E17'      # Richard Hughes 
<[email protected]>
+       'EC60AABDF42AAE8FB062640480858FA38F62AF74')     # Kalev Lember 
<[email protected]>
+source=("https://www.freedesktop.org/software/PackageKit/releases/PackageKit-${pkgver}.tar.xz"{,.asc}
+       '0001-alpm-hooks.patch')
+sha256sums=('50f448ced5b460bd79ba0c97e9fe080153eaeecad909eee108284e3f5fc7b70c'
+            'SKIP'
+            '8fab87aae67dba198cb5e090c3b4e2f7a5e3725995274d2f255aec2bacf1d3d4')
+
+prepare() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       patch -Np1 < "${srcdir}"/0001-alpm-hooks.patch
+}
+
+build() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       ./autogen.sh --prefix=/usr \
+               --sysconfdir=/etc \
+               --localstatedir=/var \
+               --libexecdir=/usr/lib/PackageKit \
+               --with-dbus-sys=/usr/share/dbus-1/system.d \
+               --disable-static \
+               --disable-gtk-doc \
+               --disable-local \
+               --disable-browser-plugin \
+               --disable-gstreamer-plugin \
+               --disable-gtk-module \
+               --disable-command-not-found \
+               --disable-cron \
+               --disable-dummy \
+               --enable-alpm
+       make
+}
+
+package() {
+       cd "${srcdir}/PackageKit-${pkgver}"
+
+       # install directory with root owner, polkit group and
+       # correct permission
+       install -d -o root -g 102 -m 750 "${pkgdir}/usr/share/polkit-1/rules.d"
+
+       make DESTDIR="${pkgdir}" install
+}
+

Reply via email to