From 72aff6c8a35b369c28f47e0fe7bae2378303fc11 Mon Sep 17 00:00:00 2001
From: "deepin-community-bot[bot]"
<156989552+deepin-community-bot[bot]@users.noreply.github.com>
Date: Fri, 17 Jul 2026 09:44:14 +0000
Subject: [PATCH] feat: update packagekit to 1.3.1-1+deb13u1
---
.cirrus.yml | 18 +-
NEWS | 110 ++
PackageKit.doap | 11 +-
README => README.md | 10 +-
RELEASE | 22 +-
backends/alpm/meson.build | 2 +-
backends/alpm/pk-alpm-config.c | 17 +-
backends/alpm/pk-alpm-sync.c | 3 +-
backends/alpm/pk-alpm-transaction.c | 17 +-
backends/alpm/pk-alpm-update.c | 9 +-
backends/alpm/pk-backend-alpm.c | 2 +
backends/apt/20packagekit | 4 +-
backends/apt/acqpkitstatus.cpp | 4 +-
backends/apt/apt-job.cpp | 60 +-
backends/apt/apt-sourceslist.cpp | 458 ++++--
backends/apt/apt-sourceslist.h | 39 +-
backends/apt/apt-utils.cpp | 3 +-
backends/apt/deb822.cpp | 305 ++++
backends/apt/deb822.h | 74 +
backends/apt/gst-matcher.cpp | 10 +-
backends/apt/meson.build | 45 +-
backends/apt/pk-backend-apt.cpp | 38 +-
backends/apt/pk-debconf-helper.c | 36 +-
backends/apt/pkg-list.cpp | 10 +-
backends/apt/tests/apt-tests.cpp | 478 ++++++
backends/apt/tests/definitions.cpp | 207 +++
backends/apt/tests/meson.build | 25 +
.../apt/tests/testdata/sources/debian.sources | 17 +
.../testdata/sources/ignorethis.list.save | 1 +
.../apt/tests/testdata/sources/mozilla.list | 3 +
.../dnf/dnf-backend-vendor-openmandriva.c | 3 +-
backends/dnf/dnf-backend.c | 14 +-
backends/dnf/meson.build | 28 +
backends/dnf/notify_packagekit.conf | 3 +
backends/dnf/notify_packagekit.cpp | 101 ++
backends/dnf/pk-backend-dnf.c | 69 +-
backends/entropy/meson.build | 2 +-
backends/freebsd/PackageDatabase.hpp | 3 +
backends/freebsd/PackageView.hpp | 12 +-
backends/freebsd/meson.build | 2 +-
backends/freebsd/pk-backend-freebsd.cpp | 1 +
backends/nix/meson.build | 2 +-
backends/portage/meson.build | 2 +-
backends/slack/meson.build | 2 +-
backends/zypp/meson.build | 4 +-
backends/zypp/pk-backend-zypp.cpp | 63 +-
client/pk-console.c | 213 ++-
client/pk-monitor.c | 8 +
client/pk-offline-update.c | 25 +-
contrib/meson.build | 4 +-
data/org.freedesktop.packagekit.metainfo.xml | 18 +-
debian/changelog | 44 +-
debian/control | 1 -
debian/libpackagekit-glib2-18.symbols | 1 +
debian/org.freedesktop.packagekit.pkla | 6 -
debian/packagekit.install | 1 -
debian/patches/01_strlen-cmp-memfix.patch | 57 -
debian/patches/02_identify-ubuntu.patch | 38 -
...t_call_dbus_on_ostree_booted_systems.patch | 17 -
debian/patches/series | 3 -
docs/api/dbus/meson.build | 4 +-
docs/html/pk-help.html | 3 +-
docs/html/pk-matrix.html | 11 +
lib/packagekit-glib2/meson.build | 1 +
lib/packagekit-glib2/pk-category.c | 161 +-
lib/packagekit-glib2/pk-client-helper.c | 4 +-
lib/packagekit-glib2/pk-client.c | 725 ++++-----
lib/packagekit-glib2/pk-control.c | 1352 ++++++---------
lib/packagekit-glib2/pk-control.h | 2 +-
lib/packagekit-glib2/pk-enum.c | 24 +-
lib/packagekit-glib2/pk-enum.h | 52 +-
lib/packagekit-glib2/pk-package-sack.c | 160 +-
lib/packagekit-glib2/pk-package.c | 334 ++--
lib/packagekit-glib2/pk-progress-bar.c | 20 +-
lib/packagekit-glib2/pk-progress-private.h | 38 +
lib/packagekit-glib2/pk-progress.c | 467 ++++--
lib/packagekit-glib2/pk-progress.h | 1 -
lib/packagekit-glib2/pk-task.c | 1232 +++++++-------
lib/python/packagekit/meson.build | 2 +-
meson.build | 120 +-
meson_options.txt | 140 +-
po/POTFILES.in | 1 +
po/ar.po | 38 +-
po/be.po | 1446 +++++++++++++++++
po/cs.po | 19 +-
po/de.po | 6 +-
po/en_GB.po | 6 +-
po/es.po | 28 +-
po/eu.po | 6 +-
po/fi.po | 13 +-
po/he.po | 36 +-
po/hi.po | 737 +++++++--
po/id.po | 34 +-
po/ja.po | 96 +-
po/ko.po | 6 +-
po/lt.po | 145 +-
po/meson.build | 4 +-
po/pl.po | 32 +-
po/pt.po | 7 +-
po/pt_BR.po | 56 +-
po/ro.po | 277 ++--
po/ru.po | 5 +
po/sl.po | 5 +
po/sq.po | 65 +
po/sv.po | 36 +-
po/tr.po | 80 +-
po/uk.po | 32 +-
po/zh_TW.po | 33 +
policy/meson.build | 2 +-
src/meson.build | 6 +-
src/org.freedesktop.PackageKit.xml | 81 +
src/pk-backend.c | 8 +
src/pk-dbus.c | 11 +-
src/pk-engine.c | 139 +-
src/pk-transaction.c | 4 +-
src/run-pk.sh | 9 +-
tests/ci/Dockerfile-debian | 36 +-
tests/ci/Dockerfile-fedora | 11 +-
tests/ci/build-and-test.sh | 12 +-
119 files changed, 7716 insertions(+), 3490 deletions(-)
rename README => README.md (58%)
create mode 100644 backends/apt/deb822.cpp
create mode 100644 backends/apt/deb822.h
create mode 100644 backends/apt/tests/apt-tests.cpp
create mode 100644 backends/apt/tests/definitions.cpp
create mode 100644 backends/apt/tests/meson.build
create mode 100644 backends/apt/tests/testdata/sources/debian.sources
create mode 100644 backends/apt/tests/testdata/sources/ignorethis.list.save
create mode 100644 backends/apt/tests/testdata/sources/mozilla.list
create mode 100644 backends/dnf/notify_packagekit.conf
create mode 100644 backends/dnf/notify_packagekit.cpp
delete mode 100644 debian/org.freedesktop.packagekit.pkla
delete mode 100644 debian/patches/01_strlen-cmp-memfix.patch
delete mode 100644 debian/patches/02_identify-ubuntu.patch
delete mode 100644 debian/patches/03_not_call_dbus_on_ostree_booted_systems.patch
create mode 100644 lib/packagekit-glib2/pk-progress-private.h
create mode 100644 po/be.po
diff --git a/.cirrus.yml b/.cirrus.yml
index 52acf0b..44c2633 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -1,20 +1,20 @@
task:
- name: "Build (freebsd)"
+ name: "Build & Test (freebsd)"
freebsd_instance:
matrix:
- - image_family: freebsd-13-2-snap
+ - image_family: freebsd-14-2
deps_script:
- env ASSUME_ALWAYS_YES=yes pkg update -f
- env ASSUME_ALWAYS_YES=yes pkg install -y docbook-xsl vala libxslt fontconfig polkit consolekit2
desktop-file-utils gettext meson ninja python3 glib gtk3 pkgconf sqlite3 gobject-introspection
- dbus
+ dbus bash
build_script:
- meson --auto-features=enabled -Db_colorout=never --buildtype debug -Dlocal_checkout=true -Dlocalstatedir=/var
-Dsystemd=false -Doffline_update=false -Dbash_completion=false -Dbash_command_not_found=false
- -Dgstreamer_plugin=false _build
+ -Dgstreamer_plugin=false -Dpackaging_backend=freebsd _build
- cd _build
- - ninja -v all
- #test_script:
- # - cd _build
- # - service dbus onestart
- # - ninja test
+ - ninja all
+ test_script:
+ - cd _build
+ - service dbus onestart
+ - ninja test
diff --git a/NEWS b/NEWS
index f680c76..a2f6ec0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,113 @@
+Version 1.3.1
+~~~~~~~~~~~~~
+Released: 2025-06-16
+
+Features:
+ * Add GetResults method to the Offline interface (Gleb Popov)
+
+Backends:
+ * apt: Fix matching gstreamer pkgs where the only modifier is ()(64bit) (Alessandro Astone)
+ * apt: Add tests for gst-matcher (Alessandro Astone)
+ * apt: Define an apt backend static library (Corentin Noël)
+ * apt: Adjust for libapt-pkg7.0 API (Julian Andres Klode)
+ * apt: Fix floating point value comparison (Matthias Klumpp)
+ * apt: Drop remnants of RPM sources support (Matthias Klumpp)
+ * apt: Add tests for repo-source reading (Matthias Klumpp)
+ * apt: Add non-destructive Deb822 file parser & streamline sources parsing (Matthias Klumpp)
+ * apt: Implement enable/disable support for deb822-style repo sources (Matthias Klumpp)
+ * apt: Harmonize repo-ids between deb822 and legacy sources (Matthias Klumpp)
+ * apt: Use 'pk_backend_job_details_full()' so download size is reported properly (sid)
+ * apt: not call dbus on ostree-managed systems (ssk-wh)
+ * alpm: fix mixed declarations and code (Christian Hesse)
+ * alpm: fix function declaration prototype (Christian Hesse)
+ * alpm: Use 'alpm_errno()' rather than incorrect 'errno' for libalpm errors (sid)
+ * alpm: Fix 'pk_alpm_logcb' printf format warning (sid)
+ * dnf5: Compile against both libdnf5 version 5.1.x and 5.2.x (Alessandro Astone)
+ * dnf: Make a bunch of implicit enum conversions explicit (Matthias Klumpp)
+ * dnf: OpenMandriva: small repo changes (Virtuti Militari)
+ * entropy/portage: Fix missing 'comma' in meson.install_data () (sidt4)
+ * freebsd: Use correct types for PackageView::{compressed,flat}size() (Gleb Popov)
+ * zypp: Mark the correct packages to-be-installed (Jonathan Kang)
+ * zypp: Raise exception on empty search string (Miika Alikirri)
+ * zypp: Fix -Werror=missing-declarations by making functions static (sid)
+ * zypp: Add G_GNUC_UNUSED to unused function 'zypp_get_packages_by_file' (sid)
+ * zypp: Fix '-Wignored-qualifiers' by removing 'const' (sid)
+ * zypp: Use 'G_GNUC_PRINTF' attribute to 'zypp_backend_finished_error' and fixup warnings (sid)
+ * zypp: Disable deprecation errors in zypp backend temporarily (sid)
+
+Bugfixes:
+ * pk-client-helper: Do not crash on edge-case GIO error (Alessandro Astone)
+ * pk-client: Allow debconf helper to display Wayland windows (Alessandro Astone)
+ * pk-task: pk_task_user_accepted/declined_idle_cb actually take an unowned gtask (Corentin Noël)
+ * PkClient: Use g_atomic_int for the copy count (Corentin Noël)
+ * PkClient: Remove the proxy_props field (Corentin Noël)
+ * PkClient: Fix mismatch between remaining and elapsed time (Corentin Noël)
+ * pk_dbus_get_session: Move ConsoleKit check under the appropriate ifdef case (Gleb Popov)
+ * Fix check in pk_engine_proxy_logind_cb (Gleb Popov)
+ * meson: Explicitly specify native argument when adding C++ compiler (Matthias Klumpp)
+ * pk-client: Fix runtime warning when backend does not support role (Milan Crha)
+
+Miscellaneous:
+ * Allow changing offline update action without polkit authentication (Alessandro Astone)
+ * pk-task: Modernize the codebase (Corentin Noël)
+ * PkPackage: Modernize the codebase (Corentin Noël)
+ * PkControl: Modernize the codebase (Corentin Noël)
+ * PkProgress: Move the progress_callback from PkClientState to PkProgress (Corentin Noël)
+ * Decouple offline_update and systemd Meson features (Gleb Popov)
+ * Decouple pk-backend from HAVE_SYSTEMD_SD_LOGIN_H (Gleb Popov)
+ * ci: Build on Debian trixie & latest Fedora (Matthias Klumpp)
+ * ci: Speed up build tests on Debian (Matthias Klumpp)
+ * ci: Add ALPM & ZYPP backends to Fedora CI (sid)
+ * meson: Remove deprecated functions & bump to 1.0 (Matthias Klumpp)
+ * Compile with C11 + GNU extensions (Matthias Klumpp)
+ * meson: Bring back maintainer mode for stricter checks (Matthias Klumpp)
+ * doap: Update the maintainer list to current maintainers (Neal Gompa)
+ * pkcon: Sort commands in 'pkcon' help output (sid)
+
+Version 1.3.0
+~~~~~~~~~~~~~
+Released: 2024-06-16
+
+New Features:
+ * Expand PkInfoEnum to contain package target states for updates (Matthias Klumpp)
+ * lib: Notify when installed database changed (Milan Crha)
+
+Backends:
+ * freebsd: Initialize libpkg plugins when doing work (Gleb Popov)
+ * freebsd: Advertise PK_GROUP_ENUM_VIRTUALIZATION package group (Gleb Popov)
+ * dnf: Free DNF sacks when they are unused for 10 minutes (Gordon Messmer)
+ * dnf5: Add dnf5 posttrans notify plugin (Alessandro Astone)
+ * dnf/zypp: Add support for language(ll_CC) to what-provides queries (Philip Withnall)
+ * alpm: add compatibility with libalpm 14 (Jelle van der Waa)
+ * apt: Don't accidentally identify Ubuntu as Debian (Matthias Klumpp)
+ * apt: Don't limit by-repo-name update classification to Debian and Ubuntu (Matthias Klumpp)
+ * apt: debconf-helper: Cleanup properly when exiting (Matthias Klumpp)
+ * apt: Use the correct version number when parsing changelogs (Matthias Klumpp)
+ * apt: Prefer deb version comparison to strcmp (sid)
+
+Bugfixes:
+ * Apply i18n for percentage values (Emir SARI)
+ * metainfo: Mark PK as compulsory for most desktops (Matthias Klumpp)
+ * pk-progress: Fix a leak of package ID (Philip Withnall)
+ * Check string length correctly to prevent memory over-consumption [RHEL-19527] (Thibault Guittet)
+ * pk-offline-update: Fix crash due to invalid g_auto declaration in switch / case (sid)
+ * PkPackage: Handle all cases for 'update-severity' property (sid)
+ * pkcon: Use appropriate callbacks for client / task async calls (sid)
+ * Fix 'g-ir-scanner' matching async / finish warning (sid)
+ * pk-offline-update: Fix crash during error cases (sid)
+ * PkControl: Fix crash with 'get-time' transaction (sid)
+ * PkTask: Fix invalid cast from 'GsPackagekitTask' to 'GTask' (sidt4)
+
+Miscellaneous:
+ * PkPackageSack: Replace the GSimpleAsyncResult with the GTask API (Corentin Noël)
+ * PkControl: Replace the GSimpleAsyncResult with the GTask API (Corentin Noël)
+ * PkTask: Replace the GSimpleAsyncResult with the GTask API (Corentin Noël)
+ * PkClient, PkProgress, PkCategory: Use a more modern GObject style (Corentin Noël)
+ * Enable building FreeBSD backend on FreeBSD CI (Gleb Popov)
+ * Convert README to Markdown (Matthias Klumpp)
+ * pk-matrix.html: Document which backends support InstalledChanged signal (Milan Crha)
+ * docs: Update real-time chat room to point to the new Matrix room (Neal Gompa)
+
Version 1.2.8
~~~~~~~~~~~~~
Released: 2023-11-08
diff --git a/PackageKit.doap b/PackageKit.doap
index ab26251..1456f58 100644
--- a/PackageKit.doap
+++ b/PackageKit.doap
@@ -15,8 +15,15 @@
- Richard Hughes
-
+ Neal Gompa
+
+
+
+
+
+
+ Matthias Klumpp
+
diff --git a/README b/README.md
similarity index 58%
rename from README
rename to README.md
index 96359c4..2603fa9 100644
--- a/README
+++ b/README.md
@@ -1,8 +1,12 @@
- PackageKit
- A DBUS packaging abstraction layer
+PackageKit
+==========
+
-PackageKit is a DBUS abstraction layer that allows the session user to manage
+A DBus packaging abstraction layer
+
+PackageKit is a DBus abstraction layer that allows the session user to manage
packages in a secure way using a cross-distro, cross-architecture API.
For more information, please see https://www.freedesktop.org/software/PackageKit/
+
Download releases at: https://www.freedesktop.org/software/PackageKit/releases/
diff --git a/RELEASE b/RELEASE
index 7743425..4929851 100644
--- a/RELEASE
+++ b/RELEASE
@@ -2,18 +2,16 @@ PackageKit Release Notes
1. Write NEWS entries for PackageKit in the same format as usual.
-git shortlog v1.2.7.. | grep -i -v trivial | grep -v Merge > NEWS.new
+git shortlog v1.3.0.. | grep -i -v trivial | grep -v Merge > NEWS.new
--------------------------------------------------------------------------------
-Version 1.2.8
+Version 1.3.1
~~~~~~~~~~~~~
-Released: 2023-xx-xx
+Released: 2024-xx-xx
Notes:
-New Features:
-
-Libraries:
+Features:
Backends:
@@ -35,8 +33,8 @@ git add ../po/*.po
4. Commit changes in PackageKit git:
# MAKE SURE THESE ARE CORRECT
-export release_version="1.2.8"
-export release_tag="v1.2.8"
+export release_version="1.3.1"
+export release_tag="v1.3.1"
git commit -a -m "Release ${release_version}"
git tag -s -f -m "Release ${release_version}" "${release_tag}"
@@ -45,12 +43,10 @@ git push
git push git+ssh://hughsient@git.freedesktop.org/git/packagekit
git push --tags git+ssh://hughsient@git.freedesktop.org/git/packagekit
-5. run 'ninja dist'
+5. run 'meson dist'
-5a. Generate the additon verification metadata
+5a. Sign the release
-sha1sum meson-dist/PackageKit-${release_version}.tar.xz > meson-dist/PackageKit-${release_version}.tar.xz.sha1
-sha256sum meson-dist/PackageKit-${release_version}.tar.xz > meson-dist/PackageKit-${release_version}.tar.xz.sha256
gpg -b -a meson-dist/PackageKit-${release_version}.tar.xz
6. Upload tarball to:
@@ -67,7 +63,7 @@ git push
9. Send an email to packagekit@lists.freedesktop.org
=================================================
-PackageKit 1.2.8 released!
+PackageKit 1.3.1 released!
Tarballs available here: https://www.freedesktop.org/software/PackageKit/releases/
diff --git a/backends/alpm/meson.build b/backends/alpm/meson.build
index eb4d5b3..d5838c3 100644
--- a/backends/alpm/meson.build
+++ b/backends/alpm/meson.build
@@ -1,4 +1,4 @@
-alpm_dep = dependency('libalpm', version: '>=13.0.0')
+alpm_dep = dependency('libalpm', version: '>=15.0.0')
shared_module(
'pk_backend_alpm',
diff --git a/backends/alpm/pk-alpm-config.c b/backends/alpm/pk-alpm-config.c
index c96b4e1..a7997e3 100644
--- a/backends/alpm/pk-alpm-config.c
+++ b/backends/alpm/pk-alpm-config.c
@@ -605,13 +605,24 @@ pk_alpm_config_parse (PkAlpmConfig *config, const gchar *filename,
continue;
}
- if (g_strcmp0 (key, "Usage") == 0 && str != NULL) {
- /* Ignore "Usage" key instead of crashing */
+ /* ignore these instead of crashing */
+ if (g_strcmp0 (key, "CacheServer") == 0 && str != NULL) {
+ continue;
+ }
+
+ if (g_strcmp0 (key, "DisableSandbox") == 0) {
+ continue;
+ }
+
+ if (g_strcmp0 (key, "DownloadUser") == 0 && str != NULL) {
continue;
}
if (g_strcmp0 (key, "ParallelDownloads") == 0 && str != NULL) {
- /* Ignore "ParallelDownloads" key instead of crashing */
+ continue;
+ }
+
+ if (g_strcmp0 (key, "Usage") == 0 && str != NULL) {
continue;
}
diff --git a/backends/alpm/pk-alpm-sync.c b/backends/alpm/pk-alpm-sync.c
index 1912873..64ab1c2 100644
--- a/backends/alpm/pk-alpm-sync.c
+++ b/backends/alpm/pk-alpm-sync.c
@@ -44,6 +44,7 @@ pk_alpm_transaction_sync_targets (PkBackendJob *job, const gchar **packages, gbo
g_auto(GStrv) package = pk_package_id_split (*packages);
gchar *repo = package[PK_PACKAGE_ID_DATA];
gchar *name = package[PK_PACKAGE_ID_NAME];
+ alpm_pkg_t *dep_to_remove;
const alpm_list_t *i = alpm_get_syncdbs (priv->alpm);
alpm_pkg_t *pkg;
@@ -61,7 +62,7 @@ pk_alpm_transaction_sync_targets (PkBackendJob *job, const gchar **packages, gbo
}
pkg = alpm_db_get_pkg (i->data, name);
- alpm_pkg_t *dep_to_remove = pk_alpm_pkg_replaces(priv->localdb, pkg);
+ dep_to_remove = pk_alpm_pkg_replaces(priv->localdb, pkg);
if (dep_to_remove) {
g_debug("scheduling to remove %s for %s", alpm_pkg_get_name(dep_to_remove), name);
alpm_remove_pkg(priv->alpm, dep_to_remove);
diff --git a/backends/alpm/pk-alpm-transaction.c b/backends/alpm/pk-alpm-transaction.c
index 58f9960..2ff5d33 100644
--- a/backends/alpm/pk-alpm-transaction.c
+++ b/backends/alpm/pk-alpm-transaction.c
@@ -361,7 +361,7 @@ pk_alpm_transaction_conv_cb (void *ctx, alpm_question_t *question)
}
static void
-pk_alpm_transaction_output_end ()
+pk_alpm_transaction_output_end (void)
{
tpkg = NULL;
@@ -865,16 +865,19 @@ pk_alpm_conflict_build_list (const alpm_list_t *i)
alpm_conflict_t *conflict = (alpm_conflict_t *) i->data;
alpm_depend_t *depend = conflict->reason;
- if (g_strcmp0 (conflict->package1, depend->name) == 0 ||
- g_strcmp0 (conflict->package2, depend->name) == 0) {
+ const char *package_name1 = alpm_pkg_get_name (conflict->package1);
+ const char *package_name2 = alpm_pkg_get_name (conflict->package2);
+
+ if (g_strcmp0 (package_name1, depend->name) == 0 ||
+ g_strcmp0 (package_name2, depend->name) == 0) {
g_string_append_printf (list, "%s <-> %s, ",
- conflict->package1,
- conflict->package2);
+ package_name1,
+ package_name2);
} else {
char *reason = alpm_dep_compute_string (depend);
g_string_append_printf (list, "%s <-> %s (%s), ",
- conflict->package1,
- conflict->package2, reason);
+ package_name1,
+ package_name2, reason);
free (reason);
}
}
diff --git a/backends/alpm/pk-alpm-update.c b/backends/alpm/pk-alpm-update.c
index 3695b3f..7976cc0 100644
--- a/backends/alpm/pk-alpm-update.c
+++ b/backends/alpm/pk-alpm-update.c
@@ -267,7 +267,7 @@ pk_alpm_refresh_databases (PkBackendJob *job, gint force, alpm_list_t *dbs, GErr
result = alpm_db_update (priv->alpm, dbs, force);
if (result < 0) {
g_set_error (error, PK_ALPM_ERROR, alpm_errno (priv->alpm), "failed to update database: %s",
- alpm_strerror (errno));
+ alpm_strerror (alpm_errno (priv->alpm)));
return FALSE;
}
@@ -285,6 +285,7 @@ pk_alpm_update_databases (PkBackendJob *job, gint force, GError **error)
PkBackend *backend = pk_backend_job_get_backend (job);
PkBackendAlpmPrivate *priv = pk_backend_get_user_data (backend);
alpm_list_t *i;
+ int ret;
if (!pk_alpm_transaction_initialize (job, 0, NULL, error))
return FALSE;
@@ -293,7 +294,7 @@ pk_alpm_update_databases (PkBackendJob *job, gint force, GError **error)
pk_backend_job_set_status (job, PK_STATUS_ENUM_DOWNLOAD_PACKAGELIST);
i = alpm_get_syncdbs (priv->alpm);
- int ret = pk_alpm_refresh_databases(job, force, i, error);
+ ret = pk_alpm_refresh_databases(job, force, i, error);
if (i == NULL)
return pk_alpm_transaction_end (job, error);
@@ -355,9 +356,10 @@ static int dep_vercmp(const char *version1, alpm_depmod_t mod,
alpm_pkg_t *
pk_alpm_pkg_replaces (alpm_db_t *db, alpm_pkg_t *pkg)
{
+ gboolean ret = FALSE;
+
g_return_val_if_fail (db != NULL, FALSE);
g_return_val_if_fail (pkg != NULL, FALSE);
- gboolean ret = FALSE;
for (alpm_list_t *list = alpm_pkg_get_replaces (pkg); list != NULL && !ret; list = list->next) {
alpm_depend_t *depend = list->data;
@@ -373,7 +375,6 @@ static alpm_pkg_t *
pk_alpm_pkg_find_update (alpm_pkg_t *pkg, const alpm_list_t *dbs)
{
const gchar *name;
- const alpm_list_t *i;
g_return_val_if_fail (pkg != NULL, NULL);
diff --git a/backends/alpm/pk-backend-alpm.c b/backends/alpm/pk-backend-alpm.c
index 6d86e57..2edee64 100644
--- a/backends/alpm/pk-backend-alpm.c
+++ b/backends/alpm/pk-backend-alpm.c
@@ -57,7 +57,9 @@ pk_alpm_logcb (void *ctx, alpm_loglevel_t level, const gchar *format, va_list ar
if (format == NULL || format[0] == '\0')
return;
+#pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
output = g_strdup_vprintf (format, args);
+#pragma GCC diagnostic pop
/* report important output to PackageKit */
switch (level) {
diff --git a/backends/apt/20packagekit b/backends/apt/20packagekit
index 91d6c92..b9e2bf4 100644
--- a/backends/apt/20packagekit
+++ b/backends/apt/20packagekit
@@ -3,10 +3,10 @@
// Whenever dpkg is called we might have different updates
// i.e. if an user removes a package that had an update
DPkg::Post-Invoke {
-"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/test ! -e /run/ostree-booted && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
};
// When APT's cache is updated (i.e. apt-cache update)
APT::Update::Post-Invoke-Success {
-"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/test ! -e /run/ostree-booted && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
};
diff --git a/backends/apt/acqpkitstatus.cpp b/backends/apt/acqpkitstatus.cpp
index b3ef55e..19f8f8b 100644
--- a/backends/apt/acqpkitstatus.cpp
+++ b/backends/apt/acqpkitstatus.cpp
@@ -22,6 +22,7 @@
#include "apt-job.h"
+#include
#include
#include
@@ -183,8 +184,7 @@ bool AcqPackageKitStatus::Pulse(pkgAcquire *Owner)
}
// calculate the overall speed
- if (CurrentCPS != m_lastCPS)
- {
+ if (fabs(CurrentCPS - m_lastCPS) > 0) {
m_lastCPS = CurrentCPS;
pk_backend_job_set_speed(m_job, static_cast(m_lastCPS));
}
diff --git a/backends/apt/apt-job.cpp b/backends/apt/apt-job.cpp
index 907059c..1ed2530 100644
--- a/backends/apt/apt-job.cpp
+++ b/backends/apt/apt-job.cpp
@@ -566,21 +566,19 @@ void AptJob::emitUpdates(PkgList &output, PkBitfield filters)
std::string origin = vf.File().Origin() == NULL ? "" : vf.File().Origin();
std::string archive = vf.File().Archive() == NULL ? "" : vf.File().Archive();
std::string label = vf.File().Label() == NULL ? "" : vf.File().Label();
- if (origin.compare("Debian") == 0 ||
- origin.compare("Ubuntu") == 0) {
- if (ends_with(archive, "-security") ||
- label.compare("Debian-Security") == 0) {
- state = PK_INFO_ENUM_SECURITY;
- } else if (ends_with(archive, "-backports")) {
- state = PK_INFO_ENUM_ENHANCEMENT;
- } else if (ends_with(archive, "-proposed-updates") || ends_with(archive, "-updates-proposed")) {
- state = PK_INFO_ENUM_LOW;
- } else if (ends_with(archive, "-updates")) {
- state = PK_INFO_ENUM_BUGFIX;
- }
- } else if (origin.compare("Backports.org archive") == 0 ||
- ends_with(origin, "-backports")) {
+
+ if (origin.compare("Backports.org archive") == 0 ||
+ ends_with(origin, "-backports")) {
state = PK_INFO_ENUM_ENHANCEMENT;
+ } else if (ends_with(archive, "-security") ||
+ label.compare("Debian-Security") == 0) {
+ state = PK_INFO_ENUM_SECURITY;
+ } else if (ends_with(archive, "-backports")) {
+ state = PK_INFO_ENUM_ENHANCEMENT;
+ } else if (ends_with(archive, "-proposed-updates") || ends_with(archive, "-updates-proposed")) {
+ state = PK_INFO_ENUM_LOW;
+ } else if (ends_with(archive, "-updates")) {
+ state = PK_INFO_ENUM_BUGFIX;
}
// NOTE: Frontends expect us to pass the update urgency as both its state *and* actual urgency value here.
@@ -749,7 +747,7 @@ bool AptJob::getArchive(pkgAcquire *Owner,
StoreFilename = QuoteString(Version.ParentPkg().Name(),"_:") + '_' +
QuoteString(Version.VerStr(),"_:") + '_' +
QuoteString(Version.Arch(),"_:.") +
- "." + flExtension(Parse.FileName());
+ "." + std::string{flExtension(Parse.FileName())};
}
for (; Vf.end() == false; Vf++) {
@@ -778,7 +776,7 @@ bool AptJob::getArchive(pkgAcquire *Owner,
Version.ParentPkg().Name());
}
- string DestFile = directory + "/" + flNotDir(StoreFilename);
+ string DestFile = directory + "/" + std::string{flNotDir(StoreFilename)};
// Create the item
new pkgAcqFile(Owner,
@@ -808,7 +806,6 @@ void AptJob::emitPackageDetail(const pkgCache::VerIterator &ver)
return;
}
- const pkgCache::PkgIterator &pkg = ver.ParentPkg();
std::string section = ver.Section() == NULL ? "" : ver.Section();
size_t found;
@@ -818,23 +815,16 @@ void AptJob::emitPackageDetail(const pkgCache::VerIterator &ver)
pkgCache::VerFileIterator vf = ver.FileList();
pkgRecords::Parser &rec = m_cache->GetPkgRecords()->Lookup(vf);
- long size;
- if (pkg->CurrentState == pkgCache::State::Installed && pkg.CurrentVer() == ver) {
- // if the package is installed emit the installed size
- size = ver->InstalledSize;
- } else {
- size = ver->Size;
- }
-
g_autofree gchar *package_id = m_cache->buildPackageId(ver);
- pk_backend_job_details(m_job,
- package_id,
- m_cache->getShortDescription(ver).c_str(),
- "unknown",
- get_enum_group(section),
- m_cache->getLongDescriptionParsed(ver).c_str(),
- rec.Homepage().c_str(),
- size);
+ pk_backend_job_details_full (m_job,
+ package_id,
+ m_cache->getShortDescription(ver).c_str(),
+ "unknown",
+ get_enum_group(section),
+ m_cache->getLongDescriptionParsed(ver).c_str(),
+ rec.Homepage().c_str(),
+ ver->InstalledSize,
+ ver->Size);
}
void AptJob::emitDetails(PkgList &pkgs)
@@ -1108,8 +1098,8 @@ PkgList AptJob::getPackagesFromRepo(SourcesList::SourceRecord *&rec)
continue;
}
- // Check if the site the package comes from is include in the Repo uri
- if (vf.File().Site() == NULL || rec->URI.find(vf.File().Site()) == std::string::npos) {
+ // Check if the site the package comes from is included in the Repo uri
+ if (vf.File().Site() == NULL || rec->PrimaryURI.find(vf.File().Site()) == std::string::npos) {
continue;
}
diff --git a/backends/apt/apt-sourceslist.cpp b/backends/apt/apt-sourceslist.cpp
index 7c06d74..2885341 100644
--- a/backends/apt/apt-sourceslist.cpp
+++ b/backends/apt/apt-sourceslist.cpp
@@ -1,8 +1,9 @@
-/* apt-sourceslist.cpp - access the sources.list file
+/* apt-sourceslist.cpp - read & write APT repository sources
*
* Copyright (c) 1999 Patrick Cole
* (c) 2002 Synaptic development team
* (c) 2016 Daniel Nicoletti
+ * (c) 2018-2025 Matthias Klumpp
*
* Author: Patrick Cole
* Michael Vogt
@@ -34,13 +35,27 @@
#include
#include
#include
+#include
+#include
#include
#include
+#include
+#include "deb822.h"
#include "apt-utils.h"
#include "config.h"
+static std::vector FindMultiValue(pkgTagSection &Tags, char const *const Field)
+{
+ auto values = Tags.FindS(Field);
+ // we ignore duplicate spaces by removing empty values
+ std::replace_if(values.begin(), values.end(), isspace_ascii, ' ');
+ auto vect = VectorizeString(values, ' ');
+ vect.erase(std::remove_if(vect.begin(), vect.end(), [](std::string const &s) { return s.empty(); }), vect.end());
+ return vect;
+}
+
SourcesList::~SourcesList()
{
for (SourceRecord *sr : SourceRecords) {
@@ -61,9 +76,117 @@ SourcesList::SourceRecord *SourcesList::AddSourceNode(SourceRecord &rec)
return newrec;
}
-bool SourcesList::ReadSourcePart(string listpath)
+bool SourcesList::OpenConfigurationFileFd(std::string const &File, FileFd &Fd) /*{{{*/
+{
+ int const fd = open(File.c_str(), O_RDONLY | O_CLOEXEC | O_NOCTTY);
+ if (fd == -1)
+ return _error->WarningE("open", "Unable to read %s", File.c_str());
+ APT::Configuration::Compressor none(".", "", "", nullptr, nullptr, 0);
+ if (Fd.OpenDescriptor(fd, FileFd::ReadOnly, none, true) == false)
+ return false;
+ Fd.SetFileName(File);
+ return true;
+}
+
+bool SourcesList::ParseDeb822Stanza(const char *Type,
+ pkgTagSection &Tags,
+ unsigned int const stanzaIdx,
+ FileFd &Fd)
+{
+ string Enabled = Tags.FindS("Enabled");
+
+ // now create one item per suite/section
+ auto const list_uris = FindMultiValue(Tags, "URIs");
+ auto const list_comp = FindMultiValue(Tags, "Components");
+ auto list_suite = FindMultiValue(Tags, "Suites");
+
+ {
+ auto const nativeArch = _config->Find("APT::Architecture");
+ std::transform(list_suite.begin(), list_suite.end(), list_suite.begin(),
+ [&](std::string const &suite) { return SubstVar(suite, "$(ARCH)", nativeArch); });
+ }
+
+ if (list_uris.empty())
+ return _error->Error("Malformed entry %u in %s file %s (%s)", stanzaIdx, "sources", Fd.Name().c_str(), "URI");
+
+ if (list_suite.empty())
+ return _error->Error("Malformed entry %u in %s file %s (%s)", stanzaIdx, "sources", Fd.Name().c_str(), "Suite");
+
+ for (auto const &S : list_suite) {
+ SourceRecord rec = SourceRecord ();
+ rec.Deb822StanzaIdx = stanzaIdx;
+
+ if (!rec.SetURIs(list_uris))
+ return _error->Error("Malformed entry %u in %s file %s (%s)", stanzaIdx, "sources", Fd.Name().c_str(), "URI parse");
+
+ if (S.empty() == false && S[S.size() - 1] == '/') {
+ if (list_comp.empty() == false)
+ return _error->Error("Malformed entry %u in %s file %s (%s)", stanzaIdx, "sources", Fd.Name().c_str(), "absolute Suite Component");
+
+ rec.SourceFile = Fd.Name();
+ if (!rec.SetType(Type)) {
+ _error->Error("Unknown type %s", Type);
+ return false;
+ }
+
+ if (Enabled.empty() == false && StringToBool(Enabled) == false)
+ rec.Type |= SourcesList::Disabled;
+
+ rec.Dist = S;
+ rec.NumSections = 0;
+ rec.Sections = nullptr;
+ AddSourceNode(rec);
+ } else {
+ if (list_comp.empty())
+ return _error->Error("Malformed entry %u in %s file %s (%s)", stanzaIdx, "sources", Fd.Name().c_str(), "Component");
+
+ rec.SourceFile = Fd.Name();
+ if (!rec.SetType(Type)) {
+ _error->Error("Unknown type %s", Type);
+ return false;
+ }
+ if (Enabled.empty() == false && StringToBool(Enabled) == false)
+ rec.Type |= SourcesList::Disabled;
+
+ rec.Dist = S;
+ rec.NumSections = list_comp.size();
+ rec.Sections = new string[rec.NumSections];
+ std::copy(list_comp.begin(), list_comp.end(), rec.Sections);
+ AddSourceNode(rec);
+ }
+ }
+
+ return true;
+}
+
+
+bool SourcesList::ReadSourceDeb822(string listpath)
+{
+ FileFd Fd;
+ if (OpenConfigurationFileFd(listpath, Fd) == false)
+ return false;
+
+ pkgTagFile Sources(&Fd, pkgTagFile::SUPPORT_COMMENTS);
+ if (Fd.IsOpen() == false || Fd.Failed())
+ return _error->Error("Malformed stanza %u in source list %s (type)", 0, listpath.c_str());
+
+ // read step by step
+ pkgTagSection Tags;
+ for (guint i = 0; Sources.Step(Tags); i++) {
+ if(Tags.Exists("Types") == false)
+ return _error->Error("Malformed stanza %u in source list %s (type)", i, listpath.c_str());
+
+ for (auto const &type : FindMultiValue(Tags, "Types")) {
+ if (!ParseDeb822Stanza(type.c_str(), Tags, i, Fd))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SourcesList::ReadSourceLegacy(string listpath)
{
- //cout << "SourcesList::ReadSourcePart() "<< listpath << endl;
char buf[512];
const char *p;
ifstream ifs(listpath.c_str(), ios::in);
@@ -84,9 +207,8 @@ bool SourcesList::ReadSourcePart(string listpath)
ifs.getline(buf, sizeof(buf));
rec.SourceFile = listpath;
- while (isspace(*p)) {
+ while (isspace(*p))
p++;
- }
if (*p == '#') {
rec.Type = Disabled;
@@ -131,7 +253,7 @@ bool SourcesList::ReadSourcePart(string listpath)
//return _error->Error("Syntax error in line %s", buf);
}
}
-#ifndef HAVE_RPM
+
// check for absolute dist
if (rec.Dist.empty() == false && rec.Dist[rec.Dist.size() - 1] == '/') {
// make sure there's no section
@@ -144,7 +266,6 @@ bool SourcesList::ReadSourcePart(string listpath)
AddSourceNode(rec);
continue;
}
-#endif
const char *tmp = p;
rec.NumSections = 0;
@@ -176,6 +297,15 @@ bool SourcesList::ReadSourcePart(string listpath)
return record_ok;
}
+bool SourcesList::ReadSourcePart(string listpath)
+{
+ if (g_str_has_suffix (listpath.c_str(), ".sources")) {
+ return ReadSourceDeb822(listpath);
+ } else {
+ return ReadSourceLegacy(listpath);
+ }
+}
+
bool SourcesList::ReadSourceDir(string Dir)
{
//cout << "SourcesList::ReadSourceDir() " << Dir << endl;
@@ -203,8 +333,9 @@ bool SourcesList::ReadSourceDir(string Dir)
continue;
}
- // Only look at files ending in .list to skip .rpmnew etc files
- if (strcmp(Ent->d_name + strlen(Ent->d_name) - 5, ".list") != 0) {
+ // Only look at files ending in .list and .sources, skip .dpkg-new/.bak/.save etc.
+ if (!g_str_has_suffix (Ent->d_name, ".list") &&
+ !g_str_has_suffix (Ent->d_name, ".sources")) {
continue;
}
@@ -253,11 +384,7 @@ bool SourcesList::ReadSources()
SourcesList::SourceRecord *SourcesList::AddEmptySource()
{
SourceRecord rec;
-#ifdef HAVE_RPM
- rec.Type = Rpm;
-#else
rec.Type = Deb;
-#endif
rec.VendorID = "";
rec.SourceFile = _config->FindFile("Dir::Etc::sourcelist");
rec.Dist = "";
@@ -309,54 +436,176 @@ void SourcesList::SwapSources( SourceRecord *&rec_one, SourceRecord *&rec_two )
SourceRecords.erase( rec_n );
}
-bool SourcesList::UpdateSources()
+bool SourcesList::UpdateSourceLegacy(const string &filename)
{
- list filenames;
+ if (std::filesystem::path(filename).extension().string() != ".list") {
+ g_warning("Tried to update APT source file '%s' as legacy file, but filename has wrong extension.",
+ filename.c_str());
+ return false;
+ }
+
+ ofstream ofs(filename.c_str(), ios::out);
+ if (!ofs != 0) {
+ return false;
+ }
+
for (SourceRecord *sr : SourceRecords) {
- if (sr->SourceFile == "") {
+ if (filename != sr->SourceFile) {
continue;
}
- filenames.push_front(sr->SourceFile);
+
+ string S;
+ if ((sr->Type & Comment) != 0) {
+ S = sr->Comment;
+ } else if (sr->PrimaryURI.empty() || sr->Dist.empty()) {
+ continue;
+ } else {
+ if ((sr->Type & Disabled) != 0)
+ S = "# ";
+
+ S += sr->GetType() + " ";
+
+ if (sr->VendorID.empty() == false)
+ S += "[" + sr->VendorID + "] ";
+
+ S += sr->PrimaryURI + " ";
+ S += sr->Dist + " ";
+
+ for (unsigned int J = 0; J < sr->NumSections; ++J) {
+ S += sr->Sections[J] + " ";
+ }
+ }
+
+ // remove extra linebreak from S, if it has any
+ if (!S.empty() && S[S.size() - 1] == '\n')
+ S.pop_back();
+ ofs << S << "\n";
}
- filenames.sort();
- filenames.unique();
+ ofs.close();
- for (const string &filename : filenames) {
- ofstream ofs(filename.c_str(), ios::out);
- if (!ofs != 0) {
- return false;
+ return true;
+}
+
+bool SourcesList::UpdateSourceDeb822(const std::string &filename)
+{
+ if (std::filesystem::path(filename).extension().string() != ".sources") {
+ g_warning("Tried to update APT source file '%s' in Deb822 format, but filename has wrong extension.",
+ filename.c_str());
+ return false;
+ }
+
+ Deb822File sf;
+ if (!sf.load(filename)) {
+ g_warning("Failed to load Deb822 file '%s': %s", filename.c_str(), sf.lastError().c_str());
+ return false;
+ }
+
+ std::set rmPendingStanzas;
+ for (SourceRecord *sr : SourceRecords) {
+ if (filename != sr->SourceFile)
+ continue;
+
+ // comments shouldn't exist for Deb822 files in this data structure,
+ // we parse them differently.
+ if ((sr->Type & Comment) != 0)
+ continue;
+
+ if (sr->PrimaryURI.empty() || sr->Dist.empty())
+ continue;
+
+ std::string components;
+ for (unsigned int J = 0; J < sr->NumSections; ++J)
+ components += sr->Sections[J] + " ";
+ if (!components.empty())
+ components.pop_back();
+
+ std::string uris;
+ for (const auto &uri : sr->URIs)
+ uris += uri + " ";
+ if (!uris.empty())
+ uris.pop_back();
+
+ const auto type = sr->GetType();
+
+ if (sf.getFieldValue(sr->Deb822StanzaIdx, "Types") != type ||
+ sf.getFieldValue(sr->Deb822StanzaIdx, "URIs") != uris ||
+ sf.getFieldValue(sr->Deb822StanzaIdx, "Components") != components ||
+ sf.getFieldValue(sr->Deb822StanzaIdx, "Suites") != sr->Dist) {
+ // The new Deb822 sources do not fit well on the existing data model and concept of
+ // what a "source" is, so we rewrite the file to make it match a "one stanza per source"
+ // scheme like what existed in legacy files.
+ // FIXME: In the long run, we should reconsider what a repository source is and adjust the internal
+ // data model, as rewriting the file like this is a really ugly hack.
+
+ // mark the old stanza for deletion and create a new one that we will edit
+ rmPendingStanzas.insert(sr->Deb822StanzaIdx);
+ sr->Deb822StanzaIdx = sf.duplicateStanza(sr->Deb822StanzaIdx);
}
- for (SourceRecord *sr : SourceRecords) {
- if (filename != sr->SourceFile) {
- continue;
- }
+ sf.updateField(sr->Deb822StanzaIdx, "Types", type);
+ sf.updateField(sr->Deb822StanzaIdx, "URIs", uris);
+ sf.updateField(sr->Deb822StanzaIdx, "Suites", sr->Dist);
+ sf.updateField(sr->Deb822StanzaIdx, "Components", components);
- string S;
- if ((sr->Type & Comment) != 0) {
- S = sr->Comment;
- } else if (sr->URI.empty() || sr->Dist.empty()) {
- continue;
- } else {
- if ((sr->Type & Disabled) != 0)
- S = "# ";
+ if ((sr->Type & Disabled) != 0)
+ sf.updateField(sr->Deb822StanzaIdx, "Enabled", "no");
+ else
+ sf.deleteField(sr->Deb822StanzaIdx, "Enabled");
+ }
- S += sr->GetType() + " ";
+ // delete any stanzas marked for removal, in descending order to avoid index shifting
+ std::vector sortedRmStanzas(rmPendingStanzas.begin(), rmPendingStanzas.end());
+ std::sort(sortedRmStanzas.rbegin(), sortedRmStanzas.rend());
+ for (uint rmIdx : sortedRmStanzas)
+ sf.deleteStanza(rmIdx);
+
+ if (!sf.save(filename)) {
+ g_warning("Failed to save Deb822 file '%s': %s", filename.c_str(), sf.lastError().c_str());
+ return false;
+ }
- if (sr->VendorID.empty() == false)
- S += "[" + sr->VendorID + "] ";
+ // remove all records from this file
+ for (auto it = SourceRecords.begin(); it != SourceRecords.end();) {
+ if ((*it)->SourceFile == filename) {
+ delete *it;
+ it = SourceRecords.erase(it);
+ } else {
+ ++it;
+ }
+ }
- S += sr->URI + " ";
- S += sr->Dist + " ";
+ // reload the updated data
+ return ReadSourceDeb822(filename);
+}
- for (unsigned int J = 0; J < sr->NumSections; ++J) {
- S += sr->Sections[J] + " ";
- }
- }
- ofs << S << endl;
+bool SourcesList::UpdateSources()
+{
+ list filenames;
+ for (SourceRecord *sr : SourceRecords) {
+ if (sr->SourceFile == "") {
+ continue;
+ }
+ filenames.push_front(sr->SourceFile);
+ }
+ filenames.sort();
+ filenames.unique();
+
+ for (const string &filename : filenames) {
+ const auto fileExt = std::filesystem::path(filename).extension().string();
+ if (fileExt == ".sources") {
+ if (!UpdateSourceDeb822(filename))
+ return false;
+
+ } else if (fileExt == ".list") {
+ if (!UpdateSourceLegacy(filename))
+ return false;
+
+ } else {
+ g_warning("Tried to update APT source file '%s', but could not determine file type.",
+ filename.c_str());
}
- ofs.close();
}
+
return true;
}
@@ -366,23 +615,10 @@ bool SourcesList::SourceRecord::SetType(string S)
Type |= Deb;
} else if (S == "deb-src") {
Type |= DebSrc;
- } else if (S == "rpm") {
- Type |= Rpm;
- } else if (S == "rpm-src") {
- Type |= RpmSrc;
- } else if (S == "rpm-dir") {
- Type |= RpmDir;
- } else if (S == "rpm-src-dir") {
- Type |= RpmSrcDir;
- } else if (S == "repomd") {
- Type |= Repomd;
- } else if (S == "repomd-src") {
- Type |= RepomdSrc;
} else {
return false;
}
- //cout << S << " settype " << (Type | Repomd) << endl;
return true;
}
@@ -392,52 +628,55 @@ string SourcesList::SourceRecord::GetType()
return "deb";
} else if ((Type & DebSrc) != 0) {
return "deb-src";
- } else if ((Type & Rpm) != 0) {
- return "rpm";
- } else if ((Type & RpmSrc) != 0) {
- return "rpm-src";
- } else if ((Type & RpmDir) != 0) {
- return "rpm-dir";
- } else if ((Type & RpmSrcDir) != 0) {
- return "rpm-src-dir";
- } else if ((Type & Repomd) != 0) {
- return "repomd";
- } else if ((Type & RepomdSrc) != 0) {
- return "repomd-src";
- }
-
- //cout << "type " << (Type & Repomd) << endl;
+ }
+
return "unknown";
}
-bool SourcesList::SourceRecord::SetURI(string S)
+static bool FixupURI(string &URI)
{
- if (S.empty() == true) {
+ if (URI.empty() == true)
return false;
- }
- if (S.find(':') == string::npos) {
+
+ if (URI.find(':') == string::npos)
return false;
- }
- S = SubstVar(S, "$(ARCH)", _config->Find("APT::Architecture"));
- S = SubstVar(S, "$(VERSION)", _config->Find("APT::DistroVersion"));
- URI = S;
+ URI = ::URI{SubstVar(URI, "$(ARCH)", _config->Find("APT::Architecture"))};
- // append a / to the end if one is not already there
- if (URI[URI.size() - 1] != '/') {
- URI += '/';
- }
+ // Make sure that the URI is / postfixed
+ if (URI.back() != '/')
+ URI.push_back('/');
return true;
}
-string SourcesList::SourceRecord::joinedSections()
+bool SourcesList::SourceRecord::SetURI(string S)
+{
+ PrimaryURI = S;
+ return ::FixupURI(PrimaryURI);
+}
+
+bool SourcesList::SourceRecord::SetURIs(const std::vector &newURIs)
+{
+ bool ret = true;
+ URIs = newURIs;
+
+ for (auto &uri : URIs) {
+ if (!::FixupURI(uri))
+ ret = false;
+ }
+ PrimaryURI = URIs.empty()? "" : URIs[0];
+
+ return ret;
+}
+
+string SourcesList::SourceRecord::joinedSections(const std::string &separator)
{
string ret;
for (unsigned int i = 0; i < NumSections; ++i) {
ret += Sections[i];
if (i + 1 < NumSections) {
- ret += " ";
+ ret += separator;
}
}
return ret;
@@ -446,7 +685,7 @@ string SourcesList::SourceRecord::joinedSections()
string SourcesList::SourceRecord::niceName()
{
string ret;
- if (starts_with(URI, "cdrom")) {
+ if (starts_with(PrimaryURI, "cdrom")) {
ret = "Disc ";
}
@@ -473,11 +712,11 @@ string SourcesList::SourceRecord::niceName()
}
std::string uri_info;
- size_t schema_pos = URI.find("://");
+ size_t schema_pos = PrimaryURI.find("://");
if (schema_pos == std::string::npos) {
- uri_info = URI;
+ uri_info = PrimaryURI;
} else {
- uri_info = URI.substr(schema_pos + 3);
+ uri_info = PrimaryURI.substr(schema_pos + 3);
if (uri_info.back() == '/')
uri_info.pop_back();
}
@@ -485,7 +724,7 @@ string SourcesList::SourceRecord::niceName()
if (g_pattern_match_simple ("*.debian.org/*", uri_info.c_str()))
return "Debian " + ret;
if (g_pattern_match_simple ("*.ubuntu.com/*", uri_info.c_str()))
- return "Debian " + ret;
+ return "Ubuntu " + ret;
if (g_pattern_match_simple ("*.pureos.net/*", uri_info.c_str()))
return "PureOS " + ret;
@@ -496,11 +735,10 @@ string SourcesList::SourceRecord::repoId()
{
string ret;
ret = SourceFile;
- ret += ":" + GetType();
- ret += VendorID + " ";
- ret += URI + " ";
- ret += Dist + " ";
- ret += joinedSections();
+ ret += ":" + GetType() + ":";
+ ret += PrimaryURI + ":";
+ ret += Dist + ":";
+ ret += joinedSections(",");
return ret;
}
@@ -519,7 +757,8 @@ SourcesList::SourceRecord &SourcesList::SourceRecord::operator=(const SourceReco
// Needed for a proper deep copy of the record; uses the string operator= to properly copy the strings
Type = rhs.Type;
VendorID = rhs.VendorID;
- URI = rhs.URI;
+ PrimaryURI = rhs.PrimaryURI;
+ URIs = rhs.URIs;
Dist = rhs.Dist;
Sections = new string[rhs.NumSections];
for (unsigned int I = 0; I < rhs.NumSections; ++I) {
@@ -528,6 +767,7 @@ SourcesList::SourceRecord &SourcesList::SourceRecord::operator=(const SourceReco
NumSections = rhs.NumSections;
Comment = rhs.Comment;
SourceFile = rhs.SourceFile;
+ Deb822StanzaIdx = rhs.Deb822StanzaIdx;
return *this;
}
@@ -644,28 +884,10 @@ ostream &operator<<(ostream &os, const SourcesList::SourceRecord &rec)
if ((rec.Type & SourcesList::DebSrc) != 0) {
os << "DebSrc";
}
- if ((rec.Type & SourcesList::Rpm) != 0) {
- os << "Rpm";
- }
- if ((rec.Type & SourcesList::RpmSrc) != 0) {
- os << "RpmSrc";
- }
- if ((rec.Type & SourcesList::RpmDir) != 0) {
- os << "RpmDir";
- }
- if ((rec.Type & SourcesList::RpmSrcDir) != 0) {
- os << "RpmSrcDir";
- }
- if ((rec.Type & SourcesList::Repomd) != 0) {
- os << "Repomd";
- }
- if ((rec.Type & SourcesList::RepomdSrc) != 0) {
- os << "RepomdSrc";
- }
os << endl;
os << "SourceFile: " << rec.SourceFile << endl;
os << "VendorID: " << rec.VendorID << endl;
- os << "URI: " << rec.URI << endl;
+ os << "URI: " << rec.PrimaryURI << endl;
os << "Dist: " << rec.Dist << endl;
os << "Section(s):" << endl;
#if 0
diff --git a/backends/apt/apt-sourceslist.h b/backends/apt/apt-sourceslist.h
index fa32919..3d00ea8 100644
--- a/backends/apt/apt-sourceslist.h
+++ b/backends/apt/apt-sourceslist.h
@@ -2,6 +2,7 @@
*
* Copyright (c) 1999 Patrick Cole
* (c) 2002 Synaptic development team
+* (c) 2018-2025 Matthias Klumpp
*
* Author: Patrick Cole
* Michael Vogt
@@ -26,6 +27,10 @@
#ifndef APT_SOURCESLIST_H
#define APT_SOURCESLIST_H
+#include
+#include
+#include
+
#include
#include
@@ -36,35 +41,34 @@ class SourcesList {
enum RecType {
Deb = 1 << 0,
DebSrc = 1 << 1,
- Rpm = 1 << 2,
- RpmSrc = 1 << 3,
- Disabled = 1 << 4,
- Comment = 1 << 5,
- RpmDir = 1 << 6,
- RpmSrcDir = 1 << 7,
- Repomd = 1 << 8,
- RepomdSrc = 1 << 9
+ Disabled = 1 << 2,
+ Comment = 1 << 3,
};
struct SourceRecord {
unsigned int Type;
string VendorID;
- string URI;
+ string PrimaryURI;
+ std::vector URIs;
string Dist;
string *Sections;
unsigned short NumSections;
- string joinedSections();
+ string Comment;
+
+ string SourceFile;
+ uint Deb822StanzaIdx;
+
+ string joinedSections(const std::string &separator = " ");
string niceName();
string repoId();
bool hasSection(const char *component);
- string Comment;
- string SourceFile;
bool SetType(string);
string GetType();
bool SetURI(string);
+ bool SetURIs(const std::vector &newURIs);
- SourceRecord():Type(0), Sections(0), NumSections(0) {}
+ SourceRecord():Type(0), Sections(0), NumSections(0), Deb822StanzaIdx(0) {}
~SourceRecord() {
if (Sections) {
delete [] Sections;
@@ -85,6 +89,13 @@ class SourcesList {
private:
SourceRecord *AddSourceNode(SourceRecord &);
VendorRecord *AddVendorNode(VendorRecord &);
+ bool OpenConfigurationFileFd(std::string const &File, FileFd &Fd);
+ bool ParseDeb822Stanza(const char*Type,
+ pkgTagSection &Tags,
+ unsigned int const stanzaIdx,
+ FileFd &Fd);
+ bool UpdateSourceLegacy(const std::string &filename);
+ bool UpdateSourceDeb822(const std::string &filename);
public:
SourceRecord *AddSource(RecType Type,
@@ -96,6 +107,8 @@ class SourcesList {
SourceRecord *AddEmptySource();
void RemoveSource(SourceRecord *&);
void SwapSources( SourceRecord *&, SourceRecord *& );
+ bool ReadSourceDeb822(string listpath);
+ bool ReadSourceLegacy(string listpath);
bool ReadSourcePart(string listpath);
bool ReadSourceDir(string Dir);
bool ReadSources();
diff --git a/backends/apt/apt-utils.cpp b/backends/apt/apt-utils.cpp
index bef3eb1..e3509d4 100644
--- a/backends/apt/apt-utils.cpp
+++ b/backends/apt/apt-utils.cpp
@@ -227,7 +227,8 @@ string fetchChangelogData(AptCacheFile &CacheFile,
// display old changelog information
if (_system != 0 &&
_system->VS->DoCmpVersion(version, version + strlen(version),
- currver.VerStr(), currver.VerStr() + strlen(currver.VerStr())) <= 0) {
+ currver.SourceVerStr(),
+ currver.SourceVerStr() + strlen(currver.SourceVerStr())) <= 0) {
g_free (version);
break;
} else {
diff --git a/backends/apt/deb822.cpp b/backends/apt/deb822.cpp
new file mode 100644
index 0000000..3e3edc5
--- /dev/null
+++ b/backends/apt/deb822.cpp
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2024-2025 Matthias Klumpp
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "deb822.h"
+
+#include
+#include
+#include
+#include
+
+
+Deb822File::Deb822File()
+{
+}
+
+bool Deb822File::isFieldStanza(const Stanza& stanza)
+{
+ return std::any_of(stanza.begin(), stanza.end(),
+ [](const Line& l) { return l.isField(); });
+}
+
+Deb822File::Line Deb822File::parseDeb822Line(const std::string& line) const
+{
+ Deb822File::Line l;
+ l.content = line;
+
+ // we return empty and comment-lines verbatim
+ if (line.empty() || line[0] == '#')
+ return l;
+
+ if (std::isspace(line[0])) {
+ l.isContinuation = true;
+ return l;
+ }
+
+ const auto colonPos = line.find(':');
+ if (colonPos != std::string::npos && colonPos > 0) {
+ l.key = line.substr(0, colonPos);
+
+ // strip leading space
+ size_t valueStart = colonPos + 1;
+ while (valueStart < line.size() && std::isspace(line[valueStart]))
+ ++valueStart;
+
+ l.value = line.substr(valueStart);
+ }
+
+ return l;
+}
+
+bool Deb822File::loadFromStream(std::istream& stream)
+{
+ m_allStanzas.clear();
+ m_fieldStanzaIndices.clear();
+
+ Stanza stanza;
+ std::string line;
+ Line *lastField = nullptr;
+
+ while (std::getline(stream, line)) {
+ if (line.empty()) {
+ if (!stanza.empty()) {
+ size_t index = m_allStanzas.size();
+ m_allStanzas.push_back(stanza);
+ if (isFieldStanza(stanza)) {
+ m_fieldStanzaIndices.push_back(index);
+ }
+
+ stanza.clear();
+ lastField = nullptr;
+ }
+ continue;
+ }
+
+ auto parsed = parseDeb822Line(line);
+
+ if (parsed.isContinuation && lastField) {
+ // append to last field value (with newline)
+ lastField->value += "\n" + parsed.content;
+ } else {
+ stanza.push_back(parsed);
+ if (parsed.isField())
+ lastField = &stanza.back();
+ else
+ lastField = nullptr;
+ }
+ }
+
+ if (!stanza.empty()) {
+ size_t index = m_allStanzas.size();
+ m_allStanzas.push_back(stanza);
+ if (isFieldStanza(stanza)) {
+ m_fieldStanzaIndices.push_back(index);
+ }
+ }
+
+ return true;
+}
+
+bool Deb822File::loadFromString(const std::string& content)
+{
+ std::istringstream stream(content);
+ return loadFromStream(stream);
+}
+
+bool Deb822File::load(const std::string& filename)
+{
+ std::ifstream file(filename);
+ if (!file) {
+ m_lastError = "Failed to open file: " + filename;
+ return false;
+ }
+ m_filename = filename;
+
+ return loadFromStream(file);
+}
+
+bool Deb822File::save(const std::string& filename)
+{
+ std::ofstream file(filename);
+ if (!file) {
+ m_lastError = "Failed to write file: " + filename;
+ return false;
+ }
+
+ for (size_t i = 0; i < m_allStanzas.size(); ++i) {
+ for (const auto& line : m_allStanzas[i])
+ file << line.content << "\n";
+
+ if (i + 1 < m_allStanzas.size())
+ file << "\n";
+ }
+
+ return true;
+}
+
+std::string Deb822File::lastError() const
+{
+ return m_lastError;
+}
+
+std::optional Deb822File::getFieldValue(size_t stanzaIndex, const std::string& field, std::optional defaultValue)
+{
+ if (stanzaIndex >= m_fieldStanzaIndices.size()) {
+ m_lastError = "Stanza index out of range";
+ return std::nullopt;
+ }
+
+ const Stanza& stanza = m_allStanzas[m_fieldStanzaIndices[stanzaIndex]];
+ for (const auto& line : stanza) {
+ if (line.key == field) {
+ return line.value;
+ }
+ }
+
+ return defaultValue;
+}
+
+bool Deb822File::updateField(size_t stanzaIndex, const std::string& field, const std::string& newValue)
+{
+ if (stanzaIndex >= m_fieldStanzaIndices.size()) {
+ m_lastError = "Stanza index out of range";
+ return false;
+ }
+
+ Stanza& stanza = m_allStanzas[m_fieldStanzaIndices[stanzaIndex]];
+ for (auto it = stanza.begin(); it != stanza.end(); ++it) {
+ if (it->key == field) {
+ auto next = std::next(it);
+ while (next != stanza.end() && next->isContinuation)
+ next = stanza.erase(next);
+
+ it->value = newValue;
+ std::istringstream valstream(newValue);
+ std::string line;
+ std::getline(valstream, line);
+ it->content = field + ": " + line;
+
+ while (std::getline(valstream, line))
+ stanza.insert(next, Line{" " + line, "", "", true});
+
+ return true;
+ }
+ }
+
+ std::istringstream valstream(newValue);
+ std::string line;
+ std::getline(valstream, line);
+ stanza.push_back(Line{field + ": " + line, field, newValue, false});
+ while (std::getline(valstream, line))
+ stanza.push_back(Line{" " + line, "", "", true});
+
+ return true;
+}
+
+bool Deb822File::deleteField(size_t stanzaIndex, const std::string& key)
+{
+ if (stanzaIndex >= m_fieldStanzaIndices.size()) {
+ m_lastError = "Stanza index out of range";
+ return false;
+ }
+
+ Stanza& stanza = m_allStanzas[m_fieldStanzaIndices[stanzaIndex]];
+
+ for (auto it = stanza.begin(); it != stanza.end(); ++it) {
+ if (it->key == key) {
+ // erase the field and its continuation lines
+ auto next = std::next(it);
+ while (next != stanza.end() && next->isContinuation)
+ next = stanza.erase(next);
+
+ stanza.erase(it);
+
+ return true;
+ }
+ }
+
+ // not found
+ m_lastError = "";
+ return false;
+}
+
+bool Deb822File::deleteStanza(size_t index)
+{
+ if (index >= m_fieldStanzaIndices.size()) {
+ m_lastError = "Stanza index out of range";
+ return false;
+ }
+
+ size_t rawIndex = m_fieldStanzaIndices[index];
+ if (rawIndex >= m_allStanzas.size()) {
+ m_lastError = "Internal error: index mismatch";
+ return false;
+ }
+
+ m_allStanzas.erase(m_allStanzas.begin() + rawIndex);
+
+ // rebuild m_fieldStanzaIndices
+ m_fieldStanzaIndices.clear();
+ for (size_t i = 0; i < m_allStanzas.size(); ++i) {
+ if (isFieldStanza(m_allStanzas[i])) {
+ m_fieldStanzaIndices.push_back(i);
+ }
+ }
+
+ return true;
+}
+
+int Deb822File::duplicateStanza(size_t index)
+{
+ if (index >= m_fieldStanzaIndices.size()) {
+ m_lastError = "Stanza index out of range";
+ return -1;
+ }
+
+ size_t rawIndex = m_fieldStanzaIndices[index];
+ if (rawIndex >= m_allStanzas.size()) {
+ m_lastError = "Internal error: index mismatch";
+ return -1;
+ }
+
+ // copy and append
+ m_allStanzas.push_back(m_allStanzas[rawIndex]);
+
+ // append new index to fieldStanzaIndices and return it
+ size_t newRawIndex = m_allStanzas.size() - 1;
+ m_fieldStanzaIndices.push_back(newRawIndex);
+
+ return static_cast(m_fieldStanzaIndices.size() - 1);
+}
+
+size_t Deb822File::stanzaCount() const
+{
+ return m_fieldStanzaIndices.size();
+}
+
+std::string Deb822File::toString() const
+{
+ std::ostringstream out;
+ for (size_t i = 0; i < m_allStanzas.size(); ++i) {
+ for (const auto& line : m_allStanzas[i])
+ out << line.content << "\n";
+
+ if (i + 1 < m_allStanzas.size())
+ out << "\n";
+ }
+
+ return out.str();
+}
diff --git a/backends/apt/deb822.h b/backends/apt/deb822.h
new file mode 100644
index 0000000..9e48076
--- /dev/null
+++ b/backends/apt/deb822.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2024-2025 Matthias Klumpp
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#pragma once
+
+#include
+#include
+#include
+
+/**
+ * Read & write a Deb822 file.
+ * This is the simplest possible parser for Deb822 files.
+ * Unlike pkgTagFile, it retains all comments and allows for
+ * non-destructive editing of Deb822 files.
+ */
+class Deb822File
+{
+public:
+ explicit Deb822File();
+
+ bool load(const std::string& filename);
+ bool loadFromStream(std::istream& stream);
+ bool loadFromString(const std::string& content);
+
+ bool save(const std::string& filename);
+
+ [[nodiscard]] std::string lastError() const;
+
+ [[nodiscard]] size_t stanzaCount() const;
+ [[nodiscard]] std::optional getFieldValue(size_t stanzaIndex, const std::string& field,
+ std::optional defaultValue = std::nullopt);
+ bool updateField(size_t stanza_index, const std::string& field, const std::string& newValue);
+ bool deleteField(size_t stanzaIndex, const std::string& key);
+ bool deleteStanza(size_t index);
+ int duplicateStanza(size_t index);
+
+ std::string toString() const;
+
+private:
+ struct Line {
+ std::string content;
+ std::string key; /// empty if comment or continuation
+ std::string value; /// only valid if key is non-empty
+
+ bool isContinuation = false;
+ [[nodiscard]] bool isField() const { return !key.empty(); }
+ };
+
+ using Stanza = std::vector;
+
+ std::string m_filename;
+ std::string m_lastError;
+ std::vector m_allStanzas; // all stanzas, including comment-only ones
+ std::vector m_fieldStanzaIndices; // map for stanzas with fields
+
+ static bool isFieldStanza(const Stanza& stanza);
+ Line parseDeb822Line(const std::string& line) const;
+};
diff --git a/backends/apt/gst-matcher.cpp b/backends/apt/gst-matcher.cpp
index fd5a9ca..75a342b 100644
--- a/backends/apt/gst-matcher.cpp
+++ b/backends/apt/gst-matcher.cpp
@@ -71,17 +71,21 @@ GstMatcher::GstMatcher(gchar **values)
if (!opt.empty()) {
size_t start_pos = 0;
// This is hardcoded in pk-gstreamer-install, so we also hardcode it here
- const string x86_64 = "()(64bit";
+ const string x86_64 = ")(64bit";
if (ends_with(opt.c_str(), x86_64.c_str())) {
// We hardcode 64bit -> amd64 here
arch = "amd64";
- // -1 -> remove the last )
- opt.erase(opt.end() - x86_64.length() - 1, opt.end());
+ opt.erase(opt.end() - x86_64.length(), opt.end());
}
// Replace all ")(" with "," - convert from input to serialized caps format
while ((start_pos = opt.find(")(", start_pos)) != string::npos) {
+ if (start_pos == opt.length()-2) {
+ // Avoid trailing comma
+ opt.erase(start_pos, 2);
+ break;
+ }
opt.replace(start_pos, 2, ",");
start_pos++;
}
diff --git a/backends/apt/meson.build b/backends/apt/meson.build
index 9d13225..abee356 100644
--- a/backends/apt/meson.build
+++ b/backends/apt/meson.build
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
cpp_compiler = meson.get_compiler('cpp')
@@ -29,9 +29,9 @@ c_args = ['-DG_LOG_DOMAIN="PackageKit-APT"',
'-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))),
]
-shared_module(
- 'pk_backend_apt',
- 'pk-backend-apt.cpp',
+# Required to be used by the test suite
+packagekit_backend_apt_lib = static_library(
+ 'pk_backend_apt_lib',
'acqpkitstatus.cpp',
'acqpkitstatus.h',
'apt-cache-file.cpp',
@@ -44,6 +44,8 @@ shared_module(
'apt-sourceslist.h',
'apt-utils.cpp',
'apt-utils.h',
+ 'deb822.cpp',
+ 'deb822.h',
'deb-file.cpp',
'deb-file.h',
'gst-matcher.cpp',
@@ -53,7 +55,6 @@ shared_module(
include_directories: packagekit_src_include,
dependencies: [
packagekit_glib2_dep,
- gmodule_dep,
apt_pkg_dep,
appstream_dep,
gstreamer_dep,
@@ -69,6 +70,38 @@ shared_module(
'-lutil',
],
override_options: [
+ 'b_lundef=false',
+ 'c_std=c11',
+ 'cpp_std=c++17'
+ ],
+)
+
+packagekit_backend_apt_dep = declare_dependency(
+ link_whole: packagekit_backend_apt_lib,
+ include_directories: [
+ packagekit_src_include,
+ include_directories('.'),
+ ],
+ dependencies: [
+ packagekit_glib2_dep,
+ ],
+)
+
+packagekit_backend_apt_module = shared_module(
+ 'pk_backend_apt',
+ 'pk-backend-apt.cpp',
+ include_directories: packagekit_src_include,
+ dependencies: [
+ packagekit_glib2_dep,
+ packagekit_backend_apt_dep,
+ ],
+ c_args: c_args,
+ cpp_args: [
+ c_args,
+ ddtp_flag,
+ ],
+ override_options: [
+ 'b_lundef=false',
'c_std=c11',
'cpp_std=c++17'
],
@@ -116,3 +149,5 @@ if get_option('systemd')
install_dir: systemd_user_unit_dir,
)
endif
+
+subdir('tests')
diff --git a/backends/apt/pk-backend-apt.cpp b/backends/apt/pk-backend-apt.cpp
index 88a85b4..433eabd 100644
--- a/backends/apt/pk-backend-apt.cpp
+++ b/backends/apt/pk-backend-apt.cpp
@@ -2,7 +2,8 @@
*
* Copyright (C) 2007-2008 Richard Hughes
* Copyright (C) 2009-2016 Daniel Nicoletti
- * 2016 Harald Sitter
+ * Copyright (C) 2016 Harald Sitter
+ * Copyright (C) 2018-2025 Matthias Klumpp
*
* Licensed under the GNU General Public License Version 2
*
@@ -388,10 +389,10 @@ static void backend_get_updates_thread(PkBackendJob *job, GVariant *params, gpoi
updates = apt->getUpdates(blocked, downgrades, installs, removals, obsoleted);
apt->emitUpdates(updates, filters);
- apt->emitPackages(installs, filters, PK_INFO_ENUM_INSTALLING);
- apt->emitPackages(removals, filters, PK_INFO_ENUM_REMOVING);
- apt->emitPackages(obsoleted, filters, PK_INFO_ENUM_OBSOLETING);
- apt->emitPackages(downgrades, filters, PK_INFO_ENUM_DOWNGRADING);
+ apt->emitPackages(installs, filters, PK_INFO_ENUM_INSTALL);
+ apt->emitPackages(removals, filters, PK_INFO_ENUM_REMOVE);
+ apt->emitPackages(obsoleted, filters, PK_INFO_ENUM_OBSOLETE);
+ apt->emitPackages(downgrades, filters, PK_INFO_ENUM_DOWNGRADE);
apt->emitPackages(blocked, filters, PK_INFO_ENUM_BLOCKED);
}
@@ -528,7 +529,7 @@ static void pk_backend_download_packages_thread(PkBackendJob *job, GVariant *par
}
gchar **files = (gchar **) g_malloc(2 * sizeof(gchar *));
- files[0] = g_strdup_printf("%s/%s", directory.c_str(), flNotDir(storeFileName).c_str());
+ files[0] = g_strdup_printf("%s/%s", directory.c_str(), std::string{flNotDir(storeFileName)}.c_str());
files[1] = NULL;
pk_backend_job_files(job, pi, files);
g_strfreev(files);
@@ -899,38 +900,35 @@ static void backend_repo_manager_thread(PkBackendJob *job, GVariant *params, gpo
return;
}
- for (SourcesList::SourceRecord *souceRecord : sourcesList.SourceRecords) {
+ for (SourcesList::SourceRecord *sourceRecord : sourcesList.SourceRecords) {
- if (souceRecord->Type & SourcesList::Comment) {
+ if (sourceRecord->Type & SourcesList::Comment) {
continue;
}
- string sections = souceRecord->joinedSections();
+ string sections = sourceRecord->joinedSections();
- string repoId = souceRecord->repoId();
+ string repoId = sourceRecord->repoId();
if (role == PK_ROLE_ENUM_GET_REPO_LIST) {
if (pk_bitfield_contain(filters, PK_FILTER_ENUM_NOT_DEVELOPMENT) &&
- (souceRecord->Type & SourcesList::DebSrc ||
- souceRecord->Type & SourcesList::RpmSrc ||
- souceRecord->Type & SourcesList::RpmSrcDir ||
- souceRecord->Type & SourcesList::RepomdSrc)) {
+ (sourceRecord->Type & SourcesList::DebSrc)) {
continue;
}
pk_backend_job_repo_detail(job,
repoId.c_str(),
- souceRecord->niceName().c_str(),
- !(souceRecord->Type & SourcesList::Disabled));
+ sourceRecord->niceName().c_str(),
+ !(sourceRecord->Type & SourcesList::Disabled));
} else if (repoId.compare(repo_id) == 0) {
// Found the repo to enable/disable
found = true;
if (role == PK_ROLE_ENUM_REPO_ENABLE) {
if (enabled) {
- souceRecord->Type = souceRecord->Type & ~SourcesList::Disabled;
+ sourceRecord->Type = sourceRecord->Type & ~SourcesList::Disabled;
} else {
- souceRecord->Type |= SourcesList::Disabled;
+ sourceRecord->Type |= SourcesList::Disabled;
}
// Commit changes
@@ -946,7 +944,7 @@ static void backend_repo_manager_thread(PkBackendJob *job, GVariant *params, gpo
return;
}
- PkgList removePkgs = apt->getPackagesFromRepo(souceRecord);
+ PkgList removePkgs = apt->getPackagesFromRepo(sourceRecord);
if (removePkgs.size() > 0) {
// Install/Update/Remove packages, or just simulate
bool ret;
@@ -966,7 +964,7 @@ static void backend_repo_manager_thread(PkBackendJob *job, GVariant *params, gpo
// Now if we are not simulating remove the repository
if (!pk_bitfield_contain(transaction_flags, PK_TRANSACTION_FLAG_ENUM_SIMULATE)) {
- sourcesList.RemoveSource(souceRecord);
+ sourcesList.RemoveSource(sourceRecord);
// Commit changes
if (!sourcesList.UpdateSources()) {
diff --git a/backends/apt/pk-debconf-helper.c b/backends/apt/pk-debconf-helper.c
index 56f7ca4..65dcb62 100644
--- a/backends/apt/pk-debconf-helper.c
+++ b/backends/apt/pk-debconf-helper.c
@@ -4,8 +4,8 @@
#include
#include
-static GMainLoop *main_loop;
-static PkClientHelper *helper;
+static GMainLoop *main_loop = NULL;
+static PkClientHelper *helper = NULL;
static gboolean exit_loop(gpointer user_data)
{
@@ -19,36 +19,40 @@ static gboolean exit_loop(gpointer user_data)
int main(void)
{
- char **argv = NULL;
- char **envp = NULL;
- GSocket *socket = NULL;
- GError *error = NULL;
+ g_auto(GStrv) argv = NULL;
+ g_auto(GStrv) envp = NULL;
+ g_autoptr(GSocket) socket = NULL;
+ g_autoptr(GError) error = NULL;
int fd = -1;
- main_loop = g_main_loop_new(NULL, FALSE);
- pk_client_create_helper_argv_envp(&argv, &envp);
+ main_loop = g_main_loop_new (NULL, FALSE);
+ pk_client_create_helper_argv_envp (&argv, &envp);
- if (sd_listen_fds(0) != 1) {
+ if (sd_listen_fds (0) != 1) {
g_error("No or too many file descriptors received.\n");
exit(1);
}
fd = SD_LISTEN_FDS_START + 0;
- socket = g_socket_new_from_fd(fd, &error);
+ socket = g_socket_new_from_fd (fd, &error);
if (error != NULL) {
- g_error("%s\n", error->message);
+ g_error ("%s\n", error->message);
return 1;
}
- helper = pk_client_helper_new();
- if (!pk_client_helper_start_with_socket(helper, socket, argv, envp, &error)) {
- g_error("%s\n", error->message);
+ helper = pk_client_helper_new ();
+ if (!pk_client_helper_start_with_socket (helper, socket, argv, envp, &error)) {
+ g_error ("%s\n", error->message);
return 1;
}
- g_timeout_add_seconds(60, exit_loop, NULL);
+ g_timeout_add_seconds (60, exit_loop, NULL);
- g_main_loop_run(main_loop);
+ g_main_loop_run (main_loop);
+
+ g_object_unref (helper);
+ g_object_unref (main_loop);
+ return 0;
}
diff --git a/backends/apt/pkg-list.cpp b/backends/apt/pkg-list.cpp
index c1dd40c..6356c6b 100644
--- a/backends/apt/pkg-list.cpp
+++ b/backends/apt/pkg-list.cpp
@@ -21,6 +21,9 @@
#include "pkg-list.h"
+#include
+#include
+
#include
// compare...uses the candidate version of each package.
@@ -35,7 +38,12 @@ class compare
const pkgCache::VerIterator &viB = b.ver;
int ret = strcmp(viA.ParentPkg().Name(), viB.ParentPkg().Name());
if (ret == 0) {
- ret = strcmp(viA.VerStr(), viB.VerStr());
+ if (_system != 0)
+ ret = _system->VS->DoCmpVersion(viA.VerStr(), viA.VerStr() + strlen(viA.VerStr()),
+ viB.VerStr(), viB.VerStr() + strlen(viB.VerStr()));
+ else
+ ret = strcmp(viA.VerStr(), viB.VerStr());
+
if (ret == 0) {
ret = strcmp(viA.Arch(), viB.Arch());
if (ret == 0) {
diff --git a/backends/apt/tests/apt-tests.cpp b/backends/apt/tests/apt-tests.cpp
new file mode 100644
index 0000000..60cefc1
--- /dev/null
+++ b/backends/apt/tests/apt-tests.cpp
@@ -0,0 +1,478 @@
+/*
+ * Copyright (c) 2024 Alessandro Astone
+ * Copyright (c) 2024-2025 Matthias Klumpp
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include
+#include
+#include
+
+#include "deb822.h"
+#include "apt-sourceslist.h"
+#include "gst-matcher.h"
+
+namespace fs = std::filesystem;
+
+static std::string testdata_dir = "";
+
+const char *gst_plugins_bad_pkg = R"(Package: gstreamer1.0-plugins-bad
+Architecture: amd64
+Version: 1.24.8-2ubuntu1
+Multi-Arch: same
+Priority: extra
+Section: universe/libs
+Source: gst-plugins-bad1.0
+Origin: Ubuntu
+Maintainer: Ubuntu Developers
+Original-Maintainer: Maintainers of GStreamer packages
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Installed-Size: 11020
+Provides: gstreamer1.0-audiosink, gstreamer1.0-audiosource, gstreamer1.0-plugins-bad-faad, gstreamer1.0-plugins-bad-videoparsers, gstreamer1.0-videosink, gstreamer1.0-videosource, gstreamer1.0-visualization
+Depends: gstreamer1.0-plugins-base (>= 1.24.0), gstreamer1.0-plugins-good (>= 1.24.0), libgstreamer-plugins-bad1.0-0 (= 1.24.8-2ubuntu1), libaom3 (>= 3.2.0), libass9 (>= 1:0.13.6), libavtp0 (>= 0.2.0), libbs2b0 (>= 3.1.0+dfsg), libbz2-1.0, libc6 (>= 2.38), libcairo2 (>= 1.6.0), libchromaprint1 (>= 1.3.2), libcurl3t64-gnutls (>= 7.55.0), libdc1394-25 (>= 2.2.6), libdca0 (>= 0.0.5), libde265-0 (>= 0.9), libdirectfb-1.7-7t64 (>= 1.7.7), libdrm2 (>= 2.4.98), libdvdnav4 (>= 4.1.3), libdvdread8t64 (>= 4.1.3), libfaad2 (>= 2.7), libflite1 (>= 1.4-release-9~), libfluidsynth3 (>= 2.2.0), libfreeaptx0 (>= 0.1.1), libgcc-s1 (>= 3.3.1), libglib2.0-0t64 (>= 2.80.0), libgme0 (>= 0.6.0), libgsm1 (>= 1.0.18), libgstreamer-gl1.0-0 (>= 1.24.0), libgstreamer-plugins-base1.0-0 (>= 1.24.0), libgstreamer-plugins-good1.0-0 (>= 1.24.7), libgstreamer1.0-0 (>= 1.24.0), libgtk-3-0t64 (>= 3.15.0), libgudev-1.0-0 (>= 146), libimath-3-1-29t64 (>= 3.1.11), libjson-glib-1.0-0 (>= 1.5.2), liblc3-1 (>= 1.0.1), liblcms2-2 (>= 2.7), libldacbt-enc2 (>= 2.0.2), liblilv-0-0 (>= 0.22), liblrdf0 (>= 0.4.0-1.2), libltc11 (>= 1.2.0), libmjpegutils-2.1-0t64 (>= 1:2.1.0+debian), libmodplug1 (>= 1:0.8.8.5), libmpcdec6 (>= 1:0.1~r435), libmpeg2encpp-2.1-0t64 (>= 1:2.1.0+debian), libmplex2-2.1-0t64 (>= 1:2.1.0+debian), libneon27t64, libnettle8t64 (>= 3), libopenal1 (>= 1:1.14), libopenexr-3-1-30 (>= 3.1.5), libopenh264-7 (>= 2.4.1+dfsg), libopenjp2-7 (>= 2.2.0), libopenmpt0t64 (>= 0.5.10), libopenni2-0 (>= 2.2.0.33+dfsg), libopus0 (>= 1.1), liborc-0.4-0t64 (>= 1:0.4.34), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.22), libqrencode4 (>= 3.2.0), librsvg2-2 (>= 2.36.2), librtmp1 (>= 2.3), libsbc1 (>= 2.0), libsndfile1 (>= 1.0.20), libsoundtouch1 (>= 2.0.0), libspandsp2t64 (>= 0.0.6~pre18), libsrt1.5-gnutls (>= 1.5.3), libsrtp2-1 (>= 2.0.0+20170516), libssl3t64 (>= 3.0.0), libstdc++6 (>= 13.1), libsvtav1enc2 (>= 2.1.0+dfsg), libusb-1.0-0 (>= 2:1.0.8), libva2 (>= 2.2.0), libvo-aacenc0 (>= 0.1.3), libvo-amrwbenc0 (>= 0.1.3), libvulkan1 (>= 1.2.131.2), libwayland-client0 (>= 1.20.0), libwebp7 (>= 1.4.0), libwebpmux3 (>= 1.4.0), libwebrtc-audio-processing-1-3 (>= 1.3), libwildmidi2 (>= 0.2.3), libx11-6, libx265-209 (>= 3.6), libxml2 (>= 2.9.0), libzbar0t64 (>= 0.10), libzvbi0t64 (>= 0.2.35), libzxing3 (>= 2.2.1)
+Suggests: frei0r-plugins
+Conflicts: gstreamer1.0-plugins-bad-faad (<< 1.11.91-1ubuntu1), gstreamer1.0-plugins-bad-videoparsers (<< 1.11.91-1ubuntu1)
+Breaks: gstreamer1.0-plugins-base (<< 0.11.94), gstreamer1.0-plugins-good (<< 1.1.2)
+Replaces: gstreamer1.0-plugins-bad-faad (<< 1.11.91-1ubuntu1), gstreamer1.0-plugins-bad-videoparsers (<< 1.11.91-1ubuntu1), gstreamer1.0-plugins-base (<< 0.11.94), gstreamer1.0-plugins-good (<< 1.1.2)
+Filename: pool/universe/g/gst-plugins-bad1.0/gstreamer1.0-plugins-bad_1.24.8-2ubuntu1_amd64.deb
+Size: 3042084
+MD5sum: 6ce2fdec6c7ddc9077d8580a19e19b2c
+SHA1: 979c1d9ffd177d92124e43325f2d1fdf9fc110d1
+SHA256: c4038572cd32da9e8e5d5e4f0949accc9cc15a3fabe1b8ef6573dba47e2ea524
+SHA512: 6689c1da1a6b399742e71874f625f1794ebc0ce6e3cb1a57e78fb881fa8794f22dab6e363907805c4bd9eba9a0d6afcb82520f066a1a8b105c740467e067684b
+Homepage: https://gstreamer.freedesktop.org
+Description: GStreamer plugins from the "bad" set
+Task: ubuntustudio-desktop, ubuntukylin-desktop, ubuntukylin-desktop, ubuntukylin-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop
+Gstreamer-Decoders: application/dash+xml; application/mxf; application/vnd.ms-sstr+xml; application/x-hls; application/x-yuv4mpeg, y4mversion=(int)2; audio/midi; audio/mpeg, mpegversion=(int)4, stream-format=(string){ raw, adts }; audio/mpeg, mpegversion=(int)2; audio/ms-gsm; audio/riff-midi; audio/x-adpcm, layout=(string){ microsoft, dvi }; audio/x-aiff; audio/x-ay; audio/x-dts; audio/x-gbs; audio/x-gsm; audio/x-gym; audio/x-hes; audio/x-ircam; audio/x-it; audio/x-kss; audio/x-midi-event; audio/x-mod; audio/x-musepack, streamversion=(int){ 7, 8 }; audio/x-nist; audio/x-nsf; audio/x-paris; audio/x-private1-dts; audio/x-rf64; audio/x-s3m; audio/x-sap; audio/x-sbc, parsed=(boolean)true; audio/x-sds; audio/x-siren, dct-length=(int)320; audio/x-spc; audio/x-stm; audio/x-svx; audio/x-vgm; audio/x-voc; audio/x-w64; audio/x-xi; audio/x-xm; image/jp2; image/png; image/svg; image/svg+xml; image/webp; image/x-exr; image/x-j2c; image/x-jpc; image/x-jpc-striped; image/x-portable-anymap; image/x-portable-bitmap; image/x-portable-graymap; image/x-portable-pixmap; video/mpeg, mpegversion=(int){ 1, 2 }, systemstream=(boolean){ true, false }; video/mpeg, mpegversion=(int)4, systemstream=(boolean)false; video/mpegts, systemstream=(boolean)true; video/x-av1; video/x-cdxa; video/x-divx, divxversion=(int)[ 4, 5 ]; video/x-h263, variant=(string)itu; video/x-h264; video/x-h265; video/x-ivf; video/x-vmnc, version=(int)1; video/x-vp8, codec-alpha=(boolean)true; video/x-vp9
+Gstreamer-Elements: a2dpsink, accurip, adpcmdec, adpcmenc, aesdec, aesenc, aiffmux, aiffparse, alphacombine, asfmux, asfparse, assrender, atscmux, audiobuffersplit, audiochannelmix, audiolatency, audiomixmatrix, audioparse, audiosegmentclip, autoconvert, autodeinterlace, autovideoconvert, autovideoflip, av12json, av1dec, av1enc, av1parse, avdtpsink, avdtpsrc, avtpaafdepay, avtpaafpay, avtpcrfcheck, avtpcrfsync, avtpcvfdepay, avtpcvfpay, avtprvfdepay, avtprvfpay, avtpsink, avtpsrc, avwait, bayer2rgb, bpmdetect, bs2b, bulge, burn, bz2dec, bz2enc, cc708overlay, cccombiner, ccconverter, ccextractor, cea608mux, checksumsink, chopmydata, chromahold, chromaprint, chromium, circle, clockselect, codecalphademux, coloreffects, combdetect, compare, curlfilesink, curlftpsink, curlhttpsink, curlhttpsrc, curlsftpsink, curlsmtpsink, dashdemux, dashsink, dc1394src, debugqroverlay, debugspy, decklinkaudiosink, decklinkaudiosrc, decklinkvideosink, decklinkvideosrc, dfbvideosink, diffuse, dilate, diracparse, dodge, dtlsdec, dtlsenc, dtlssrtpdec, dtlssrtpdemux, dtlssrtpenc, dtmfdetect, dtsdec, dvbbasebin, dvbsrc, dvbsubenc, dvbsuboverlay, dvdspu, errorignore, exclusion, faad, faceoverlay, fakeaudiosink, fakevideosink, fbdevsink, festival, fieldanalysis, fisheye, flitetestsrc, fluiddec, fpsdisplaysink, freeverb, gaussianblur, gdpdepay, gdppay, gmedec, gsmdec, gsmenc, gtkwaylandsink, h263parse, h2642json, h264parse, h264timestamper, h2652json, h265parse, h265timestamper, hlsdemux, hlssink, hlssink2, id3mux, insertbin, interaudiosink, interaudiosrc, interlace, intersubsink, intersubsrc, intervideosink, intervideosrc, ipcpipelinesink, ipcpipelinesrc, ipcslavepipeline, irtspparse, ivfparse, ivtc, jp2kdecimator, jpeg2000parse, kaleidoscope, kmssink, ladspa-amp-so-amp-mono, ladspa-amp-so-amp-stereo, ladspa-delay-so-delay-5s, ladspa-filter-so-hpf, ladspa-filter-so-lpf, ladspa-sine-so-sine-faaa, ladspa-sine-so-sine-faac, ladspa-sine-so-sine-fcaa, ladspasrc-noise-so-noise-white, ladspasrc-sine-so-sine-fcac, lc3dec, lc3enc, lcms, ldacenc, libde265dec, line21decoder, line21encoder, marble, midiparse, mirror, modplug, mpeg2enc, mpeg4videoparse, mpegpsdemux, mpegpsmux, mpegtsmux, mpegvideoparse, mplex, msesrc, mssdemux, musepackdec, mxfdemux, mxfmux, neonhttpsrc, netsim, objectdetectionoverlay, openalsink, openalsrc, openaptxdec, openaptxenc, openexrdec, openh264dec, openh264enc, openjpegdec, openjpegenc, openmptdec, openni2src, opusparse, pcapparse, perspective, pinch, pitch, pngparse, pnmdec, pnmenc, proxysink, proxysrc, qroverlay, removesilence, rfbsrc, rgb2bayer, ristrtpdeext, ristrtpext, ristrtxreceive, ristrtxsend, ristsink, ristsrc, rotate, roundrobin, rsndvdbin, rsvgdec, rsvgoverlay, rtmp2sink, rtmp2src, rtmpsink, rtmpsrc, rtpasfpay, rtponvifparse, rtponviftimestamp, rtpsink, rtpsrc, sbcdec, sbcenc, scenechange, sctpdec, sctpenc, sdpdemux, sdpsrc, sfdec, shmsink, shmsrc, simplevideomark, simplevideomarkdetect, sirendec, sirenenc, smooth, solarize, spacescope, spanplc, spectrascope, speed, sphere, square, srtclientsink, srtclientsrc, srtenc, srtpdec, srtpenc, srtserversink, srtserversrc, srtsink, srtsrc, stretch, svtav1enc, switchbin, synaescope, teletextdec, testsrcbin, timecodestamper, tonegeneratesrc, transcodebin, tsdemux, tsparse, ttmlparse, ttmlrender, tunnel, twirl, unixfdsink, unixfdsrc, uritranscodebin, uvch264mjpgdemux, uvch264src, uvcsink, vc1parse, videoanalyse, videocodectestsink, videodiff, videoframe-audiolevel, videoparse, videosegmentclip, vmncdec, voaacenc, voamrwbenc, vp82json, vp8alphadecodebin, vp9alphadecodebin, vp9parse, vulkancolorconvert, vulkandownload, vulkanh264dec, vulkanh265dec, vulkanimageidentity, vulkanoverlaycompositor, vulkanshaderspv, vulkansink, vulkanupload, vulkanviewconvert, watchdog, waterripple, wavescope, waylandsink, webpdec, webpenc, webrtcbin, webrtcdsp, webrtcechoprobe, webvttenc, wildmididec, x265enc, y4mdec, zbar, zebrastripe, zxing
+Gstreamer-Encoders: application/mxf; application/x-bzip; application/x-dtls; application/x-gdp; application/x-rtp, media=(string){ audio, video, application }, encoding-name=(string)X-ASF-PF; application/x-sctp; application/x-subtitle; application/x-subtitle-vtt; audio/AMR-WB; audio/aptx; audio/aptx-hd; audio/mpeg, mpegversion=(int)4, stream-format=(string){ adts, raw }, base-profile=(string)lc; audio/x-adpcm, layout=(string)dvi; audio/x-aiff; audio/x-gsm; audio/x-lc3, frame-bytes=(int)[ 20, 400 ], frame-duration-us=(int){ 10000, 7500 }, framed=(boolean)true; audio/x-ldac, channel-mode=(string){ mono, dual, stereo }; audio/x-sbc, channel-mode=(string){ mono, dual, stereo, joint }, blocks=(int){ 4, 8, 12, 16 }, subbands=(int){ 4, 8 }, allocation-method=(string){ snr, loudness }, bitpool=(int)[ 2, 64 ]; audio/x-siren, dct-length=(int)320; image/jp2; image/webp; image/x-j2c, num-components=(int)[ 1, 4 ], sampling=(string){ RGB, BGR, RGBA, BGRA, YCbCr-4:4:4, YCbCr-4:2:2, YCbCr-4:2:0, YCbCr-4:1:1, YCbCr-4:1:0, GRAYSCALE, YCbCrA-4:4:4:4 }, colorspace=(string){ sRGB, sYUV, GRAY }; image/x-jpc, num-components=(int)[ 1, 4 ], num-stripes=(int)[ 1, 2147483647 ], alignment=(string){ frame, stripe }, sampling=(string){ RGB, BGR, RGBA, BGRA, YCbCr-4:4:4, YCbCr-4:2:2, YCbCr-4:2:0, YCbCr-4:1:1, YCbCr-4:1:0, GRAYSCALE, YCbCrA-4:4:4:4 }, colorspace=(string){ sRGB, sYUV, GRAY }; image/x-jpc-striped, num-components=(int)[ 1, 4 ], sampling=(string){ RGB, BGR, RGBA, BGRA, YCbCr-4:4:4, YCbCr-4:2:2, YCbCr-4:2:0, YCbCr-4:1:1, YCbCr-4:1:0, GRAYSCALE, YCbCrA-4:4:4:4 }, colorspace=(string){ sRGB, sYUV, GRAY }, num-stripes=(int)[ 2, 2147483647 ], stripe-height=(int)[ 1, 2147483647 ]; image/x-portable-anymap; image/x-portable-bitmap; image/x-portable-graymap; image/x-portable-pixmap; video/mpeg, systemstream=(boolean)false, mpegversion=(int){ 1, 2 }; video/mpeg, systemstream=(boolean)true; video/mpegts, systemstream=(boolean)true, packetsize=(int){ 192, 188 }; video/x-av1, stream-format=(string)obu-stream, alignment=(string)tu; video/x-h264, stream-format=(string)byte-stream, alignment=(string)au, profile=(string){ constrained-baseline, baseline, main, constrained-high, high }; video/x-h265, stream-format=(string)byte-stream, alignment=(string)au, profile=(string){ main, main-still-picture, main-intra, main-444, main-444-intra, main-444-still-picture, main-10, main-10-intra, main-422-10, main-422-10-intra, main-444-10, main-444-10-intra, main-12, main-12-intra, main-422-12, main-422-12-intra, main-444-12, main-444-12-intra }; video/x-ms-asf, parsed=(boolean)true
+Gstreamer-Uri-Sinks: rtmfp, rtmp, rtmpe, rtmps, rtmpt, rtmpte, rtmpts, rtp, srt
+Gstreamer-Uri-Sources: dvb, dvd, http, https, mse, rfb, rist, rtmfp, rtmp, rtmpe, rtmps, rtmpt, rtmpte, rtmpts, rtp, sdp, srt, testbin
+Gstreamer-Version: 1.24
+Description-md5: 96aaaad9b842ce9ddb51b002cc05eca0
+)";
+
+const char *gst_plugins_ugly_pkg = R"(
+Package: gstreamer1.0-plugins-ugly
+Architecture: amd64
+Version: 1.24.8-1
+Multi-Arch: same
+Priority: optional
+Section: universe/libs
+Source: gst-plugins-ugly1.0
+Origin: Ubuntu
+Maintainer: Ubuntu Developers
+Original-Maintainer: Maintainers of GStreamer packages
+Bugs: https://bugs.launchpad.net/ubuntu/+filebug
+Installed-Size: 762
+Depends: liba52-0.7.4 (>= 0.7.4), libc6 (>= 2.14), libcdio19t64 (>= 2.1.0), libdvdread8t64 (>= 4.1.3), libgcc-s1 (>= 3.3.1), libglib2.0-0t64 (>= 2.80.0), libgstreamer-plugins-base1.0-0 (>= 1.24.0), libgstreamer1.0-0 (>= 1.24.0), libmpeg2-4 (>= 0.5.1), liborc-0.4-0t64 (>= 1:0.4.34), libsidplay1v5, libstdc++6 (>= 5), libx264-164 (>= 2:0.164.3108+git31e19f9)
+Filename: pool/universe/g/gst-plugins-ugly1.0/gstreamer1.0-plugins-ugly_1.24.8-1_amd64.deb
+Size: 189710
+MD5sum: 89b6e8f329891e6dcebbd6a39677223e
+SHA1: 7b6976a3c521ca35d85e63fe8087ac06a052f2db
+SHA256: c2ab817c21a54209c706c94b2bbc9116f26f0ba3f2816c6425b2c507f542aa18
+SHA512: d93e976c6e328c0e6e4fd52ed91425b548f3a164dcb11a3ab8da041847b4e0375ff682178f4801d674c938acdf46dd6ab41d99b903f1d4fef52c451493c51d05
+Homepage: https://gstreamer.freedesktop.org
+Description: GStreamer plugins from the "ugly" set
+Task: ubuntu-budgie-desktop-minimal, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi, ubuntu-unity-desktop, ubuntucinnamon-desktop-minimal, ubuntucinnamon-desktop, ubuntucinnamon-desktop, ubuntucinnamon-desktop-raspi
+Gstreamer-Decoders: application/vnd.rn-realmedia; application/x-pn-realaudio; application/x-rtp, media=(string){ application, video, audio }, payload=(int)[ 96, 127 ], encoding-name=(string)X-ASF-PF; audio/ac3; audio/x-ac3; audio/x-lpcm; audio/x-private-ts-lpcm; audio/x-private1-ac3; audio/x-private1-lpcm; audio/x-private2-lpcm; audio/x-sid; video/mpeg, mpegversion=(int)[ 1, 2 ], systemstream=(boolean)false; video/x-ms-asf
+Gstreamer-Elements: a52dec, asfdemux, cdiocddasrc, dvdlpcmdec, dvdreadsrc, dvdsubdec, dvdsubparse, mpeg2dec, rademux, rmdemux, rtpasfdepay, rtspwms, siddec, x264enc
+Gstreamer-Encoders: video/x-h264, stream-format=(string){ avc, byte-stream }, alignment=(string)au, profile=(string){ high-4:4:4, high-4:2:2, high-10, high, main, baseline, constrained-baseline, high-4:4:4-intra, high-4:2:2-intra, high-10-intra }
+Gstreamer-Uri-Sources: cdda, dvd
+Gstreamer-Version: 1.24
+Description-md5: c036226562f55540aad2e51fbde63d54
+)";
+
+static GStrv
+codec_strv(const char *codec)
+{
+ g_autoptr(GStrvBuilder) builder = g_strv_builder_new();
+ g_strv_builder_add(builder, codec);
+ return g_strv_builder_end(builder);
+}
+
+static void
+apt_test_gst_matcher_bad_codec (void)
+{
+ {
+ GstMatcher matcher(codec_strv("foobar()"));
+ g_assert_false(matcher.hasMatches());
+ }
+
+ {
+ GstMatcher matcher(codec_strv("foobar()()(64bit)"));
+ g_assert_false(matcher.hasMatches());
+ }
+}
+
+static void
+apt_test_gst_matcher_with_caps (void)
+{
+ {
+ /* Matches amd64-only */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-audio/mpeg)(mpegversion=4)()(64bit)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_false(matcher.matches(gst_plugins_bad_pkg, "i386"));
+ }
+
+ {
+ /* Matches any architectures */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-audio/mpeg)(mpegversion=4)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "i386"));
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "arm64"));
+ }
+
+ {
+ /* Matches the right package only */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-audio/mpeg)(mpegversion=4)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_false(matcher.matches(gst_plugins_ugly_pkg, "amd64"));
+ g_assert_false(matcher.matches("", "amd64"));
+ }
+}
+
+static void
+apt_test_gst_matcher_without_caps (void)
+{
+ {
+ /* Matches amd64-only */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-video/x-h265)()(64bit)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_false(matcher.matches(gst_plugins_bad_pkg, "i386"));
+ }
+
+ {
+ /* Matches any architectures */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-video/x-h265)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "i386"));
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "arm64"));
+ }
+
+ {
+ /* Matches the right package only */
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-video/x-h265)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_true(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ g_assert_false(matcher.matches(gst_plugins_ugly_pkg, "amd64"));
+ g_assert_false(matcher.matches("", "amd64"));
+ }
+}
+
+static void
+apt_test_gst_matcher_bad_caps (void)
+{
+ {
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-audio/mpeg)(mpegversion=5)()(64bit)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_false(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ }
+
+ {
+ GstMatcher matcher(codec_strv("gstreamer1(decoder-audio/mpeg)(mpegversion=5)"));
+ g_assert_true(matcher.hasMatches());
+
+ g_assert_false(matcher.matches(gst_plugins_bad_pkg, "amd64"));
+ }
+}
+
+static void
+apt_test_deb822 (void)
+{
+ const std::string input = R"(# Comment
+Package: testpkg
+Version: 1.0
+# Intermediate comment
+Description: This is a test
+ for multiline
+ field.
+
+# Another comment
+
+Package: packagekit
+Version: 1.4
+)";
+
+ const std::string expectedOutputModify = R"(# Comment
+Package: testpkg
+Version: 2.0.0
+# Intermediate comment
+Description: This is a test
+NewField: hello
+ world
+
+# Another comment
+
+Package: packagekit
+Version: 1.4
+AnotherNewField: Yay: Hurray!
+)";
+
+ const std::string expectedOutputDelete = R"(# Another comment
+
+Package: packagekit
+Version: 1.4
+AnotherNewField: Yay: Hurray!
+)";
+
+ const std::string expectedOutputDuplicate = R"(# Another comment
+
+Package: packagekit
+Version: 1.4
+AnotherNewField: Yay: Hurray!
+
+Package: packagekit
+Version: 1.6
+AnotherNewField: Yay: Hurray!
+)";
+
+ const std::string expectedOutputFieldDelete = R"(# Another comment
+
+Version: 1.4
+AnotherNewField: Yay: Hurray!
+
+Package: packagekit
+Version: 1.6
+AnotherNewField: Yay: Hurray!
+)";
+
+ Deb822File deb;
+ g_assert_true(deb.loadFromString(input));
+
+ // read field
+ auto version = deb.getFieldValue(0, "Version");
+ g_assert_true(version.has_value());
+ g_assert_cmpstr(version.value().c_str(), ==, "1.0");
+
+ auto desc = deb.getFieldValue(0, "Description");
+ g_assert_true(desc.has_value());
+ g_assert_cmpstr(desc.value().c_str(), ==, "This is a test\n for multiline\n field.");
+
+ auto value = deb.getFieldValue(1, "Package");
+ g_assert_true(value.has_value());
+ g_assert_cmpstr(value.value().c_str(), ==, "packagekit");
+
+ // modify/add fields
+ g_assert_true(deb.updateField(0, "Version", "2.0.0"));
+ g_assert_true(deb.updateField(0, "NewField", "hello\nworld"));
+ g_assert_true(deb.updateField(1, "AnotherNewField", "Yay: Hurray!"));
+
+ // get modified fields
+ auto newField = deb.getFieldValue(0, "NewField");
+ g_assert_true(newField.has_value());
+ g_assert_cmpstr(newField.value().c_str(), ==, "hello\nworld");
+ newField = deb.getFieldValue(1, "AnotherNewField");
+ g_assert_true(newField.has_value());
+ g_assert_cmpstr(newField.value().c_str(), ==, "Yay: Hurray!");
+
+ auto output = deb.toString();
+ g_assert_cmpstr(output.c_str(), ==, expectedOutputModify.c_str());
+
+ // test stanza deletion
+ g_assert_cmpuint(deb.stanzaCount(), ==, 2);
+ g_assert_true(deb.deleteStanza(0));
+ g_assert_cmpuint(deb.stanzaCount(), ==, 1);
+
+ output = deb.toString();
+ g_assert_cmpstr(output.c_str(), ==, expectedOutputDelete.c_str());
+
+ // test stanza duplication
+ int newIndex = deb.duplicateStanza(0);
+ g_assert_cmpint(newIndex, >=, 0);
+ g_assert_true(deb.updateField(newIndex, "Version", "1.6"));
+ output = deb.toString();
+ g_assert_cmpstr(output.c_str(), ==, expectedOutputDuplicate.c_str());
+
+ // test field deletion
+ g_assert_true(deb.deleteField(0, "Package"));
+ g_assert_false(deb.getFieldValue(0, "Package").has_value());
+ output = deb.toString();
+ g_assert_cmpstr(output.c_str(), ==, expectedOutputFieldDelete.c_str());
+}
+
+static bool
+_test_string_sets_equal(const set &expected, const set &testSet)
+{
+ if (expected == testSet)
+ return true;
+
+ g_test_message("Mismatch in sets:");
+
+ for (const string &line : testSet) {
+ if (expected.find(line) == expected.end())
+ g_test_message(" Unexpected: %s", line.c_str());
+ }
+
+ for (const string &line : expected) {
+ if (testSet.find(line) == testSet.end())
+ g_test_message(" Missing: %s", line.c_str());
+ }
+
+ return false;
+}
+
+static bool
+_test_sample_sources(const std::string &testSourcesDir)
+{
+ SourcesList sourcesList;
+ g_assert_true (sourcesList.ReadSourceDir(testSourcesDir));
+
+ const set expectedSources = {
+ testSourcesDir + "/debian.sources:deb:http://deb.debian.org/debian/:experimental:main,contrib,non-free | main contrib non-free | Debian Experimental (main contrib non-free) | disabled",
+ testSourcesDir + "/debian.sources:deb:http://deb.debian.org/debian/:testing:main,contrib,non-free-firmware,non-free | main contrib non-free-firmware non-free | Debian Testing (main contrib non-free-firmware non-free) | enabled",
+ testSourcesDir + "/debian.sources:deb-src:http://deb.debian.org/debian/:testing:main,contrib,non-free-firmware,non-free | main contrib non-free-firmware non-free | Debian Testing (main contrib non-free-firmware non-free) Sources | enabled",
+ testSourcesDir + "/mozilla.list:deb:https://packages.mozilla.org/apt/:mozilla:main | main | packages.mozilla.org/apt - Mozilla (main) | enabled",
+ testSourcesDir + "/mozilla.list:deb:https://packages.mozilla.org/apt/:mozilla-disabled:main | main | packages.mozilla.org/apt - Mozilla disabled (main) | disabled"
+ };
+
+ set foundSources;
+ for (SourcesList::SourceRecord *sourceRecord : sourcesList.SourceRecords) {
+ if (sourceRecord->Type & SourcesList::Comment)
+ continue;
+
+ string srcRecordStr = sourceRecord->repoId() + " | " + sourceRecord->joinedSections() + " | " + sourceRecord->niceName() + " | " +
+ ((sourceRecord->Type & SourcesList::Disabled)? "disabled" : "enabled");
+ foundSources.insert(srcRecordStr);
+ }
+
+ // compare results
+ return _test_string_sets_equal(expectedSources, foundSources);
+}
+
+static void
+apt_test_sources_read (void)
+{
+ std::string testSourcesDir = testdata_dir + "/sources";
+ g_assert_true (_test_sample_sources(testSourcesDir));
+}
+
+static void
+apt_test_sources_write (void)
+{
+ std::string origSampleSourcesDir = testdata_dir + "/sources";
+ std::string wtestSourcesDir = testdata_dir + "/sources.tmp";
+
+ // create pristine directory to work in
+ if (fs::exists(wtestSourcesDir) && fs::is_directory(wtestSourcesDir))
+ fs::remove_all(wtestSourcesDir);
+ fs::copy(origSampleSourcesDir, wtestSourcesDir, fs::copy_options::recursive);
+
+ const set expectedSourcesDisabled = {
+ wtestSourcesDir + "/debian.sources:deb:http://deb.debian.org/debian/:experimental:main,contrib,non-free | main contrib non-free | Debian Experimental (main contrib non-free) | enabled",
+ wtestSourcesDir + "/debian.sources:deb:http://deb.debian.org/debian/:testing:main,contrib,non-free-firmware,non-free | main contrib non-free-firmware non-free | Debian Testing (main contrib non-free-firmware non-free) | disabled",
+ wtestSourcesDir + "/debian.sources:deb-src:http://deb.debian.org/debian/:testing:main,contrib,non-free-firmware,non-free | main contrib non-free-firmware non-free | Debian Testing (main contrib non-free-firmware non-free) Sources | enabled",
+ wtestSourcesDir + "/mozilla.list:deb:https://packages.mozilla.org/apt/:mozilla:main | main | packages.mozilla.org/apt - Mozilla (main) | enabled",
+ wtestSourcesDir + "/mozilla.list:deb:https://packages.mozilla.org/apt/:mozilla-disabled:main | main | packages.mozilla.org/apt - Mozilla disabled (main) | enabled"
+ };
+
+ // read data and write it back, ensure we do not change anything
+ auto sourcesList = std::make_unique();
+ g_assert_true (sourcesList->ReadSourceDir(wtestSourcesDir));
+ g_assert_true (sourcesList->UpdateSources());
+ g_assert_true (_test_sample_sources(wtestSourcesDir));
+
+ // enable/disable some stuff
+ for (SourcesList::SourceRecord *sourceRecord : sourcesList->SourceRecords) {
+ if (sourceRecord->Type & SourcesList::Comment)
+ continue;
+
+ if (sourceRecord->niceName() == "Debian Testing (main contrib non-free-firmware non-free)")
+ sourceRecord->Type |= SourcesList::Disabled;
+ else if (sourceRecord->niceName() == "Debian Experimental (main contrib non-free)")
+ sourceRecord->Type = sourceRecord->Type & ~SourcesList::Disabled;
+ else if (sourceRecord->niceName() == "packages.mozilla.org/apt - Mozilla disabled (main)")
+ sourceRecord->Type = sourceRecord->Type & ~SourcesList::Disabled;
+ }
+ g_assert_true (sourcesList->UpdateSources());
+
+ // full reload
+ sourcesList = std::make_unique();
+ g_assert_true (sourcesList->ReadSourceDir(wtestSourcesDir));
+
+ set foundSources;
+ for (SourcesList::SourceRecord *sourceRecord : sourcesList->SourceRecords) {
+ if (sourceRecord->Type & SourcesList::Comment)
+ continue;
+
+ string srcRecordStr = sourceRecord->repoId() + " | " + sourceRecord->joinedSections() + " | " + sourceRecord->niceName() + " | " +
+ ((sourceRecord->Type & SourcesList::Disabled)? "disabled" : "enabled");
+ foundSources.insert(srcRecordStr);
+ }
+
+ // compare results
+ g_assert_true (_test_string_sets_equal(expectedSourcesDisabled, foundSources));
+
+ // restore previous state
+ for (SourcesList::SourceRecord *sourceRecord : sourcesList->SourceRecords) {
+ if (sourceRecord->Type & SourcesList::Comment)
+ continue;
+
+ if (sourceRecord->niceName() == "Debian Testing (main contrib non-free-firmware non-free)")
+ sourceRecord->Type = sourceRecord->Type & ~SourcesList::Disabled;
+ else if (sourceRecord->niceName() == "Debian Experimental (main contrib non-free)")
+ sourceRecord->Type |= SourcesList::Disabled;
+ else if (sourceRecord->niceName() == "packages.mozilla.org/apt - Mozilla disabled (main)")
+ sourceRecord->Type |= SourcesList::Disabled;
+ }
+ g_assert_true (sourcesList->UpdateSources());
+
+ // check if state was restored
+ g_assert_true (_test_sample_sources(wtestSourcesDir));
+
+ // cleanup
+ fs::remove_all(wtestSourcesDir);
+}
+
+int
+main (int argc, char **argv)
+{
+ if (argc == 0)
+ g_error ("No test directory specified!");
+
+ g_assert_nonnull (argv[1]);
+ testdata_dir = std::string (argv[1]);
+ if (!testdata_dir.empty() && testdata_dir.back() == '/')
+ testdata_dir.pop_back();
+ g_assert_true (g_file_test (testdata_dir.c_str(), G_FILE_TEST_EXISTS));
+
+ g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+ g_test_init (&argc, &argv, NULL);
+
+ /* tests go here */
+ g_test_add_func ("/apt/gst-matcher/bad-codec", apt_test_gst_matcher_bad_codec);
+ g_test_add_func ("/apt/gst-matcher/with-caps", apt_test_gst_matcher_with_caps);
+ g_test_add_func ("/apt/gst-matcher/without-caps", apt_test_gst_matcher_without_caps);
+ g_test_add_func ("/apt/gst-matcher/bad-caps", apt_test_gst_matcher_bad_caps);
+ g_test_add_func ("/apt/deb822/readwrite", apt_test_deb822);
+ g_test_add_func ("/apt/sources/read", apt_test_sources_read);
+ g_test_add_func ("/apt/sources/write", apt_test_sources_write);
+
+ return g_test_run();
+}
diff --git a/backends/apt/tests/definitions.cpp b/backends/apt/tests/definitions.cpp
new file mode 100644
index 0000000..bb2a77a
--- /dev/null
+++ b/backends/apt/tests/definitions.cpp
@@ -0,0 +1,207 @@
+#include "pk-backend.h"
+#include
+
+/* Define symbols used by libpk_backend_apt,
+ * otherwise we can't link it.
+ */
+
+const gchar *
+pk_backend_job_get_locale (PkBackendJob *job)
+{
+ return NULL;
+}
+
+gpointer
+pk_backend_job_get_user_data (PkBackendJob *job)
+{
+ return NULL;
+}
+
+void
+pk_backend_job_set_user_data (PkBackendJob *job, gpointer user_data)
+{
+}
+
+void
+pk_backend_job_repo_detail (PkBackendJob *job,
+ const gchar *repo_id,
+ const gchar *description,
+ gboolean enabled)
+{
+}
+
+void
+pk_backend_job_update_details (PkBackendJob *job,
+ GPtrArray *update_details)
+{
+}
+
+void
+pk_backend_job_packages (PkBackendJob *job,
+ GPtrArray *packages)
+{
+}
+
+void
+pk_backend_job_set_download_size_remaining (PkBackendJob *job,
+ guint64 download_size_remaining)
+{
+}
+
+void
+pk_backend_job_error_code (PkBackendJob *job,
+ PkErrorEnum error_code,
+ const gchar *format, ...)
+{
+}
+
+void
+pk_backend_job_files (PkBackendJob *job,
+ const gchar *package_id,
+ gchar **files)
+{
+}
+
+void
+pk_backend_job_require_restart (PkBackendJob *job,
+ PkRestartEnum restart,
+ const gchar *package_id)
+{
+}
+
+void
+pk_backend_job_set_percentage (PkBackendJob *job,
+ guint percentage)
+{
+}
+
+void
+pk_backend_job_set_speed (PkBackendJob *job,
+ guint speed)
+{
+}
+
+PkBitfield
+pk_backend_job_get_transaction_flags (PkBackendJob *job)
+{
+ return 0;
+}
+
+void
+pk_backend_job_package (PkBackendJob *job,
+ PkInfoEnum info,
+ const gchar *package_id,
+ const gchar *summary)
+{
+}
+
+void
+pk_backend_job_media_change_required (PkBackendJob *job,
+ PkMediaTypeEnum media_type,
+ const gchar *media_id,
+ const gchar *media_text)
+{
+}
+
+void
+pk_backend_job_set_allow_cancel (PkBackendJob *job,
+ gboolean allow_cancel)
+{
+}
+
+gboolean
+pk_backend_job_get_interactive (PkBackendJob *job)
+{
+ return FALSE;
+}
+
+void
+pk_backend_job_set_status (PkBackendJob *job,
+ PkStatusEnum status)
+{
+}
+
+PkRoleEnum
+pk_backend_job_get_role (PkBackendJob *job)
+{
+ return PK_ROLE_ENUM_UNKNOWN;
+}
+
+const gchar *
+pk_backend_job_get_proxy_ftp (PkBackendJob *job)
+{
+ return NULL;
+}
+
+void
+pk_backend_job_set_item_progress (PkBackendJob *job,
+ const gchar *package_id,
+ PkStatusEnum status,
+ guint percentage)
+{
+
+}
+
+gpointer
+pk_backend_job_get_backend (PkBackendJob *job)
+{
+ return NULL;
+}
+
+const gchar *
+pk_backend_job_get_frontend_socket (PkBackendJob *job)
+{
+ return NULL;
+}
+
+gboolean
+pk_backend_job_thread_create (PkBackendJob *job,
+ PkBackendJobThreadFunc func,
+ gpointer user_data,
+ GDestroyNotify destroy_func)
+{
+ return TRUE;
+}
+
+const gchar *
+pk_backend_job_get_proxy_http (PkBackendJob *job)
+{
+ return NULL;
+}
+
+void
+pk_backend_job_details_full (PkBackendJob *job,
+ const gchar *package_id,
+ const gchar *summary,
+ const gchar *license,
+ PkGroupEnum group,
+ const gchar *description,
+ const gchar *url,
+ gulong size,
+ guint64 download_size)
+{
+}
+
+guint
+pk_backend_job_get_uid (PkBackendJob *job)
+{
+ return 0;
+}
+
+gchar *
+pk_backend_convert_uri (const gchar *proxy)
+{
+ return NULL;
+}
+
+GType
+pk_backend_get_type ()
+{
+ return G_TYPE_RESERVED_USER_FIRST;
+}
+
+gboolean
+pk_backend_is_online (PkBackend *backend)
+{
+ return TRUE;
+}
diff --git a/backends/apt/tests/meson.build b/backends/apt/tests/meson.build
new file mode 100644
index 0000000..d641ea9
--- /dev/null
+++ b/backends/apt/tests/meson.build
@@ -0,0 +1,25 @@
+
+apt_test_data_dir = meson.current_source_dir() / 'testdata'
+
+apt_tests_exe = executable(
+ 'apt-tests',
+ 'apt-tests.cpp',
+ 'definitions.cpp',
+ include_directories: [
+ packagekit_src_include,
+ ],
+ dependencies: [
+ packagekit_glib2_dep,
+ packagekit_backend_apt_dep,
+ gstreamer_dep,
+ apt_pkg_dep,
+ ],
+ build_by_default: true,
+ install: false,
+)
+
+test(
+ 'apt-backend-tests',
+ apt_tests_exe,
+ args: [apt_test_data_dir],
+)
diff --git a/backends/apt/tests/testdata/sources/debian.sources b/backends/apt/tests/testdata/sources/debian.sources
new file mode 100644
index 0000000..9aab66b
--- /dev/null
+++ b/backends/apt/tests/testdata/sources/debian.sources
@@ -0,0 +1,17 @@
+Types: deb deb-src
+URIs: http://deb.debian.org/debian/
+Suites: testing
+Components: main contrib non-free-firmware non-free
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+
+#
+# Just a comment block
+#
+
+# I am a comment!
+Types: deb
+URIs: http://deb.debian.org/debian/
+Suites: experimental
+Components: main contrib non-free
+Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
+Enabled: no
diff --git a/backends/apt/tests/testdata/sources/ignorethis.list.save b/backends/apt/tests/testdata/sources/ignorethis.list.save
new file mode 100644
index 0000000..bd4f5a9
--- /dev/null
+++ b/backends/apt/tests/testdata/sources/ignorethis.list.save
@@ -0,0 +1 @@
+deb https://example.org/apt/ invalid main
diff --git a/backends/apt/tests/testdata/sources/mozilla.list b/backends/apt/tests/testdata/sources/mozilla.list
new file mode 100644
index 0000000..56362dd
--- /dev/null
+++ b/backends/apt/tests/testdata/sources/mozilla.list
@@ -0,0 +1,3 @@
+deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt/ mozilla main
+
+#deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt/ mozilla-disabled main
diff --git a/backends/dnf/dnf-backend-vendor-openmandriva.c b/backends/dnf/dnf-backend-vendor-openmandriva.c
index 40536f3..5235140 100644
--- a/backends/dnf/dnf-backend-vendor-openmandriva.c
+++ b/backends/dnf/dnf-backend-vendor-openmandriva.c
@@ -29,7 +29,7 @@ dnf_validate_supported_repo (const gchar *id)
guint i, j, k, l, m;
const gchar *valid_sourcesect[] = { "",
- "-unsupported",
+ "-extra",
"-restricted",
"-non-free",
NULL };
@@ -44,6 +44,7 @@ dnf_validate_supported_repo (const gchar *id)
"i686",
"aarch64",
"armv7hnl",
+ "riscv64",
NULL };
const gchar *valid_stage[] = { "",
diff --git a/backends/dnf/dnf-backend.c b/backends/dnf/dnf-backend.c
index 72d35bd..fefe959 100644
--- a/backends/dnf/dnf-backend.c
+++ b/backends/dnf/dnf-backend.c
@@ -38,9 +38,9 @@ dnf_emit_package (PkBackendJob *job, PkInfoEnum info, DnfPackage *pkg)
/* detect */
if (info == PK_INFO_ENUM_UNKNOWN)
- info = dnf_package_get_info (pkg);
+ info = (PkInfoEnum) dnf_package_get_info (pkg);
if (info == PK_INFO_ENUM_UNKNOWN)
- info = dnf_package_installed (pkg) ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
+ info = (PkInfoEnum) dnf_package_installed (pkg) ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
pk_backend_job_package_full (job,
info,
dnf_package_get_package_id (pkg),
@@ -69,9 +69,9 @@ dnf_emit_package_list (PkBackendJob *job,
package_info = info;
if (package_info == PK_INFO_ENUM_UNKNOWN)
- package_info = dnf_package_get_info (dnf_package);
+ package_info = (PkInfoEnum) dnf_package_get_info (dnf_package);
if (package_info == PK_INFO_ENUM_UNKNOWN)
- package_info = dnf_package_installed (dnf_package) ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
+ package_info = (PkInfoEnum) dnf_package_installed (dnf_package) ? PK_INFO_ENUM_INSTALLED : PK_INFO_ENUM_AVAILABLE;
/* check we are valid */
pk_package = pk_package_new ();
@@ -132,12 +132,12 @@ dnf_emit_package_list_filter (PkBackendJob *job,
/* a lower cost package */
if (dnf_package_get_cost (pkg) < dnf_package_get_cost (found)) {
- dnf_package_set_info (found, PK_INFO_ENUM_BLOCKED);
+ dnf_package_set_info (found, (DnfPackageInfo) PK_INFO_ENUM_BLOCKED);
g_hash_table_replace (hash_cost,
g_strdup (dnf_package_get_nevra (pkg)),
(gpointer) pkg);
} else {
- dnf_package_set_info (pkg, PK_INFO_ENUM_BLOCKED);
+ dnf_package_set_info (pkg, (DnfPackageInfo) PK_INFO_ENUM_BLOCKED);
}
}
@@ -163,7 +163,7 @@ dnf_emit_package_list_filter (PkBackendJob *job,
continue;
if (dnf_repo_get_enabled (repo) != DNF_REPO_ENABLED_METADATA)
continue;
- dnf_package_set_info (pkg, PK_INFO_ENUM_UNAVAILABLE);
+ dnf_package_set_info (pkg, (DnfPackageInfo) PK_INFO_ENUM_UNAVAILABLE);
}
for (i = 0; i < pkglist->len; i++) {
diff --git a/backends/dnf/meson.build b/backends/dnf/meson.build
index 814b0d9..ad02898 100644
--- a/backends/dnf/meson.build
+++ b/backends/dnf/meson.build
@@ -1,6 +1,9 @@
appstream_dep = dependency('appstream', version: '>=0.14.0')
dnf_dep = dependency('libdnf', version: '>=0.43.1')
+dnf5_dep = dependency('libdnf5').partial_dependency(includes: true, compile_args: true)
+libdnf5_version = dnf5_dep.version().split('.')
rpm_dep = dependency('rpm')
+sdbus_cpp_dep = dependency('sdbus-c++')
c_args = ['-DG_LOG_DOMAIN="PackageKit-DNF"']
if meson.get_compiler('c').has_function('hy_query_get_advisory_pkgs', prefix: '#include ', dependencies: dnf_dep)
@@ -20,6 +23,31 @@ install_data(
install_dir: join_paths(python_package_dir),
)
+add_languages('cpp', native: false)
+shared_module(
+ 'notify_packagekit',
+ 'notify_packagekit.cpp',
+ cpp_args: [
+ '-std=c++20',
+ '-DLIBDNF5_VERSION_MAJOR=' + libdnf5_version[0],
+ '-DLIBDNF5_VERSION_MINOR=' + libdnf5_version[1],
+ '-DLIBDNF5_VERSION_PATCH=' + libdnf5_version[2],
+ ],
+ include_directories: packagekit_glib2_includes,
+ dependencies: [
+ dnf5_dep,
+ sdbus_cpp_dep,
+ ],
+ name_prefix: '',
+ install: true,
+ install_dir: get_option('libdir') / 'libdnf5/plugins/',
+)
+
+install_data(
+ 'notify_packagekit.conf',
+ install_dir: get_option('sysconfdir') / 'dnf/libdnf5-plugins/'
+)
+
shared_module(
'pk_backend_dnf',
'dnf-backend-vendor-@0@.c'.format(get_option('dnf_vendor')),
diff --git a/backends/dnf/notify_packagekit.conf b/backends/dnf/notify_packagekit.conf
new file mode 100644
index 0000000..80b956b
--- /dev/null
+++ b/backends/dnf/notify_packagekit.conf
@@ -0,0 +1,3 @@
+[main]
+name = notify_packagekit
+enabled = yes
diff --git a/backends/dnf/notify_packagekit.cpp b/backends/dnf/notify_packagekit.cpp
new file mode 100644
index 0000000..3f9263b
--- /dev/null
+++ b/backends/dnf/notify_packagekit.cpp
@@ -0,0 +1,101 @@
+// Copyright (C) 2024 Alessandro Astone
+// SPDX-License-Identifier: LGPL-2.1-or-later
+
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+
+#include
+
+using namespace libdnf5;
+
+namespace {
+
+constexpr const char * PLUGIN_NAME{"notify_packagekit"};
+
+constexpr plugin::Version PLUGIN_VERSION{.major = PK_MAJOR_VERSION, .minor = PK_MINOR_VERSION, .micro = PK_MICRO_VERSION};
+
+constexpr const char * attrs[]{"author.name", "author.email", "description", nullptr};
+constexpr const char * attrs_value[]{"Alessandro Astone", "ales.astone@gmail.com",
+ "Notify packagekitd when packages are installed, updated, or removed."};
+
+class NotifyPackagekitPlugin : public plugin::IPlugin {
+public:
+#if LIBDNF5_VERSION_MAJOR >= 5 && LIBDNF5_VERSION_MINOR >= 2
+ NotifyPackagekitPlugin(libdnf5::plugin::IPluginData & data, libdnf5::ConfigParser &) : IPlugin(data) {}
+#else
+ NotifyPackagekitPlugin(libdnf5::Base & base, libdnf5::ConfigParser &) : IPlugin(base) {}
+#endif
+
+ const char * get_name() const noexcept override { return PLUGIN_NAME; }
+
+ plugin::Version get_version() const noexcept override { return PLUGIN_VERSION; }
+
+ PluginAPIVersion get_api_version() const noexcept override { return PLUGIN_API_VERSION; }
+
+ /// Add custom attributes, such as information about yourself and a description of the plugin.
+ /// These can be used to query plugin-specific data through the API.
+ /// Optional to override.
+ const char * const * get_attributes() const noexcept override { return attrs; }
+ const char * get_attribute(const char * attribute) const noexcept override {
+ for (size_t i = 0; attrs[i]; ++i) {
+ if (std::strcmp(attribute, attrs[i]) == 0) {
+ return attrs_value[i];
+ }
+ }
+ return nullptr;
+ }
+
+ void post_transaction(const libdnf5::base::Transaction & transaction) override;
+};
+
+void NotifyPackagekitPlugin::post_transaction(const libdnf5::base::Transaction & transaction) {
+ auto packagekitProxy = sdbus::createProxy("org.freedesktop.PackageKit", "/org/freedesktop/PackageKit");
+ auto method = packagekitProxy->createMethodCall("org.freedesktop.PackageKit", "StateHasChanged");
+ method << "posttrans";
+ packagekitProxy->callMethod(method);
+}
+
+} // namespace
+
+/// Below is a block of functions with C linkage used for loading the plugin binaries from disk.
+/// All of these are MANDATORY to implement.
+
+/// Return plugin's API version.
+PluginAPIVersion libdnf_plugin_get_api_version(void) {
+ return PLUGIN_API_VERSION;
+}
+
+/// Return plugin's name.
+const char * libdnf_plugin_get_name(void) {
+ return PLUGIN_NAME;
+}
+
+/// Return plugin's version.
+plugin::Version libdnf_plugin_get_version(void) {
+ return PLUGIN_VERSION;
+}
+
+/// Return the instance of the implemented plugin.
+plugin::IPlugin * libdnf_plugin_new_instance(
+ [[maybe_unused]] LibraryVersion library_version,
+#if LIBDNF5_VERSION_MAJOR >= 5 && LIBDNF5_VERSION_MINOR >= 2
+ libdnf5::plugin::IPluginData & base,
+#else
+ libdnf5::Base & base,
+#endif
+ libdnf5::ConfigParser & parser) try {
+ return new NotifyPackagekitPlugin(base, parser);
+} catch (...) {
+ return nullptr;
+}
+
+/// Delete the plugin instance.
+void libdnf_plugin_delete_instance(plugin::IPlugin * plugin_object) {
+ delete plugin_object;
+}
diff --git a/backends/dnf/pk-backend-dnf.c b/backends/dnf/pk-backend-dnf.c
index 1318dd3..356a09d 100644
--- a/backends/dnf/pk-backend-dnf.c
+++ b/backends/dnf/pk-backend-dnf.c
@@ -46,10 +46,12 @@
#include "dnf-backend.h"
#include "pk-backend-dnf-common.h"
+#define DNF_SACK_MAX_AGE 600 /* seconds */
+
typedef struct {
DnfSack *sack;
- gboolean valid;
gchar *key;
+ GTimer *timer;
} DnfSackCacheItem;
typedef struct {
@@ -59,6 +61,7 @@ typedef struct {
GMutex sack_mutex;
GTimer *repos_timer;
gchar *release_ver;
+ guint sack_expire_id;
} PkBackendDnfPrivate;
typedef struct {
@@ -94,24 +97,37 @@ pk_backend_supports_parallelization (PkBackend *backend)
return FALSE;
}
+static gboolean
+pk_backend_check_sack_timer (gpointer key, gpointer value, gpointer user_data)
+{
+ DnfSackCacheItem *cache_item = value;
+ if (g_timer_elapsed (cache_item->timer, NULL) > DNF_SACK_MAX_AGE) {
+ g_debug ("invalidating %s as expired", (char *)key);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static gboolean
+pk_backend_sack_expire (gpointer user_data)
+{
+ PkBackendDnfPrivate *priv = user_data;
+ g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->sack_mutex);
+
+ g_hash_table_foreach_remove (priv->sack_cache,
+ pk_backend_check_sack_timer, NULL);
+ return TRUE;
+}
+
static void
pk_backend_sack_cache_invalidate (PkBackend *backend, const gchar *why)
{
- GList *l;
- DnfSackCacheItem *cache_item;
PkBackendDnfPrivate *priv = pk_backend_get_user_data (backend);
- g_autoptr(GList) values = NULL;
g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->sack_mutex);
- /* set all the cached sacks as invalid */
- values = g_hash_table_get_values (priv->sack_cache);
- for (l = values; l != NULL; l = l->next) {
- cache_item = l->data;
- if (cache_item->valid) {
- g_debug ("invalidating %s as %s", cache_item->key, why);
- cache_item->valid = FALSE;
- }
- }
+ /* remove all cached sacks */
+ g_debug ("removing all dnf sack caches");
+ g_hash_table_remove_all (priv->sack_cache);
}
static void
@@ -124,6 +140,7 @@ pk_backend_yum_repos_changed_cb (DnfRepoLoader *repo_loader, PkBackend *backend)
static void
dnf_sack_cache_item_free (DnfSackCacheItem *cache_item)
{
+ g_timer_destroy (cache_item->timer);
g_object_unref (cache_item->sack);
g_free (cache_item->key);
g_slice_free (DnfSackCacheItem, cache_item);
@@ -261,6 +278,10 @@ pk_backend_initialize (GKeyFile *conf, PkBackend *backend)
g_free,
(GDestroyNotify) dnf_sack_cache_item_free);
+ priv->sack_expire_id = g_timeout_add_seconds (DNF_SACK_MAX_AGE / 2,
+ pk_backend_sack_expire,
+ priv);
+
if (!pk_backend_ensure_default_dnf_context (backend, &error))
g_warning ("failed to setup context: %s", error->message);
}
@@ -273,6 +294,8 @@ pk_backend_destroy (PkBackend *backend)
g_key_file_unref (priv->conf);
if (priv->context != NULL)
g_object_unref (priv->context);
+ if (priv->sack_expire_id > 0)
+ g_source_remove (priv->sack_expire_id);
g_timer_destroy (priv->repos_timer);
g_mutex_clear (&priv->sack_mutex);
g_hash_table_unref (priv->sack_cache);
@@ -316,9 +339,9 @@ pk_backend_state_action_changed_cb (DnfState *state,
{
if (action != DNF_STATE_ACTION_UNKNOWN) {
g_debug ("got state %s with hint %s",
- pk_status_enum_to_string (action),
+ pk_status_enum_to_string ((PkStatusEnum) action),
action_hint);
- pk_backend_job_set_status (job, action);
+ pk_backend_job_set_status (job, (PkStatusEnum) action);
}
switch (action) {
@@ -651,14 +674,9 @@ dnf_utils_create_sack_for_filters (PkBackendJob *job,
g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&priv->sack_mutex);
cache_item = g_hash_table_lookup (priv->sack_cache, cache_key);
if (cache_item != NULL && cache_item->sack != NULL) {
- if (cache_item->valid) {
- g_debug ("using cached sack %s", cache_key);
- return g_object_ref (cache_item->sack);
- } else {
- /* we have to do this now rather than rely on the
- * callback of the hash table */
- g_hash_table_remove (priv->sack_cache, cache_key);
- }
+ g_debug ("using cached sack %s", cache_key);
+ g_timer_start (cache_item->timer);
+ return g_object_ref (cache_item->sack);
}
}
@@ -724,7 +742,7 @@ dnf_utils_create_sack_for_filters (PkBackendJob *job,
cache_item = g_slice_new (DnfSackCacheItem);
cache_item->key = g_strdup (cache_key);
cache_item->sack = g_object_ref (sack);
- cache_item->valid = TRUE;
+ cache_item->timer = g_timer_new ();
g_debug ("created cached sack %s", cache_item->key);
g_hash_table_insert (priv->sack_cache, g_strdup (cache_key), cache_item);
g_mutex_unlock (&priv->sack_mutex);
@@ -855,6 +873,7 @@ pk_backend_what_provides_decompose (gchar **values, GError **error)
g_ptr_array_add (array, g_strdup_printf ("postscriptdriver(%s)", values[i]));
g_ptr_array_add (array, g_strdup_printf ("plasma4(%s)", values[i]));
g_ptr_array_add (array, g_strdup_printf ("plasma5(%s)", values[i]));
+ g_ptr_array_add (array, g_strdup_printf ("language(%s)", values[i]));
}
g_ptr_array_add (array, NULL);
return (gchar **) g_ptr_array_free (array, FALSE);
@@ -1099,7 +1118,7 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
dnf_advisory_free (advisory);
#endif
info_enum = dnf_advisory_kind_to_info_enum (kind);
- dnf_package_set_info (pkg, info_enum);
+ dnf_package_set_info (pkg, (DnfPackageInfo) info_enum);
}
}
}
diff --git a/backends/entropy/meson.build b/backends/entropy/meson.build
index b80002b..27d8e7c 100644
--- a/backends/entropy/meson.build
+++ b/backends/entropy/meson.build
@@ -15,6 +15,6 @@ shared_module(
install_data(
'entropyBackend.py',
- install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'entropy')
+ install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'entropy'),
install_mode: 'rwxr--r--'
)
diff --git a/backends/freebsd/PackageDatabase.hpp b/backends/freebsd/PackageDatabase.hpp
index 9eaceba..979bf33 100644
--- a/backends/freebsd/PackageDatabase.hpp
+++ b/backends/freebsd/PackageDatabase.hpp
@@ -47,6 +47,9 @@ class PackageDatabase {
if (pkg_ini(NULL, NULL, PKG_INIT_FLAG_USE_IPV4) != EPKG_OK)
g_error("pkg_ini failure");
+
+ pkg_plugins_init();
+
// can't pass nullptr here, unique_ptr won't call the deleter
libpkgDeleter = deleted_unique_ptr(reinterpret_cast(0xDEADC0DE), [](void* p) { pkg_shutdown(); });
}
diff --git a/backends/freebsd/PackageView.hpp b/backends/freebsd/PackageView.hpp
index ed4c457..7802dc2 100644
--- a/backends/freebsd/PackageView.hpp
+++ b/backends/freebsd/PackageView.hpp
@@ -21,6 +21,7 @@
#pragma once
+#include
#include
#include
@@ -57,10 +58,10 @@ class PackageView
pkg_asprintf(&buf, "%L", pkg);
_license = free_deleted_unique_ptr(buf);
pkg_asprintf(&buf, "%s", pkg);
- _flatsize = std::atoi(buf);
+ _flatsize = std::strtoul(buf, nullptr, 10);
free(buf);
pkg_asprintf(&buf, "%x", pkg);
- _compressedsize = std::atoi(buf);
+ _compressedsize = std::strtoull(buf, nullptr, 10);
free(buf);
}
@@ -139,13 +140,13 @@ class PackageView
return _license.get();
}
- int64_t flatsize() const {
+ gulong flatsize() const {
// flatsize can only be obtained from pkg*
g_assert (pk_id_parts == nullptr);
return _flatsize;
}
- int64_t compressedsize() const {
+ guint64 compressedsize() const {
// flatsize can only be obtained from pkg*
g_assert (pk_id_parts == nullptr);
return _compressedsize;
@@ -172,7 +173,8 @@ class PackageView
_version, _abi, _reponame, _comment,
_descr, _url, _license;
g_strfreev_deleted_unique_ptr _categories;
- int64_t _flatsize, _compressedsize;
+ gulong _flatsize;
+ guint64 _compressedsize;
gchar* external_pk_id = nullptr;
g_free_deleted_unique_ptr built_pk_id;
g_strfreev_deleted_unique_ptr pk_id_parts;
diff --git a/backends/freebsd/meson.build b/backends/freebsd/meson.build
index 2019e29..961d3f6 100644
--- a/backends/freebsd/meson.build
+++ b/backends/freebsd/meson.build
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
libpkg_dep = dependency('pkg', version : '>=1.20.99')
diff --git a/backends/freebsd/pk-backend-freebsd.cpp b/backends/freebsd/pk-backend-freebsd.cpp
index e126fcf..cdf864f 100644
--- a/backends/freebsd/pk-backend-freebsd.cpp
+++ b/backends/freebsd/pk-backend-freebsd.cpp
@@ -80,6 +80,7 @@ static void InitAdvertisedGroups()
PK_GROUP_ENUM_SYSTEM, //sysutils
PK_GROUP_ENUM_SCIENCE, //science
PK_GROUP_ENUM_MAPS, //geography
+ PK_GROUP_ENUM_VIRTUALIZATION, // emulators
-1);
}
diff --git a/backends/nix/meson.build b/backends/nix/meson.build
index 7f8603c..9b24bba 100644
--- a/backends/nix/meson.build
+++ b/backends/nix/meson.build
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
nix_expr_dep = dependency('nix-expr', version: '>=2.9')
nix_main_dep = dependency('nix-main', version: '>=2.9')
diff --git a/backends/portage/meson.build b/backends/portage/meson.build
index 1b5a0a3..2a266c5 100644
--- a/backends/portage/meson.build
+++ b/backends/portage/meson.build
@@ -15,6 +15,6 @@ shared_module(
install_data(
'portageBackend.py',
- install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'portage')
+ install_dir: join_paths(get_option('datadir'), 'PackageKit', 'helpers', 'portage'),
install_mode: 'rwxr--r--'
)
diff --git a/backends/slack/meson.build b/backends/slack/meson.build
index 8e4d30f..e01398b 100644
--- a/backends/slack/meson.build
+++ b/backends/slack/meson.build
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
curl_dep = meson.get_compiler('c').find_library('curl')
bzip2_dep = dependency('bzip2')
diff --git a/backends/zypp/meson.build b/backends/zypp/meson.build
index a090f8e..b85939d 100644
--- a/backends/zypp/meson.build
+++ b/backends/zypp/meson.build
@@ -1,4 +1,4 @@
-add_languages('cpp')
+add_languages('cpp', native: false)
zypp_dep = dependency('libzypp', version: '>=17.31.0')
@@ -22,10 +22,10 @@ shared_module(
'-Wall',
'-Woverloaded-virtual',
'-Wnon-virtual-dtor',
+ '-Wno-error=deprecated-declarations',
'-std=c++1z'
],
c_args: [
- '-Wno-deprecated',
'-D_FILE_OFFSET_BITS=64',
],
install: true,
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index 67ea9ab..05fb065 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -633,7 +633,7 @@ ZyppJob::get_zypp()
/**
* Enable and rotate zypp logging
*/
-gboolean
+static gboolean
zypp_logging ()
{
gchar *file = g_strdup ("/var/log/pk_backend_zypp");
@@ -679,7 +679,7 @@ namespace {
}
}
-gboolean
+static gboolean
zypp_is_development_repo (RepoInfo repo)
{
return ( name_ends_or_contains( repo.alias(), "-debuginfo" )
@@ -688,7 +688,7 @@ zypp_is_development_repo (RepoInfo repo)
|| name_ends_or_contains( repo.alias(), "-development" ) );
}
-gboolean
+static gboolean
zypp_is_valid_repo (PkBackendJob *job, RepoInfo repo)
{
@@ -709,7 +709,7 @@ zypp_is_valid_repo (PkBackendJob *job, RepoInfo repo)
* Build and return a ResPool that contains all local resolvables
* and ones found in the enabled repositories.
*/
-ResPool
+static ResPool
zypp_build_pool (ZYpp::Ptr zypp, gboolean include_local)
{
static gboolean repos_loaded = FALSE;
@@ -770,7 +770,7 @@ zypp_build_pool (ZYpp::Ptr zypp, gboolean include_local)
/**
* Return the rpmHeader of a package
*/
-target::rpm::RpmHeader::constPtr
+static target::rpm::RpmHeader::constPtr
zypp_get_rpmHeader (const string &name, Edition edition)
{
target::rpm::librpmDb::db_const_iterator it;
@@ -786,7 +786,7 @@ zypp_get_rpmHeader (const string &name, Edition edition)
/**
* Return the PkEnumGroup of the given PoolItem.
*/
-PkGroupEnum
+static PkGroupEnum
get_enum_group (const string &group_)
{
string group(str::toLower(group_));
@@ -841,7 +841,7 @@ get_enum_group (const string &group_)
/**
* Returns a list of packages that match the specified package_name.
*/
-void
+static void
zypp_get_packages_by_name (const gchar *package_name,
const ResKind kind,
vector &result,
@@ -863,7 +863,8 @@ zypp_get_packages_by_name (const gchar *package_name,
/**
* Returns a list of packages that owns the specified file.
*/
-void
+G_GNUC_UNUSED
+static void
zypp_get_packages_by_file (ZYpp::Ptr zypp,
const gchar *search_file,
vector &ret)
@@ -895,7 +896,7 @@ zypp_get_packages_by_file (ZYpp::Ptr zypp,
/**
* Return the package is from a local file or not.
*/
-bool
+static bool
zypp_package_is_local (const gchar *package_id)
{
MIL << package_id << endl;
@@ -916,7 +917,7 @@ zypp_package_is_local (const gchar *package_id)
* Returns the Resolvable for the specified package_id.
* e.g. gnome-packagekit;3.6.1-132.1;x86_64;G:F
*/
-sat::Solvable
+static sat::Solvable
zypp_get_package_by_id (const gchar *package_id)
{
MIL << package_id << endl;
@@ -981,7 +982,7 @@ zypp_get_package_by_id (const gchar *package_id)
return package;
}
-RepoInfo
+static RepoInfo
zypp_get_Repository (PkBackendJob *job, const gchar *alias)
{
RepoInfo info;
@@ -1171,7 +1172,7 @@ zypp_backend_package (PkBackendJob *job, PkInfoEnum info,
* we don't notify the client that the package is also available, since
* PK doesn't handle re-installs (by some quirk).
*/
-void
+static void
zypp_emit_filtered_packages_in_list (PkBackendJob *job, PkBitfield filters, const vector &v)
{
typedef vector::const_iterator sat_it_t;
@@ -1791,6 +1792,7 @@ zypp_refresh_cache (PkBackendJob *job, ZYpp::Ptr zypp, gboolean force)
/**
* helper to simplify returning errors
*/
+G_GNUC_PRINTF (3, 4)
static void
zypp_backend_finished_error (PkBackendJob *job, PkErrorEnum err_code,
const char *format, ...)
@@ -1930,7 +1932,7 @@ backend_required_by_thread (PkBackendJob *job, GVariant *params, gpointer user_d
}
zypp_backend_finished_error (
job, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED,
- problem.c_str());
+ "%s", problem.c_str());
return;
}
@@ -2127,11 +2129,11 @@ backend_depends_on_thread (PkBackendJob *job, GVariant *params, gpointer user_da
pk_backend_job_set_percentage (job, 100);
} catch (const repo::RepoNotFoundException &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_REPO_NOT_FOUND, "%s", ex.asUserString().c_str());
return;
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString().c_str());
return;
}
}
@@ -2211,7 +2213,7 @@ backend_get_details_thread (PkBackendJob *job, GVariant *params, gpointer user_d
(gulong)size);
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString ().c_str ());
return;
}
}
@@ -2593,7 +2595,7 @@ backend_install_files_thread (PkBackendJob *job, GVariant *params, gpointer user
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString ().c_str ());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString ().c_str ());
return;
}
@@ -2865,7 +2867,7 @@ backend_install_packages_thread (PkBackendJob *job, GVariant *params, gpointer u
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString().c_str());
return;
}
}
@@ -2981,11 +2983,11 @@ backend_remove_packages_thread (PkBackendJob *job, GVariant *params, gpointer us
} catch (const repo::RepoNotFoundException &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_REPO_NOT_FOUND, "%s", ex.asUserString().c_str());
return;
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString().c_str());
return;
}
}
@@ -3110,7 +3112,7 @@ backend_find_packages_thread (PkBackendJob *job, GVariant *params, gpointer user
&_filters,
&values);
- if (values == NULL && values[0] == NULL) {
+ if (values == NULL || values[0] == NULL) {
pk_backend_job_error_code (job, PK_ERROR_ENUM_PACKAGE_ID_INVALID,
"Empty search string is not supported.");
return;
@@ -3275,11 +3277,11 @@ pk_backend_get_repo_list (PkBackend *backend, PkBackendJob *job, PkBitfield filt
repos = list(manager.repoBegin(),manager.repoEnd());
} catch (const repo::RepoNotFoundException &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_REPO_NOT_FOUND, "%s", ex.asUserString().c_str());
return;
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString().c_str());
return;
}
@@ -3330,11 +3332,11 @@ pk_backend_repo_enable (PkBackend *backend, PkBackendJob *job, const gchar *rid,
} catch (const repo::RepoNotFoundException &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_REPO_NOT_FOUND, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_REPO_NOT_FOUND, "%s", ex.asUserString().c_str());
return;
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_INTERNAL_ERROR, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_INTERNAL_ERROR, "%s", ex.asUserString().c_str());
return;
}
@@ -3524,11 +3526,6 @@ backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer us
zypp_backend_finished_error (job, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED, "Package %s is not installed", package_ids[i]);
return;
}
- item = sel->updateCandidateObj();
- if (!item) {
- zypp_backend_finished_error(job, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED, "There is no update candidate for %s", sel->installedObj().satSolvable().asString().c_str());
- return;
- }
}
item.status ().setToBeInstalled (ResStatus::USER);
@@ -3573,7 +3570,6 @@ pk_backend_upgrade_system_thread (PkBackendJob *job,
}
ResPool pool = zypp_build_pool (zypp, TRUE);
- PkRestartEnum restart = PK_RESTART_ENUM_NONE;
PoolStatusSaver saver;
if (is_tumbleweed ()) {
@@ -3766,6 +3762,7 @@ pk_backend_what_provides_decompose (PkBackendJob *job, gchar **values)
g_ptr_array_add (array, g_strdup_printf ("postscriptdriver(%s)", values[i]));
g_ptr_array_add (array, g_strdup_printf ("plasma4(%s)", values[i]));
g_ptr_array_add (array, g_strdup_printf ("plasma5(%s)", values[i]));
+ g_ptr_array_add (array, g_strdup_printf ("language(%s)", values[i]));
}
search = pk_ptr_array_to_strv (array);
for (i = 0; search[i] != NULL; i++)
@@ -3843,7 +3840,7 @@ backend_what_provides_thread (PkBackendJob *job, GVariant *params, gpointer user
for (sat::WhatProvides::const_iterator it = prov.begin (); it != prov.end (); ++it) {
if (it->isSystem ())
g_hash_table_insert (installed_hash,
- (const gpointer) make(*it)->summary().c_str (),
+ (gpointer) make(*it)->summary().c_str (),
GUINT_TO_POINTER (1));
}
@@ -3957,7 +3954,7 @@ backend_download_packages_thread (PkBackendJob *job, GVariant *params, gpointer
}
} catch (const Exception &ex) {
zypp_backend_finished_error (
- job, PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED, ex.asUserString().c_str());
+ job, PK_ERROR_ENUM_PACKAGE_DOWNLOAD_FAILED, "%s", ex.asUserString().c_str());
return;
}
}
diff --git a/client/pk-console.c b/client/pk-console.c
index 056e37e..bedb26f 100644
--- a/client/pk-console.c
+++ b/client/pk-console.c
@@ -637,7 +637,7 @@ pk_console_progress_cb (PkProgress *progress, PkProgressType type, gpointer data
}
static void
-pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
+pk_console_process_results (PkResults *results, PkConsoleCtx *ctx, const GError *finish_error)
{
const gchar *filename;
gboolean ret;
@@ -645,11 +645,8 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
PkPackageSack *sack;
PkRestartEnum restart;
PkRoleEnum role;
- PkConsoleCtx *ctx = (PkConsoleCtx *) data;
- g_autoptr(GError) error = NULL;
g_autoptr(GFile) file = NULL;
g_autoptr(PkError) error_code = NULL;
- g_autoptr(PkResults) results = NULL;
/* no more progress */
if (ctx->is_console) {
@@ -659,13 +656,11 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
g_print ("%s\n", _("Results:"));
}
- /* get the results */
- results = pk_task_generic_finish (PK_TASK (ctx->task), res, &error);
if (results == NULL) {
/* TRANSLATORS: we failed to get any results, which is pretty
* fatal in my book */
- g_print ("%s: %s\n", _("Fatal error"), error->message);
- switch (error->code - 0xff) {
+ g_print ("%s: %s\n", _("Fatal error"), finish_error->message);
+ switch (finish_error->code - 0xff) {
case PK_ERROR_ENUM_ALL_PACKAGES_ALREADY_INSTALLED:
case PK_ERROR_ENUM_REPO_NOT_AVAILABLE:
ctx->retval = PK_EXIT_CODE_NOTHING_USEFUL;
@@ -821,6 +816,7 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
/* write the sack to disk */
if (role == PK_ROLE_ENUM_GET_PACKAGES && filename != NULL) {
+ g_autoptr(GError) error = NULL;
file = g_file_new_for_path (filename);
ret = pk_package_sack_to_file (sack, file, &error);
if (!ret) {
@@ -833,6 +829,30 @@ pk_console_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
g_main_loop_quit (ctx->loop);
}
+static void
+pk_console_client_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
+{
+ g_autoptr(GError) error = NULL;
+ g_autoptr(PkResults) results = NULL;
+ PkConsoleCtx *ctx = (PkConsoleCtx *) data;
+
+ results = pk_client_generic_finish (PK_CLIENT (ctx->task), res, &error);
+
+ pk_console_process_results (results, ctx, error);
+}
+
+static void
+pk_console_task_finished_cb (GObject *object, GAsyncResult *res, gpointer data)
+{
+ g_autoptr(GError) error = NULL;
+ g_autoptr(PkResults) results = NULL;
+ PkConsoleCtx *ctx = (PkConsoleCtx *) data;
+
+ results = pk_task_generic_finish (PK_TASK (ctx->task), res, &error);
+
+ pk_console_process_results (results, ctx, error);
+}
+
static gchar *
pk_console_resolve_package (PkConsoleCtx *ctx, const gchar *package_name, GError **error)
{
@@ -1057,7 +1077,7 @@ pk_console_install_packages (PkConsoleCtx *ctx, gchar **packages, GError **error
pk_task_install_packages_async (PK_TASK (ctx->task),
package_ids, ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1086,7 +1106,7 @@ pk_console_remove_packages (PkConsoleCtx *ctx, gchar **packages, gboolean autore
TRUE, autoremove,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1115,7 +1135,7 @@ pk_console_download_packages (PkConsoleCtx *ctx, gchar **packages, const gchar *
directory,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1145,7 +1165,7 @@ pk_console_update_packages (PkConsoleCtx *ctx, gchar **packages, GError **error)
package_ids,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1188,7 +1208,7 @@ pk_console_update_system (PkConsoleCtx *ctx, GError **error)
package_ids,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1200,7 +1220,7 @@ pk_console_upgrade_system (PkConsoleCtx *ctx, const gchar *distro_id, const gcha
pk_upgrade_kind_enum_from_string (upgrade_kind),
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1230,7 +1250,7 @@ pk_console_required_by (PkConsoleCtx *ctx, gchar **packages, GError **error)
TRUE,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1259,7 +1279,7 @@ pk_console_depends_on (PkConsoleCtx *ctx, gchar **packages, GError **error)
FALSE,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1275,7 +1295,7 @@ pk_console_get_details (PkConsoleCtx *ctx, gchar **packages, GError **error)
packages,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
return TRUE;
}
@@ -1296,7 +1316,7 @@ pk_console_get_details (PkConsoleCtx *ctx, gchar **packages, GError **error)
package_ids,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1307,7 +1327,7 @@ pk_console_get_details_local (PkConsoleCtx *ctx, gchar **files, GError **error)
files,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
return TRUE;
}
@@ -1318,7 +1338,7 @@ pk_console_get_files_local (PkConsoleCtx *ctx, gchar **files, GError **error)
files,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
return TRUE;
}
@@ -1334,7 +1354,7 @@ pk_console_get_files (PkConsoleCtx *ctx, gchar **packages, GError **error)
packages,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
return TRUE;
}
@@ -1355,7 +1375,7 @@ pk_console_get_files (PkConsoleCtx *ctx, gchar **packages, GError **error)
package_ids,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1383,7 +1403,7 @@ pk_console_get_update_detail (PkConsoleCtx *ctx, gchar **packages, GError **erro
package_ids,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
return TRUE;
}
@@ -1415,11 +1435,21 @@ pk_console_sigint_cb (gpointer user_data)
return FALSE;
}
+static int
+cmp_strings (gconstpointer a,
+ gconstpointer b)
+{
+ const char **aa = (const char **)a;
+ const char **bb = (const char **)b;
+
+ return g_strcmp0 (*aa, *bb);
+}
+
static gchar *
pk_console_get_summary (PkConsoleCtx *ctx)
{
- GString *string;
- string = g_string_new ("");
+ GString *string = g_string_new ("");
+ g_autoptr(GPtrArray) cmds = g_ptr_array_sized_new (30);
/* TRANSLATORS: This is the header to the --help menu */
g_string_append_printf (string, "%s\n\n%s\n", _("PackageKit Console Interface"),
@@ -1427,75 +1457,86 @@ pk_console_get_summary (PkConsoleCtx *ctx)
_("Subcommands:"));
/* always */
- g_string_append_printf (string, " %s\n", "backend-details");
- g_string_append_printf (string, " %s\n", "get-roles");
- g_string_append_printf (string, " %s\n", "get-groups");
- g_string_append_printf (string, " %s\n", "get-filters");
- g_string_append_printf (string, " %s\n", "get-transactions");
- g_string_append_printf (string, " %s\n", "get-time");
+ g_ptr_array_add (cmds, (gchar *) "backend-details");
+ g_ptr_array_add (cmds, (gchar *) "get-roles");
+ g_ptr_array_add (cmds, (gchar *) "get-groups");
+ g_ptr_array_add (cmds, (gchar *) "get-filters");
+ g_ptr_array_add (cmds, (gchar *) "get-transactions");
+ g_ptr_array_add (cmds, (gchar *) "get-time");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_SEARCH_NAME) ||
pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_SEARCH_DETAILS) ||
pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_SEARCH_GROUP) ||
pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_SEARCH_FILE))
- g_string_append_printf (string, " %s\n", "search [name|details|group|file] [data]");
+ g_ptr_array_add (cmds, (gchar *) "search [name|details|group|file] [data]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_INSTALL_PACKAGES))
- g_string_append_printf (string, " %s\n", "install [packages]");
+ g_ptr_array_add (cmds, (gchar *) "install [packages]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_INSTALL_FILES))
- g_string_append_printf (string, " %s\n", "install-local [files]");
+ g_ptr_array_add (cmds, (gchar *) "install-local [files]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_DOWNLOAD_PACKAGES))
- g_string_append_printf (string, " %s\n", "download [directory] [packages]");
+ g_ptr_array_add (cmds, (gchar *) "download [directory] [packages]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_INSTALL_SIGNATURE))
- g_string_append_printf (string, " %s\n", "install-sig [type] [key_id] [package_id]");
+ g_ptr_array_add (cmds, (gchar *) "install-sig [type] [key_id] [package_id]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REMOVE_PACKAGES))
- g_string_append_printf (string, " %s\n", "remove [package]");
+ g_ptr_array_add (cmds, (gchar *) "remove [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_UPDATE_PACKAGES))
- g_string_append_printf (string, " %s\n", "update [package]");
+ g_ptr_array_add (cmds, (gchar *) "update [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REFRESH_CACHE))
- g_string_append_printf (string, " %s\n", "refresh [force]");
+ g_ptr_array_add (cmds, (gchar *) "refresh [force]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_RESOLVE))
- g_string_append_printf (string, " %s\n", "resolve [package]");
+ g_ptr_array_add (cmds, (gchar *) "resolve [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_UPDATES))
- g_string_append_printf (string, " %s\n", "get-updates");
+ g_ptr_array_add (cmds, (gchar *) "get-updates");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_DEPENDS_ON))
- g_string_append_printf (string, " %s\n", "depends-on [package]");
+ g_ptr_array_add (cmds, (gchar *) "depends-on [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REQUIRED_BY))
- g_string_append_printf (string, " %s\n", "required-by [package]");
+ g_ptr_array_add (cmds, (gchar *) "required-by [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_DETAILS))
- g_string_append_printf (string, " %s\n", "get-details [package]");
+ g_ptr_array_add (cmds, (gchar *) "get-details [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_DISTRO_UPGRADES))
- g_string_append_printf (string, " %s\n", "get-distro-upgrades");
+ g_ptr_array_add (cmds, (gchar *) "get-distro-upgrades");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_FILES))
- g_string_append_printf (string, " %s\n", "get-files [package]");
+ g_ptr_array_add (cmds, (gchar *) "get-files [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_UPDATE_DETAIL))
- g_string_append_printf (string, " %s\n", "get-update-detail [package]");
+ g_ptr_array_add (cmds, (gchar *) "get-update-detail [package]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_PACKAGES))
- g_string_append_printf (string, " %s\n", "get-packages");
+ g_ptr_array_add (cmds, (gchar *) "get-packages");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_REPO_LIST))
- g_string_append_printf (string, " %s\n", "repo-list");
+ g_ptr_array_add (cmds, (gchar *) "repo-list");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REPO_ENABLE)) {
- g_string_append_printf (string, " %s\n", "repo-enable [repo_id]");
- g_string_append_printf (string, " %s\n", "repo-disable [repo_id]");
+ g_ptr_array_add (cmds, (gchar *) "repo-enable [repo_id]");
+ g_ptr_array_add (cmds, (gchar *) "repo-disable [repo_id]");
}
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REPO_SET_DATA))
- g_string_append_printf (string, " %s\n", "repo-set-data [repo_id] [parameter] [value]");
+ g_ptr_array_add (cmds, (gchar *) "repo-set-data [repo_id] [parameter] [value]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REPO_REMOVE))
- g_string_append_printf (string, " %s\n", "repo-remove [repo_id] [autoremove]");
+ g_ptr_array_add (cmds, (gchar *) "repo-remove [repo_id] [autoremove]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_WHAT_PROVIDES))
- g_string_append_printf (string, " %s\n", "what-provides [search]");
+ g_ptr_array_add (cmds, (gchar *) "what-provides [search]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_ACCEPT_EULA))
- g_string_append_printf (string, " %s\n", "accept-eula [eula-id]");
+ g_ptr_array_add (cmds, (gchar *) "accept-eula [eula-id]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_GET_CATEGORIES))
- g_string_append_printf (string, " %s\n", "get-categories");
+ g_ptr_array_add (cmds, (gchar *) "get-categories");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_UPGRADE_SYSTEM))
- g_string_append_printf (string, " %s\n", "upgrade-system [distro-name] [minimal|default|complete]");
+ g_ptr_array_add (cmds, (gchar *) "upgrade-system [distro-name] [minimal|default|complete]");
if (pk_bitfield_contain (ctx->roles, PK_ROLE_ENUM_REPAIR_SYSTEM))
- g_string_append_printf (string, " %s\n", "repair");
- g_string_append_printf (string, " %s\n", "offline-get-prepared");
- g_string_append_printf (string, " %s\n", "offline-trigger");
- g_string_append_printf (string, " %s\n", "offline-cancel");
- g_string_append_printf (string, " %s\n", "offline-status");
- g_string_append_printf (string, " %s\n", "quit");
+ g_ptr_array_add (cmds, (gchar *) "repair");
+
+ // offline update commands
+ g_ptr_array_add (cmds, (gchar *) "offline-get-prepared");
+ g_ptr_array_add (cmds, (gchar *) "offline-trigger");
+ g_ptr_array_add (cmds, (gchar *) "offline-cancel");
+ g_ptr_array_add (cmds, (gchar *) "offline-status");
+
+ // sort all commands
+ g_ptr_array_sort (cmds, (GCompareFunc) cmp_strings);
+
+ for (guint i = 0; i < cmds->len; i++)
+ g_string_append_printf (string, " %s\n", (gchar *) cmds->pdata[i]);
+
+ // 'quit' as last command
+ g_string_append_printf (string, " %s", "quit");
+
return g_string_free (string, FALSE);
}
@@ -1830,7 +1871,7 @@ main (int argc, char *argv[])
argv + 3,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (value, "details") == 0) {
if (details == NULL) {
@@ -1847,7 +1888,7 @@ main (int argc, char *argv[])
argv + 3,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (value, "group") == 0) {
if (details == NULL) {
@@ -1864,7 +1905,7 @@ main (int argc, char *argv[])
argv + 3,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (value, "file") == 0) {
if (details == NULL) {
@@ -1881,7 +1922,7 @@ main (int argc, char *argv[])
argv + 3,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else {
/* fallback to a generic search */
pk_task_search_details_async (PK_TASK (ctx->task),
@@ -1889,7 +1930,7 @@ main (int argc, char *argv[])
argv + 2,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
}
} else if (strcmp (mode, "install") == 0) {
@@ -1920,7 +1961,7 @@ main (int argc, char *argv[])
argv + 2,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "install-sig") == 0) {
if (value == NULL || details == NULL || parameter == NULL) {
@@ -1938,7 +1979,7 @@ main (int argc, char *argv[])
parameter,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "remove") == 0) {
if (value == NULL) {
@@ -1992,7 +2033,7 @@ main (int argc, char *argv[])
value,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "update") == 0) {
if (value == NULL) {
@@ -2019,7 +2060,7 @@ main (int argc, char *argv[])
argv + 2,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "repo-enable") == 0) {
if (value == NULL) {
@@ -2036,7 +2077,7 @@ main (int argc, char *argv[])
TRUE,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "repo-disable") == 0) {
if (value == NULL) {
@@ -2053,7 +2094,7 @@ main (int argc, char *argv[])
FALSE,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "repo-set-data") == 0) {
if (value == NULL || details == NULL || parameter == NULL) {
@@ -2070,7 +2111,7 @@ main (int argc, char *argv[])
parameter,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "repo-remove") == 0) {
if (value == NULL || details == NULL) {
@@ -2088,14 +2129,14 @@ main (int argc, char *argv[])
atoi (details),
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "repo-list") == 0) {
pk_task_get_repo_list_async (PK_TASK (ctx->task),
ctx->filters,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "get-time") == 0) {
PkRoleEnum role;
@@ -2144,7 +2185,7 @@ main (int argc, char *argv[])
pk_client_get_distro_upgrades_async (PK_CLIENT (ctx->task),
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "get-update-detail") == 0) {
if (value == NULL) {
@@ -2186,7 +2227,7 @@ main (int argc, char *argv[])
argv + 2,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "get-details") == 0) {
if (value == NULL) {
@@ -2237,20 +2278,20 @@ main (int argc, char *argv[])
ctx->filters,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "get-categories") == 0) {
pk_task_get_categories_async (PK_TASK (ctx->task),
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "get-packages") == 0) {
pk_task_get_packages_async (PK_TASK (ctx->task),
ctx->filters,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "upgrade-system") == 0) {
/* do the system upgrade */
@@ -2341,7 +2382,7 @@ main (int argc, char *argv[])
10,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_client_finished_cb, ctx);
} else if (strcmp (mode, "refresh") == 0) {
gboolean force = (value != NULL && g_strcmp0 (value, "force") == 0);
@@ -2349,12 +2390,12 @@ main (int argc, char *argv[])
force,
ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "repair") == 0) {
pk_task_repair_system_async (PK_TASK (ctx->task), ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else if (strcmp (mode, "list-create") == 0) {
if (value == NULL) {
@@ -2386,7 +2427,7 @@ main (int argc, char *argv[])
g_free);
pk_task_get_packages_async (PK_TASK (ctx->task), ctx->filters, ctx->cancellable,
pk_console_progress_cb, ctx,
- pk_console_finished_cb, ctx);
+ pk_console_task_finished_cb, ctx);
} else {
error = g_error_new (PK_CONSOLE_ERROR,
PK_ERROR_ENUM_INTERNAL_ERROR,
diff --git a/client/pk-monitor.c b/client/pk-monitor.c
index 60788ec..b768bcc 100644
--- a/client/pk-monitor.c
+++ b/client/pk-monitor.c
@@ -29,6 +29,12 @@
static PkClient *client = NULL;
+static void
+pk_monitor_installed_changed_cb (PkControl *control, gpointer data)
+{
+ g_print ("installed-changed\n");
+}
+
static void
pk_monitor_repo_list_changed_cb (PkControl *control, gpointer data)
{
@@ -368,6 +374,8 @@ main (int argc, char *argv[])
loop = g_main_loop_new (NULL, FALSE);
control = pk_control_new ();
+ g_signal_connect (control, "installed-changed",
+ G_CALLBACK (pk_monitor_installed_changed_cb), NULL);
g_signal_connect (control, "repo-list-changed",
G_CALLBACK (pk_monitor_repo_list_changed_cb), NULL);
g_signal_connect (control, "updates-changed",
diff --git a/client/pk-offline-update.c b/client/pk-offline-update.c
index 900f975..3444da8 100644
--- a/client/pk-offline-update.c
+++ b/client/pk-offline-update.c
@@ -32,7 +32,13 @@
#include
#include
#include
+#ifdef HAVE_SYSTEMD_SD_JOURNAL_H
#include
+#else
+#define LOG_INFO STDERR_FILENO
+#define LOG_WARNING STDERR_FILENO
+#define sd_journal_print dprintf
+#endif
static void
pk_offline_update_set_plymouth_msg (const gchar *msg)
@@ -113,6 +119,7 @@ pk_offline_update_progress_cb (PkProgress *progress,
PkStatusEnum status;
gint percentage;
g_autofree gchar *msg = NULL;
+ g_autofree gchar *tmp_perc = NULL;
g_autoptr(PkPackage) pkg = NULL;
switch (type) {
@@ -150,15 +157,18 @@ pk_offline_update_progress_cb (PkProgress *progress,
return;
sd_journal_print (LOG_INFO, "percentage %i%%", percentage);
+ /* TRANSLATORS: this is a percentage value we use in messages, e.g. "90%" */
+ tmp_perc = g_strdup_printf (_("%i%%"), percentage);
+
role = pk_progress_get_role (progress);
if (role == PK_ROLE_ENUM_UPGRADE_SYSTEM) {
/* TRANSLATORS: this is the message we send plymouth to
* advise of the new percentage completion when installing system upgrades */
- msg = g_strdup_printf ("%s - %i%%", _("Installing System Upgrade"), percentage);
+ msg = g_strdup_printf ("%s — %s", _("Installing System Upgrade"), tmp_perc);
} else {
/* TRANSLATORS: this is the message we send plymouth to
* advise of the new percentage completion when installing updates */
- msg = g_strdup_printf ("%s - %i%%", _("Installing Updates"), percentage);
+ msg = g_strdup_printf ("%s — %s", _("Installing Updates"), tmp_perc);
}
if (percentage > 10)
pk_offline_update_set_plymouth_msg (msg);
@@ -371,7 +381,11 @@ pk_offline_update_do_update (PkTask *task, PkProgressBar *progressbar, GError **
/* get the list of packages to update */
package_ids = pk_offline_get_prepared_ids (error);
if (package_ids == NULL) {
- g_prefix_error (error, "failed to read %s: ", PK_OFFLINE_PREPARED_FILENAME);
+ g_set_error (error,
+ PK_OFFLINE_ERROR,
+ PK_OFFLINE_ERROR_FAILED,
+ "failed to read %s",
+ PK_OFFLINE_PREPARED_FILENAME);
return FALSE;
}
@@ -404,7 +418,10 @@ pk_offline_update_do_upgrade (PkTask *task, PkProgressBar *progressbar, GError *
/* get the version to upgrade to */
version = pk_offline_get_prepared_upgrade_version (error);
if (version == NULL) {
- g_prefix_error (error, "failed to get prepared system upgrade version: ");
+ g_set_error (error,
+ PK_OFFLINE_ERROR,
+ PK_OFFLINE_ERROR_FAILED,
+ "failed to get prepared system upgrade version");
return FALSE;
}
diff --git a/contrib/meson.build b/contrib/meson.build
index cca7518..9285aab 100644
--- a/contrib/meson.build
+++ b/contrib/meson.build
@@ -14,7 +14,9 @@ if get_option('bash_completion')
bash_completion_dep = dependency('bash-completion', version: '>=2.0')
install_data(
'pkcon',
- install_dir: bash_completion_dep.get_pkgconfig_variable('completionsdir', define_variable: ['prefix', get_option('prefix')])
+ install_dir: bash_completion_dep.get_variable(
+ pkgconfig: 'completionsdir',
+ pkgconfig_define: ['prefix', get_option('prefix')])
)
endif
diff --git a/data/org.freedesktop.packagekit.metainfo.xml b/data/org.freedesktop.packagekit.metainfo.xml
index f779b9d..ce47582 100644
--- a/data/org.freedesktop.packagekit.metainfo.xml
+++ b/data/org.freedesktop.packagekit.metainfo.xml
@@ -15,18 +15,28 @@
The work is done by backends which make use of the package manager shipped by the corresponding distribution.
- The main benefits are:
+ Its main benefits are:
- - unified interface on several distributions
- - fine grained privileges by using PolicyKit
- - independence from a running desktop session during processing
+ - Unified developer and user interface on many distributions
+ - Fine-grained permission control via PolicyKit
+ - On-demand installation of missing system components
https://www.freedesktop.org/software/PackageKit
packagekit.service
+
+ Cinnamon
+ GNOME
+ KDE
+ LXQt
+ MATE
+ Pantheon
+ Unity
+ XFCE
+
System
diff --git a/debian/changelog b/debian/changelog
index 5f57127..31b0cc5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,20 +1,48 @@
-packagekit (1.2.8-2deepin2) unstable; urgency=medium
+packagekit (1.3.1-1+deb13u1) trixie-security; urgency=high
+ * Non-maintainer upload by the Security Team.
* Do not allow re-invoking methods on non-new transactions
- -- Tianyu Chen Thu, 23 Apr 2026 10:38:03 +0800
+ -- Salvatore Bonaccorso Tue, 21 Apr 2026 16:45:57 +0200
-packagekit (1.2.8-2deepin1) unstable; urgency=medium
+packagekit (1.3.1-1) unstable; urgency=medium
- * Not call dbus on ostree-booted systems
+ [ Matthias Klumpp ]
+ * New upstream version: 1.3.1
+ - Implement enable/disable support for deb822-style repo sources
+ - Harmonize repo-ids between deb822 and legacy sources
+ - Use 'pk_backend_job_details_full()' so download size is
+ reported properly (Closes: #1026076)
+ * Drop patches: Applied upstream
+ * Drop build-dependency on gobject-introspection-bin (Closes: #1094624)
+
+ [ Michael Biebl ]
+ * Drop obsolete pkla configuration file (Closes: #1093073)
+
+ -- Matthias Klumpp Tue, 22 Apr 2025 22:18:16 +0200
+
+packagekit (1.3.0-3) unstable; urgency=medium
- -- ssk-wh Wed, 18 Dec 2024 13:15:30 +0800
+ * Adjust for libapt-pkg7.0 API
-packagekit (1.2.8-2deepin0) unstable; urgency=medium
+ -- Julian Andres Klode Mon, 17 Feb 2025 10:35:40 +0100
- * No source change upload against GCC 12.
+packagekit (1.3.0-2) unstable; urgency=medium
+
+ * Team upload
+ * Backport patch to fix pkcon crashing in transactions with user prompt
+ (LP: #2086771)
+ * Backport patch to fix showing the GTK debconf helper on Wayland
+ (LP: #2086773)
+
+ -- Alessandro Astone Fri, 08 Nov 2024 15:56:31 -0500
+
+packagekit (1.3.0-1) unstable; urgency=medium
+
+ * New upstream version: 1.3.0
+ * Drop all patches: Applied upstream
- -- Tianyu Chen Fri, 20 Sep 2024 12:15:25 +0800
+ -- Matthias Klumpp Sun, 16 Jun 2024 17:40:52 +0200
packagekit (1.2.8-2) unstable; urgency=medium
diff --git a/debian/control b/debian/control
index 1e255a9..7c37f0a 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,6 @@ Build-Depends: bash-completion,
debhelper-compat (= 13),
gir1.2-glib-2.0 (>= 1.36),
gobject-introspection (>= 1.36),
- gobject-introspection-bin,
gtk-doc-tools,
libappstream-dev (>= 0.16.0),
libapt-pkg-dev (>= 1.9.2),
diff --git a/debian/libpackagekit-glib2-18.symbols b/debian/libpackagekit-glib2-18.symbols
index 8acf0e1..94760bf 100644
--- a/debian/libpackagekit-glib2-18.symbols
+++ b/debian/libpackagekit-glib2-18.symbols
@@ -341,6 +341,7 @@ libpackagekit-glib2.so.18 libpackagekit-glib2-18 #MINVER#
pk_progress_get_type@Base 0.9.4
pk_progress_get_uid@Base 1.1.0
pk_progress_new@Base 0.9.4
+ pk_progress_new_with_callback@Base 1.3.1
pk_progress_set_allow_cancel@Base 0.9.4
pk_progress_set_caller_active@Base 0.9.4
pk_progress_set_download_size_remaining@Base 0.9.4
diff --git a/debian/org.freedesktop.packagekit.pkla b/debian/org.freedesktop.packagekit.pkla
deleted file mode 100644
index f958703..0000000
--- a/debian/org.freedesktop.packagekit.pkla
+++ /dev/null
@@ -1,6 +0,0 @@
-[Allow admins to upgrade the system]
-Identity=unix-group:sudo
-Action=org.freedesktop.packagekit.upgrade-system;org.freedesktop.packagekit.trigger-offline-update
-ResultAny=no
-ResultInactive=no
-ResultActive=yes
diff --git a/debian/packagekit.install b/debian/packagekit.install
index 5c58648..d4798dc 100644
--- a/debian/packagekit.install
+++ b/debian/packagekit.install
@@ -1,5 +1,4 @@
${env:deb_systemdsystemunitdir}
-debian/org.freedesktop.packagekit.pkla var/lib/polkit-1/localauthority/10-vendor.d/
etc/PackageKit/PackageKit.conf
etc/PackageKit/Vendor.conf
etc/apt/apt.conf.d/20packagekit
diff --git a/debian/patches/01_strlen-cmp-memfix.patch b/debian/patches/01_strlen-cmp-memfix.patch
deleted file mode 100644
index 0fe1fdc..0000000
--- a/debian/patches/01_strlen-cmp-memfix.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 4c354c53a6475820c481b31f8fb44194b69aefc6 Mon Sep 17 00:00:00 2001
-From: Thibault Guittet <88336850+rh-tguittet@users.noreply.github.com>
-Date: Mon, 18 Dec 2023 12:07:32 +0100
-Subject: [PATCH] Check string length correctly to prevent memory
- over-consumption (RHEL-19527)
-
-pk_strlen() cannot return larger values than the sentinel value (1024)
-in this case and make the return value check uniform.
----
- src/pk-engine.c | 4 ++--
- src/pk-transaction.c | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/pk-engine.c b/src/pk-engine.c
-index c910c1f18..f5e7c78d8 100644
---- a/src/pk-engine.c
-+++ b/src/pk-engine.c
-@@ -686,7 +686,7 @@ pk_engine_set_proxy (PkEngine *engine,
-
- /* check length of http */
- len = pk_strlen (proxy_http, 1024);
-- if (len == 1024) {
-+ if (len >= 1024) {
- error = g_error_new_literal (PK_ENGINE_ERROR,
- PK_ENGINE_ERROR_CANNOT_SET_PROXY,
- "http proxy was too long");
-@@ -696,7 +696,7 @@ pk_engine_set_proxy (PkEngine *engine,
-
- /* check length of ftp */
- len = pk_strlen (proxy_ftp, 1024);
-- if (len == 1024) {
-+ if (len >= 1024) {
- error = g_error_new_literal (PK_ENGINE_ERROR,
- PK_ENGINE_ERROR_CANNOT_SET_PROXY,
- "ftp proxy was too long");
-diff --git a/src/pk-transaction.c b/src/pk-transaction.c
-index 5c24462c7..f67d48345 100644
---- a/src/pk-transaction.c
-+++ b/src/pk-transaction.c
-@@ -2484,7 +2484,7 @@ pk_transaction_strvalidate (const gchar *text, GError **error)
- "Invalid input passed to daemon: zero length string");
- return FALSE;
- }
-- if (length > 1024) {
-+ if (length >= 1024) {
- g_set_error (error, PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INPUT_INVALID,
- "Invalid input passed to daemon: input too long: %u", length);
- return FALSE;
-@@ -2536,7 +2536,7 @@ pk_transaction_search_check_item (const gchar *values, GError **error)
- "Invalid search containing '?'");
- return FALSE;
- }
-- if (size == 1024) {
-+ if (size >= 1024) {
- g_set_error_literal (error,
- PK_TRANSACTION_ERROR,
- PK_TRANSACTION_ERROR_SEARCH_INVALID,
diff --git a/debian/patches/02_identify-ubuntu.patch b/debian/patches/02_identify-ubuntu.patch
deleted file mode 100644
index 1462ab3..0000000
--- a/debian/patches/02_identify-ubuntu.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From f1e4ad6a5b0000b93625ecc6d5ca953e0218f627 Mon Sep 17 00:00:00 2001
-From: Matthias Klumpp
-Date: Tue, 20 Feb 2024 00:02:47 +0100
-Subject: [PATCH] apt: Don't accidentally identify Ubuntu as Debian
-
----
- backends/apt/apt-job.cpp | 3 ++-
- backends/apt/apt-sourceslist.cpp | 2 +-
- 2 files changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/backends/apt/apt-job.cpp b/backends/apt/apt-job.cpp
-index 907059c83..1a89deee1 100644
---- a/backends/apt/apt-job.cpp
-+++ b/backends/apt/apt-job.cpp
-@@ -566,8 +566,9 @@ void AptJob::emitUpdates(PkgList &output, PkBitfield filters)
- std::string origin = vf.File().Origin() == NULL ? "" : vf.File().Origin();
- std::string archive = vf.File().Archive() == NULL ? "" : vf.File().Archive();
- std::string label = vf.File().Label() == NULL ? "" : vf.File().Label();
-+
- if (origin.compare("Debian") == 0 ||
-- origin.compare("Ubuntu") == 0) {
-+ origin.compare("Ubuntu") == 0) {
- if (ends_with(archive, "-security") ||
- label.compare("Debian-Security") == 0) {
- state = PK_INFO_ENUM_SECURITY;
-diff --git a/backends/apt/apt-sourceslist.cpp b/backends/apt/apt-sourceslist.cpp
-index 7c06d741d..bf48f4906 100644
---- a/backends/apt/apt-sourceslist.cpp
-+++ b/backends/apt/apt-sourceslist.cpp
-@@ -485,7 +485,7 @@ string SourcesList::SourceRecord::niceName()
- if (g_pattern_match_simple ("*.debian.org/*", uri_info.c_str()))
- return "Debian " + ret;
- if (g_pattern_match_simple ("*.ubuntu.com/*", uri_info.c_str()))
-- return "Debian " + ret;
-+ return "Ubuntu " + ret;
- if (g_pattern_match_simple ("*.pureos.net/*", uri_info.c_str()))
- return "PureOS " + ret;
-
diff --git a/debian/patches/03_not_call_dbus_on_ostree_booted_systems.patch b/debian/patches/03_not_call_dbus_on_ostree_booted_systems.patch
deleted file mode 100644
index 8c5ccb8..0000000
--- a/debian/patches/03_not_call_dbus_on_ostree_booted_systems.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Index: packagekit-fork-from-deepin/backends/apt/20packagekit
-===================================================================
---- packagekit-fork-from-deepin.orig/backends/apt/20packagekit
-+++ packagekit-fork-from-deepin/backends/apt/20packagekit
-@@ -3,10 +3,10 @@
- // Whenever dpkg is called we might have different updates
- // i.e. if an user removes a package that had an update
- DPkg::Post-Invoke {
--"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
-+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/test ! -e /run/ostree-booted && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
- };
-
- // When APT's cache is updated (i.e. apt-cache update)
- APT::Update::Post-Invoke-Success {
--"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
-+"/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/test ! -e /run/ostree-booted && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
- };
diff --git a/debian/patches/series b/debian/patches/series
index ae43f43..1fca1c2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,2 @@
policy.diff
-01_strlen-cmp-memfix.patch
-02_identify-ubuntu.patch
-03_not_call_dbus_on_ostree_booted_systems.patch
PK_Do-not-allow-re-invoking-methods-on-non-new-txn.patch
diff --git a/docs/api/dbus/meson.build b/docs/api/dbus/meson.build
index 842389b..eaf4db1 100644
--- a/docs/api/dbus/meson.build
+++ b/docs/api/dbus/meson.build
@@ -2,7 +2,7 @@ spec_to_docbook = find_program('spec-to-docbook.sh')
packagekit_ref_xml = custom_target(
'org.freedesktop.PackageKit.ref.xml',
- input: join_paths(meson.source_root(), 'src', 'org.freedesktop.PackageKit.xml'),
+ input: join_paths(source_root, 'src', 'org.freedesktop.PackageKit.xml'),
output: 'org.freedesktop.PackageKit.ref.xml',
build_by_default: true,
command: [
@@ -15,7 +15,7 @@ packagekit_ref_xml = custom_target(
packagekit_transaction_ref_xml = custom_target(
'org.freedesktop.PackageKit.Transaction.ref.xml',
- input: join_paths(meson.source_root(), 'src', 'org.freedesktop.PackageKit.Transaction.xml'),
+ input: join_paths(source_root, 'src', 'org.freedesktop.PackageKit.Transaction.xml'),
output: 'org.freedesktop.PackageKit.Transaction.ref.xml',
build_by_default: true,
command: [
diff --git a/docs/html/pk-help.html b/docs/html/pk-help.html
index 49d6b0a..a85ffee 100644
--- a/docs/html/pk-help.html
+++ b/docs/html/pk-help.html
@@ -21,7 +21,8 @@ How can I help?
Anyone interested in PackageKit development is invited to join the
-channel #PackageKit on freenode.
+Matrix room
+#PackageKit:matrix.org.
We are a friendly bunch, and can answer questions on backends, GUI's or
anything else PackageKit related.
diff --git a/docs/html/pk-matrix.html b/docs/html/pk-matrix.html
index 916b18c..4109a42 100644
--- a/docs/html/pk-matrix.html
+++ b/docs/html/pk-matrix.html
@@ -368,6 +368,17 @@ Feature Matrix
![[yes]](img/status-good.png) |
![[no]](img/status-bad.png) |
+
+| InstalledChanged |
+![[no]](img/status-bad.png) |
+![[yes]](img/status-good.png) |
+![[no]](img/status-bad.png) |
+![[no]](img/status-bad.png) |
+![[no]](img/status-bad.png) |
+![[no]](img/status-bad.png) |
+![[yes]](img/status-good.png) |
+![[no]](img/status-bad.png) |
+
Filters
diff --git a/lib/packagekit-glib2/meson.build b/lib/packagekit-glib2/meson.build
index b90b897..518d63f 100644
--- a/lib/packagekit-glib2/meson.build
+++ b/lib/packagekit-glib2/meson.build
@@ -110,6 +110,7 @@ packagekitprivate_sources = files(
'pk-common-private.h',
'pk-console-shared.c',
'pk-console-shared.h',
+ 'pk-progress-private.h',
'pk-progress-bar.c',
'pk-progress-bar.h',
'pk-task-text.c',
diff --git a/lib/packagekit-glib2/pk-category.c b/lib/packagekit-glib2/pk-category.c
index c627392..9cafb39 100644
--- a/lib/packagekit-glib2/pk-category.c
+++ b/lib/packagekit-glib2/pk-category.c
@@ -34,8 +34,6 @@
static void pk_category_finalize (GObject *object);
-#define PK_CATEGORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_CATEGORY, PkCategoryPrivate))
-
/**
* PkCategoryPrivate:
*
@@ -60,7 +58,9 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (PkCategory, pk_category, PK_TYPE_SOURCE)
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (PkCategory, pk_category, PK_TYPE_SOURCE)
/**
* pk_category_get_parent_id:
@@ -68,15 +68,18 @@ G_DEFINE_TYPE (PkCategory, pk_category, PK_TYPE_SOURCE)
*
* Gets the parent category id.
*
- * Return value: the string value, or %NULL for unset.
+ * Returns: (nullable): the string value, or %NULL for unset.
*
* Since: 0.6.2
**/
const gchar *
pk_category_get_parent_id (PkCategory *category)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_val_if_fail (PK_IS_CATEGORY (category), NULL);
- return category->priv->parent_id;
+
+ return priv->parent_id;
}
/**
@@ -91,9 +94,16 @@ pk_category_get_parent_id (PkCategory *category)
void
pk_category_set_parent_id (PkCategory *category, const gchar *parent_id)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_if_fail (PK_IS_CATEGORY (category));
- g_free (category->priv->parent_id);
- category->priv->parent_id = g_strdup (parent_id);
+
+ if (g_strcmp0 (priv->parent_id, parent_id) == 0)
+ return;
+
+ g_free (priv->parent_id);
+ priv->parent_id = g_strdup (parent_id);
+ g_object_notify_by_pspec (G_OBJECT(category), obj_properties[PROP_PARENT_ID]);
}
/**
@@ -102,15 +112,18 @@ pk_category_set_parent_id (PkCategory *category, const gchar *parent_id)
*
* Gets the id specific to this category.
*
- * Return value: the string value, or %NULL for unset.
+ * Returns: (nullable): the string value, or %NULL for unset.
*
* Since: 0.6.2
**/
const gchar *
pk_category_get_id (PkCategory *category)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_val_if_fail (PK_IS_CATEGORY (category), NULL);
- return category->priv->cat_id;
+
+ return priv->cat_id;
}
/**
@@ -125,9 +138,16 @@ pk_category_get_id (PkCategory *category)
void
pk_category_set_id (PkCategory *category, const gchar *cat_id)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_if_fail (PK_IS_CATEGORY (category));
- g_free (category->priv->cat_id);
- category->priv->cat_id = g_strdup (cat_id);
+
+ if (g_strcmp0 (priv->cat_id, cat_id) == 0)
+ return;
+
+ g_free (priv->cat_id);
+ priv->cat_id = g_strdup (cat_id);
+ g_object_notify_by_pspec (G_OBJECT(category), obj_properties[PROP_CAT_ID]);
}
/**
@@ -136,15 +156,18 @@ pk_category_set_id (PkCategory *category, const gchar *cat_id)
*
* Gets the name.
*
- * Return value: the string value, or %NULL for unset.
+ * Returns: (nullable): the string value, or %NULL for unset.
*
* Since: 0.6.2
**/
const gchar *
pk_category_get_name (PkCategory *category)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_val_if_fail (PK_IS_CATEGORY (category), NULL);
- return category->priv->name;
+
+ return priv->name;
}
/**
@@ -159,9 +182,16 @@ pk_category_get_name (PkCategory *category)
void
pk_category_set_name (PkCategory *category, const gchar *name)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_if_fail (PK_IS_CATEGORY (category));
- g_free (category->priv->name);
- category->priv->name = g_strdup (name);
+
+ if (g_strcmp0 (priv->name, name) == 0)
+ return;
+
+ g_free (priv->name);
+ priv->name = g_strdup (name);
+ g_object_notify_by_pspec (G_OBJECT(category), obj_properties[PROP_NAME]);
}
/**
@@ -170,15 +200,18 @@ pk_category_set_name (PkCategory *category, const gchar *name)
*
* Gets the summary.
*
- * Return value: the string value, or %NULL for unset.
+ * Returns: (nullable): the string value, or %NULL for unset.
*
* Since: 0.6.2
**/
const gchar *
pk_category_get_summary (PkCategory *category)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_val_if_fail (PK_IS_CATEGORY (category), NULL);
- return category->priv->summary;
+
+ return priv->summary;
}
/**
@@ -193,9 +226,16 @@ pk_category_get_summary (PkCategory *category)
void
pk_category_set_summary (PkCategory *category, const gchar *summary)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_if_fail (PK_IS_CATEGORY (category));
- g_free (category->priv->summary);
- category->priv->summary = g_strdup (summary);
+
+ if (g_strcmp0 (priv->summary, summary) == 0)
+ return;
+
+ g_free (priv->summary);
+ priv->summary = g_strdup (summary);
+ g_object_notify_by_pspec (G_OBJECT(category), obj_properties[PROP_SUMMARY]);
}
/**
@@ -204,15 +244,18 @@ pk_category_set_summary (PkCategory *category, const gchar *summary)
*
* Gets the icon filename.
*
- * Return value: the string value, or %NULL for unset.
+ * Returns: (nullable): the string value, or %NULL for unset.
*
* Since: 0.6.2
**/
const gchar *
pk_category_get_icon (PkCategory *category)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_val_if_fail (PK_IS_CATEGORY (category), NULL);
- return category->priv->icon;
+
+ return priv->icon;
}
/**
@@ -227,9 +270,16 @@ pk_category_get_icon (PkCategory *category)
void
pk_category_set_icon (PkCategory *category, const gchar *icon)
{
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
+
g_return_if_fail (PK_IS_CATEGORY (category));
- g_free (category->priv->icon);
- category->priv->icon = g_strdup (icon);
+
+ if (g_strcmp0 (priv->icon, icon) == 0)
+ return;
+
+ g_free (priv->icon);
+ priv->icon = g_strdup (icon);
+ g_object_notify_by_pspec (G_OBJECT(category), obj_properties[PROP_ICON]);
}
/*
@@ -239,7 +289,7 @@ static void
pk_category_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkCategory *category = PK_CATEGORY (object);
- PkCategoryPrivate *priv = category->priv;
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
switch (prop_id) {
case PROP_PARENT_ID:
@@ -270,28 +320,22 @@ static void
pk_category_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
PkCategory *category = PK_CATEGORY (object);
- PkCategoryPrivate *priv = category->priv;
switch (prop_id) {
case PROP_PARENT_ID:
- g_free (priv->parent_id);
- priv->parent_id = g_strdup (g_value_get_string (value));
+ pk_category_set_parent_id (category, g_value_get_string (value));
break;
case PROP_CAT_ID:
- g_free (priv->cat_id);
- priv->cat_id = g_strdup (g_value_get_string (value));
+ pk_category_set_id (category, g_value_get_string (value));
break;
case PROP_NAME:
- g_free (priv->name);
- priv->name = g_strdup (g_value_get_string (value));
+ pk_category_set_name (category, g_value_get_string (value));
break;
case PROP_SUMMARY:
- g_free (priv->summary);
- priv->summary = g_strdup (g_value_get_string (value));
+ pk_category_set_summary (category, g_value_get_string (value));
break;
case PROP_ICON:
- g_free (priv->icon);
- priv->icon = g_strdup (g_value_get_string (value));
+ pk_category_set_icon (category, g_value_get_string (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -305,7 +349,6 @@ pk_category_set_property (GObject *object, guint prop_id, const GValue *value, G
static void
pk_category_class_init (PkCategoryClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = pk_category_finalize;
object_class->get_property = pk_category_get_property;
@@ -316,52 +359,52 @@ pk_category_class_init (PkCategoryClass *klass)
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("parent-id", NULL, NULL,
+ obj_properties[PROP_PARENT_ID] =
+ g_param_spec_string ("parent-id", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PARENT_ID, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkCategory:cat-id:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("cat-id", NULL, NULL,
+ obj_properties[PROP_CAT_ID] =
+ g_param_spec_string ("cat-id", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_CAT_ID, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkCategory:name:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("name", NULL, NULL,
+ obj_properties[PROP_NAME] =
+ g_param_spec_string ("name", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_NAME, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkCategory:summary:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("summary", NULL, NULL,
+ obj_properties[PROP_SUMMARY] =
+ g_param_spec_string ("summary", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SUMMARY, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkCategory:icon:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("icon", NULL, NULL,
+ obj_properties[PROP_ICON] =
+ g_param_spec_string ("icon", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ICON, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- g_type_class_add_private (klass, sizeof (PkCategoryPrivate));
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
}
/*
@@ -370,7 +413,7 @@ pk_category_class_init (PkCategoryClass *klass)
static void
pk_category_init (PkCategory *category)
{
- category->priv = PK_CATEGORY_GET_PRIVATE (category);
+ category->priv = pk_category_get_instance_private (category);
}
/*
@@ -380,13 +423,13 @@ static void
pk_category_finalize (GObject *object)
{
PkCategory *category = PK_CATEGORY (object);
- PkCategoryPrivate *priv = category->priv;
+ PkCategoryPrivate *priv = pk_category_get_instance_private (category);
- g_free (priv->parent_id);
- g_free (priv->cat_id);
- g_free (priv->name);
- g_free (priv->summary);
- g_free (priv->icon);
+ g_clear_pointer (&priv->parent_id, g_free);
+ g_clear_pointer (&priv->cat_id, g_free);
+ g_clear_pointer (&priv->name, g_free);
+ g_clear_pointer (&priv->summary, g_free);
+ g_clear_pointer (&priv->icon, g_free);
G_OBJECT_CLASS (pk_category_parent_class)->finalize (object);
}
diff --git a/lib/packagekit-glib2/pk-client-helper.c b/lib/packagekit-glib2/pk-client-helper.c
index c730632..65044c1 100644
--- a/lib/packagekit-glib2/pk-client-helper.c
+++ b/lib/packagekit-glib2/pk-client-helper.c
@@ -207,7 +207,7 @@ pk_client_helper_copy_stdout_cb (GIOChannel *source, GIOCondition condition, PkC
g_debug ("child has input to push to the socket: %s", data);
status = g_io_channel_write_chars (child->socket_channel, data, len, &written, &error);
if (status != G_IO_STATUS_NORMAL) {
- g_warning ("failed to write to socket: %s", error->message);
+ g_warning ("failed to write to socket: %s", error ? error->message : "Unknown error");
return G_SOURCE_REMOVE;
}
if (written != len) {
@@ -278,7 +278,7 @@ pk_client_helper_copy_conn_cb (GIOChannel *source, GIOCondition condition, PkCli
g_debug ("socket has data to push to child: '%s'", data);
status = g_io_channel_write_chars (child->stdin_channel, data, len, &written, &error);
if (status != G_IO_STATUS_NORMAL) {
- g_warning ("failed to write to stdin: %s", error->message);
+ g_warning ("failed to write to stdin: %s", error ? error->message : "Unknown error");
return G_SOURCE_REMOVE;
}
if (written != len) {
diff --git a/lib/packagekit-glib2/pk-client.c b/lib/packagekit-glib2/pk-client.c
index c3eadc2..96ff9a6 100644
--- a/lib/packagekit-glib2/pk-client.c
+++ b/lib/packagekit-glib2/pk-client.c
@@ -44,11 +44,10 @@
#include
#include
#include
+#include
static void pk_client_finalize (GObject *object);
-#define PK_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_CLIENT, PkClientPrivate))
-
#define PK_CLIENT_DBUS_METHOD_TIMEOUT G_MAXINT /* ms */
/**
@@ -80,7 +79,9 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (PkClient, pk_client, G_TYPE_OBJECT)
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (PkClient, pk_client, G_TYPE_OBJECT)
#define PK_TYPE_CLIENT_STATE (pk_client_state_get_type ())
@@ -155,24 +156,21 @@ struct _PkClientState
gchar *distro_id;
gchar *transaction_id;
gchar *value;
- gpointer progress_user_data;
gpointer user_data;
guint number;
gulong cancellable_id;
GDBusProxy *proxy;
- GDBusProxy *proxy_props;
GCancellable *cancellable;
GCancellable *cancellable_client;
GTask *res;
PkBitfield filters;
PkClient *client;
PkProgress *progress;
- PkProgressCallback progress_callback;
PkResults *results;
PkRoleEnum role;
PkSigTypeEnum type;
PkUpgradeKindEnum upgrade_kind;
- guint refcount;
+ gint remaining_files_to_copy;
PkClientHelper *client_helper;
gboolean waiting_for_finished;
};
@@ -199,46 +197,37 @@ pk_client_state_unset_proxy (PkClientState *state)
static void
pk_client_state_remove (PkClient *client, PkClientState *state)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
gboolean is_idle;
- g_ptr_array_remove (client->priv->calls, state);
+
+ g_ptr_array_remove (priv->calls, state);
/* has the idle state changed? */
- is_idle = (client->priv->calls->len == 0);
- if (is_idle != client->priv->idle) {
- client->priv->idle = is_idle;
- g_object_notify (G_OBJECT(client), "idle");
+ is_idle = (priv->calls->len == 0);
+ if (is_idle != priv->idle) {
+ priv->idle = is_idle;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_IDLE]);
}
}
/*
* pk_client_state_finish:
- * @state: (transfer full): the #PkClientState
+ * @state: (transfer none): the #PkClientState
* @error: (transfer full): the #GError
**/
static void
pk_client_state_finish (PkClientState *state, GError *error)
{
- gboolean ret;
-
if (state->res == NULL)
return;
/* force finished (if not already set) so clients can update the UI's */
if (state->progress != NULL) {
- ret = pk_progress_set_status (state->progress, PK_STATUS_ENUM_FINISHED);
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_STATUS,
- state->progress_user_data);
- state->progress_callback = NULL;
- }
+ pk_progress_set_status (state->progress, PK_STATUS_ENUM_FINISHED);
}
pk_client_state_unset_proxy (state);
- if (state->proxy_props != NULL)
- g_object_unref (G_OBJECT (state->proxy_props));
-
if (state->ret) {
g_task_return_pointer (state->res,
g_object_ref (state->results),
@@ -430,7 +419,7 @@ static void
pk_client_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkClient *client = PK_CLIENT (object);
- PkClientPrivate *priv = client->priv;
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
switch (prop_id) {
case PROP_LOCALE:
@@ -464,7 +453,7 @@ static void
pk_client_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
PkClient *client = PK_CLIENT (object);
- PkClientPrivate *priv = client->priv;
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
switch (prop_id) {
case PROP_LOCALE:
@@ -682,30 +671,19 @@ pk_client_set_property_value (PkClientState *state,
const char *key,
GVariant *value)
{
- gboolean ret;
const gchar *package_id;
/* role */
if (g_strcmp0 (key, "Role") == 0) {
- ret = pk_progress_set_role (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_ROLE,
- state->progress_user_data);
- }
+ pk_progress_set_role (state->progress,
+ g_variant_get_uint32 (value));
return;
}
/* status */
if (g_strcmp0 (key, "Status") == 0) {
- ret = pk_progress_set_status (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_STATUS,
- state->progress_user_data);
- }
+ pk_progress_set_status (state->progress,
+ g_variant_get_uint32 (value));
return;
}
@@ -713,136 +691,79 @@ pk_client_set_property_value (PkClientState *state,
if (g_strcmp0 (key, "LastPackage") == 0) {
package_id = g_variant_get_string (value, NULL);
/* check to see if it's been set yet */
- ret = pk_package_id_check (package_id);
- if (!ret)
+ if (!pk_package_id_check (package_id))
return;
- ret = pk_progress_set_package_id (state->progress,
- package_id);
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PACKAGE_ID,
- state->progress_user_data);
- }
+ pk_progress_set_package_id (state->progress, package_id);
return;
}
/* percentage */
if (g_strcmp0 (key, "Percentage") == 0) {
- ret = pk_progress_set_percentage (state->progress,
- pk_client_percentage_to_signed (g_variant_get_uint32 (value)));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PERCENTAGE,
- state->progress_user_data);
- }
+ pk_progress_set_percentage (state->progress,
+ pk_client_percentage_to_signed (g_variant_get_uint32 (value)));
return;
}
/* allow-cancel */
if (g_strcmp0 (key, "AllowCancel") == 0) {
- ret = pk_progress_set_allow_cancel (state->progress,
- g_variant_get_boolean (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_ALLOW_CANCEL,
- state->progress_user_data);
- }
+ pk_progress_set_allow_cancel (state->progress,
+ g_variant_get_boolean (value));
return;
}
/* caller-active */
if (g_strcmp0 (key, "CallerActive") == 0) {
- ret = pk_progress_set_caller_active (state->progress,
- g_variant_get_boolean (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_CALLER_ACTIVE,
- state->progress_user_data);
- }
+ pk_progress_set_caller_active (state->progress,
+ g_variant_get_boolean (value));
return;
}
/* elapsed-time */
if (g_strcmp0 (key, "ElapsedTime") == 0) {
- ret = pk_progress_set_elapsed_time (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_ELAPSED_TIME,
- state->progress_user_data);
- }
+ pk_progress_set_elapsed_time (state->progress,
+ g_variant_get_uint32 (value));
return;
}
/* remaining-time */
if (g_strcmp0 (key, "RemainingTime") == 0) {
- ret = pk_progress_set_elapsed_time (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_REMAINING_TIME,
- state->progress_user_data);
- }
+ pk_progress_set_remaining_time (state->progress,
+ g_variant_get_uint32 (value));
return;
}
/* speed */
if (g_strcmp0 (key, "Speed") == 0) {
- ret = pk_progress_set_speed (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_SPEED,
- state->progress_user_data);
- }
+ pk_progress_set_speed (state->progress,
+ g_variant_get_uint32 (value));
return;
}
/* download-size-remaining */
if (g_strcmp0 (key, "DownloadSizeRemaining") == 0) {
- ret = pk_progress_set_download_size_remaining (state->progress,
- g_variant_get_uint64 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_DOWNLOAD_SIZE_REMAINING,
- state->progress_user_data);
- }
+ pk_progress_set_download_size_remaining (state->progress,
+ g_variant_get_uint64 (value));
return;
}
/* transaction-flags */
if (g_strcmp0 (key, "TransactionFlags") == 0) {
- ret = pk_progress_set_transaction_flags (state->progress,
- g_variant_get_uint64 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_TRANSACTION_FLAGS,
- state->progress_user_data);
- }
+ pk_progress_set_transaction_flags (state->progress,
+ g_variant_get_uint64 (value));
return;
}
/* uid */
if (g_strcmp0 (key, "Uid") == 0) {
- ret = pk_progress_set_uid (state->progress,
- g_variant_get_uint32 (value));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_UID,
- state->progress_user_data);
- }
+ pk_progress_set_uid (state->progress,
+ g_variant_get_uint32 (value));
return;
}
/* sender */
if (g_strcmp0 (key, "Sender") == 0) {
- ret = pk_progress_set_sender (state->progress,
- g_variant_get_string (value, NULL));
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_SENDER,
- state->progress_user_data);
- }
+ pk_progress_set_sender (state->progress,
+ g_variant_get_string (value, NULL));
return;
}
@@ -855,15 +776,16 @@ pk_client_set_property_value (PkClientState *state,
static void
pk_client_state_add (PkClient *client, PkClientState *state)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
gboolean is_idle;
- g_ptr_array_add (client->priv->calls, state);
+ g_ptr_array_add (priv->calls, state);
/* has the idle state changed? */
- is_idle = (client->priv->calls->len == 0);
- if (is_idle != client->priv->idle) {
- client->priv->idle = is_idle;
- g_object_notify (G_OBJECT(client), "idle");
+ is_idle = (priv->calls->len == 0);
+ if (is_idle != priv->idle) {
+ priv->idle = is_idle;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_IDLE]);
}
}
@@ -905,7 +827,6 @@ pk_client_signal_package (PkClientState *state,
const gchar *package_id,
const gchar *summary)
{
- gboolean ret;
g_autoptr(GError) error = NULL;
g_autoptr(PkPackage) package = NULL;
@@ -940,18 +861,8 @@ pk_client_signal_package (PkClientState *state,
case PK_INFO_ENUM_PREPARING:
case PK_INFO_ENUM_DECOMPRESSING:
case PK_INFO_ENUM_FINISHED:
- ret = pk_progress_set_package_id (state->progress, package_id);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PACKAGE_ID,
- state->progress_user_data);
- }
- ret = pk_progress_set_package (state->progress, package);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PACKAGE,
- state->progress_user_data);
- }
+ pk_progress_set_package_id (state->progress, package_id);
+ pk_progress_set_package (state->progress, package);
break;
default:
break;
@@ -996,10 +907,11 @@ pk_client_copy_finished_remove_old_files (PkClientState *state)
* pk_client_copy_downloaded_finished_cb:
*/
static void
-pk_client_copy_downloaded_finished_cb (GFile *file, GAsyncResult *res, PkClientState *state)
+pk_client_copy_downloaded_finished_cb (GFile *file, GAsyncResult *res, gpointer user_data)
{
g_autofree gchar *path = NULL;
g_autoptr(GError) error = NULL;
+ g_autoptr(PkClientState) state = user_data;
/* debug */
path = g_file_get_path (file);
@@ -1012,7 +924,7 @@ pk_client_copy_downloaded_finished_cb (GFile *file, GAsyncResult *res, PkClientS
}
/* no more copies pending? */
- if (--state->refcount == 0) {
+ if (g_atomic_int_dec_and_test (&state->remaining_files_to_copy)) {
pk_client_copy_finished_remove_old_files (state);
state->ret = TRUE;
pk_client_state_finish (state, NULL);
@@ -1025,28 +937,17 @@ pk_client_copy_downloaded_finished_cb (GFile *file, GAsyncResult *res, PkClientS
static void
pk_client_copy_progress_cb (goffset current_num_bytes, goffset total_num_bytes, PkClientState *state)
{
- gboolean ret;
gint percentage = -1;
/* save status */
- ret = pk_progress_set_status (state->progress, PK_STATUS_ENUM_COPY_FILES);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_STATUS,
- state->progress_user_data);
- }
+ pk_progress_set_status (state->progress, PK_STATUS_ENUM_COPY_FILES);
/* calculate percentage */
if (total_num_bytes > 0)
percentage = 100 * current_num_bytes / total_num_bytes;
/* save percentage */
- ret = pk_progress_set_percentage (state->progress, percentage);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PERCENTAGE,
- state->progress_user_data);
- }
+ pk_progress_set_percentage (state->progress, percentage);
}
/*
@@ -1082,7 +983,7 @@ pk_client_copy_downloaded_file (PkClientState *state, const gchar *package_id, c
g_file_copy_async (source, destination, G_FILE_COPY_OVERWRITE,
G_PRIORITY_DEFAULT, state->cancellable,
(GFileProgressCallback) pk_client_copy_progress_cb, state,
- (GAsyncReadyCallback) pk_client_copy_downloaded_finished_cb, state);
+ (GAsyncReadyCallback) pk_client_copy_downloaded_finished_cb, g_object_ref (state));
/* Add the result (as a GStrv) to the results set */
files = g_strsplit (path, ",", -1);
@@ -1110,7 +1011,6 @@ pk_client_copy_downloaded (PkClientState *state)
guint j;
guint len;
PkFiles *item;
- gboolean ret;
g_autoptr(GPtrArray) array = NULL;
/* get data */
@@ -1123,19 +1023,14 @@ pk_client_copy_downloaded (PkClientState *state)
/* get the number of files to copy */
for (i = 0; i < array->len; i++) {
item = g_ptr_array_index (array, i);
- state->refcount += g_strv_length (pk_files_get_files (item));
+ g_atomic_int_add (&state->remaining_files_to_copy, g_strv_length (pk_files_get_files (item)));
}
/* get a cached value, as pk_client_copy_downloaded_file() adds items */
len = array->len;
/* save percentage */
- ret = pk_progress_set_percentage (state->progress, -1);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PERCENTAGE,
- state->progress_user_data);
- }
+ pk_progress_set_percentage (state->progress, -1);
/* do the copies pipelined */
for (i = 0; i < len; i++) {
@@ -1265,7 +1160,6 @@ pk_client_signal_cb (GDBusProxy *proxy,
g_autoptr(PkClientState) state = g_weak_ref_get (weak_ref);
gchar *tmp_str[12];
gboolean tmp_bool;
- gboolean ret;
guint tmp_uint;
guint tmp_uint2;
guint tmp_uint3;
@@ -1601,23 +1495,17 @@ pk_client_signal_cb (GDBusProxy *proxy,
"percentage", tmp_uint2,
"transaction-id", state->transaction_id,
NULL);
- ret = pk_progress_set_item_progress (state->progress,
- item);
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_ITEM_PROGRESS,
- state->progress_user_data);
- }
+ pk_progress_set_item_progress (state->progress, item);
return;
}
if (g_strcmp0 (signal_name, "Destroy") == 0) {
g_autoptr(GError) local_error = NULL;
- if (state->waiting_for_finished)
+ if (state->waiting_for_finished) {
local_error = g_error_new_literal (PK_CLIENT_ERROR, PK_CLIENT_ERROR_FAILED,
"PackageKit transaction disappeared");
-
- pk_client_state_finish (state, g_steal_pointer (&local_error));
+ pk_client_state_finish (state, g_steal_pointer (&local_error));
+ }
return;
}
}
@@ -1710,16 +1598,9 @@ pk_client_method_cb (GObject *source_object,
static void
pk_client_set_role (PkClientState *state, PkRoleEnum role)
{
- gboolean ret;
pk_progress_set_transaction_flags (state->progress,
state->transaction_flags);
- ret = pk_progress_set_role (state->progress, role);
- if (ret && state->progress_callback != NULL) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_ROLE,
- state->progress_user_data);
- }
- return;
+ pk_progress_set_role (state->progress, role);
}
/*
@@ -2156,6 +2037,8 @@ pk_client_create_helper_argv_envp (gchar ***argv,
{
const gchar *dialog = NULL;
const gchar *display;
+ const gchar *wayland_display;
+ const gchar *xauthority;
const gchar *term;
gboolean ret;
guint envpi = 0;
@@ -2171,7 +2054,7 @@ pk_client_create_helper_argv_envp (gchar ***argv,
*argv = g_new0 (gchar *, 2);
*argv[0] = g_strdup ("/usr/bin/debconf-communicate");
- *envp_out = g_new0 (gchar *, 8);
+ *envp_out = g_new0 (gchar *, 11);
envp = *envp_out;
envp[envpi++] = g_strdup ("DEBCONF_DB_REPLACE=configdb");
envp[envpi++] = g_strdup ("DEBCONF_DB_OVERRIDE=Pipe{infd:none outfd:none}");
@@ -2189,6 +2072,17 @@ pk_client_create_helper_argv_envp (gchar ***argv,
display = g_getenv ("DISPLAY");
if (display != NULL) {
envp[envpi++] = g_strdup_printf ("DISPLAY=%s", display);
+ }
+ xauthority = g_getenv ("XAUTHORITY");
+ if (xauthority != NULL) {
+ envp[envpi++] = g_strdup_printf ("XAUTHORITY=%s", xauthority);
+ }
+ wayland_display = g_getenv ("WAYLAND_DISPLAY");
+ if (wayland_display != NULL) {
+ envp[envpi++] = g_strdup_printf ("WAYLAND_DISPLAY=%s", wayland_display);
+ envp[envpi++] = g_strdup_printf ("XDG_RUNTIME_DIR=%s", g_get_user_runtime_dir ());
+ }
+ if (display != NULL || wayland_display != NULL) {
if (g_strcmp0 (g_getenv ("KDE_FULL_SESSION"), "true") == 0)
dialog = "kde";
else
@@ -2274,6 +2168,7 @@ pk_client_get_proxy_cb (GObject *object,
g_autoptr(PkClientState) state = PK_CLIENT_STATE (g_steal_pointer (&user_data));
g_autoptr(GError) error = NULL;
g_autoptr(GPtrArray) array = NULL;
+ PkClientPrivate *priv = pk_client_get_instance_private (state->client);
state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
if (state->proxy == NULL)
@@ -2286,29 +2181,28 @@ pk_client_get_proxy_cb (GObject *object,
array = g_ptr_array_new_with_free_func (g_free);
/* locale */
- if (state->client->priv->locale != NULL) {
- hint = g_strdup_printf ("locale=%s", state->client->priv->locale);
+ if (priv->locale != NULL) {
+ hint = g_strdup_printf ("locale=%s", priv->locale);
g_ptr_array_add (array, hint);
}
/* background */
hint = g_strdup_printf ("background=%s",
- pk_client_bool_to_string (state->client->priv->background));
+ pk_client_bool_to_string (priv->background));
g_ptr_array_add (array, hint);
/* interactive */
hint = g_strdup_printf ("interactive=%s",
- pk_client_bool_to_string (state->client->priv->interactive));
+ pk_client_bool_to_string (priv->interactive));
g_ptr_array_add (array, hint);
- if (state->client->priv->details_with_deps_size &&
+ if (priv->details_with_deps_size &&
state->role == PK_ROLE_ENUM_GET_DETAILS)
g_ptr_array_add (array, g_strdup ("details-with-deps-size=true"));
/* cache-age */
- if (state->client->priv->cache_age > 0) {
- hint = g_strdup_printf ("cache-age=%u",
- state->client->priv->cache_age);
+ if (priv->cache_age > 0) {
+ hint = g_strdup_printf ("cache-age=%u", priv->cache_age);
g_ptr_array_add (array, hint);
}
@@ -2337,7 +2231,7 @@ pk_client_get_proxy_cb (GObject *object,
g_object_ref (state));
/* track state */
- g_ptr_array_add (state->client->priv->calls, state);
+ g_ptr_array_add (priv->calls, state);
}
/*
@@ -2393,7 +2287,7 @@ pk_client_generic_finish (PkClient *client, GAsyncResult *res, GError **error)
}
/**
- * pk_client_resolve_async:
+ * pk_client_resolve_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @packages: (array zero-terminated=1): an array of package names to resolve, e.g. "gnome-system-tools"
@@ -2414,6 +2308,7 @@ pk_client_resolve_async (PkClient *client, PkBitfield filters, gchar **packages,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2425,9 +2320,7 @@ pk_client_resolve_async (PkClient *client, PkBitfield filters, gchar **packages,
state = pk_client_state_new (client, callback_ready, user_data, pk_client_resolve_async, PK_ROLE_ENUM_RESOLVE, cancellable);
state->filters = filters;
state->package_ids = g_strdupv (packages);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2440,14 +2333,14 @@ pk_client_resolve_async (PkClient *client, PkBitfield filters, gchar **packages,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_search_names_async:
+ * pk_client_search_names_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @values: (array zero-terminated=1): free text to search for, for instance, "power"
@@ -2467,6 +2360,7 @@ pk_client_search_names_async (PkClient *client, PkBitfield filters, gchar **valu
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2478,9 +2372,7 @@ pk_client_search_names_async (PkClient *client, PkBitfield filters, gchar **valu
state = pk_client_state_new (client, callback_ready, user_data, pk_client_search_names_async, PK_ROLE_ENUM_SEARCH_NAME, cancellable);
state->filters = filters;
state->search = g_strdupv (values);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2493,14 +2385,14 @@ pk_client_search_names_async (PkClient *client, PkBitfield filters, gchar **valu
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_search_details_async:
+ * pk_client_search_details_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @values: (array zero-terminated=1): free text to search for, for instance, "power"
@@ -2521,6 +2413,7 @@ pk_client_search_details_async (PkClient *client, PkBitfield filters, gchar **va
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2532,9 +2425,7 @@ pk_client_search_details_async (PkClient *client, PkBitfield filters, gchar **va
state = pk_client_state_new (client, callback_ready, user_data, pk_client_search_details_async, PK_ROLE_ENUM_SEARCH_DETAILS, cancellable);
state->filters = filters;
state->search = g_strdupv (values);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2547,14 +2438,14 @@ pk_client_search_details_async (PkClient *client, PkBitfield filters, gchar **va
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_search_groups_async:
+ * pk_client_search_groups_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @values: (array zero-terminated=1): a group enum to search for, for instance, "system-tools"
@@ -2573,6 +2464,7 @@ pk_client_search_groups_async (PkClient *client, PkBitfield filters, gchar **val
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2584,9 +2476,7 @@ pk_client_search_groups_async (PkClient *client, PkBitfield filters, gchar **val
state = pk_client_state_new (client, callback_ready, user_data, pk_client_search_groups_async, PK_ROLE_ENUM_SEARCH_GROUP, cancellable);
state->filters = filters;
state->search = g_strdupv (values);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2599,14 +2489,14 @@ pk_client_search_groups_async (PkClient *client, PkBitfield filters, gchar **val
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_search_files_async:
+ * pk_client_search_files_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @values: (array zero-terminated=1): file to search for, for instance, "/sbin/service"
@@ -2625,6 +2515,7 @@ pk_client_search_files_async (PkClient *client, PkBitfield filters, gchar **valu
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2636,9 +2527,7 @@ pk_client_search_files_async (PkClient *client, PkBitfield filters, gchar **valu
state = pk_client_state_new (client, callback_ready, user_data, pk_client_search_files_async, PK_ROLE_ENUM_SEARCH_FILE, cancellable);
state->filters = filters;
state->search = g_strdupv (values);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2651,14 +2540,14 @@ pk_client_search_files_async (PkClient *client, PkBitfield filters, gchar **valu
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_details_async:
+ * pk_client_get_details_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -2677,6 +2566,7 @@ pk_client_get_details_async (PkClient *client, gchar **package_ids, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2688,9 +2578,7 @@ pk_client_get_details_async (PkClient *client, gchar **package_ids, GCancellable
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_details_async, PK_ROLE_ENUM_GET_DETAILS, cancellable);
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2703,14 +2591,14 @@ pk_client_get_details_async (PkClient *client, gchar **package_ids, GCancellable
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_details_local_async:
+ * pk_client_get_details_local_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @files: (array zero-terminated=1): a null terminated array of filenames
* @cancellable: a #GCancellable or %NULL
@@ -2729,6 +2617,7 @@ pk_client_get_details_local_async (PkClient *client, gchar **files, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2739,9 +2628,8 @@ pk_client_get_details_local_async (PkClient *client, gchar **files, GCancellable
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_details_local_async, PK_ROLE_ENUM_GET_DETAILS_LOCAL, cancellable);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
+
state->files = pk_client_convert_real_paths (files, &error);
if (state->files == NULL) {
pk_client_state_finish (state, g_steal_pointer (&error));
@@ -2759,14 +2647,14 @@ pk_client_get_details_local_async (PkClient *client, gchar **files, GCancellable
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_files_local_async:
+ * pk_client_get_files_local_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @files: (array zero-terminated=1): a null terminated array of filenames
* @cancellable: a #GCancellable or %NULL
@@ -2785,6 +2673,7 @@ pk_client_get_files_local_async (PkClient *client, gchar **files, GCancellable *
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2795,9 +2684,7 @@ pk_client_get_files_local_async (PkClient *client, gchar **files, GCancellable *
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_files_local_async, PK_ROLE_ENUM_GET_FILES_LOCAL, cancellable);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
state->files = pk_client_convert_real_paths (files, &error);
if (state->files == NULL) {
pk_client_state_finish (state, g_steal_pointer (&error));
@@ -2815,14 +2702,14 @@ pk_client_get_files_local_async (PkClient *client, gchar **files, GCancellable *
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_update_detail_async:
+ * pk_client_get_update_detail_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -2841,6 +2728,7 @@ pk_client_get_update_detail_async (PkClient *client, gchar **package_ids, GCance
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2852,9 +2740,7 @@ pk_client_get_update_detail_async (PkClient *client, gchar **package_ids, GCance
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_update_detail_async, PK_ROLE_ENUM_GET_UPDATE_DETAIL, cancellable);
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2867,14 +2753,14 @@ pk_client_get_update_detail_async (PkClient *client, gchar **package_ids, GCance
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_download_packages_async:
+ * pk_client_download_packages_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @directory: the location where packages are to be downloaded
@@ -2893,6 +2779,7 @@ pk_client_download_packages_async (PkClient *client, gchar **package_ids, const
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2905,9 +2792,7 @@ pk_client_download_packages_async (PkClient *client, gchar **package_ids, const
state = pk_client_state_new (client, callback_ready, user_data, pk_client_download_packages_async, PK_ROLE_ENUM_DOWNLOAD_PACKAGES, cancellable);
state->package_ids = g_strdupv (package_ids);
state->directory = g_strdup (directory);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2920,14 +2805,14 @@ pk_client_download_packages_async (PkClient *client, gchar **package_ids, const
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_updates_async:
+ * pk_client_get_updates_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_DEVELOPMENT or %PK_FILTER_ENUM_NONE
* @cancellable: a #GCancellable or %NULL
@@ -2945,6 +2830,7 @@ pk_client_get_updates_async (PkClient *client, PkBitfield filters, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -2955,9 +2841,7 @@ pk_client_get_updates_async (PkClient *client, PkBitfield filters, GCancellable
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_updates_async, PK_ROLE_ENUM_GET_UPDATES, cancellable);
state->filters = filters;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -2970,14 +2854,14 @@ pk_client_get_updates_async (PkClient *client, PkBitfield filters, GCancellable
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_old_transactions_async:
+ * pk_client_get_old_transactions_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @number: the number of past transactions to return, or 0 for all
* @cancellable: a #GCancellable or %NULL
@@ -2995,6 +2879,7 @@ pk_client_get_old_transactions_async (PkClient *client, guint number, GCancellab
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3005,9 +2890,7 @@ pk_client_get_old_transactions_async (PkClient *client, guint number, GCancellab
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_old_transactions_async, PK_ROLE_ENUM_GET_OLD_TRANSACTIONS, cancellable);
state->number = number;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3020,14 +2903,14 @@ pk_client_get_old_transactions_async (PkClient *client, guint number, GCancellab
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_depends_on_async:
+ * pk_client_depends_on_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -3047,6 +2930,7 @@ pk_client_depends_on_async (PkClient *client, PkBitfield filters, gchar **packag
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3060,9 +2944,7 @@ pk_client_depends_on_async (PkClient *client, PkBitfield filters, gchar **packag
state->filters = filters;
state->recursive = recursive;
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3075,14 +2957,14 @@ pk_client_depends_on_async (PkClient *client, PkBitfield filters, gchar **packag
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_packages_async:
+ * pk_client_get_packages_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @cancellable: a #GCancellable or %NULL
@@ -3100,6 +2982,7 @@ pk_client_get_packages_async (PkClient *client, PkBitfield filters, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3110,9 +2993,7 @@ pk_client_get_packages_async (PkClient *client, PkBitfield filters, GCancellable
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_packages_async, PK_ROLE_ENUM_GET_PACKAGES, cancellable);
state->filters = filters;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3125,14 +3006,14 @@ pk_client_get_packages_async (PkClient *client, PkBitfield filters, GCancellable
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_required_by_async:
+ * pk_client_required_by_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -3152,6 +3033,7 @@ pk_client_required_by_async (PkClient *client, PkBitfield filters, gchar **packa
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3165,9 +3047,7 @@ pk_client_required_by_async (PkClient *client, PkBitfield filters, gchar **packa
state->recursive = recursive;
state->filters = filters;
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3180,14 +3060,14 @@ pk_client_required_by_async (PkClient *client, PkBitfield filters, gchar **packa
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_what_provides_async:
+ * pk_client_what_provides_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_GUI | %PK_FILTER_ENUM_FREE or %PK_FILTER_ENUM_NONE
* @values: (array zero-terminated=1): a search term such as "sound/mp3"
@@ -3211,6 +3091,7 @@ pk_client_what_provides_async (PkClient *client,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3222,9 +3103,7 @@ pk_client_what_provides_async (PkClient *client,
state = pk_client_state_new (client, callback_ready, user_data, pk_client_what_provides_async, PK_ROLE_ENUM_WHAT_PROVIDES, cancellable);
state->filters = filters;
state->search = g_strdupv (values);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3237,14 +3116,14 @@ pk_client_what_provides_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_distro_upgrades_async:
+ * pk_client_get_distro_upgrades_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -3262,6 +3141,7 @@ pk_client_get_distro_upgrades_async (PkClient *client, GCancellable *cancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3271,9 +3151,7 @@ pk_client_get_distro_upgrades_async (PkClient *client, GCancellable *cancellable
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_distro_upgrades_async, PK_ROLE_ENUM_GET_DISTRO_UPGRADES, cancellable);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3286,14 +3164,14 @@ pk_client_get_distro_upgrades_async (PkClient *client, GCancellable *cancellable
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_files_async:
+ * pk_client_get_files_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -3311,6 +3189,7 @@ pk_client_get_files_async (PkClient *client, gchar **package_ids, GCancellable *
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3322,9 +3201,7 @@ pk_client_get_files_async (PkClient *client, gchar **package_ids, GCancellable *
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_files_async, PK_ROLE_ENUM_GET_FILES, cancellable);
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3337,14 +3214,14 @@ pk_client_get_files_async (PkClient *client, gchar **package_ids, GCancellable *
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_categories_async:
+ * pk_client_get_categories_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -3361,6 +3238,7 @@ pk_client_get_categories_async (PkClient *client, GCancellable *cancellable,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3370,9 +3248,7 @@ pk_client_get_categories_async (PkClient *client, GCancellable *cancellable,
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_categories_async, PK_ROLE_ENUM_GET_CATEGORIES, cancellable);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3385,14 +3261,14 @@ pk_client_get_categories_async (PkClient *client, GCancellable *cancellable,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_remove_packages_async:
+ * pk_client_remove_packages_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -3422,6 +3298,7 @@ pk_client_remove_packages_async (PkClient *client,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3436,9 +3313,7 @@ pk_client_remove_packages_async (PkClient *client,
state->allow_deps = allow_deps;
state->autoremove = autoremove;
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3451,14 +3326,14 @@ pk_client_remove_packages_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_refresh_cache_async:
+ * pk_client_refresh_cache_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @force: if we should aggressively drop caches
* @cancellable: a #GCancellable or %NULL
@@ -3479,6 +3354,7 @@ pk_client_refresh_cache_async (PkClient *client, gboolean force, GCancellable *c
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3489,9 +3365,7 @@ pk_client_refresh_cache_async (PkClient *client, gboolean force, GCancellable *c
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_refresh_cache_async, PK_ROLE_ENUM_REFRESH_CACHE, cancellable);
state->force = force;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3504,14 +3378,14 @@ pk_client_refresh_cache_async (PkClient *client, gboolean force, GCancellable *c
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_install_packages_async:
+ * pk_client_install_packages_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -3530,6 +3404,7 @@ pk_client_install_packages_async (PkClient *client, PkBitfield transaction_flags
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3542,9 +3417,7 @@ pk_client_install_packages_async (PkClient *client, PkBitfield transaction_flags
state = pk_client_state_new (client, callback_ready, user_data, pk_client_install_packages_async, PK_ROLE_ENUM_INSTALL_PACKAGES, cancellable);
state->transaction_flags = transaction_flags;
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3557,14 +3430,14 @@ pk_client_install_packages_async (PkClient *client, PkBitfield transaction_flags
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_install_signature_async:
+ * pk_client_install_signature_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @type: the signature type, e.g. %PK_SIGTYPE_ENUM_GPG
* @key_id: a key ID such as "0df23df"
@@ -3584,6 +3457,7 @@ pk_client_install_signature_async (PkClient *client, PkSigTypeEnum type, const g
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3596,9 +3470,7 @@ pk_client_install_signature_async (PkClient *client, PkSigTypeEnum type, const g
state->type = type;
state->key_id = g_strdup (key_id);
state->package_id = g_strdup (package_id);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3611,14 +3483,14 @@ pk_client_install_signature_async (PkClient *client, PkSigTypeEnum type, const g
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_update_packages_async:
+ * pk_client_update_packages_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -3642,6 +3514,7 @@ pk_client_update_packages_async (PkClient *client,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3654,9 +3527,7 @@ pk_client_update_packages_async (PkClient *client,
state = pk_client_state_new (client, callback_ready, user_data, pk_client_update_packages_async, PK_ROLE_ENUM_UPDATE_PACKAGES, cancellable);
state->transaction_flags = transaction_flags;
state->package_ids = g_strdupv (package_ids);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3669,7 +3540,7 @@ pk_client_update_packages_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
@@ -3691,9 +3562,10 @@ pk_client_copy_native_finished_cb (GFile *file, GAsyncResult *res, gpointer user
}
/* no more copies pending? */
- if (--state->refcount == 0) {
+ if (g_atomic_int_dec_and_test (&state->remaining_files_to_copy)) {
+ PkClientPrivate *client_priv = pk_client_get_instance_private (state->client);
/* now get tid and continue on our merry way */
- pk_control_get_tid_async (state->client->priv->control,
+ pk_control_get_tid_async (client_priv->control,
state->cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_object_ref (state));
@@ -3718,11 +3590,6 @@ pk_client_copy_non_native_then_get_tid (PkClientState *state)
/* save percentage */
ret = pk_progress_set_percentage (state->progress, -1);
- if (state->progress_callback != NULL && ret) {
- state->progress_callback (state->progress,
- PK_PROGRESS_TYPE_PERCENTAGE,
- state->progress_user_data);
- }
/* copy each file that is non-native */
for (i = 0; state->files[i] != NULL; i++) {
@@ -3752,7 +3619,7 @@ pk_client_copy_non_native_then_get_tid (PkClientState *state)
}
/**
- * pk_client_install_files_async:
+ * pk_client_install_files_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @files: (array zero-terminated=1): a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm"
@@ -3777,6 +3644,7 @@ pk_client_install_files_async (PkClient *client,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
gboolean ret;
guint i;
@@ -3790,9 +3658,7 @@ pk_client_install_files_async (PkClient *client,
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_install_files_async, PK_ROLE_ENUM_INSTALL_FILES, cancellable);
state->transaction_flags = transaction_flags;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3816,13 +3682,13 @@ pk_client_install_files_async (PkClient *client,
ret = pk_client_is_file_native (state->files[i]);
/* on a FUSE mount (probably created by gvfs) and not readable by packagekitd */
if (!ret)
- state->refcount++;
+ g_atomic_int_inc (&state->remaining_files_to_copy);
}
/* nothing to copy, common case */
- if (state->refcount == 0) {
+ if (g_atomic_int_get (&state->remaining_files_to_copy) == 0) {
/* just get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_object_ref (state));
@@ -3834,7 +3700,7 @@ pk_client_install_files_async (PkClient *client,
}
/**
- * pk_client_accept_eula_async:
+ * pk_client_accept_eula_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @eula_id: the eula_id we are agreeing to
* @cancellable: a #GCancellable or %NULL
@@ -3852,6 +3718,7 @@ pk_client_accept_eula_async (PkClient *client, const gchar *eula_id, GCancellabl
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3862,9 +3729,7 @@ pk_client_accept_eula_async (PkClient *client, const gchar *eula_id, GCancellabl
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_accept_eula_async, PK_ROLE_ENUM_ACCEPT_EULA, cancellable);
state->eula_id = g_strdup (eula_id);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3877,14 +3742,14 @@ pk_client_accept_eula_async (PkClient *client, const gchar *eula_id, GCancellabl
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_get_repo_list_async:
+ * pk_client_get_repo_list_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @filters: a #PkBitfield such as %PK_FILTER_ENUM_DEVELOPMENT or %PK_FILTER_ENUM_NONE
* @cancellable: a #GCancellable or %NULL
@@ -3902,6 +3767,7 @@ pk_client_get_repo_list_async (PkClient *client, PkBitfield filters, GCancellabl
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3912,9 +3778,7 @@ pk_client_get_repo_list_async (PkClient *client, PkBitfield filters, GCancellabl
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_get_repo_list_async, PK_ROLE_ENUM_GET_REPO_LIST, cancellable);
state->filters = filters;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3927,14 +3791,14 @@ pk_client_get_repo_list_async (PkClient *client, PkBitfield filters, GCancellabl
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_repo_enable_async:
+ * pk_client_repo_enable_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @repo_id: a repo_id structure such as "livna-devel"
* @enabled: if we should enable the repository
@@ -3953,6 +3817,7 @@ pk_client_repo_enable_async (PkClient *client, const gchar *repo_id, gboolean en
PkProgressCallback progress_callback,
gpointer progress_user_data, GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -3964,9 +3829,7 @@ pk_client_repo_enable_async (PkClient *client, const gchar *repo_id, gboolean en
state = pk_client_state_new (client, callback_ready, user_data, pk_client_repo_enable_async, PK_ROLE_ENUM_REPO_ENABLE, cancellable);
state->enabled = enabled;
state->repo_id = g_strdup (repo_id);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -3979,14 +3842,14 @@ pk_client_repo_enable_async (PkClient *client, const gchar *repo_id, gboolean en
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_repo_set_data_async:
+ * pk_client_repo_set_data_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @repo_id: a repo_id structure such as "livna-devel"
* @parameter: the parameter to change
@@ -4007,6 +3870,7 @@ pk_client_repo_set_data_async (PkClient *client, const gchar *repo_id, const gch
PkProgressCallback progress_callback,
gpointer progress_user_data, GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -4019,9 +3883,7 @@ pk_client_repo_set_data_async (PkClient *client, const gchar *repo_id, const gch
state->repo_id = g_strdup (repo_id);
state->parameter = g_strdup (parameter);
state->value = g_strdup (value);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -4034,14 +3896,14 @@ pk_client_repo_set_data_async (PkClient *client, const gchar *repo_id, const gch
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_repo_remove_async:
+ * pk_client_repo_remove_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: transaction flags
* @repo_id: a repo_id structure such as "livna-devel"
@@ -4067,6 +3929,7 @@ pk_client_repo_remove_async (PkClient *client,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -4079,9 +3942,7 @@ pk_client_repo_remove_async (PkClient *client,
state->transaction_flags = transaction_flags;
state->repo_id = g_strdup (repo_id);
state->autoremove = autoremove;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -4094,14 +3955,14 @@ pk_client_repo_remove_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_upgrade_system_async:
+ * pk_client_upgrade_system_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @distro_id: a distro ID such as "fedora-14"
@@ -4128,6 +3989,7 @@ pk_client_upgrade_system_async (PkClient *client,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -4140,9 +4002,7 @@ pk_client_upgrade_system_async (PkClient *client,
state->transaction_flags = transaction_flags;
state->distro_id = g_strdup (distro_id);
state->upgrade_kind = upgrade_kind;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL &&
@@ -4155,14 +4015,14 @@ pk_client_upgrade_system_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
}
/**
- * pk_client_repair_system_async:
+ * pk_client_repair_system_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_flags: a transaction type bitfield
* @cancellable: a #GCancellable or %NULL
@@ -4189,6 +4049,7 @@ pk_client_repair_system_async (PkClient *client,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
g_autoptr(PkClientState) state = NULL;
g_autoptr(GError) error = NULL;
@@ -4199,9 +4060,7 @@ pk_client_repair_system_async (PkClient *client,
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_repair_system_async, PK_ROLE_ENUM_REPAIR_SYSTEM, cancellable);
state->transaction_flags = transaction_flags;
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
/* check not already cancelled */
if (cancellable != NULL && g_cancellable_set_error_if_cancelled (cancellable, &error)) {
@@ -4213,7 +4072,7 @@ pk_client_repair_system_async (PkClient *client,
pk_client_set_role (state, state->role);
/* get tid */
- pk_control_get_tid_async (client->priv->control,
+ pk_control_get_tid_async (priv->control,
cancellable,
(GAsyncReadyCallback) pk_client_get_tid_cb,
g_steal_pointer (&state));
@@ -4243,7 +4102,7 @@ pk_client_adopt_get_proxy_cb (GObject *object,
}
/**
- * pk_client_adopt_async:
+ * pk_client_adopt_async: (finish-func pk_client_generic_finish):
* @client: a valid #PkClient instance
* @transaction_id: a transaction ID such as "/21_ebcbdaae_data"
* @cancellable: a #GCancellable or %NULL
@@ -4275,9 +4134,7 @@ pk_client_adopt_async (PkClient *client,
/* save state */
state = pk_client_state_new (client, callback_ready, user_data, pk_client_adopt_async, PK_ROLE_ENUM_UNKNOWN, cancellable);
state->tid = g_strdup (transaction_id);
- state->progress_callback = progress_callback;
- state->progress_user_data = progress_user_data;
- state->progress = pk_progress_new ();
+ state->progress = pk_progress_new_with_callback (progress_callback, progress_user_data);
state->results = pk_results_new ();
g_object_set (state->results,
"role", state->role,
@@ -4352,9 +4209,6 @@ pk_client_get_progress_state_finish (PkClientState *state, GError *error)
pk_client_state_unset_proxy (state);
- if (state->proxy_props != NULL)
- g_object_unref (G_OBJECT (state->proxy_props));
-
if (state->ret) {
g_task_return_pointer (state->res,
g_object_ref (state->progress),
@@ -4455,12 +4309,13 @@ pk_client_get_progress_async (PkClient *client,
static gboolean
pk_client_cancel_all_dbus_methods (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
const PkClientState *state;
guint i;
GPtrArray *array;
/* just cancel the call */
- array = client->priv->calls;
+ array = priv->calls;
for (i = 0; i < array->len; i++) {
state = g_ptr_array_index (array, i);
if (state->proxy == NULL)
@@ -4485,14 +4340,16 @@ pk_client_cancel_all_dbus_methods (PkClient *client)
void
pk_client_set_locale (PkClient *client, const gchar *locale)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_if_fail (PK_IS_CLIENT (client));
- if (g_strcmp0 (client->priv->locale, locale) == 0)
+ if (g_strcmp0 (priv->locale, locale) == 0)
return;
- g_free (client->priv->locale);
- client->priv->locale = g_strdup (locale);
- g_object_notify (G_OBJECT (client), "locale");
+ g_free (priv->locale);
+ priv->locale = g_strdup (locale);
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_LOCALE]);
}
/**
@@ -4508,8 +4365,11 @@ pk_client_set_locale (PkClient *client, const gchar *locale)
const gchar *
pk_client_get_locale (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), NULL);
- return client->priv->locale;
+
+ return priv->locale;
}
/**
@@ -4526,13 +4386,15 @@ pk_client_get_locale (PkClient *client)
void
pk_client_set_background (PkClient *client, gboolean background)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_if_fail (PK_IS_CLIENT (client));
- if (client->priv->background == background)
+ if (priv->background == background)
return;
- client->priv->background = background;
- g_object_notify (G_OBJECT (client), "background");
+ priv->background = background;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_BACKGROUND]);
}
/**
@@ -4548,8 +4410,11 @@ pk_client_set_background (PkClient *client, gboolean background)
gboolean
pk_client_get_background (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- return client->priv->background;
+
+ return priv->background;
}
/**
@@ -4565,13 +4430,15 @@ pk_client_get_background (PkClient *client)
void
pk_client_set_interactive (PkClient *client, gboolean interactive)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_if_fail (PK_IS_CLIENT (client));
- if (client->priv->interactive == interactive)
+ if (priv->interactive == interactive)
return;
- client->priv->interactive = interactive;
- g_object_notify (G_OBJECT (client), "interactive");
+ priv->interactive = interactive;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_INTERACTIVE]);
}
/**
@@ -4587,8 +4454,11 @@ pk_client_set_interactive (PkClient *client, gboolean interactive)
gboolean
pk_client_get_interactive (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- return client->priv->interactive;
+
+ return priv->interactive;
}
/**
@@ -4604,8 +4474,11 @@ pk_client_get_interactive (PkClient *client)
gboolean
pk_client_get_idle (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- return client->priv->idle;
+
+ return priv->idle;
}
/**
@@ -4621,13 +4494,15 @@ pk_client_get_idle (PkClient *client)
void
pk_client_set_cache_age (PkClient *client, guint cache_age)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_if_fail (PK_IS_CLIENT (client));
- if (client->priv->cache_age == cache_age)
+ if (priv->cache_age == cache_age)
return;
- client->priv->cache_age = cache_age;
- g_object_notify (G_OBJECT (client), "cache-age");
+ priv->cache_age = cache_age;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_CACHE_AGE]);
}
/**
@@ -4643,8 +4518,11 @@ pk_client_set_cache_age (PkClient *client, guint cache_age)
guint
pk_client_get_cache_age (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- return client->priv->cache_age;
+
+ return priv->cache_age;
}
/**
@@ -4660,13 +4538,15 @@ pk_client_get_cache_age (PkClient *client)
void
pk_client_set_details_with_deps_size (PkClient *client, gboolean details_with_deps_size)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_if_fail (PK_IS_CLIENT (client));
- if (client->priv->details_with_deps_size == details_with_deps_size)
+ if (priv->details_with_deps_size == details_with_deps_size)
return;
- client->priv->details_with_deps_size = details_with_deps_size;
- g_object_notify (G_OBJECT (client), "details-with-deps-size");
+ priv->details_with_deps_size = details_with_deps_size;
+ g_object_notify_by_pspec (G_OBJECT (client), obj_properties[PROP_DETAILS_WITH_DEPS_SIZE]);
}
/**
@@ -4683,8 +4563,11 @@ pk_client_set_details_with_deps_size (PkClient *client, gboolean details_with_de
gboolean
pk_client_get_details_with_deps_size (PkClient *client)
{
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
- return client->priv->details_with_deps_size;
+
+ return priv->details_with_deps_size;
}
/*
@@ -4693,8 +4576,8 @@ pk_client_get_details_with_deps_size (PkClient *client)
static void
pk_client_class_init (PkClientClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
object_class->finalize = pk_client_finalize;
object_class->get_property = pk_client_get_property;
object_class->set_property = pk_client_set_property;
@@ -4704,42 +4587,42 @@ pk_client_class_init (PkClientClass *klass)
*
* Since: 0.5.3
*/
- pspec = g_param_spec_string ("locale", NULL, NULL,
+ obj_properties[PROP_LOCALE] =
+ g_param_spec_string ("locale", NULL, NULL,
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_LOCALE, pspec);
/**
* PkClient:background:
*
* Since: 0.5.3
*/
- pspec = g_param_spec_boolean ("background", NULL, NULL,
+ obj_properties[PROP_BACKGROUND] =
+ g_param_spec_boolean ("background", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_BACKGROUND, pspec);
/**
* PkClient:interactive:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_boolean ("interactive", NULL, NULL,
+ obj_properties[PROP_INTERACTIVE] =
+ g_param_spec_boolean ("interactive", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_INTERACTIVE, pspec);
/**
* PkClient:idle:
*
+ * Whether there are transactions in progress on this client or not
+ *
* Since: 0.5.4
*/
- pspec = g_param_spec_boolean ("idle", NULL, "if there are no transactions in progress on this client",
+ obj_properties[PROP_IDLE] =
+ g_param_spec_boolean ("idle", NULL, NULL,
TRUE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_IDLE, pspec);
-
- g_type_class_add_private (klass, sizeof (PkClientPrivate));
/**
* PkClient:cache-age:
@@ -4749,20 +4632,22 @@ pk_client_class_init (PkClientClass *klass)
*
* Since: 0.6.10
*/
- pspec = g_param_spec_uint ("cache-age", NULL, NULL,
+ obj_properties[PROP_CACHE_AGE] =
+ g_param_spec_uint ("cache-age", NULL, NULL,
0, G_MAXUINT, G_MAXUINT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_CACHE_AGE, pspec);
/**
* PkClient:details-with-deps-size:
*
* Since: 1.2.7
*/
- pspec = g_param_spec_boolean ("details-with-deps-size", NULL, NULL,
+ obj_properties[PROP_DETAILS_WITH_DEPS_SIZE] =
+ g_param_spec_boolean ("details-with-deps-size", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_DETAILS_WITH_DEPS_SIZE, pspec);
+
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
}
/*
@@ -4771,19 +4656,21 @@ pk_client_class_init (PkClientClass *klass)
static void
pk_client_init (PkClient *client)
{
- client->priv = PK_CLIENT_GET_PRIVATE (client);
- client->priv->calls = g_ptr_array_new ();
- client->priv->background = FALSE;
- client->priv->interactive = TRUE;
- client->priv->idle = TRUE;
- client->priv->cache_age = G_MAXUINT;
- client->priv->details_with_deps_size = FALSE;
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
+
+ client->priv = priv;
+ priv->calls = g_ptr_array_new ();
+ priv->background = FALSE;
+ priv->interactive = TRUE;
+ priv->idle = TRUE;
+ priv->cache_age = G_MAXUINT;
+ priv->details_with_deps_size = FALSE;
/* use a control object */
- client->priv->control = pk_control_new ();
+ priv->control = pk_control_new ();
/* cache locale */
- client->priv->locale = g_strdup (setlocale (LC_MESSAGES, NULL));
+ priv->locale = g_strdup (setlocale (LC_MESSAGES, NULL));
}
/*
@@ -4793,14 +4680,14 @@ static void
pk_client_finalize (GObject *object)
{
PkClient *client = PK_CLIENT (object);
- PkClientPrivate *priv = client->priv;
+ PkClientPrivate *priv = pk_client_get_instance_private (client);
/* ensure we cancel any in-flight DBus calls */
pk_client_cancel_all_dbus_methods (client);
- g_free (client->priv->locale);
- g_object_unref (priv->control);
- g_ptr_array_unref (priv->calls);
+ g_clear_pointer (&priv->locale, g_free);
+ g_clear_object (&priv->control);
+ g_clear_pointer (&priv->calls, g_ptr_array_unref);
G_OBJECT_CLASS (pk_client_parent_class)->finalize (object);
}
diff --git a/lib/packagekit-glib2/pk-control.c b/lib/packagekit-glib2/pk-control.c
index ef3d0bd..241dcd8 100644
--- a/lib/packagekit-glib2/pk-control.c
+++ b/lib/packagekit-glib2/pk-control.c
@@ -40,8 +40,6 @@
static void pk_control_finalize (GObject *object);
-#define PK_CONTROL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_CONTROL, PkControlPrivate))
-
#define PK_CONTROL_DBUS_METHOD_TIMEOUT 1500 /* ms */
/**
@@ -75,6 +73,7 @@ struct _PkControlPrivate
enum {
SIGNAL_TRANSACTION_LIST_CHANGED,
SIGNAL_RESTART_SCHEDULE,
+ SIGNAL_INSTALLED_CHANGED,
SIGNAL_UPDATES_CHANGED,
SIGNAL_REPO_LIST_CHANGED,
SIGNAL_LAST
@@ -103,31 +102,16 @@ enum {
static guint signals[SIGNAL_LAST] = { 0 };
static gpointer pk_control_object = NULL;
-G_DEFINE_TYPE (PkControl, pk_control, G_TYPE_OBJECT)
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
-typedef struct {
- gboolean ret;
- gchar *tid;
- gchar **transaction_list;
- gchar *daemon_state;
- guint time;
- gulong cancellable_id;
- GCancellable *call;
- GCancellable *cancellable;
- GSimpleAsyncResult *res;
- PkAuthorizeEnum authorize;
- PkControl *control;
- PkNetworkEnum network;
- GVariant *parameters;
- GDBusProxy *proxy;
-} PkControlState;
+G_DEFINE_TYPE_WITH_PRIVATE (PkControl, pk_control, G_TYPE_OBJECT)
/**
* pk_control_error_quark:
*
* We are a GObject that sets errors
*
- * Return value: Our personal error quark.
+ * Returns: Our personal error quark.
*
* Since: 0.5.2
**/
@@ -178,6 +162,7 @@ pk_control_set_property_value (PkControl *control,
const gchar *key,
GVariant *value)
{
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
const gchar *tmp_str;
gboolean tmp_bool;
guint tmp_uint;
@@ -185,111 +170,111 @@ pk_control_set_property_value (PkControl *control,
if (g_strcmp0 (key, "VersionMajor") == 0) {
tmp_uint = g_variant_get_uint32 (value);
- if (control->priv->version_major == tmp_uint)
+ if (priv->version_major == tmp_uint)
return;
- control->priv->version_major = tmp_uint;
- g_object_notify (G_OBJECT(control), "version-major");
+ priv->version_major = tmp_uint;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_VERSION_MAJOR]);
return;
}
if (g_strcmp0 (key, "VersionMinor") == 0) {
tmp_uint = g_variant_get_uint32 (value);
- if (control->priv->version_minor == tmp_uint)
+ if (priv->version_minor == tmp_uint)
return;
- control->priv->version_minor = tmp_uint;
- g_object_notify (G_OBJECT(control), "version-minor");
+ priv->version_minor = tmp_uint;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_VERSION_MINOR]);
return;
}
if (g_strcmp0 (key, "VersionMicro") == 0) {
tmp_uint = g_variant_get_uint32 (value);
- if (control->priv->version_micro == tmp_uint)
+ if (priv->version_micro == tmp_uint)
return;
- control->priv->version_micro = tmp_uint;
- g_object_notify (G_OBJECT(control), "version-micro");
+ priv->version_micro = tmp_uint;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_VERSION_MICRO]);
return;
}
if (g_strcmp0 (key, "BackendName") == 0) {
tmp_str = g_variant_get_string (value, NULL);
- if (g_strcmp0 (control->priv->backend_name, tmp_str) == 0)
+ if (g_strcmp0 (priv->backend_name, tmp_str) == 0)
return;
- g_free (control->priv->backend_name);
- control->priv->backend_name = g_strdup (tmp_str);
- g_object_notify (G_OBJECT(control), "backend-name");
+ g_free (priv->backend_name);
+ priv->backend_name = g_strdup (tmp_str);
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_BACKEND_NAME]);
return;
}
if (g_strcmp0 (key, "BackendDescription") == 0) {
tmp_str = g_variant_get_string (value, NULL);
- if (g_strcmp0 (control->priv->backend_description, tmp_str) == 0)
+ if (g_strcmp0 (priv->backend_description, tmp_str) == 0)
return;
- g_free (control->priv->backend_description);
- control->priv->backend_description = g_strdup (tmp_str);
- g_object_notify (G_OBJECT(control), "backend-description");
+ g_free (priv->backend_description);
+ priv->backend_description = g_strdup (tmp_str);
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_BACKEND_DESCRIPTION]);
return;
}
if (g_strcmp0 (key, "BackendAuthor") == 0) {
tmp_str = g_variant_get_string (value, NULL);
- if (g_strcmp0 (control->priv->backend_author, tmp_str) == 0)
+ if (g_strcmp0 (priv->backend_author, tmp_str) == 0)
return;
- g_free (control->priv->backend_author);
- control->priv->backend_author = g_strdup (tmp_str);
- g_object_notify (G_OBJECT(control), "backend-author");
+ g_free (priv->backend_author);
+ priv->backend_author = g_strdup (tmp_str);
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_BACKEND_AUTHOR]);
return;
}
if (g_strcmp0 (key, "MimeTypes") == 0) {
g_autofree gchar **tmp_strv = NULL;
tmp_strv = (gchar **) g_variant_get_strv (value, NULL);
- if (_g_strvcmp0 (control->priv->mime_types, tmp_strv))
+ if (_g_strvcmp0 (priv->mime_types, tmp_strv))
return;
- g_strfreev (control->priv->mime_types);
- control->priv->mime_types = g_strdupv (tmp_strv);
- g_object_notify (G_OBJECT(control), "mime-types");
+ g_strfreev (priv->mime_types);
+ priv->mime_types = g_strdupv (tmp_strv);
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_MIME_TYPES]);
return;
}
if (g_strcmp0 (key, "Roles") == 0) {
tmp_bitfield = g_variant_get_uint64 (value);
- if (control->priv->roles == tmp_bitfield)
+ if (priv->roles == tmp_bitfield)
return;
- control->priv->roles = tmp_bitfield;
- g_object_notify (G_OBJECT(control), "roles");
+ priv->roles = tmp_bitfield;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_ROLES]);
return;
}
if (g_strcmp0 (key, "Provides") == 0) {
tmp_bitfield = g_variant_get_uint64 (value);
- if (control->priv->provides == tmp_bitfield)
+ if (priv->provides == tmp_bitfield)
return;
- control->priv->provides = tmp_bitfield;
- g_object_notify (G_OBJECT(control), "provides");
+ priv->provides = tmp_bitfield;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_PROVIDES]);
return;
}
if (g_strcmp0 (key, "Groups") == 0) {
tmp_bitfield = g_variant_get_uint64 (value);
- if (control->priv->groups == tmp_bitfield)
+ if (priv->groups == tmp_bitfield)
return;
- control->priv->groups = tmp_bitfield;
- g_object_notify (G_OBJECT(control), "groups");
+ priv->groups = tmp_bitfield;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_GROUPS]);
return;
}
if (g_strcmp0 (key, "Filters") == 0) {
tmp_bitfield = g_variant_get_uint64 (value);
- if (control->priv->filters == tmp_bitfield)
+ if (priv->filters == tmp_bitfield)
return;
- control->priv->filters = tmp_bitfield;
- g_object_notify (G_OBJECT(control), "filters");
+ priv->filters = tmp_bitfield;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_FILTERS]);
return;
}
if (g_strcmp0 (key, "Locked") == 0) {
tmp_bool = g_variant_get_boolean (value);
- if (control->priv->locked == tmp_bool)
+ if (priv->locked == tmp_bool)
return;
- control->priv->locked = tmp_bool;
- g_object_notify (G_OBJECT(control), "locked");
+ priv->locked = tmp_bool;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_LOCKED]);
return;
}
if (g_strcmp0 (key, "NetworkState") == 0) {
tmp_uint = g_variant_get_uint32 (value);
- if (control->priv->network_state == tmp_uint)
+ if (priv->network_state == tmp_uint)
return;
- control->priv->network_state = tmp_uint;
- g_object_notify (G_OBJECT(control), "network-state");
+ priv->network_state = tmp_uint;
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_NETWORK_STATE]);
return;
}
if (g_strcmp0 (key, "DistroId") == 0) {
@@ -297,11 +282,11 @@ pk_control_set_property_value (PkControl *control,
/* we don't want distro specific results in 'make check' */
if (g_getenv ("PK_SELF_TEST") != NULL)
tmp_str = "selftest;11.91;i686";
- if (g_strcmp0 (control->priv->distro_id, tmp_str) == 0)
+ if (g_strcmp0 (priv->distro_id, tmp_str) == 0)
return;
- g_free (control->priv->distro_id);
- control->priv->distro_id = g_strdup (tmp_str);
- g_object_notify (G_OBJECT(control), "distro-id");
+ g_free (priv->distro_id);
+ priv->distro_id = g_strdup (tmp_str);
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_DISTRO_ID]);
return;
}
g_warning ("unhandled property '%s'", key);
@@ -357,6 +342,11 @@ pk_control_signal_cb (GDBusProxy *proxy,
signals[SIGNAL_TRANSACTION_LIST_CHANGED], 0,
ids);
}
+ if (g_strcmp0 (signal_name, "InstalledChanged") == 0) {
+ g_debug ("emit installed-changed");
+ g_signal_emit (control, signals[SIGNAL_INSTALLED_CHANGED], 0);
+ return;
+ }
if (g_strcmp0 (signal_name, "UpdatesChanged") == 0) {
g_debug ("emit updates-changed");
g_signal_emit (control, signals[SIGNAL_UPDATES_CHANGED], 0);
@@ -378,71 +368,38 @@ pk_control_signal_cb (GDBusProxy *proxy,
* pk_control_proxy_connect:
**/
static void
-pk_control_proxy_connect (PkControlState *state)
+pk_control_proxy_connect (PkControl *control,
+ GDBusProxy *proxy)
{
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
guint i;
g_auto(GStrv) props = NULL;
/* coldplug properties */
- props = g_dbus_proxy_get_cached_property_names (state->proxy);
+ props = g_dbus_proxy_get_cached_property_names (proxy);
for (i = 0; props != NULL && props[i] != NULL; i++) {
g_autoptr(GVariant) value_tmp = NULL;
- value_tmp = g_dbus_proxy_get_cached_property (state->proxy, props[i]);
- pk_control_set_property_value (state->control,
+ value_tmp = g_dbus_proxy_get_cached_property (proxy, props[i]);
+ pk_control_set_property_value (control,
props[i],
value_tmp);
}
/* connect up signals */
- g_signal_connect (state->proxy, "g-properties-changed",
+ g_signal_connect (proxy, "g-properties-changed",
G_CALLBACK (pk_control_properties_changed_cb),
- state->control);
- g_signal_connect (state->proxy, "g-signal",
+ control);
+ g_signal_connect (proxy, "g-signal",
G_CALLBACK (pk_control_signal_cb),
- state->control);
+ control);
/* if we have no generic system wide proxy, then use this */
- if (state->control->priv->proxy == NULL)
- state->control->priv->proxy = g_object_ref (state->proxy);
+ if (priv->proxy == NULL)
+ priv->proxy = g_object_ref (proxy);
}
/**********************************************************************/
-/*
- * pk_control_get_tid_state_finish:
- **/
-static void
-pk_control_get_tid_state_finish (PkControlState *state, const GError *error)
-{
- /* get result */
- if (state->tid != NULL) {
- g_simple_async_result_set_op_res_gpointer (state->res,
- g_strdup (state->tid),
- g_free);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_free (state->tid);
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_get_tid_cb:
**/
@@ -452,40 +409,49 @@ pk_control_get_tid_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
+ gchar *tid = NULL;
/* get the result */
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
/* fix up the D-Bus error */
pk_control_fixup_dbus_error (error);
- pk_control_get_tid_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* save results */
- g_variant_get (value, "(o)", &state->tid);
+ g_variant_get (value, "(o)", &tid);
/* we're done */
- pk_control_get_tid_state_finish (state, NULL);
+ g_task_return_pointer (task, g_steal_pointer (&tid), g_free);
}
/*
* pk_control_get_tid_internal:
**/
static void
-pk_control_get_tid_internal (PkControlState *state)
+pk_control_get_tid_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ g_dbus_proxy_call (priv->proxy,
"CreateTransaction",
NULL,
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_get_tid_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -496,16 +462,19 @@ pk_control_get_tid_proxy_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_get_tid_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_get_tid_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_get_tid_internal (control, g_steal_pointer (&task));
}
/**
@@ -525,36 +494,29 @@ pk_control_get_tid_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
g_autoptr(GError) error = NULL;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) task = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_get_tid_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_get_tid_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_get_tid_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_get_tid_async);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_get_tid_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_get_tid_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -562,13 +524,10 @@ pk_control_get_tid_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_get_tid_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -579,7 +538,7 @@ pk_control_get_tid_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: the ID, or %NULL if unset, free with g_free()
+ * Returns: (nullable): the ID, or %NULL if unset, free with g_free()
*
* Since: 0.5.2
**/
@@ -588,61 +547,16 @@ pk_control_get_tid_finish (PkControl *control,
GAsyncResult *res,
GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), NULL);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (g_task_is_valid (res, control), NULL);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_get_tid_async), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_get_tid_async, NULL);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
-
- return g_strdup (g_simple_async_result_get_op_res_gpointer (simple));
+ return g_task_propagate_pointer (G_TASK (res), error);
}
/**********************************************************************/
-
-/*
- * pk_control_suggest_daemon_quit_state_finish:
- **/
-static void
-pk_control_suggest_daemon_quit_state_finish (PkControlState *state,
- const GError *error)
-{
- /* get result */
- if (state->ret) {
- g_simple_async_result_set_op_res_gboolean (state->res,
- state->ret);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_suggest_daemon_quit_cb:
**/
@@ -652,38 +566,43 @@ pk_control_suggest_daemon_quit_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
/* get the result */
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
- pk_control_suggest_daemon_quit_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- /* save data */
- state->ret = TRUE;
-
/* we're done */
- pk_control_suggest_daemon_quit_state_finish (state, NULL);
+ g_task_return_boolean (task, TRUE);
}
/*
* pk_control_suggest_daemon_quit_internal:
**/
static void
-pk_control_suggest_daemon_quit_internal (PkControlState *state)
+pk_control_suggest_daemon_quit_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ g_dbus_proxy_call (priv->proxy,
"SuggestDaemonQuit",
NULL,
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_suggest_daemon_quit_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -694,16 +613,19 @@ pk_control_suggest_daemon_quit_proxy_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
g_autoptr(GError) error = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_suggest_daemon_quit_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_suggest_daemon_quit_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_suggest_daemon_quit_internal (control, g_steal_pointer (&task));
}
/**
@@ -723,36 +645,29 @@ pk_control_suggest_daemon_quit_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_suggest_daemon_quit_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_suggest_daemon_quit_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_suggest_daemon_quit_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_suggest_daemon_quit_async);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_suggest_daemon_quit_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_suggest_daemon_quit_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -760,13 +675,10 @@ pk_control_suggest_daemon_quit_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_suggest_daemon_quit_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -777,68 +689,23 @@ pk_control_suggest_daemon_quit_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: %TRUE if the suggestion was sent
+ * Returns: %TRUE if the suggestion was sent
*
* Since: 0.6.2
**/
gboolean
pk_control_suggest_daemon_quit_finish (PkControl *control, GAsyncResult *res, GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (g_task_is_valid (res, control), FALSE);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_suggest_daemon_quit_async), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_suggest_daemon_quit_async, FALSE);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
-
- return g_simple_async_result_get_op_res_gboolean (simple);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
/**********************************************************************/
-
-/*
- * pk_control_get_daemon_state_state_finish:
- **/
-static void
-pk_control_get_daemon_state_state_finish (PkControlState *state, const GError *error)
-{
- /* get result */
- if (state->daemon_state != NULL) {
- g_simple_async_result_set_op_res_gpointer (state->res,
- g_strdup (state->daemon_state), g_free);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_free (state->daemon_state);
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_get_daemon_state_cb:
**/
@@ -848,40 +715,49 @@ pk_control_get_daemon_state_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr (GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
+ gchar *daemon_state = NULL;
/* get the result */
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
/* fix up the D-Bus error */
pk_control_fixup_dbus_error (error);
- pk_control_get_daemon_state_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* save results */
- g_variant_get (value, "(s)", &state->daemon_state);
+ g_variant_get (value, "(s)", &daemon_state);
/* we're done */
- pk_control_get_daemon_state_state_finish (state, NULL);
+ g_task_return_pointer (task, g_steal_pointer (&daemon_state), g_free);
}
/*
* pk_control_get_daemon_state_internal:
**/
static void
-pk_control_get_daemon_state_internal (PkControlState *state)
+pk_control_get_daemon_state_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ g_dbus_proxy_call (priv->proxy,
"GetDaemonState",
NULL,
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_get_daemon_state_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -893,15 +769,18 @@ pk_control_get_daemon_state_proxy_cb (GObject *source_object,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_get_daemon_state_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_get_daemon_state_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_get_daemon_state_internal (control, g_steal_pointer (&task));
}
/**
@@ -921,36 +800,29 @@ pk_control_get_daemon_state_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_get_daemon_state_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_get_daemon_state_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_get_daemon_state_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_get_daemon_state_async);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_get_daemon_state_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_get_daemon_state_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -958,13 +830,10 @@ pk_control_get_daemon_state_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_get_daemon_state_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -975,7 +844,7 @@ pk_control_get_daemon_state_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: the ID, or %NULL if unset, free with g_free()
+ * Returns: (nullable): the ID, or %NULL if unset, free with g_free()
*
* Since: 0.5.2
**/
@@ -984,62 +853,16 @@ pk_control_get_daemon_state_finish (PkControl *control,
GAsyncResult *res,
GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), NULL);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (g_task_is_valid (res, control), NULL);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_get_daemon_state_async), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_get_daemon_state_async, NULL);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
-
- return g_strdup (g_simple_async_result_get_op_res_gpointer (simple));
+ return g_task_propagate_pointer (G_TASK (res), error);
}
/**********************************************************************/
-
-/*
- * pk_control_set_proxy_state_finish:
- **/
-static void
-pk_control_set_proxy_state_finish (PkControlState *state,
- const GError *error)
-{
- /* get result */
- if (state->ret) {
- g_simple_async_result_set_op_res_gboolean (state->res,
- state->ret);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_variant_unref (state->parameters);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_set_proxy_cb:
**/
@@ -1049,7 +872,7 @@ pk_control_set_proxy_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
@@ -1057,31 +880,38 @@ pk_control_set_proxy_cb (GObject *source_object,
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
g_warning ("failed to set proxy: %s", error->message);
- pk_control_set_proxy_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- /* save data */
- state->ret = TRUE;
-
/* we're done */
- pk_control_set_proxy_state_finish (state, NULL);
+ g_task_return_boolean (task, TRUE);
}
/*
* pk_control_set_proxy_internal:
**/
static void
-pk_control_set_proxy_internal (PkControlState *state)
+pk_control_set_proxy_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+ GVariant *parameters;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ parameters = g_task_get_task_data (task);
+ g_dbus_proxy_call (priv->proxy,
"SetProxy",
- state->parameters,
+ parameters,
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_set_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -1093,19 +923,22 @@ pk_control_set_proxy_proxy_cb (GObject *source_object,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_set_proxy_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_set_proxy_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_set_proxy_internal (control, g_steal_pointer (&task));
}
/**
- * pk_control_set_proxy2_async:
+ * pk_control_set_proxy2_async: (finish-func pk_control_set_proxy_finish):
* @control: a valid #PkControl instance
* @proxy_http: a HTTP proxy string such as "username:password@server.lan:8080", or %NULL
* @proxy_https: a HTTPS proxy string such as "username:password@server.lan:8080", or %NULL
@@ -1133,44 +966,40 @@ pk_control_set_proxy2_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
+ GVariant *parameters = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_set_proxy_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- state->parameters = g_variant_new ("(ssssss)",
- proxy_http ? proxy_http : "",
- proxy_https ? proxy_https : "",
- proxy_ftp ? proxy_ftp : "",
- proxy_socks ? proxy_socks : "",
- no_proxy ? no_proxy : "",
- pac ? pac : "");
- g_variant_ref_sink (state->parameters);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_set_proxy_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_set_proxy_async,
+ g_steal_pointer (&error));
return;
}
+ /* save state */
+ parameters = g_variant_new ("(ssssss)",
+ proxy_http ? proxy_http : "",
+ proxy_https ? proxy_https : "",
+ proxy_ftp ? proxy_ftp : "",
+ proxy_socks ? proxy_socks : "",
+ no_proxy ? no_proxy : "",
+ pac ? pac : "");
+
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_set_proxy_async);
+ g_task_set_task_data (task, g_variant_ref_sink (parameters), (GDestroyNotify) g_variant_unref);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_set_proxy_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_set_proxy_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -1178,13 +1007,10 @@ pk_control_set_proxy2_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_set_proxy_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -1231,7 +1057,7 @@ pk_control_set_proxy_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: %TRUE if we set the proxy successfully
+ * Returns: %TRUE if we set the proxy successfully
*
* Since: 0.5.2
**/
@@ -1240,62 +1066,16 @@ pk_control_set_proxy_finish (PkControl *control,
GAsyncResult *res,
GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (g_task_is_valid (res, control), FALSE);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_set_proxy_async), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_set_proxy_async, FALSE);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
-
- return g_simple_async_result_get_op_res_gboolean (simple);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
/**********************************************************************/
-/*
- * pk_control_get_transaction_list_state_finish:
- **/
-static void
-pk_control_get_transaction_list_state_finish (PkControlState *state,
- const GError *error)
-{
- /* get result */
- if (state->transaction_list != NULL) {
- g_simple_async_result_set_op_res_gpointer (state->res,
- g_strdupv (state->transaction_list),
- (GDestroyNotify) g_strfreev);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_strfreev (state->transaction_list);
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_get_transaction_list_cb:
**/
@@ -1306,7 +1086,7 @@ pk_control_get_transaction_list_cb (GObject *source_object,
{
const gchar **tlist_tmp = NULL;
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
@@ -1315,37 +1095,43 @@ pk_control_get_transaction_list_cb (GObject *source_object,
if (value == NULL) {
/* fix up the D-Bus error */
pk_control_fixup_dbus_error (error);
- pk_control_get_transaction_list_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* unwrap data */
g_variant_get (value, "(^a&o)", &tlist_tmp);
+
+ /* we're done */
if (tlist_tmp == NULL) {
- state->transaction_list = g_new0 (gchar *, 1);
+ g_task_return_pointer (task, g_new0 (gchar *, 1), g_free);
} else {
- state->transaction_list = g_strdupv ((gchar **)tlist_tmp);
+ g_task_return_pointer (task, g_strdupv ((gchar **)tlist_tmp), (GDestroyNotify) g_strfreev);
}
- g_assert (state->transaction_list != NULL);
-
- /* we're done */
- pk_control_get_transaction_list_state_finish (state, NULL);
}
/*
* pk_control_get_transaction_list_internal:
**/
static void
-pk_control_get_transaction_list_internal (PkControlState *state)
+pk_control_get_transaction_list_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ g_dbus_proxy_call (priv->proxy,
"GetTransactionList",
NULL,
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_get_transaction_list_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -1357,15 +1143,18 @@ pk_control_get_transaction_list_proxy_cb (GObject *source_object,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_get_transaction_list_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_get_transaction_list_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_get_transaction_list_internal (control, g_steal_pointer (&task));
}
/**
@@ -1385,36 +1174,29 @@ pk_control_get_transaction_list_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_get_transaction_list_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_get_transaction_list_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_get_transaction_list_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_get_transaction_list_async);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_get_transaction_list_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_get_transaction_list_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -1422,13 +1204,10 @@ pk_control_get_transaction_list_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_get_transaction_list_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -1439,7 +1218,7 @@ pk_control_get_transaction_list_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: (transfer full): A GStrv list of transaction ID's, free with g_strfreev()
+ * Returns: (transfer full): A GStrv list of transaction ID's, free with g_strfreev()
*
* Since: 0.5.2
**/
@@ -1448,61 +1227,16 @@ pk_control_get_transaction_list_finish (PkControl *control,
GAsyncResult *res,
GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), NULL);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (g_task_is_valid (res, control), NULL);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_get_transaction_list_async), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_get_transaction_list_async, NULL);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
-
- return g_strdupv (g_simple_async_result_get_op_res_gpointer (simple));
+ return g_task_propagate_pointer (G_TASK (res), error);
}
/**********************************************************************/
-
-/*
- * pk_control_get_time_since_action_state_finish:
- **/
-static void
-pk_control_get_time_since_action_state_finish (PkControlState *state,
- const GError *error)
-{
- /* get result */
- if (state->time != 0) {
- g_simple_async_result_set_op_res_gssize (state->res, state->time);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_variant_unref (state->parameters);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_get_time_since_action_cb:
**/
@@ -1512,45 +1246,57 @@ pk_control_get_time_since_action_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GVariant) value = NULL;
g_autoptr(GError) error = NULL;
+ guint time = 0;
/* get the result */
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
/* fix up the D-Bus error */
pk_control_fixup_dbus_error (error);
- pk_control_get_time_since_action_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* save data */
- g_variant_get (value, "(u)", &state->time);
- if (state->time == 0) {
- error = g_error_new (PK_CONTROL_ERROR, PK_CONTROL_ERROR_FAILED, "could not get time");
- pk_control_get_time_since_action_state_finish (state, error);
+ g_variant_get (value, "(u)", &time);
+ if (time == 0) {
+ g_task_return_new_error (task,
+ PK_CONTROL_ERROR, PK_CONTROL_ERROR_FAILED,
+ "could not get time");
return;
}
/* we're done */
- pk_control_get_time_since_action_state_finish (state, NULL);
+ g_task_return_pointer (task, GUINT_TO_POINTER (time), NULL);
}
/*
* pk_control_get_time_since_action_internal:
**/
static void
-pk_control_get_time_since_action_internal (PkControlState *state)
+pk_control_get_time_since_action_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+ guint role;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ role = GPOINTER_TO_UINT (g_task_get_task_data (task));
+ g_dbus_proxy_call (priv->proxy,
"GetTimeSinceAction",
- state->parameters,
+ g_variant_new ("(u)", role),
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_get_time_since_action_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -1562,15 +1308,18 @@ pk_control_get_time_since_action_proxy_cb (GObject *source_object,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_get_time_since_action_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_get_time_since_action_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_get_time_since_action_internal (control, g_steal_pointer (&task));
}
/**
@@ -1593,38 +1342,30 @@ pk_control_get_time_since_action_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_get_time_since_action_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- state->parameters = g_variant_new ("(u)", role);
- g_variant_ref_sink (state->parameters);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_get_time_since_action_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_get_time_since_action_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_get_time_since_action_async);
+ g_task_set_task_data (task, GUINT_TO_POINTER ((guint) role), NULL);
+
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_get_time_since_action_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_get_time_since_action_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -1632,13 +1373,10 @@ pk_control_get_time_since_action_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_get_time_since_action_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -1649,7 +1387,7 @@ pk_control_get_time_since_action_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: %TRUE if the daemon serviced the request
+ * Returns: %TRUE if the daemon serviced the request
*
* Since: 0.5.2
**/
@@ -1658,60 +1396,16 @@ pk_control_get_time_since_action_finish (PkControl *control,
GAsyncResult *res,
GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), 0);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), 0);
+ g_return_val_if_fail (g_task_is_valid (res, control), 0);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_get_time_since_action_async), 0);
g_return_val_if_fail (error == NULL || *error == NULL, 0);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_get_time_since_action_async, 0);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return 0;
-
- return (guint) g_simple_async_result_get_op_res_gssize (simple);
+ return GPOINTER_TO_UINT(g_task_propagate_pointer (G_TASK (res), error));
}
/**********************************************************************/
-
-/*
- * pk_control_can_authorize_state_finish:
- **/
-static void
-pk_control_can_authorize_state_finish (PkControlState *state, const GError *error)
-{
- /* get result */
- if (state->authorize != PK_AUTHORIZE_ENUM_UNKNOWN) {
- g_simple_async_result_set_op_res_gssize (state->res, state->authorize);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_variant_unref (state->parameters);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_can_authorize_cb:
**/
@@ -1721,45 +1415,57 @@ pk_control_can_authorize_cb (GObject *source_object,
gpointer user_data)
{
GDBusProxy *proxy = G_DBUS_PROXY (source_object);
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(GVariant) value = NULL;
+ guint authorize = PK_AUTHORIZE_ENUM_UNKNOWN;
/* get the result */
value = g_dbus_proxy_call_finish (proxy, res, &error);
if (value == NULL) {
/* fix up the D-Bus error */
pk_control_fixup_dbus_error (error);
- pk_control_can_authorize_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* save data */
- g_variant_get (value, "(u)", &state->authorize);
- if (state->authorize == PK_AUTHORIZE_ENUM_UNKNOWN) {
- error = g_error_new (PK_CONTROL_ERROR, PK_CONTROL_ERROR_FAILED, "could not get state");
- pk_control_can_authorize_state_finish (state, error);
+ g_variant_get (value, "(u)", &authorize);
+ if (authorize == PK_AUTHORIZE_ENUM_UNKNOWN) {
+ g_task_return_new_error (task,
+ PK_CONTROL_ERROR, PK_CONTROL_ERROR_FAILED,
+ "could not get state");
return;
}
/* we're done */
- pk_control_can_authorize_state_finish (state, NULL);
+ g_task_return_pointer (task, GUINT_TO_POINTER (authorize), NULL);
}
/*
* pk_control_can_authorize_internal:
**/
static void
-pk_control_can_authorize_internal (PkControlState *state)
+pk_control_can_authorize_internal (PkControl *control,
+ GTask *task)
{
- g_dbus_proxy_call (state->control->priv->proxy,
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ GCancellable *cancellable;
+ const gchar *action_id;
+
+ g_assert (PK_IS_CONTROL (control));
+ g_assert (G_IS_TASK (task));
+
+ cancellable = g_task_get_cancellable (task);
+ action_id = g_task_get_task_data (task);
+ g_dbus_proxy_call (priv->proxy,
"CanAuthorize",
- state->parameters,
+ g_variant_new ("(s)", action_id),
G_DBUS_CALL_FLAGS_NONE,
PK_CONTROL_DBUS_METHOD_TIMEOUT,
- state->cancellable,
+ cancellable,
pk_control_can_authorize_cb,
- state);
+ g_steal_pointer (&task));
}
/*
@@ -1771,15 +1477,18 @@ pk_control_can_authorize_proxy_cb (GObject *source_object,
gpointer user_data)
{
g_autoptr(GError) error = NULL;
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_can_authorize_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- pk_control_proxy_connect (state);
- pk_control_can_authorize_internal (state);
+
+ pk_control_proxy_connect (control, proxy);
+ pk_control_can_authorize_internal (control, g_steal_pointer (&task));
}
/**
@@ -1802,39 +1511,30 @@ pk_control_can_authorize_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_can_authorize_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- state->parameters = g_variant_new ("(s)", action_id);
- g_variant_ref_sink (state->parameters);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_can_authorize_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_can_authorize_async,
+ g_steal_pointer (&error));
return;
}
- state->authorize = PK_AUTHORIZE_ENUM_UNKNOWN;
+
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_can_authorize_async);
+ g_task_set_task_data (task, g_strdup (action_id), g_free);
/* skip straight to the D-Bus method if already connection */
- if (control->priv->proxy != NULL) {
- pk_control_can_authorize_internal (state);
+ if (priv->proxy != NULL) {
+ pk_control_can_authorize_internal (control, g_steal_pointer (&task));
} else {
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,
@@ -1842,13 +1542,10 @@ pk_control_can_authorize_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_can_authorize_proxy_cb,
- state);
+ g_steal_pointer (&task));
}
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
}
/**
@@ -1859,66 +1556,28 @@ pk_control_can_authorize_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: the #PkAuthorizeEnum or %PK_AUTHORIZE_ENUM_UNKNOWN if the method failed
+ * Returns: the #PkAuthorizeEnum or %PK_AUTHORIZE_ENUM_UNKNOWN if the method failed
*
* Since: 0.5.2
**/
PkAuthorizeEnum
pk_control_can_authorize_finish (PkControl *control, GAsyncResult *res, GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
+ gpointer result;
g_return_val_if_fail (PK_IS_CONTROL (control), PK_AUTHORIZE_ENUM_UNKNOWN);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), PK_AUTHORIZE_ENUM_UNKNOWN);
-
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
+ g_return_val_if_fail (g_task_is_valid (res, control), PK_AUTHORIZE_ENUM_UNKNOWN);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_can_authorize_async), PK_AUTHORIZE_ENUM_UNKNOWN);
- g_return_val_if_fail (source_tag == pk_control_can_authorize_async, PK_AUTHORIZE_ENUM_UNKNOWN);
-
- if (g_simple_async_result_propagate_error (simple, error))
+ result = g_task_propagate_pointer (G_TASK (res), error);
+ if (!result)
return PK_AUTHORIZE_ENUM_UNKNOWN;
- return (PkAuthorizeEnum) g_simple_async_result_get_op_res_gssize (simple);
+ return (PkAuthorizeEnum) GPOINTER_TO_UINT(result);
}
/**********************************************************************/
-
-/*
- * pk_control_get_properties_state_finish:
- **/
-static void
-pk_control_get_properties_state_finish (PkControlState *state, const GError *error)
-{
- /* get result */
- if (state->ret) {
- g_simple_async_result_set_op_res_gboolean (state->res,
- state->ret);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* remove from list */
- g_ptr_array_remove (state->control->priv->calls, state);
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL) {
- g_cancellable_disconnect (state->cancellable,
- state->cancellable_id);
- g_object_unref (state->cancellable);
- }
- g_object_unref (state->res);
- g_object_unref (state->control);
- if (state->proxy != NULL)
- g_object_unref (state->proxy);
- g_slice_free (PkControlState, state);
-}
-
/*
* pk_control_get_properties_cb:
**/
@@ -1927,23 +1586,21 @@ pk_control_get_properties_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
- PkControlState *state = (PkControlState *) user_data;
+ g_autoptr(GTask) task = G_TASK (user_data);
g_autoptr(GError) error = NULL;
+ g_autoptr(GDBusProxy) proxy = NULL;
+ PkControl *control = g_task_get_source_object (task);
- state->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
- if (state->proxy == NULL) {
- pk_control_get_properties_state_finish (state, error);
+ proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+ if (proxy == NULL) {
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
- /* connect up proxy */
- pk_control_proxy_connect (state);
-
- /* save data */
- state->ret = TRUE;
+ pk_control_proxy_connect (control, proxy);
/* we're done */
- pk_control_get_properties_state_finish (state, NULL);
+ g_task_return_boolean (task, TRUE);
}
/**
@@ -1963,37 +1620,29 @@ pk_control_get_properties_async (PkControl *control,
GAsyncReadyCallback callback,
gpointer user_data)
{
- PkControlState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ g_autoptr(GTask) task = NULL;
g_autoptr(GError) error = NULL;
g_return_if_fail (PK_IS_CONTROL (control));
g_return_if_fail (callback != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (control),
- callback,
- user_data,
- pk_control_get_properties_async);
-
- /* save state */
- state = g_slice_new0 (PkControlState);
- state->res = g_object_ref (res);
- state->control = g_object_ref (control);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
-
/* check not already cancelled */
if (cancellable != NULL &&
g_cancellable_set_error_if_cancelled (cancellable, &error)) {
- pk_control_get_properties_state_finish (state, error);
+ g_task_report_error (control, callback, user_data,
+ pk_control_get_properties_async,
+ g_steal_pointer (&error));
return;
}
+ task = g_task_new (control, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_control_get_properties_async);
+
/* already done */
- if (control->priv->proxy != NULL) {
- state->ret = TRUE;
- pk_control_get_properties_state_finish (state, NULL);
+ if (priv->proxy != NULL) {
+ g_task_return_boolean (task, TRUE);
return;
}
@@ -2004,12 +1653,9 @@ pk_control_get_properties_async (PkControl *control,
PK_DBUS_SERVICE,
PK_DBUS_PATH,
PK_DBUS_INTERFACE,
- control->priv->cancellable,
+ priv->cancellable,
pk_control_get_properties_cb,
- state);
-
- /* track state */
- g_ptr_array_add (control->priv->calls, state);
+ g_steal_pointer (&task));
}
/**
@@ -2020,29 +1666,19 @@ pk_control_get_properties_async (PkControl *control,
*
* Gets the result from the asynchronous function.
*
- * Return value: %TRUE if we set the proxy successfully
+ * Returns: %TRUE if we set the proxy successfully
*
* Since: 0.5.2
**/
gboolean
pk_control_get_properties_finish (PkControl *control, GAsyncResult *res, GError **error)
{
- GSimpleAsyncResult *simple;
- gpointer source_tag;
-
g_return_val_if_fail (PK_IS_CONTROL (control), FALSE);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (g_task_is_valid (res, control), FALSE);
+ g_return_val_if_fail (g_async_result_is_tagged (res, pk_control_get_properties_async), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- simple = G_SIMPLE_ASYNC_RESULT (res);
- source_tag = g_simple_async_result_get_source_tag (simple);
-
- g_return_val_if_fail (source_tag == pk_control_get_properties_async, FALSE);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
-
- return g_simple_async_result_get_op_res_gboolean (simple);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
/**********************************************************************/
@@ -2054,7 +1690,7 @@ static void
pk_control_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkControl *control = PK_CONTROL (object);
- PkControlPrivate *priv = control->priv;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
switch (prop_id) {
case PROP_VERSION_MAJOR:
@@ -2127,7 +1763,6 @@ pk_control_set_property (GObject *object, guint prop_id, const GValue *value, GP
static void
pk_control_class_init (PkControlClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = pk_control_get_property;
object_class->set_property = pk_control_set_property;
@@ -2138,151 +1773,168 @@ pk_control_class_init (PkControlClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("version-major", NULL, NULL,
+ obj_properties[PROP_VERSION_MAJOR] =
+ g_param_spec_uint ("version-major", NULL, NULL,
0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_VERSION_MAJOR, pspec);
/**
* PkControl:version-minor:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("version-minor", NULL, NULL,
+ obj_properties[PROP_VERSION_MINOR] =
+ g_param_spec_uint ("version-minor", NULL, NULL,
0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_VERSION_MINOR, pspec);
/**
* PkControl:version-micro:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("version-micro", NULL, NULL,
+ obj_properties[PROP_VERSION_MICRO] =
+ g_param_spec_uint ("version-micro", NULL, NULL,
0, G_MAXUINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_VERSION_MICRO, pspec);
/**
* PkControl:backend-name:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_string ("backend-name", NULL, NULL,
+ obj_properties[PROP_BACKEND_NAME] =
+ g_param_spec_string ("backend-name", NULL, NULL,
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_BACKEND_NAME, pspec);
/**
* PkControl:backend-description:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_string ("backend-description", NULL, NULL,
+ obj_properties[PROP_BACKEND_DESCRIPTION] =
+ g_param_spec_string ("backend-description", NULL, NULL,
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_BACKEND_DESCRIPTION, pspec);
/**
* PkControl:backend-author:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_string ("backend-author", NULL, NULL,
+ obj_properties[PROP_BACKEND_AUTHOR] =
+ g_param_spec_string ("backend-author", NULL, NULL,
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_BACKEND_AUTHOR, pspec);
/**
* PkControl:roles:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint64 ("roles", NULL, NULL,
+ obj_properties[PROP_ROLES] =
+ g_param_spec_uint64 ("roles", NULL, NULL,
0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ROLES, pspec);
/**
* PkControl:groups:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint64 ("groups", NULL, NULL,
+ obj_properties[PROP_GROUPS] =
+ g_param_spec_uint64 ("groups", NULL, NULL,
0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_GROUPS, pspec);
/**
* PkControl:filters:
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint64 ("filters", NULL, NULL,
+ obj_properties[PROP_FILTERS] =
+ g_param_spec_uint64 ("filters", NULL, NULL,
0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_FILTERS, pspec);
/**
* PkControl:provides:
*
* Since: 0.8.8
*/
- pspec = g_param_spec_uint64 ("provides", NULL, NULL,
+ obj_properties[PROP_PROVIDES] =
+ g_param_spec_uint64 ("provides", NULL, NULL,
0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PROVIDES, pspec);
/**
* PkControl:mime-types:
*
* Since: 0.8.1
*/
- pspec = g_param_spec_boxed ("mime-types", NULL, NULL,
+ obj_properties[PROP_MIME_TYPES] =
+ g_param_spec_boxed ("mime-types", NULL, NULL,
G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_MIME_TYPES, pspec);
/**
* PkControl:locked:
*
* Since: 0.5.3
*/
- pspec = g_param_spec_boolean ("locked", NULL, NULL,
+ obj_properties[PROP_LOCKED] =
+ g_param_spec_boolean ("locked", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_LOCKED, pspec);
/**
* PkControl:network-state:
*
* Since: 0.5.3
*/
- pspec = g_param_spec_enum ("network-state", NULL, NULL,
+ obj_properties[PROP_NETWORK_STATE] =
+ g_param_spec_enum ("network-state", NULL, NULL,
PK_TYPE_NETWORK_ENUM, PK_NETWORK_ENUM_LAST,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_NETWORK_STATE, pspec);
/**
* PkControl:distro-id:
*
* Since: 0.5.5
*/
- pspec = g_param_spec_string ("distro-id", NULL, NULL,
+ obj_properties[PROP_DISTRO_ID] =
+ g_param_spec_string ("distro-id", NULL, NULL,
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_DISTRO_ID, pspec);
/**
* PkControl:connected:
*
* Since: 0.5.3
*/
- pspec = g_param_spec_boolean ("connected", NULL, NULL,
+ obj_properties[PROP_CONNECTED] =
+ g_param_spec_boolean ("connected", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_CONNECTED, pspec);
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
+
+ /**
+ * PkControl::installed-changed:
+ * @control: the #PkControl instance that emitted the signal
+ *
+ * The ::installed-changed signal is emitted when the list of installed apps may have
+ * changed and the control program may have to update some UI.
+ *
+ * Since: 1.2.9
+ **/
+ signals[SIGNAL_INSTALLED_CHANGED] =
+ g_signal_new ("installed-changed",
+ G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (PkControlClass, installed_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
/**
* PkControl::updates-changed:
* @control: the #PkControl instance that emitted the signal
@@ -2316,7 +1968,7 @@ pk_control_class_init (PkControlClass *klass)
* The ::restart_schedule signal is emitted when the packagekitd service
* has been restarted because it has been upgraded.
* Client programs should reload themselves when it is convenient to
- * do so, as old client tools may not be compatable with the new daemon.
+ * do so, as old client tools may not be compatible with the new daemon.
**/
signals[SIGNAL_RESTART_SCHEDULE] =
g_signal_new ("restart-schedule",
@@ -2338,8 +1990,6 @@ pk_control_class_init (PkControlClass *klass)
G_STRUCT_OFFSET (PkControlClass, transaction_list_changed),
NULL, NULL, g_cclosure_marshal_VOID__BOXED,
G_TYPE_NONE, 1, G_TYPE_STRV);
-
- g_type_class_add_private (klass, sizeof (PkControlPrivate));
}
/*
@@ -2352,9 +2002,10 @@ pk_control_name_appeared_cb (GDBusConnection *connection,
gpointer user_data)
{
PkControl *control = PK_CONTROL (user_data);
- control->priv->connected = TRUE;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ priv->connected = TRUE;
g_debug ("notify::connected");
- g_object_notify (G_OBJECT(control), "connected");
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_CONNECTED]);
}
/*
@@ -2363,16 +2014,18 @@ pk_control_name_appeared_cb (GDBusConnection *connection,
static void
pk_control_proxy_destroy (PkControl *control)
{
- if (control->priv->proxy == NULL)
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+
+ if (priv->proxy == NULL)
return;
- g_signal_handlers_disconnect_by_func (control->priv->proxy,
+
+ g_signal_handlers_disconnect_by_func (priv->proxy,
G_CALLBACK (pk_control_properties_changed_cb),
control);
- g_signal_handlers_disconnect_by_func (control->priv->proxy,
+ g_signal_handlers_disconnect_by_func (priv->proxy,
G_CALLBACK (pk_control_signal_cb),
control);
- g_object_unref (control->priv->proxy);
- control->priv->proxy = NULL;
+ g_clear_object (&priv->proxy);
}
/*
@@ -2384,9 +2037,11 @@ pk_control_name_vanished_cb (GDBusConnection *connection,
gpointer user_data)
{
PkControl *control = PK_CONTROL (user_data);
- control->priv->connected = FALSE;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+
+ priv->connected = FALSE;
g_debug ("notify::connected");
- g_object_notify (G_OBJECT(control), "connected");
+ g_object_notify_by_pspec (G_OBJECT(control), obj_properties[PROP_CONNECTED]);
/* destroy the proxy, as even though it's "well known" we get a
* GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown if we try to
@@ -2401,20 +2056,20 @@ pk_control_name_vanished_cb (GDBusConnection *connection,
static void
pk_control_init (PkControl *control)
{
- control->priv = PK_CONTROL_GET_PRIVATE (control);
- control->priv->network_state = PK_NETWORK_ENUM_UNKNOWN;
- control->priv->version_major = G_MAXUINT;
- control->priv->version_minor = G_MAXUINT;
- control->priv->version_micro = G_MAXUINT;
- control->priv->cancellable = g_cancellable_new ();
- control->priv->calls = g_ptr_array_new ();
- control->priv->watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
- PK_DBUS_SERVICE,
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- pk_control_name_appeared_cb,
- pk_control_name_vanished_cb,
- control,
- NULL);
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
+ priv->network_state = PK_NETWORK_ENUM_UNKNOWN;
+ priv->version_major = G_MAXUINT;
+ priv->version_minor = G_MAXUINT;
+ priv->version_micro = G_MAXUINT;
+ priv->cancellable = g_cancellable_new ();
+ priv->watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ PK_DBUS_SERVICE,
+ G_BUS_NAME_WATCHER_FLAGS_NONE,
+ pk_control_name_appeared_cb,
+ pk_control_name_vanished_cb,
+ control,
+ NULL);
+ control->priv = priv;
}
/*
@@ -2425,7 +2080,7 @@ static void
pk_control_finalize (GObject *object)
{
PkControl *control = PK_CONTROL (object);
- PkControlPrivate *priv = control->priv;
+ PkControlPrivate *priv = pk_control_get_instance_private (control);
/* ensure we cancel any in-flight DBus calls */
g_cancellable_cancel (priv->cancellable);
@@ -2434,13 +2089,12 @@ pk_control_finalize (GObject *object)
/* disconnect proxy and destroy it */
pk_control_proxy_destroy (control);
- g_free (priv->backend_name);
- g_free (priv->backend_description);
- g_free (priv->backend_author);
- g_strfreev (priv->mime_types);
- g_free (priv->distro_id);
- g_ptr_array_unref (priv->calls);
- g_object_unref (priv->cancellable);
+ g_clear_pointer (&priv->backend_name, g_free);
+ g_clear_pointer (&priv->backend_description, g_free);
+ g_clear_pointer (&priv->backend_author, g_free);
+ g_clear_pointer (&priv->mime_types, g_strfreev);
+ g_clear_pointer (&priv->distro_id, g_free);
+ g_clear_object (&priv->cancellable);
G_OBJECT_CLASS (pk_control_parent_class)->finalize (object);
}
@@ -2448,7 +2102,7 @@ pk_control_finalize (GObject *object)
/**
* pk_control_new:
*
- * Return value: a new #PkControl object.
+ * Returns: a new #PkControl object.
*
* Since: 0.5.2
**/
diff --git a/lib/packagekit-glib2/pk-control.h b/lib/packagekit-glib2/pk-control.h
index acbb753..5c94792 100644
--- a/lib/packagekit-glib2/pk-control.h
+++ b/lib/packagekit-glib2/pk-control.h
@@ -84,12 +84,12 @@ struct _PkControlClass
gboolean is_locked);
void (* connection_changed) (PkControl *control,
gboolean connected);
+ void (* installed_changed) (PkControl *control);
/* padding for future expansion */
void (*_pk_reserved1) (void);
void (*_pk_reserved2) (void);
void (*_pk_reserved3) (void);
void (*_pk_reserved4) (void);
- void (*_pk_reserved5) (void);
};
GQuark pk_control_error_quark (void);
diff --git a/lib/packagekit-glib2/pk-enum.c b/lib/packagekit-glib2/pk-enum.c
index c8d3dea..f540a98 100644
--- a/lib/packagekit-glib2/pk-enum.c
+++ b/lib/packagekit-glib2/pk-enum.c
@@ -320,9 +320,13 @@ static const PkEnumMatch enum_info[] = {
{PK_INFO_ENUM_DOWNGRADING, "downgrading"},
{PK_INFO_ENUM_PREPARING, "preparing"},
{PK_INFO_ENUM_DECOMPRESSING, "decompressing"},
- {PK_INFO_ENUM_UNTRUSTED, "untrusted"},
- {PK_INFO_ENUM_TRUSTED, "trusted"},
+ {PK_INFO_ENUM_UNTRUSTED, "untrusted"},
+ {PK_INFO_ENUM_TRUSTED, "trusted"},
{PK_INFO_ENUM_CRITICAL, "critical"},
+ {PK_INFO_ENUM_INSTALL, "install"},
+ {PK_INFO_ENUM_REMOVE, "remove"},
+ {PK_INFO_ENUM_OBSOLETE, "obsolete"},
+ {PK_INFO_ENUM_DOWNGRADE, "downgrade"},
{0, NULL}
};
@@ -1008,6 +1012,22 @@ pk_info_enum_to_localised_text (PkInfoEnum info)
/* TRANSLATORS: The state of a package, i.e. not installed */
text = dgettext("PackageKit", "Unavailable");
break;
+ case PK_INFO_ENUM_INSTALL:
+ /* TRANSLATORS: The state of a package: to be installed with the next action */
+ text = dgettext("PackageKit", "Install");
+ break;
+ case PK_INFO_ENUM_REMOVE:
+ /* TRANSLATORS: The state of a package: to be removed with the next action */
+ text = dgettext("PackageKit", "Remove");
+ break;
+ case PK_INFO_ENUM_OBSOLETE:
+ /* TRANSLATORS: The state of a package: package is obsolete */
+ text = dgettext("PackageKit", "Obsolete");
+ break;
+ case PK_INFO_ENUM_DOWNGRADE:
+ /* TRANSLATORS: The state of a package: package is to be downgraded */
+ text = dgettext("PackageKit", "Downgrade");
+ break;
default:
g_warning ("info unrecognised: %s", pk_info_enum_to_string (info));
}
diff --git a/lib/packagekit-glib2/pk-enum.h b/lib/packagekit-glib2/pk-enum.h
index cfe8946..5fea789 100644
--- a/lib/packagekit-glib2/pk-enum.h
+++ b/lib/packagekit-glib2/pk-enum.h
@@ -618,33 +618,37 @@ typedef enum {
/**
* PkInfoEnum:
- * @PK_INFO_ENUM_UNKNOWN: Package status is unknown
- * @PK_INFO_ENUM_INSTALLED: Package is installed
- * @PK_INFO_ENUM_AVAILABLE: Package is available to be installed
- * @PK_INFO_ENUM_LOW:
- * @PK_INFO_ENUM_ENHANCEMENT:
- * @PK_INFO_ENUM_NORMAL:
- * @PK_INFO_ENUM_BUGFIX:
- * @PK_INFO_ENUM_IMPORTANT:
- * @PK_INFO_ENUM_SECURITY:
- * @PK_INFO_ENUM_BLOCKED: Package is blocked
- * @PK_INFO_ENUM_DOWNLOADING: Package is downloading
- * @PK_INFO_ENUM_UPDATING: Package is updating
- * @PK_INFO_ENUM_INSTALLING: Package is being installed
- * @PK_INFO_ENUM_REMOVING: Package is being removed
- * @PK_INFO_ENUM_CLEANUP: Package is running cleanup
- * @PK_INFO_ENUM_OBSOLETING:
+ * @PK_INFO_ENUM_UNKNOWN: Package status is unknown
+ * @PK_INFO_ENUM_INSTALLED: Package is installed
+ * @PK_INFO_ENUM_AVAILABLE: Package is available to be installed
+ * @PK_INFO_ENUM_LOW: Package update has a low priority
+ * @PK_INFO_ENUM_ENHANCEMENT: Package update is an enhancement
+ * @PK_INFO_ENUM_NORMAL: Package update has normal priority
+ * @PK_INFO_ENUM_BUGFIX: Package update fixes bugs
+ * @PK_INFO_ENUM_IMPORTANT: Package update is important
+ * @PK_INFO_ENUM_SECURITY: Package update contains a security fix
+ * @PK_INFO_ENUM_BLOCKED: Package is blocked
+ * @PK_INFO_ENUM_DOWNLOADING: Package is being downloaded
+ * @PK_INFO_ENUM_UPDATING: Package is updating
+ * @PK_INFO_ENUM_INSTALLING: Package is being installed
+ * @PK_INFO_ENUM_REMOVING: Package is being removed
+ * @PK_INFO_ENUM_CLEANUP: Package is running cleanup
+ * @PK_INFO_ENUM_OBSOLETING: Package is being obsoleted
* @PK_INFO_ENUM_COLLECTION_INSTALLED:
* @PK_INFO_ENUM_COLLECTION_AVAILABLE:
* @PK_INFO_ENUM_FINISHED:
- * @PK_INFO_ENUM_REINSTALLING: Package is being reinstalled
- * @PK_INFO_ENUM_DOWNGRADING: Package is being downgraded
- * @PK_INFO_ENUM_PREPARING: Package is preparing for installation/removal
+ * @PK_INFO_ENUM_REINSTALLING: Package is being reinstalled
+ * @PK_INFO_ENUM_DOWNGRADING: Package is being downgraded
+ * @PK_INFO_ENUM_PREPARING: Package is preparing for installation/removal
* @PK_INFO_ENUM_DECOMPRESSING: Package is decompressing
* @PK_INFO_ENUM_UNTRUSTED:
* @PK_INFO_ENUM_TRUSTED:
- * @PK_INFO_ENUM_UNAVAILABLE: Package is unavailable
- * @PK_INFO_ENUM_CRITICAL: Update severity is critical; Since: 1.2.4
+ * @PK_INFO_ENUM_UNAVAILABLE: Package is unavailable
+ * @PK_INFO_ENUM_CRITICAL: Package update severity is critical. Since: 1.2.4
+ * @PK_INFO_ENUM_INSTALL: Package is intended for installation. Since 1.3.0
+ * @PK_INFO_ENUM_REMOVE: Package is intended for removal. Since 1.3.0
+ * @PK_INFO_ENUM_OBSOLETE: Package is obsoleted. Since 1.3.0
+ * @PK_INFO_ENUM_DOWNGRADE: Package is intended for downgrade. Since 1.3.0
* @PK_INFO_ENUM_LAST:
*
* The enumerated types used in Package() - these have to refer to a specific
@@ -677,7 +681,11 @@ typedef enum {
PK_INFO_ENUM_UNTRUSTED,
PK_INFO_ENUM_TRUSTED,
PK_INFO_ENUM_UNAVAILABLE,
- PK_INFO_ENUM_CRITICAL, /* Since: 1.2.4 */
+ PK_INFO_ENUM_CRITICAL,
+ PK_INFO_ENUM_INSTALL,
+ PK_INFO_ENUM_REMOVE,
+ PK_INFO_ENUM_OBSOLETE,
+ PK_INFO_ENUM_DOWNGRADE,
PK_INFO_ENUM_LAST
} PkInfoEnum;
diff --git a/lib/packagekit-glib2/pk-package-sack.c b/lib/packagekit-glib2/pk-package-sack.c
index 1d217e6..c2eedb9 100644
--- a/lib/packagekit-glib2/pk-package-sack.c
+++ b/lib/packagekit-glib2/pk-package-sack.c
@@ -699,45 +699,15 @@ pk_package_sack_get_package_ids (PkPackageSack *sack)
return package_ids;
}
-typedef struct {
- PkPackageSack *sack;
- GCancellable *cancellable;
- gboolean ret;
- GSimpleAsyncResult *res;
-} PkPackageSackState;
-
/***************************************************************************************************/
-/*
- * pk_package_sack_merge_bool_state_finish:
- **/
-static void
-pk_package_sack_merge_bool_state_finish (PkPackageSackState *state, const GError *error)
-{
- /* get result */
- if (state->ret) {
- g_simple_async_result_set_op_res_gboolean (state->res, state->ret);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
-
- /* deallocate */
- if (state->cancellable != NULL)
- g_object_unref (state->cancellable);
- g_object_unref (state->res);
- g_object_unref (state->sack);
- g_slice_free (PkPackageSackState, state);
-}
-
/*
* pk_package_sack_resolve_cb:
**/
static void
-pk_package_sack_resolve_cb (GObject *source_object, GAsyncResult *res, PkPackageSackState *state)
+pk_package_sack_resolve_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) task = G_TASK (user_data);
PkClient *client = PK_CLIENT (source_object);
PkPackage *item;
guint i;
@@ -746,21 +716,24 @@ pk_package_sack_resolve_cb (GObject *source_object, GAsyncResult *res, PkPackage
g_autoptr(GError) error = NULL;
g_autoptr(PkResults) results = NULL;
g_autoptr(GPtrArray) packages = NULL;
+ PkPackageSack *sack;
+
+ sack = g_task_get_source_object (task);
/* get the results */
results = pk_client_generic_finish (client, res, &error);
if (results == NULL) {
g_warning ("failed to resolve: %s", error->message);
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* get the packages */
packages = pk_results_get_package_array (results);
if (packages->len == 0) {
- g_warning ("%i", state->ret);
- error = g_error_new (1, 0, "no packages found!");
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_new_error (task,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ "no packages found!");
return;
}
@@ -768,7 +741,7 @@ pk_package_sack_resolve_cb (GObject *source_object, GAsyncResult *res, PkPackage
for (i = 0; i < packages->len; i++) {
item = g_ptr_array_index (packages, i);
package_id = pk_package_get_id (item);
- package = pk_package_sack_find_by_id (state->sack, package_id);
+ package = pk_package_sack_find_by_id (sack, package_id);
if (package == NULL) {
g_warning ("failed to find %s", package_id);
continue;
@@ -782,15 +755,11 @@ pk_package_sack_resolve_cb (GObject *source_object, GAsyncResult *res, PkPackage
g_object_unref (package);
}
- /* all okay */
- state->ret = TRUE;
-
- /* we're done */
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_boolean (task, TRUE);
}
/**
- * pk_package_sack_resolve_async:
+ * pk_package_sack_resolve_async: (finish-func pk_client_generic_finish):
* @sack: a valid #PkPackageSack instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -807,29 +776,21 @@ pk_package_sack_resolve_async (PkPackageSack *sack, GCancellable *cancellable,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback, gpointer user_data)
{
- PkPackageSackState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) task = NULL;
g_auto(GStrv) package_ids = NULL;
g_return_if_fail (PK_IS_PACKAGE_SACK (sack));
g_return_if_fail (callback != NULL);
- res = g_simple_async_result_new (G_OBJECT (sack), callback, user_data, pk_package_sack_resolve_async);
-
- /* save state */
- state = g_slice_new0 (PkPackageSackState);
- state->res = g_object_ref (res);
- state->sack = g_object_ref (sack);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
- state->ret = FALSE;
+ task = g_task_new (sack, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_package_sack_resolve_async);
/* start resolve async */
package_ids = pk_package_sack_get_package_ids (sack);
pk_client_resolve_async (sack->priv->client,
pk_bitfield_value (PK_FILTER_ENUM_INSTALLED), package_ids,
cancellable, progress_callback, progress_user_data,
- (GAsyncReadyCallback) pk_package_sack_resolve_cb, state);
+ pk_package_sack_resolve_cb, g_steal_pointer (&task));
}
/**
@@ -847,18 +808,11 @@ pk_package_sack_resolve_async (PkPackageSack *sack, GCancellable *cancellable,
gboolean
pk_package_sack_merge_generic_finish (PkPackageSack *sack, GAsyncResult *res, GError **error)
{
- GSimpleAsyncResult *simple;
-
g_return_val_if_fail (PK_IS_PACKAGE_SACK (sack), FALSE);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), FALSE);
+ g_return_val_if_fail (g_task_is_valid (res, sack), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- simple = G_SIMPLE_ASYNC_RESULT (res);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return FALSE;
-
- return g_simple_async_result_get_op_res_gboolean (simple);
+ return g_task_propagate_boolean (G_TASK (res), error);
}
/***************************************************************************************************/
@@ -867,8 +821,9 @@ pk_package_sack_merge_generic_finish (PkPackageSack *sack, GAsyncResult *res, GE
* pk_package_sack_get_details_cb:
**/
static void
-pk_package_sack_get_details_cb (GObject *source_object, GAsyncResult *res, PkPackageSackState *state)
+pk_package_sack_get_details_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) task = G_TASK (user_data);
PkClient *client = PK_CLIENT (source_object);
PkDetails *item;
guint i;
@@ -876,20 +831,24 @@ pk_package_sack_get_details_cb (GObject *source_object, GAsyncResult *res, PkPac
g_autoptr(GError) error = NULL;
g_autoptr(PkResults) results = NULL;
g_autoptr(GPtrArray) details = NULL;
+ PkPackageSack *sack;
+
+ sack = g_task_get_source_object (task);
/* get the results */
results = pk_client_generic_finish (client, res, &error);
if (results == NULL) {
g_warning ("failed to details: %s", error->message);
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* get the details */
details = pk_results_get_details_array (results);
if (details->len == 0) {
- error = g_error_new (1, 0, "no details found!");
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_new_error (task,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ "no details found!");
return;
}
@@ -902,7 +861,7 @@ pk_package_sack_get_details_cb (GObject *source_object, GAsyncResult *res, PkPac
NULL);
/* get package, and set data */
- package = pk_package_sack_find_by_id (state->sack, package_id);
+ package = pk_package_sack_find_by_id (sack, package_id);
if (package == NULL) {
g_warning ("failed to find %s", package_id);
continue;
@@ -919,15 +878,11 @@ pk_package_sack_get_details_cb (GObject *source_object, GAsyncResult *res, PkPac
g_object_unref (package);
}
- /* all okay */
- state->ret = TRUE;
-
- /* we're done */
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_boolean (task, TRUE);
}
/**
- * pk_package_sack_get_details_async:
+ * pk_package_sack_get_details_async: (finish-func pk_client_generic_finish):
* @sack: a valid #PkPackageSack instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -942,28 +897,20 @@ pk_package_sack_get_details_async (PkPackageSack *sack, GCancellable *cancellabl
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback, gpointer user_data)
{
- PkPackageSackState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) task = NULL;
g_auto(GStrv) package_ids = NULL;
g_return_if_fail (PK_IS_PACKAGE_SACK (sack));
g_return_if_fail (callback != NULL);
- res = g_simple_async_result_new (G_OBJECT (sack), callback, user_data, pk_package_sack_get_details_async);
-
- /* save state */
- state = g_slice_new0 (PkPackageSackState);
- state->res = g_object_ref (res);
- state->sack = g_object_ref (sack);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
- state->ret = FALSE;
+ task = g_task_new (sack, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_package_sack_get_details_async);
/* start details async */
package_ids = pk_package_sack_get_package_ids (sack);
pk_client_get_details_async (sack->priv->client, package_ids,
cancellable, progress_callback, progress_user_data,
- (GAsyncReadyCallback) pk_package_sack_get_details_cb, state);
+ pk_package_sack_get_details_cb, task);
}
/***************************************************************************************************/
@@ -972,8 +919,9 @@ pk_package_sack_get_details_async (PkPackageSack *sack, GCancellable *cancellabl
* pk_package_sack_get_update_detail_cb:
**/
static void
-pk_package_sack_get_update_detail_cb (GObject *source_object, GAsyncResult *res, PkPackageSackState *state)
+pk_package_sack_get_update_detail_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) task = G_TASK (user_data);
PkClient *client = PK_CLIENT (source_object);
PkUpdateDetail *item;
guint i;
@@ -981,20 +929,24 @@ pk_package_sack_get_update_detail_cb (GObject *source_object, GAsyncResult *res,
g_autoptr(GError) error = NULL;
g_autoptr(PkResults) results = NULL;
g_autoptr(GPtrArray) update_details = NULL;
+ PkPackageSack *sack;
+
+ sack = g_task_get_source_object (task);
/* get the results */
results = pk_client_generic_finish (client, res, &error);
if (results == NULL) {
g_warning ("failed to update_detail: %s", error->message);
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_error (task, g_steal_pointer (&error));
return;
}
/* get the update_details */
update_details = pk_results_get_update_detail_array (results);
if (update_details->len == 0) {
- error = g_error_new (1, 0, "no update details found!");
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_new_error (task,
+ G_IO_ERROR, G_IO_ERROR_FAILED,
+ "no update details found!");
return;
}
@@ -1030,7 +982,7 @@ pk_package_sack_get_update_detail_cb (GObject *source_object, GAsyncResult *res,
NULL);
/* get package, and set data */
- package = pk_package_sack_find_by_id (state->sack, package_id);
+ package = pk_package_sack_find_by_id (sack, package_id);
if (package == NULL) {
g_warning ("failed to find %s", package_id);
continue;
@@ -1053,15 +1005,11 @@ pk_package_sack_get_update_detail_cb (GObject *source_object, GAsyncResult *res,
g_object_unref (package);
}
- /* all okay */
- state->ret = TRUE;
-
- /* we're done */
- pk_package_sack_merge_bool_state_finish (state, error);
+ g_task_return_boolean (task, TRUE);
}
/**
- * pk_package_sack_get_update_detail_async:
+ * pk_package_sack_get_update_detail_async: (finish-func pk_client_generic_finish):
* @sack: a valid #PkPackageSack instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -1078,28 +1026,20 @@ pk_package_sack_get_update_detail_async (PkPackageSack *sack, GCancellable *canc
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback, gpointer user_data)
{
- PkPackageSackState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) task = NULL;
g_auto(GStrv) package_ids = NULL;
g_return_if_fail (PK_IS_PACKAGE_SACK (sack));
g_return_if_fail (callback != NULL);
- res = g_simple_async_result_new (G_OBJECT (sack), callback, user_data, pk_package_sack_get_update_detail_async);
-
- /* save state */
- state = g_slice_new0 (PkPackageSackState);
- state->res = g_object_ref (res);
- state->sack = g_object_ref (sack);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
- state->ret = FALSE;
+ task = g_task_new (sack, cancellable, callback, user_data);
+ g_task_set_source_tag (task, pk_package_sack_get_update_detail_async);
/* start update_detail async */
package_ids = pk_package_sack_get_package_ids (sack);
pk_client_get_update_detail_async (sack->priv->client, package_ids,
cancellable, progress_callback, progress_user_data,
- (GAsyncReadyCallback) pk_package_sack_get_update_detail_cb, state);
+ pk_package_sack_get_update_detail_cb, task);
}
/***************************************************************************************************/
diff --git a/lib/packagekit-glib2/pk-package.c b/lib/packagekit-glib2/pk-package.c
index 13f426f..af1468f 100644
--- a/lib/packagekit-glib2/pk-package.c
+++ b/lib/packagekit-glib2/pk-package.c
@@ -40,8 +40,6 @@
static void pk_package_finalize (GObject *object);
-#define PK_PACKAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_PACKAGE, PkPackagePrivate))
-
/**
* PkPackagePrivate:
*
@@ -105,7 +103,9 @@ enum {
static guint signals [SIGNAL_LAST] = { 0 };
-G_DEFINE_TYPE (PkPackage, pk_package, PK_TYPE_SOURCE)
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (PkPackage, pk_package, PK_TYPE_SOURCE)
/**
* pk_package_equal:
@@ -114,18 +114,22 @@ G_DEFINE_TYPE (PkPackage, pk_package, PK_TYPE_SOURCE)
*
* Do the #PkPackage's have the same ID.
*
- * Return value: %TRUE if the packages have the same package_id, info and summary.
+ * Returns: %TRUE if the packages have the same package_id, info and summary.
*
* Since: 0.5.4
**/
gboolean
pk_package_equal (PkPackage *package1, PkPackage *package2)
{
+ PkPackagePrivate *priv1 = pk_package_get_instance_private (package1);
+ PkPackagePrivate *priv2 = pk_package_get_instance_private (package2);
+
g_return_val_if_fail (PK_IS_PACKAGE (package1), FALSE);
g_return_val_if_fail (PK_IS_PACKAGE (package2), FALSE);
- return (g_strcmp0 (package1->priv->summary, package2->priv->summary) == 0 &&
- g_strcmp0 (package1->priv->package_id, package2->priv->package_id) == 0 &&
- package1->priv->info == package2->priv->info);
+
+ return (g_strcmp0 (priv1->summary, priv2->summary) == 0 &&
+ g_strcmp0 (priv1->package_id, priv2->package_id) == 0 &&
+ priv1->info == priv2->info);
}
/**
@@ -135,16 +139,20 @@ pk_package_equal (PkPackage *package1, PkPackage *package2)
*
* Do the #PkPackage's have the same ID.
*
- * Return value: %TRUE if the packages have the same package_id.
+ * Returns: %TRUE if the packages have the same package_id.
*
* Since: 0.5.4
**/
gboolean
pk_package_equal_id (PkPackage *package1, PkPackage *package2)
{
+ PkPackagePrivate *priv1 = pk_package_get_instance_private (package1);
+ PkPackagePrivate *priv2 = pk_package_get_instance_private (package2);
+
g_return_val_if_fail (PK_IS_PACKAGE (package1), FALSE);
g_return_val_if_fail (PK_IS_PACKAGE (package2), FALSE);
- return (g_strcmp0 (package1->priv->package_id, package2->priv->package_id) == 0);
+
+ return (g_strcmp0 (priv1->package_id, priv2->package_id) == 0);
}
/**
@@ -155,21 +163,23 @@ pk_package_equal_id (PkPackage *package1, PkPackage *package2)
*
* Sets the package object to have the given ID
*
- * Return value: %TRUE if the package_id was set
+ * Returns: %TRUE if the package_id was set
*
* Since: 0.5.4
**/
gboolean
pk_package_set_id (PkPackage *package, const gchar *package_id, GError **error)
{
- PkPackagePrivate *priv = package->priv;
- gboolean ret;
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
guint cnt = 0;
guint i;
g_return_val_if_fail (PK_IS_PACKAGE (package), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ if (g_strcmp0 (priv->package_id, package_id) == 0)
+ return TRUE;
+
/* free old data */
g_free (priv->package_id);
g_free (priv->package_id_data);
@@ -178,7 +188,7 @@ pk_package_set_id (PkPackage *package, const gchar *package_id, GError **error)
* and reference the pointers in the const gchar * array */
priv->package_id = g_strdup (package_id);
priv->package_id_data = g_strdup (package_id);
- priv->package_id_split[0] = priv->package_id_data;
+ priv->package_id_split[PK_PACKAGE_ID_NAME] = priv->package_id_data;
for (i = 0; priv->package_id_data[i] != '\0'; i++) {
if (package_id[i] == ';') {
if (++cnt > 3)
@@ -188,19 +198,27 @@ pk_package_set_id (PkPackage *package, const gchar *package_id, GError **error)
}
}
if (cnt != 3) {
- ret = FALSE;
g_set_error (error, 1, 0, "invalid number of sections %i", cnt);
goto out;
}
/* name has to be valid */
- ret = (priv->package_id_split[0][0] != '\0');
- if (!ret) {
+ if (priv->package_id_split[PK_PACKAGE_ID_NAME][0] == '\0') {
g_set_error_literal (error, 1, 0, "name invalid");
goto out;
}
+
+ g_object_notify_by_pspec (G_OBJECT(package), obj_properties[PROP_PACKAGE_ID]);
+ return TRUE;
+
out:
- return ret;
+ g_clear_pointer (&priv->package_id, g_free);
+ g_clear_pointer (&priv->package_id_data, g_free);
+ priv->package_id_split[PK_PACKAGE_ID_NAME] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_VERSION] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_ARCH] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_DATA] = NULL;
+ return FALSE;
}
/**
@@ -211,7 +229,7 @@ pk_package_set_id (PkPackage *package, const gchar *package_id, GError **error)
*
* Parses the data to populate the #PkPackage.
*
- * Return value: %TRUE if the data was parsed correcty
+ * Returns: %TRUE if the data was parsed correctly
*
* Since: 0.8.11
**/
@@ -231,11 +249,11 @@ pk_package_parse (PkPackage *package, const gchar *data, GError **error)
}
/* parse object */
- package->priv->info = pk_info_enum_from_string (sections[0]);
+ pk_package_set_info (package, pk_info_enum_from_string (sections[0]));
if (!pk_package_set_id (package, sections[1], error))
return FALSE;
- g_free (package->priv->summary);
- package->priv->summary = g_strdup (sections[2]);
+
+ pk_package_set_summary (package, sections[2]);
return TRUE;
}
@@ -245,15 +263,18 @@ pk_package_parse (PkPackage *package, const gchar *data, GError **error)
*
* Gets the package object ID
*
- * Return value: the #PkInfoEnum
+ * Returns: the #PkInfoEnum
*
* Since: 0.5.4
**/
PkInfoEnum
pk_package_get_info (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), FALSE);
- return package->priv->info;
+
+ return priv->info;
}
/**
@@ -268,8 +289,15 @@ pk_package_get_info (PkPackage *package)
void
pk_package_set_info (PkPackage *package, PkInfoEnum info)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_if_fail (PK_IS_PACKAGE (package));
- package->priv->info = info;
+
+ if (priv->info == info)
+ return;
+
+ priv->info = info;
+ g_object_notify_by_pspec (G_OBJECT(package), obj_properties[PROP_INFO]);
}
/**
@@ -284,9 +312,16 @@ pk_package_set_info (PkPackage *package, PkInfoEnum info)
void
pk_package_set_summary (PkPackage *package, const gchar *summary)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_if_fail (PK_IS_PACKAGE (package));
- g_free (package->priv->summary);
- package->priv->summary = g_strdup (summary);
+
+ if (g_strcmp0 (priv->summary, summary) == 0)
+ return;
+
+ g_free (priv->summary);
+ priv->summary = g_strdup (summary);
+ g_object_notify_by_pspec (G_OBJECT(package), obj_properties[PROP_SUMMARY]);
}
/**
@@ -295,15 +330,18 @@ pk_package_set_summary (PkPackage *package, const gchar *summary)
*
* Gets the package object ID
*
- * Return value: the ID, or %NULL if unset
+ * Returns: (nullable): the ID, or %NULL if unset
*
* Since: 0.5.4
**/
const gchar *
pk_package_get_id (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->package_id;
+
+ return priv->package_id;
}
/**
@@ -312,15 +350,18 @@ pk_package_get_id (PkPackage *package)
*
* Gets the package object ID
*
- * Return value: the summary, or %NULL if unset
+ * Returns: (nullable): the summary, or %NULL if unset
*
* Since: 0.5.4
**/
const gchar *
pk_package_get_summary (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->summary;
+
+ return priv->summary;
}
/**
@@ -329,15 +370,18 @@ pk_package_get_summary (PkPackage *package)
*
* Gets the package name.
*
- * Return value: the name, or %NULL if unset
+ * Returns: (nullable): the name, or %NULL if unset
*
* Since: 0.6.4
**/
const gchar *
pk_package_get_name (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->package_id_split[PK_PACKAGE_ID_NAME];
+
+ return priv->package_id_split[PK_PACKAGE_ID_NAME];
}
/**
@@ -346,15 +390,18 @@ pk_package_get_name (PkPackage *package)
*
* Gets the package version.
*
- * Return value: the version, or %NULL if unset
+ * Returns: (nullable): the version, or %NULL if unset
*
* Since: 0.6.4
**/
const gchar *
pk_package_get_version (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->package_id_split[PK_PACKAGE_ID_VERSION];
+
+ return priv->package_id_split[PK_PACKAGE_ID_VERSION];
}
/**
@@ -363,15 +410,18 @@ pk_package_get_version (PkPackage *package)
*
* Gets the package arch.
*
- * Return value: the arch, or %NULL if unset
+ * Returns: (nullable): the arch, or %NULL if unset
*
* Since: 0.6.4
**/
const gchar *
pk_package_get_arch (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->package_id_split[PK_PACKAGE_ID_ARCH];
+
+ return priv->package_id_split[PK_PACKAGE_ID_ARCH];
}
/**
@@ -382,15 +432,18 @@ pk_package_get_arch (PkPackage *package)
* package. Special ID's include "installed" for installed packages, and "local"
* for local packages that exist on disk but not in a repository.
*
- * Return value: the data, or %NULL if unset
+ * Returns: (nullable): the data, or %NULL if unset
*
* Since: 0.6.4
**/
const gchar *
pk_package_get_data (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), NULL);
- return package->priv->package_id_split[PK_PACKAGE_ID_DATA];
+
+ return priv->package_id_split[PK_PACKAGE_ID_DATA];
}
/**
@@ -404,14 +457,16 @@ pk_package_get_data (PkPackage *package)
void
pk_package_print (PkPackage *package)
{
- PkPackagePrivate *priv = package->priv;
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_if_fail (PK_IS_PACKAGE (package));
+
g_print ("%s-%s.%s\t%s\t%s\n",
priv->package_id_split[PK_PACKAGE_ID_NAME],
priv->package_id_split[PK_PACKAGE_ID_VERSION],
priv->package_id_split[PK_PACKAGE_ID_ARCH],
priv->package_id_split[PK_PACKAGE_ID_DATA],
- package->priv->summary);
+ priv->summary);
}
/*
@@ -421,7 +476,7 @@ static void
pk_package_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkPackage *package = PK_PACKAGE (object);
- PkPackagePrivate *priv = package->priv;
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
switch (prop_id) {
case PROP_PACKAGE_ID:
@@ -497,40 +552,41 @@ static void
pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
PkPackage *package = PK_PACKAGE (object);
- PkPackagePrivate *priv = package->priv;
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
switch (prop_id) {
case PROP_INFO:
- pk_package_set_info (package, g_value_get_enum (value));
+ priv->info = g_value_get_enum (value);
break;
case PROP_SUMMARY:
- pk_package_set_summary (package, g_value_get_string (value));
+ g_free (priv->summary);
+ priv->summary = g_value_dup_string (value);
break;
case PROP_LICENSE:
g_free (priv->license);
- priv->license = g_strdup (g_value_get_string (value));
+ priv->license = g_value_dup_string (value);
break;
case PROP_GROUP:
priv->group = g_value_get_enum (value);
break;
case PROP_DESCRIPTION:
g_free (priv->description);
- priv->description = g_strdup (g_value_get_string (value));
+ priv->description = g_value_dup_string (value);
break;
case PROP_URL:
g_free (priv->url);
- priv->url = g_strdup (g_value_get_string (value));
+ priv->url = g_value_dup_string (value);
break;
case PROP_SIZE:
priv->size = g_value_get_uint64 (value);
break;
case PROP_UPDATE_UPDATES:
g_free (priv->update_updates);
- priv->update_updates = g_strdup (g_value_get_string (value));
+ priv->update_updates = g_value_dup_string (value);
break;
case PROP_UPDATE_OBSOLETES:
g_free (priv->update_obsoletes);
- priv->update_obsoletes = g_strdup (g_value_get_string (value));
+ priv->update_obsoletes = g_value_dup_string (value);
break;
case PROP_UPDATE_VENDOR_URLS:
g_strfreev (priv->update_vendor_urls);
@@ -549,22 +605,22 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
break;
case PROP_UPDATE_UPDATE_TEXT:
g_free (priv->update_text);
- priv->update_text = g_strdup (g_value_get_string (value));
+ priv->update_text = g_value_dup_string (value);
break;
case PROP_UPDATE_CHANGELOG:
g_free (priv->update_changelog);
- priv->update_changelog = g_strdup (g_value_get_string (value));
+ priv->update_changelog = g_value_dup_string (value);
break;
case PROP_UPDATE_STATE:
priv->update_state = g_value_get_enum (value);
break;
case PROP_UPDATE_ISSUED:
g_free (priv->update_issued);
- priv->update_issued = g_strdup (g_value_get_string (value));
+ priv->update_issued = g_value_dup_string (value);
break;
case PROP_UPDATE_UPDATED:
g_free (priv->update_updated);
- priv->update_updated = g_strdup (g_value_get_string (value));
+ priv->update_updated = g_value_dup_string (value);
break;
case PROP_UPDATE_SEVERITY:
pk_package_set_update_severity (package, g_value_get_enum (value));
@@ -581,7 +637,6 @@ pk_package_set_property (GObject *object, guint prop_id, const GValue *value, GP
static void
pk_package_class_init (PkPackageClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = pk_package_get_property;
object_class->set_property = pk_package_set_property;
@@ -592,223 +647,227 @@ pk_package_class_init (PkPackageClass *klass)
*
* Since: 0.5.4
*/
- pspec = g_param_spec_enum ("info", NULL,
+ obj_properties[PROP_INFO] =
+ g_param_spec_enum ("info", NULL,
"The PkInfoEnum package type, e.g. PK_INFO_ENUM_NORMAL",
PK_TYPE_INFO_ENUM, PK_INFO_ENUM_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_INFO, pspec);
/**
* PkPackage:package-id:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("package-id", NULL,
+ obj_properties[PROP_PACKAGE_ID] =
+ g_param_spec_string ("package-id", NULL,
"The full package_id, e.g. 'gnome-power-manager;0.1.2;i386;fedora'",
NULL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PACKAGE_ID, pspec);
/**
* PkPackage:summary:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("summary", NULL,
+ obj_properties[PROP_SUMMARY] =
+ g_param_spec_string ("summary", NULL,
"The package summary",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SUMMARY, pspec);
/**
* PkPackage:license:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("license", NULL,
+ obj_properties[PROP_LICENSE] =
+ g_param_spec_string ("license", NULL,
"The package license",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_LICENSE, pspec);
/**
* PkPackage:group:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_enum ("group", NULL,
+ obj_properties[PROP_GROUP] =
+ g_param_spec_enum ("group", NULL,
"The package group",
PK_TYPE_GROUP_ENUM, PK_GROUP_ENUM_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_GROUP, pspec);
/**
* PkPackage:description:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("description", NULL,
+ obj_properties[PROP_DESCRIPTION] =
+ g_param_spec_string ("description", NULL,
"The package description",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_DESCRIPTION, pspec);
/**
* PkPackage:url:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("url", NULL,
+ obj_properties[PROP_URL] =
+ g_param_spec_string ("url", NULL,
"The package homepage URL",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_URL, pspec);
/**
* PkPackage:size:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_uint64 ("size", NULL,
+ obj_properties[PROP_SIZE] =
+ g_param_spec_uint64 ("size", NULL,
"The package size",
0, G_MAXUINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SIZE, pspec);
/**
* PkPackage:update-updates:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-updates", NULL,
+ obj_properties[PROP_UPDATE_UPDATES] =
+ g_param_spec_string ("update-updates", NULL,
"The update packages",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_UPDATES, pspec);
/**
* PkPackage:update-obsoletes:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-obsoletes", NULL,
+ obj_properties[PROP_UPDATE_OBSOLETES] =
+ g_param_spec_string ("update-obsoletes", NULL,
"The update packages that are obsoleted",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_OBSOLETES, pspec);
/**
* PkPackage:update-vendor-urls:
*
* Since: 0.8.1
*/
- pspec = g_param_spec_boxed ("update-vendor-urls", NULL,
+ obj_properties[PROP_UPDATE_VENDOR_URLS] =
+ g_param_spec_boxed ("update-vendor-urls", NULL,
"The update vendor URLs",
G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_VENDOR_URLS, pspec);
/**
* PkPackage:update-bugzilla-urls:
*
* Since: 0.8.1
*/
- pspec = g_param_spec_boxed ("update-bugzilla-urls", NULL,
+ obj_properties[PROP_UPDATE_BUGZILLA_URLS] =
+ g_param_spec_boxed ("update-bugzilla-urls", NULL,
"The update bugzilla URLs",
G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_BUGZILLA_URLS, pspec);
/**
* PkPackage:update-cve-urls:
*
* Since: 0.8.1
*/
- pspec = g_param_spec_boxed ("update-cve-urls", NULL,
+ obj_properties[PROP_UPDATE_CVE_URLS] =
+ g_param_spec_boxed ("update-cve-urls", NULL,
"The update CVE URLs",
G_TYPE_STRV,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_CVE_URLS, pspec);
/**
* PkPackage:update-restart:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_enum ("update-restart", NULL,
+ obj_properties[PROP_UPDATE_RESTART] =
+ g_param_spec_enum ("update-restart", NULL,
"The update restart type",
PK_TYPE_RESTART_ENUM, PK_RESTART_ENUM_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_RESTART, pspec);
/**
* PkPackage:update-text:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-text", NULL,
+ obj_properties[PROP_UPDATE_UPDATE_TEXT] =
+ g_param_spec_string ("update-text", NULL,
"The update description",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_UPDATE_TEXT, pspec);
/**
* PkPackage:update-changelog:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-changelog", NULL,
+ obj_properties[PROP_UPDATE_CHANGELOG] =
+ g_param_spec_string ("update-changelog", NULL,
"The update ChangeLog",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_CHANGELOG, pspec);
/**
* PkPackage:update-state:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_enum ("update-state", NULL,
+ obj_properties[PROP_UPDATE_STATE] =
+ g_param_spec_enum ("update-state", NULL,
"The update state",
PK_TYPE_UPDATE_STATE_ENUM, PK_UPDATE_STATE_ENUM_UNKNOWN,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_STATE, pspec);
/**
* PkPackage:update-issued:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-issued", NULL,
+ obj_properties[PROP_UPDATE_ISSUED] =
+ g_param_spec_string ("update-issued", NULL,
"When the update was issued",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_ISSUED, pspec);
/**
* PkPackage:update-updated:
*
* Since: 0.5.4
*/
- pspec = g_param_spec_string ("update-updated", NULL,
+ obj_properties[PROP_UPDATE_UPDATED] =
+ g_param_spec_string ("update-updated", NULL,
"When the update was last updated",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_UPDATED, pspec);
/**
* PkPackage:update-severity:
*
- * Can be one of %PK_INFO_ENUM_UNKNOWN, %PK_INFO_ENUM_LOW, %PK_INFO_ENUM_NORMAL,
- * %PK_INFO_ENUM_IMPORTANT or %PK_INFO_ENUM_CRITICAL.
+ * Can be one of %PK_INFO_ENUM_UNKNOWN, %PK_INFO_ENUM_LOW,
+ * %PK_INFO_ENUM_ENHANCEMENT, %PK_INFO_ENUM_NORMAL,
+ * %PK_INFO_ENUM_BUGFIX, %PK_INFO_ENUM_IMPORTANT,
+ * %PK_INFO_ENUM_SECURITY or %PK_INFO_ENUM_CRITICAL.
*
* Since: 1.2.4
*/
- pspec = g_param_spec_enum ("update-severity", NULL,
+ obj_properties[PROP_UPDATE_SEVERITY] =
+ g_param_spec_enum ("update-severity", NULL,
"Package update severity",
PK_TYPE_INFO_ENUM, PK_INFO_ENUM_UNKNOWN,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UPDATE_SEVERITY, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
+
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
/**
* PkPackage::changed:
@@ -822,8 +881,6 @@ pk_package_class_init (PkPackageClass *klass)
G_STRUCT_OFFSET (PkPackageClass, changed),
NULL, NULL, g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
-
- g_type_class_add_private (klass, sizeof (PkPackagePrivate));
}
/*
@@ -833,11 +890,12 @@ pk_package_class_init (PkPackageClass *klass)
static void
pk_package_init (PkPackage *package)
{
- package->priv = PK_PACKAGE_GET_PRIVATE (package);
- package->priv->package_id_split[PK_PACKAGE_ID_NAME] = NULL;
- package->priv->package_id_split[PK_PACKAGE_ID_VERSION] = NULL;
- package->priv->package_id_split[PK_PACKAGE_ID_ARCH] = NULL;
- package->priv->package_id_split[PK_PACKAGE_ID_DATA] = NULL;
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+ priv->package_id_split[PK_PACKAGE_ID_NAME] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_VERSION] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_ARCH] = NULL;
+ priv->package_id_split[PK_PACKAGE_ID_DATA] = NULL;
+ package->priv = priv;
}
/*
@@ -848,23 +906,23 @@ static void
pk_package_finalize (GObject *object)
{
PkPackage *package = PK_PACKAGE (object);
- PkPackagePrivate *priv = package->priv;
-
- g_free (priv->package_id);
- g_free (priv->summary);
- g_free (priv->license);
- g_free (priv->description);
- g_free (priv->url);
- g_free (priv->update_updates);
- g_free (priv->update_obsoletes);
- g_strfreev (priv->update_vendor_urls);
- g_strfreev (priv->update_bugzilla_urls);
- g_strfreev (priv->update_cve_urls);
- g_free (priv->update_text);
- g_free (priv->update_changelog);
- g_free (priv->update_issued);
- g_free (priv->update_updated);
- g_free (priv->package_id_data);
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
+ g_clear_pointer (&priv->package_id, g_free);
+ g_clear_pointer (&priv->summary, g_free);
+ g_clear_pointer (&priv->license, g_free);
+ g_clear_pointer (&priv->description, g_free);
+ g_clear_pointer (&priv->url, g_free);
+ g_clear_pointer (&priv->update_updates, g_free);
+ g_clear_pointer (&priv->update_obsoletes, g_free);
+ g_clear_pointer (&priv->update_vendor_urls, g_strfreev);
+ g_clear_pointer (&priv->update_bugzilla_urls, g_strfreev);
+ g_clear_pointer (&priv->update_cve_urls, g_strfreev);
+ g_clear_pointer (&priv->update_text, g_free);
+ g_clear_pointer (&priv->update_changelog, g_free);
+ g_clear_pointer (&priv->update_issued, g_free);
+ g_clear_pointer (&priv->update_updated, g_free);
+ g_clear_pointer (&priv->package_id_data, g_free);
G_OBJECT_CLASS (pk_package_parent_class)->finalize (object);
}
@@ -872,7 +930,7 @@ pk_package_finalize (GObject *object)
/**
* pk_package_new:
*
- * Return value: a new #PkPackage object.
+ * Returns: a new #PkPackage object.
*
* Since: 0.5.4
**/
@@ -888,9 +946,11 @@ pk_package_new (void)
* pk_package_get_update_severity:
* @package: a #PkPackage
*
- * Returns the @package update severity. Can be one of %PK_INFO_ENUM_UNKNOWN,
- * %PK_INFO_ENUM_LOW, %PK_INFO_ENUM_NORMAL, %PK_INFO_ENUM_IMPORTANT or
- * %PK_INFO_ENUM_CRITICAL.
+ * Returns the @package update severity. Can be one of
+ * %PK_INFO_ENUM_UNKNOWN, %PK_INFO_ENUM_LOW,
+ * %PK_INFO_ENUM_ENHANCEMENT, %PK_INFO_ENUM_NORMAL,
+ * %PK_INFO_ENUM_BUGFIX, %PK_INFO_ENUM_IMPORTANT,
+ * %PK_INFO_ENUM_SECURITY or %PK_INFO_ENUM_CRITICAL.
*
* Returns: the @package update severity, if known.
*
@@ -899,9 +959,11 @@ pk_package_new (void)
PkInfoEnum
pk_package_get_update_severity (PkPackage *package)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_val_if_fail (PK_IS_PACKAGE (package), PK_INFO_ENUM_UNKNOWN);
- return package->priv->update_severity;
+ return priv->update_severity;
}
/**
@@ -909,9 +971,11 @@ pk_package_get_update_severity (PkPackage *package)
* @package: a #PkPackage
* @update_severity: a #PkInfoEnum
*
- * Set an update severity for the @package. The @update_severity can be
- * one of %PK_INFO_ENUM_UNKNOWN, %PK_INFO_ENUM_LOW, %PK_INFO_ENUM_NORMAL,
- * %PK_INFO_ENUM_IMPORTANT or %PK_INFO_ENUM_CRITICAL.
+ * Set an update severity for the @package. The @update_severity can
+ * be one of %PK_INFO_ENUM_UNKNOWN, %PK_INFO_ENUM_LOW,
+ * %PK_INFO_ENUM_ENHANCEMENT, %PK_INFO_ENUM_NORMAL,
+ * %PK_INFO_ENUM_BUGFIX, %PK_INFO_ENUM_IMPORTANT,
+ * %PK_INFO_ENUM_SECURITY or %PK_INFO_ENUM_CRITICAL.
*
* Since: 1.2.4
**/
@@ -919,17 +983,21 @@ void
pk_package_set_update_severity (PkPackage *package,
PkInfoEnum update_severity)
{
+ PkPackagePrivate *priv = pk_package_get_instance_private (package);
+
g_return_if_fail (PK_IS_PACKAGE (package));
g_return_if_fail (update_severity == PK_INFO_ENUM_UNKNOWN ||
update_severity == PK_INFO_ENUM_LOW ||
+ update_severity == PK_INFO_ENUM_ENHANCEMENT ||
update_severity == PK_INFO_ENUM_NORMAL ||
+ update_severity == PK_INFO_ENUM_BUGFIX ||
update_severity == PK_INFO_ENUM_IMPORTANT ||
+ update_severity == PK_INFO_ENUM_SECURITY ||
update_severity == PK_INFO_ENUM_CRITICAL);
- if (package->priv->update_severity == update_severity)
+ if (priv->update_severity == update_severity)
return;
- package->priv->update_severity = update_severity;
-
- g_object_notify (G_OBJECT (package), "update-severity");
+ priv->update_severity = update_severity;
+ g_object_notify_by_pspec (G_OBJECT(package), obj_properties[PROP_UPDATE_SEVERITY]);
}
diff --git a/lib/packagekit-glib2/pk-progress-bar.c b/lib/packagekit-glib2/pk-progress-bar.c
index fc5c8c1..748d70d 100644
--- a/lib/packagekit-glib2/pk-progress-bar.c
+++ b/lib/packagekit-glib2/pk-progress-bar.c
@@ -22,6 +22,8 @@
#include "config.h"
#include
+#include
+#include
#include
#include
#include
@@ -131,10 +133,13 @@ pk_progress_bar_draw (PkProgressBar *self, gint percentage)
for (i = 0; i < self->priv->size - section; i++)
g_string_append (str, " ");
g_string_append (str, "] ");
- if (percentage >= 0 && percentage < 100)
- g_string_append_printf (str, "(%i%%) ", percentage);
- else
+ if (percentage >= 0 && percentage < 100) {
+ /* TRANSLATORS: this is a percentage value we use in messages, e.g. "90%. */
+ g_string_append_printf (str, _("(%i%%)"), percentage);
+ g_string_append_printf (str, " ");
+ } else {
g_string_append (str, " ");
+ }
pk_progress_bar_console (self, str->str);
g_string_free (str, TRUE);
return TRUE;
@@ -172,10 +177,13 @@ pk_progress_bar_pulse_bar (PkProgressBar *self)
for (i = 0; i < (gint) (self->priv->size - self->priv->pulse_state.position - 1); i++)
g_string_append (str, " ");
g_string_append (str, "] ");
- if (self->priv->percentage >= 0 && self->priv->percentage != PK_PROGRESS_BAR_PERCENTAGE_INVALID)
- g_string_append_printf (str, "(%i%%) ", self->priv->percentage);
- else
+ if (self->priv->percentage >= 0 && self->priv->percentage != PK_PROGRESS_BAR_PERCENTAGE_INVALID) {
+ /* TRANSLATORS: this is a percentage value we use in messages, e.g. "90%. */
+ g_string_append_printf (str, _("(%i%%)"), self->priv->percentage);
+ g_string_append_printf (str, " ");
+ } else {
g_string_append (str, " ");
+ }
pk_progress_bar_console (self, str->str);
g_string_free (str, TRUE);
diff --git a/lib/packagekit-glib2/pk-progress-private.h b/lib/packagekit-glib2/pk-progress-private.h
new file mode 100644
index 0000000..45763de
--- /dev/null
+++ b/lib/packagekit-glib2/pk-progress-private.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2025 Corentin Noël
+ *
+ * Licensed under the GNU Lesser General Public License Version 2.1
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#if !defined (__PACKAGEKIT_H_INSIDE__) && !defined (PK_COMPILATION)
+#error "Only can be included directly."
+#endif
+
+#ifndef __PK_PROGRESS_PRIVATE_H
+#define __PK_PROGRESS_PRIVATE_H
+
+#include
+#include
+
+G_BEGIN_DECLS
+
+PkProgress *pk_progress_new_with_callback (PkProgressCallback callback,
+ gpointer user_data);
+
+G_END_DECLS
+
+#endif /* __PK_PROGRESS_PRIVATE_H */
diff --git a/lib/packagekit-glib2/pk-progress.c b/lib/packagekit-glib2/pk-progress.c
index eea5109..19efdff 100644
--- a/lib/packagekit-glib2/pk-progress.c
+++ b/lib/packagekit-glib2/pk-progress.c
@@ -32,11 +32,11 @@
#include
#include
#include
+#include
+static void pk_progress_dispose (GObject *object);
static void pk_progress_finalize (GObject *object);
-#define PK_PROGRESS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_PROGRESS, PkProgressPrivate))
-
/**
* PkProgressPrivate:
*
@@ -60,6 +60,8 @@ struct _PkProgressPrivate
gchar *sender;
PkItemProgress *item_progress;
PkPackage *package;
+ PkProgressCallback callback;
+ gpointer callback_user_data;
};
enum {
@@ -83,7 +85,9 @@ enum {
PROP_LAST
};
-G_DEFINE_TYPE (PkProgress, pk_progress, G_TYPE_OBJECT)
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
+
+G_DEFINE_TYPE_WITH_PRIVATE (PkProgress, pk_progress, G_TYPE_OBJECT)
/*
* pk_progress_get_property:
@@ -92,55 +96,56 @@ static void
pk_progress_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkProgress *progress = PK_PROGRESS (object);
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
switch (prop_id) {
case PROP_PACKAGE_ID:
- g_value_set_string (value, progress->priv->package_id);
+ g_value_set_string (value, priv->package_id);
break;
case PROP_TRANSACTION_ID:
- g_value_set_string (value, progress->priv->transaction_id);
+ g_value_set_string (value, priv->transaction_id);
break;
case PROP_PERCENTAGE:
- g_value_set_int (value, progress->priv->percentage);
+ g_value_set_int (value, priv->percentage);
break;
case PROP_ITEM_PROGRESS:
- g_value_set_object (value, progress->priv->item_progress);
+ g_value_set_object (value, priv->item_progress);
break;
case PROP_ALLOW_CANCEL:
- g_value_set_boolean (value, progress->priv->allow_cancel);
+ g_value_set_boolean (value, priv->allow_cancel);
break;
case PROP_STATUS:
- g_value_set_uint (value, progress->priv->status);
+ g_value_set_uint (value, priv->status);
break;
case PROP_ROLE:
- g_value_set_uint (value, progress->priv->role);
+ g_value_set_uint (value, priv->role);
break;
case PROP_CALLER_ACTIVE:
- g_value_set_boolean (value, progress->priv->caller_active);
+ g_value_set_boolean (value, priv->caller_active);
break;
case PROP_ELAPSED_TIME:
- g_value_set_uint (value, progress->priv->elapsed_time);
+ g_value_set_uint (value, priv->elapsed_time);
break;
case PROP_REMAINING_TIME:
- g_value_set_uint (value, progress->priv->remaining_time);
+ g_value_set_uint (value, priv->remaining_time);
break;
case PROP_SPEED:
- g_value_set_uint (value, progress->priv->speed);
+ g_value_set_uint (value, priv->speed);
break;
case PROP_DOWNLOAD_SIZE_REMAINING:
- g_value_set_uint64 (value, progress->priv->download_size_remaining);
+ g_value_set_uint64 (value, priv->download_size_remaining);
break;
case PROP_TRANSACTION_FLAGS:
- g_value_set_uint64 (value, progress->priv->transaction_flags);
+ g_value_set_uint64 (value, priv->transaction_flags);
break;
case PROP_UID:
- g_value_set_uint (value, progress->priv->uid);
+ g_value_set_uint (value, priv->uid);
break;
case PROP_SENDER:
- g_value_set_string (value, progress->priv->sender);
+ g_value_set_string (value, priv->sender);
break;
case PROP_PACKAGE:
- g_value_set_object (value, progress->priv->package);
+ g_value_set_object (value, priv->package);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -148,6 +153,17 @@ pk_progress_get_property (GObject *object, guint prop_id, GValue *value, GParamS
}
}
+static inline void
+pk_progress_invoke_callback (PkProgress *progress, PkProgressType type)
+{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
+ g_assert (PK_IS_PROGRESS (progress));
+
+ if (priv->callback)
+ priv->callback (progress, type, priv->callback_user_data);
+}
+
/**
* pk_progress_set_package_id:
* @progress: a valid #PkProgress instance
@@ -162,10 +178,12 @@ pk_progress_get_property (GObject *object, guint prop_id, GValue *value, GParamS
gboolean
pk_progress_set_package_id (PkProgress *progress, const gchar *package_id)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (g_strcmp0 (progress->priv->package_id, package_id) == 0)
+ if (g_strcmp0 (priv->package_id, package_id) == 0)
return FALSE;
/* valid? */
@@ -175,9 +193,10 @@ pk_progress_set_package_id (PkProgress *progress, const gchar *package_id)
}
/* new value */
- g_free (progress->priv->package_id);
- progress->priv->package_id = g_strdup (package_id);
- g_object_notify (G_OBJECT(progress), "package-id");
+ g_free (priv->package_id);
+ priv->package_id = g_strdup (package_id);
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_PACKAGE_ID]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_PACKAGE_ID);
return TRUE;
}
@@ -195,8 +214,11 @@ pk_progress_set_package_id (PkProgress *progress, const gchar *package_id)
const gchar *
pk_progress_get_package_id (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), NULL);
- return progress->priv->package_id;
+
+ return priv->package_id;
}
/**
@@ -214,18 +236,17 @@ gboolean
pk_progress_set_item_progress (PkProgress *progress,
PkItemProgress *item_progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
- /* the same as before? */
- if (progress->priv->item_progress == item_progress)
- return FALSE;
+ if (g_set_object (&priv->item_progress, item_progress)) {
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_ITEM_PROGRESS]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_ITEM_PROGRESS);
+ return TRUE;
+ }
- /* new value */
- if (progress->priv->item_progress != NULL)
- g_object_unref (progress->priv->item_progress);
- progress->priv->item_progress = g_object_ref (item_progress);
- g_object_notify (G_OBJECT(progress), "item-progress");
- return TRUE;
+ return FALSE;
}
/**
@@ -241,8 +262,11 @@ pk_progress_set_item_progress (PkProgress *progress,
PkItemProgress *
pk_progress_get_item_progress (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), NULL);
- return progress->priv->item_progress;
+
+ return priv->item_progress;
}
/**
@@ -259,16 +283,19 @@ pk_progress_get_item_progress (PkProgress *progress)
gboolean
pk_progress_set_transaction_id (PkProgress *progress, const gchar *transaction_id)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (g_strcmp0 (progress->priv->transaction_id, transaction_id) == 0)
+ if (g_strcmp0 (priv->transaction_id, transaction_id) == 0)
return FALSE;
/* new value */
- g_free (progress->priv->transaction_id);
- progress->priv->transaction_id = g_strdup (transaction_id);
- g_object_notify (G_OBJECT(progress), "transaction-id");
+ g_free (priv->transaction_id);
+ priv->transaction_id = g_strdup (transaction_id);
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_TRANSACTION_ID]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_TRANSACTION_ID);
return TRUE;
}
@@ -286,8 +313,11 @@ pk_progress_set_transaction_id (PkProgress *progress, const gchar *transaction_i
const gchar *
pk_progress_get_transaction_id (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), NULL);
- return progress->priv->transaction_id;
+
+ return priv->transaction_id;
}
/**
@@ -304,15 +334,18 @@ pk_progress_get_transaction_id (PkProgress *progress)
gboolean
pk_progress_set_percentage (PkProgress *progress, gint percentage)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->percentage == percentage)
+ if (priv->percentage == percentage)
return FALSE;
/* new value */
- progress->priv->percentage = percentage;
- g_object_notify (G_OBJECT(progress), "percentage");
+ priv->percentage = percentage;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_PERCENTAGE]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_PERCENTAGE);
return TRUE;
}
@@ -330,8 +363,11 @@ pk_progress_set_percentage (PkProgress *progress, gint percentage)
gint
pk_progress_get_percentage (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), -1);
- return progress->priv->percentage;
+
+ return priv->percentage;
}
/**
@@ -348,15 +384,18 @@ pk_progress_get_percentage (PkProgress *progress)
gboolean
pk_progress_set_status (PkProgress *progress, PkStatusEnum status)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->status == status)
+ if (priv->status == status)
return FALSE;
/* new value */
- progress->priv->status = status;
- g_object_notify (G_OBJECT(progress), "status");
+ priv->status = status;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_STATUS]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_STATUS);
return TRUE;
}
@@ -374,8 +413,11 @@ pk_progress_set_status (PkProgress *progress, PkStatusEnum status)
PkStatusEnum
pk_progress_get_status (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), PK_STATUS_ENUM_UNKNOWN);
- return progress->priv->status;
+
+ return priv->status;
}
/**
@@ -392,6 +434,8 @@ pk_progress_get_status (PkProgress *progress)
gboolean
pk_progress_set_role (PkProgress *progress, PkRoleEnum role)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* ignore unknown as we don't want to replace a valid value */
@@ -399,13 +443,14 @@ pk_progress_set_role (PkProgress *progress, PkRoleEnum role)
return FALSE;
/* the same as before? */
- if (progress->priv->role == role)
+ if (priv->role == role)
return FALSE;
/* new value */
- progress->priv->role = role;
+ priv->role = role;
g_debug ("role now %s", pk_role_enum_to_string (role));
- g_object_notify (G_OBJECT(progress), "role");
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_ROLE]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_ROLE);
return TRUE;
}
@@ -423,8 +468,11 @@ pk_progress_set_role (PkProgress *progress, PkRoleEnum role)
PkRoleEnum
pk_progress_get_role (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), PK_ROLE_ENUM_UNKNOWN);
- return progress->priv->role;
+
+ return priv->role;
}
/**
@@ -441,15 +489,18 @@ pk_progress_get_role (PkProgress *progress)
gboolean
pk_progress_set_allow_cancel (PkProgress *progress, gboolean allow_cancel)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->allow_cancel == allow_cancel)
+ if (priv->allow_cancel == allow_cancel)
return FALSE;
/* new value */
- progress->priv->allow_cancel = allow_cancel;
- g_object_notify (G_OBJECT(progress), "allow-cancel");
+ priv->allow_cancel = allow_cancel;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_ALLOW_CANCEL]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_ALLOW_CANCEL);
return TRUE;
}
@@ -467,8 +518,11 @@ pk_progress_set_allow_cancel (PkProgress *progress, gboolean allow_cancel)
gboolean
pk_progress_get_allow_cancel (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
- return progress->priv->allow_cancel;
+
+ return priv->allow_cancel;
}
/**
@@ -485,15 +539,18 @@ pk_progress_get_allow_cancel (PkProgress *progress)
gboolean
pk_progress_set_caller_active (PkProgress *progress, gboolean caller_active)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->caller_active == caller_active)
+ if (priv->caller_active == caller_active)
return FALSE;
/* new value */
- progress->priv->caller_active = caller_active;
- g_object_notify (G_OBJECT(progress), "caller-active");
+ priv->caller_active = caller_active;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_CALLER_ACTIVE]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_CALLER_ACTIVE);
return TRUE;
}
@@ -511,8 +568,11 @@ pk_progress_set_caller_active (PkProgress *progress, gboolean caller_active)
gboolean
pk_progress_get_caller_active (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
- return progress->priv->caller_active;
+
+ return priv->caller_active;
}
/**
@@ -529,15 +589,18 @@ pk_progress_get_caller_active (PkProgress *progress)
gboolean
pk_progress_set_elapsed_time (PkProgress *progress, guint elapsed_time)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->elapsed_time == elapsed_time)
+ if (priv->elapsed_time == elapsed_time)
return FALSE;
/* new value */
- progress->priv->elapsed_time = elapsed_time;
- g_object_notify (G_OBJECT(progress), "elapsed-time");
+ priv->elapsed_time = elapsed_time;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_ELAPSED_TIME]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_ELAPSED_TIME);
return TRUE;
}
@@ -555,8 +618,11 @@ pk_progress_set_elapsed_time (PkProgress *progress, guint elapsed_time)
guint
pk_progress_get_elapsed_time (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->elapsed_time;
+
+ return priv->elapsed_time;
}
/**
@@ -573,15 +639,18 @@ pk_progress_get_elapsed_time (PkProgress *progress)
gboolean
pk_progress_set_remaining_time (PkProgress *progress, guint remaining_time)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->remaining_time == remaining_time)
+ if (priv->remaining_time == remaining_time)
return FALSE;
/* new value */
- progress->priv->remaining_time = remaining_time;
- g_object_notify (G_OBJECT(progress), "remaining-time");
+ priv->remaining_time = remaining_time;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_REMAINING_TIME]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_REMAINING_TIME);
return TRUE;
}
@@ -599,8 +668,11 @@ pk_progress_set_remaining_time (PkProgress *progress, guint remaining_time)
guint
pk_progress_get_remaining_time (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->remaining_time;
+
+ return priv->remaining_time;
}
/**
@@ -617,15 +689,18 @@ pk_progress_get_remaining_time (PkProgress *progress)
gboolean
pk_progress_set_speed (PkProgress *progress, guint speed)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->speed == speed)
+ if (priv->speed == speed)
return FALSE;
/* new value */
- progress->priv->speed = speed;
- g_object_notify (G_OBJECT(progress), "speed");
+ priv->speed = speed;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_SPEED]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_SPEED);
return TRUE;
}
@@ -643,8 +718,11 @@ pk_progress_set_speed (PkProgress *progress, guint speed)
guint
pk_progress_get_speed (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->speed;
+
+ return priv->speed;
}
/**
@@ -661,15 +739,18 @@ pk_progress_get_speed (PkProgress *progress)
gboolean
pk_progress_set_download_size_remaining (PkProgress *progress, guint64 download_size_remaining)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->download_size_remaining == download_size_remaining)
+ if (priv->download_size_remaining == download_size_remaining)
return FALSE;
/* new value */
- progress->priv->download_size_remaining = download_size_remaining;
- g_object_notify (G_OBJECT(progress), "download-size-remaining");
+ priv->download_size_remaining = download_size_remaining;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_DOWNLOAD_SIZE_REMAINING]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_DOWNLOAD_SIZE_REMAINING);
return TRUE;
}
@@ -687,8 +768,11 @@ pk_progress_set_download_size_remaining (PkProgress *progress, guint64 download_
guint64
pk_progress_get_download_size_remaining (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->download_size_remaining;
+
+ return priv->download_size_remaining;
}
/**
@@ -705,15 +789,18 @@ pk_progress_get_download_size_remaining (PkProgress *progress)
gboolean
pk_progress_set_transaction_flags (PkProgress *progress, guint64 transaction_flags)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->transaction_flags == transaction_flags)
+ if (priv->transaction_flags == transaction_flags)
return FALSE;
/* new value */
- progress->priv->transaction_flags = transaction_flags;
- g_object_notify (G_OBJECT(progress), "transaction-flags");
+ priv->transaction_flags = transaction_flags;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_TRANSACTION_FLAGS]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_TRANSACTION_FLAGS);
return TRUE;
}
@@ -731,8 +818,11 @@ pk_progress_set_transaction_flags (PkProgress *progress, guint64 transaction_fla
guint64
pk_progress_get_transaction_flags (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->transaction_flags;
+
+ return priv->transaction_flags;
}
/**
@@ -749,15 +839,18 @@ pk_progress_get_transaction_flags (PkProgress *progress)
gboolean
pk_progress_set_uid (PkProgress *progress, guint uid)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (progress->priv->uid == uid)
+ if (priv->uid == uid)
return FALSE;
/* new value */
- progress->priv->uid = uid;
- g_object_notify (G_OBJECT(progress), "uid");
+ priv->uid = uid;
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_UID]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_UID);
return TRUE;
}
@@ -775,8 +868,11 @@ pk_progress_set_uid (PkProgress *progress, guint uid)
guint
pk_progress_get_uid (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), 0);
- return progress->priv->uid;
+
+ return priv->uid;
}
/**
@@ -793,16 +889,19 @@ pk_progress_get_uid (PkProgress *progress)
gboolean
pk_progress_set_sender (PkProgress *progress, const gchar *bus_name)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
/* the same as before? */
- if (g_strcmp0 (progress->priv->sender, bus_name) == 0)
+ if (g_strcmp0 (priv->sender, bus_name) == 0)
return FALSE;
/* new value */
- g_free (progress->priv->sender);
- progress->priv->sender = g_strdup (bus_name);
- g_object_notify (G_OBJECT(progress), "sender");
+ g_free (priv->sender);
+ priv->sender = g_strdup (bus_name);
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_SENDER]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_SENDER);
return TRUE;
}
@@ -820,8 +919,11 @@ pk_progress_set_sender (PkProgress *progress, const gchar *bus_name)
gchar*
pk_progress_get_sender (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), NULL);
- return progress->priv->sender;
+
+ return priv->sender;
}
/**
@@ -838,19 +940,17 @@ pk_progress_get_sender (PkProgress *progress)
gboolean
pk_progress_set_package (PkProgress *progress, PkPackage *package)
{
- g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
- /* the same as before? */
- if (progress->priv->package == package)
- return FALSE;
+ g_return_val_if_fail (PK_IS_PROGRESS (progress), FALSE);
- /* new value */
- if (progress->priv->package != NULL)
- g_object_unref (progress->priv->package);
- progress->priv->package = g_object_ref (package);
- g_object_notify (G_OBJECT(progress), "package");
+ if (g_set_object (&priv->package, package)) {
+ g_object_notify_by_pspec (G_OBJECT(progress), obj_properties[PROP_PACKAGE]);
+ pk_progress_invoke_callback (progress, PK_PROGRESS_TYPE_PACKAGE);
+ return TRUE;
+ }
- return TRUE;
+ return FALSE;
}
/**
@@ -866,8 +966,34 @@ pk_progress_set_package (PkProgress *progress, PkPackage *package)
PkPackage *
pk_progress_get_package (PkProgress *progress)
{
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
g_return_val_if_fail (PK_IS_PROGRESS (progress), NULL);
- return progress->priv->package;
+
+ return priv->package;
+}
+
+/**
+ * pk_progress_new_with_callback:
+ * @callback: (scope notified): the function to run when the progress changes
+ * @user_data: data to pass to @callback
+ *
+ * Create a progress with a callback function.
+ *
+ * Returns: (transfer full): a new #PkProgress
+ **/
+PkProgress *
+pk_progress_new_with_callback (PkProgressCallback callback, gpointer user_data)
+{
+ PkProgress *progress;
+ PkProgressPrivate *priv;
+
+ progress = pk_progress_new ();
+ priv = pk_progress_get_instance_private (progress);
+ priv->callback = callback;
+ priv->callback_user_data = user_data;
+
+ return progress;
}
/*
@@ -918,6 +1044,15 @@ pk_progress_set_property (GObject *object, guint prop_id, const GValue *value, G
case PROP_ITEM_PROGRESS:
pk_progress_set_item_progress (progress, g_value_get_object (value));
break;
+ case PROP_SENDER:
+ pk_progress_set_sender (progress, g_value_get_string (value));
+ break;
+ case PROP_DOWNLOAD_SIZE_REMAINING:
+ pk_progress_set_download_size_remaining (progress, g_value_get_uint64 (value));
+ break;
+ case PROP_TRANSACTION_FLAGS:
+ pk_progress_set_transaction_flags (progress, g_value_get_uint64 (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -930,24 +1065,24 @@ pk_progress_set_property (GObject *object, guint prop_id, const GValue *value, G
static void
pk_progress_class_init (PkProgressClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = pk_progress_get_property;
object_class->set_property = pk_progress_set_property;
+ object_class->dispose = pk_progress_dispose;
object_class->finalize = pk_progress_finalize;
/**
* PkProgress:package-id:
*
- * Package ID this transaction is acting on.
+ * Full package ID this transaction is acting on.
+ * e.g. 'gnome-power-manager;0.1.2;i386;fedora'
*
* Since: 0.5.2
*/
- pspec = g_param_spec_string ("package-id", NULL,
- "The full package_id, e.g. 'gnome-power-manager;0.1.2;i386;fedora'",
+ obj_properties[PROP_PACKAGE_ID] =
+ g_param_spec_string ("package-id", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PACKAGE_ID, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:transaction-id:
@@ -956,11 +1091,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_string ("transaction-id", NULL,
- "The transaction_id, e.g. '/892_deabbbdb_data'",
+ obj_properties[PROP_TRANSACTION_ID] =
+ g_param_spec_string ("transaction-id", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_TRANSACTION_ID, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:percentage:
@@ -969,10 +1103,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_int ("percentage", NULL, NULL,
+ obj_properties[PROP_PERCENTAGE] =
+ g_param_spec_int ("percentage", NULL, NULL,
-1, G_MAXINT, -1,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PERCENTAGE, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:allow-cancel:
@@ -981,10 +1115,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_boolean ("allow-cancel", NULL, NULL,
+ obj_properties[PROP_ALLOW_CANCEL] =
+ g_param_spec_boolean ("allow-cancel", NULL, NULL,
FALSE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ALLOW_CANCEL, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:status:
@@ -993,10 +1127,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("status", NULL, NULL,
+ obj_properties[PROP_STATUS] =
+ g_param_spec_uint ("status", NULL, NULL,
0, PK_STATUS_ENUM_LAST, PK_STATUS_ENUM_UNKNOWN,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_STATUS, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:role:
@@ -1005,10 +1139,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("role", NULL, NULL,
+ obj_properties[PROP_ROLE] =
+ g_param_spec_uint ("role", NULL, NULL,
0, PK_ROLE_ENUM_LAST, PK_ROLE_ENUM_UNKNOWN,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ROLE, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:caller-active:
@@ -1017,10 +1151,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_boolean ("caller-active", NULL, NULL,
+ obj_properties[PROP_CALLER_ACTIVE] =
+ g_param_spec_boolean ("caller-active", NULL, NULL,
FALSE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_CALLER_ACTIVE, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:elapsed-time:
@@ -1029,10 +1163,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("elapsed-time", NULL, NULL,
+ obj_properties[PROP_ELAPSED_TIME] =
+ g_param_spec_uint ("elapsed-time", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ELAPSED_TIME, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:remaining-time:
@@ -1041,10 +1175,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("remaining-time", NULL, NULL,
+ obj_properties[PROP_REMAINING_TIME] =
+ g_param_spec_uint ("remaining-time", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_REMAINING_TIME, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:speed:
@@ -1053,10 +1187,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("speed", NULL, NULL,
+ obj_properties[PROP_SPEED] =
+ g_param_spec_uint ("speed", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SPEED, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:download-size-remaining:
@@ -1065,10 +1199,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.8.0
*/
- pspec = g_param_spec_uint64 ("download-size-remaining", NULL, NULL,
+ obj_properties[PROP_DOWNLOAD_SIZE_REMAINING] =
+ g_param_spec_uint64 ("download-size-remaining", NULL, NULL,
0, G_MAXUINT64, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_DOWNLOAD_SIZE_REMAINING, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:transaction-flags:
@@ -1077,10 +1211,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.8.8
*/
- pspec = g_param_spec_uint64 ("transaction-flags", NULL, NULL,
+ obj_properties[PROP_TRANSACTION_FLAGS] =
+ g_param_spec_uint64 ("transaction-flags", NULL, NULL,
0, G_MAXUINT64, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_TRANSACTION_FLAGS, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:uid:
@@ -1089,10 +1223,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_uint ("uid", NULL, NULL,
+ obj_properties[PROP_UID] =
+ g_param_spec_uint ("uid", NULL, NULL,
0, G_MAXUINT, 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_UID, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:sender:
@@ -1101,10 +1235,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 1.2.6
*/
- pspec = g_param_spec_string ("sender", NULL, NULL,
+ obj_properties[PROP_SENDER] =
+ g_param_spec_string ("sender", NULL, NULL,
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SENDER, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:package:
@@ -1113,10 +1247,10 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.5.3
*/
- pspec = g_param_spec_object ("package", NULL, NULL,
+ obj_properties[PROP_PACKAGE] =
+ g_param_spec_object ("package", NULL, NULL,
PK_TYPE_PACKAGE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_PACKAGE, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
/**
* PkProgress:item-progress:
@@ -1125,12 +1259,12 @@ pk_progress_class_init (PkProgressClass *klass)
*
* Since: 0.8.1
*/
- pspec = g_param_spec_object ("item-progress", NULL, NULL,
+ obj_properties[PROP_ITEM_PROGRESS] =
+ g_param_spec_object ("item-progress", NULL, NULL,
PK_TYPE_ITEM_PROGRESS,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ITEM_PROGRESS, pspec);
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- g_type_class_add_private (klass, sizeof (PkProgressPrivate));
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
}
/*
@@ -1139,7 +1273,22 @@ pk_progress_class_init (PkProgressClass *klass)
static void
pk_progress_init (PkProgress *progress)
{
- progress->priv = PK_PROGRESS_GET_PRIVATE (progress);
+ progress->priv = pk_progress_get_instance_private (progress);
+}
+
+/*
+ * pk_progress_dispose:
+ **/
+static void
+pk_progress_dispose (GObject *object)
+{
+ PkProgress *progress = PK_PROGRESS (object);
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
+
+ g_clear_object (&priv->package);
+ g_clear_object (&priv->item_progress);
+
+ G_OBJECT_CLASS (pk_progress_parent_class)->dispose (object);
}
/*
@@ -1149,15 +1298,11 @@ static void
pk_progress_finalize (GObject *object)
{
PkProgress *progress = PK_PROGRESS (object);
+ PkProgressPrivate *priv = pk_progress_get_instance_private (progress);
- if (progress->priv->package != NULL)
- g_object_unref (progress->priv->package);
- if (progress->priv->item_progress != NULL)
- g_object_unref (progress->priv->item_progress);
-
- g_free (progress->priv->package_id);
- g_free (progress->priv->transaction_id);
- g_free (progress->priv->sender);
+ g_clear_pointer (&priv->package_id, g_free);
+ g_clear_pointer (&priv->transaction_id, g_free);
+ g_clear_pointer (&priv->sender, g_free);
G_OBJECT_CLASS (pk_progress_parent_class)->finalize (object);
}
diff --git a/lib/packagekit-glib2/pk-progress.h b/lib/packagekit-glib2/pk-progress.h
index fd5d7b1..70ba478 100644
--- a/lib/packagekit-glib2/pk-progress.h
+++ b/lib/packagekit-glib2/pk-progress.h
@@ -175,4 +175,3 @@ PkPackage *pk_progress_get_package (PkProgress *progress);
G_END_DECLS
#endif /* __PK_PROGRESS_H */
-
diff --git a/lib/packagekit-glib2/pk-task.c b/lib/packagekit-glib2/pk-task.c
index 205c6e1..b61aa52 100644
--- a/lib/packagekit-glib2/pk-task.c
+++ b/lib/packagekit-glib2/pk-task.c
@@ -36,8 +36,6 @@
static void pk_task_finalize (GObject *object);
-#define PK_TASK_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_TASK, PkTaskPrivate))
-
#define PK_TASK_TRANSACTION_CANCELLED_RETRY_TIMEOUT 2000 /* ms */
/**
@@ -47,7 +45,7 @@ static void pk_task_finalize (GObject *object);
**/
struct _PkTaskPrivate
{
- GPtrArray *array;
+ GHashTable *gtasks; /* uint, GTask* */
gboolean simulate;
gboolean only_download;
gboolean only_trusted;
@@ -58,13 +56,15 @@ struct _PkTaskPrivate
enum {
PROP_0,
PROP_SIMULATE,
- PROP_ONLY_PREPARE,
+ PROP_ONLY_DOWNLOAD,
PROP_ONLY_TRUSTED,
PROP_ALLOW_REINSTALL,
PROP_ALLOW_DOWNGRADE,
PROP_LAST
};
+static GParamSpec *obj_properties[PROP_LAST] = { NULL, };
+
/**
* PkTaskState:
*
@@ -83,11 +83,7 @@ typedef struct {
gboolean allow_deps;
gboolean autoremove;
gchar **files;
- GSimpleAsyncResult *res;
PkResults *results;
- gboolean ret;
- PkTask *task;
- GCancellable *cancellable;
PkProgressCallback progress_callback;
gpointer progress_user_data;
gboolean enabled;
@@ -104,9 +100,9 @@ typedef struct {
guint retry_id;
} PkTaskState;
-G_DEFINE_TYPE (PkTask, pk_task, PK_TYPE_CLIENT)
+G_DEFINE_TYPE_WITH_PRIVATE (PkTask, pk_task, PK_TYPE_CLIENT)
-static void pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state);
+static void pk_task_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data);
/*
* pk_task_generate_request_id:
@@ -121,54 +117,25 @@ pk_task_generate_request_id (void)
/*
* pk_task_find_by_request:
**/
-static PkTaskState *
+static inline GTask *
pk_task_find_by_request (PkTask *task, guint request)
{
- PkTaskState *item;
- guint i;
- GPtrArray *array;
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
g_return_val_if_fail (PK_IS_TASK (task), NULL);
g_return_val_if_fail (request != 0, NULL);
- array = task->priv->array;
- for (i = 0; i < array->len; i++) {
- item = g_ptr_array_index (array, i);
- if (item->request == request)
- return item;
- }
- return NULL;
+ return g_hash_table_lookup (priv->gtasks, GUINT_TO_POINTER (request));
}
/*
* pk_task_generic_state_finish:
**/
static void
-pk_task_generic_state_finish (PkTaskState *state, const GError *error)
+pk_task_state_free (gpointer task_state)
{
- /* get result */
- if (state->ret) {
- g_simple_async_result_set_op_res_gpointer (state->res,
- g_object_ref ((GObject*) state->results),
- g_object_unref);
- } else {
- g_simple_async_result_set_from_error (state->res, error);
- }
-
- /* complete */
- g_simple_async_result_complete_in_idle (state->res);
+ PkTaskState *state = task_state;
- /* remove from list */
- g_debug ("remove state %p", state);
- g_ptr_array_remove (state->task->priv->array, state);
-
- /* deallocate */
- if (state->cancellable != NULL)
- g_object_unref (state->cancellable);
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
if (state->retry_id != 0)
g_source_remove (state->retry_id);
g_free (state->directory);
@@ -179,8 +146,6 @@ pk_task_generic_state_finish (PkTaskState *state, const GError *error)
g_strfreev (state->package_ids);
g_strfreev (state->packages);
g_strfreev (state->values);
- g_object_unref (state->res);
- g_object_unref (state->task);
g_slice_free (PkTaskState, state);
}
@@ -188,8 +153,12 @@ pk_task_generic_state_finish (PkTaskState *state, const GError *error)
* pk_task_do_async_action:
**/
static void
-pk_task_do_async_action (PkTaskState *state)
+pk_task_do_async_action (GTask *gtask)
{
+ PkTask *task = g_task_get_source_object (gtask);
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+ PkTaskState *state = g_task_get_task_data (gtask);
+ GCancellable *cancellable = g_task_get_cancellable (gtask);
PkBitfield transaction_flags;
/* so the callback knows if we are serious or not */
@@ -197,122 +166,122 @@ pk_task_do_async_action (PkTaskState *state)
/* only prepare the transaction */
transaction_flags = state->transaction_flags;
- if (state->task->priv->only_download) {
+ if (priv->only_download) {
pk_bitfield_add (transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD);
}
- if (state->task->priv->allow_reinstall) {
+ if (priv->allow_reinstall) {
pk_bitfield_add (transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL);
}
- if (state->task->priv->allow_downgrade) {
+ if (priv->allow_downgrade) {
pk_bitfield_add (transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_DOWNGRADE);
}
/* do the correct action */
if (state->role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
- pk_client_install_packages_async (PK_CLIENT(state->task), transaction_flags, state->package_ids,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_install_packages_async (PK_CLIENT(task), transaction_flags, state->package_ids,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
- pk_client_update_packages_async (PK_CLIENT(state->task), transaction_flags, state->package_ids,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_update_packages_async (PK_CLIENT(task), transaction_flags, state->package_ids,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
- pk_client_remove_packages_async (PK_CLIENT(state->task),
+ pk_client_remove_packages_async (PK_CLIENT(task),
transaction_flags,
state->package_ids,
state->allow_deps,
state->autoremove,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_INSTALL_FILES) {
- pk_client_install_files_async (PK_CLIENT(state->task), transaction_flags, state->files,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_install_files_async (PK_CLIENT(task), transaction_flags, state->files,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_RESOLVE) {
- pk_client_resolve_async (PK_CLIENT(state->task), state->filters, state->packages,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_resolve_async (PK_CLIENT(task), state->filters, state->packages,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_SEARCH_NAME) {
- pk_client_search_names_async (PK_CLIENT(state->task), state->filters, state->values,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_search_names_async (PK_CLIENT(task), state->filters, state->values,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_SEARCH_DETAILS) {
- pk_client_search_details_async (PK_CLIENT(state->task), state->filters, state->values,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_search_details_async (PK_CLIENT(task), state->filters, state->values,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_SEARCH_GROUP) {
- pk_client_search_groups_async (PK_CLIENT(state->task), state->filters, state->values,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_search_groups_async (PK_CLIENT(task), state->filters, state->values,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_SEARCH_FILE) {
- pk_client_search_files_async (PK_CLIENT(state->task), state->filters, state->values,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_search_files_async (PK_CLIENT(task), state->filters, state->values,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_DETAILS) {
- pk_client_get_details_async (PK_CLIENT(state->task), state->package_ids,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_details_async (PK_CLIENT(task), state->package_ids,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_UPDATE_DETAIL) {
- pk_client_get_update_detail_async (PK_CLIENT(state->task), state->package_ids,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_update_detail_async (PK_CLIENT(task), state->package_ids,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_DOWNLOAD_PACKAGES) {
- pk_client_download_packages_async (PK_CLIENT(state->task), state->package_ids, state->directory,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_download_packages_async (PK_CLIENT(task), state->package_ids, state->directory,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_UPDATES) {
- pk_client_get_updates_async (PK_CLIENT(state->task), state->filters,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_updates_async (PK_CLIENT(task), state->filters,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_DEPENDS_ON) {
- pk_client_depends_on_async (PK_CLIENT(state->task), state->filters, state->package_ids, state->recursive,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_depends_on_async (PK_CLIENT(task), state->filters, state->package_ids, state->recursive,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_PACKAGES) {
- pk_client_get_packages_async (PK_CLIENT(state->task), state->filters,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_packages_async (PK_CLIENT(task), state->filters,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REQUIRED_BY) {
- pk_client_required_by_async (PK_CLIENT(state->task), state->filters, state->package_ids, state->recursive,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_required_by_async (PK_CLIENT(task), state->filters, state->package_ids, state->recursive,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_WHAT_PROVIDES) {
- pk_client_what_provides_async (PK_CLIENT(state->task), state->filters, state->values,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_what_provides_async (PK_CLIENT(task), state->filters, state->values,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_FILES) {
- pk_client_get_files_async (PK_CLIENT(state->task), state->package_ids,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_files_async (PK_CLIENT(task), state->package_ids,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_CATEGORIES) {
- pk_client_get_categories_async (PK_CLIENT(state->task),
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_categories_async (PK_CLIENT(task),
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REFRESH_CACHE) {
- pk_client_refresh_cache_async (PK_CLIENT(state->task), state->force,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_refresh_cache_async (PK_CLIENT(task), state->force,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_GET_REPO_LIST) {
- pk_client_get_repo_list_async (PK_CLIENT(state->task), state->filters,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_get_repo_list_async (PK_CLIENT(task), state->filters,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REPO_ENABLE) {
- pk_client_repo_enable_async (PK_CLIENT(state->task), state->repo_id, state->enabled,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_repo_enable_async (PK_CLIENT(task), state->repo_id, state->enabled,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_UPGRADE_SYSTEM) {
- pk_client_upgrade_system_async (PK_CLIENT(state->task), transaction_flags, state->distro_id, state->upgrade_kind,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_upgrade_system_async (PK_CLIENT(task), transaction_flags, state->distro_id, state->upgrade_kind,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REPAIR_SYSTEM) {
- pk_client_repair_system_async (PK_CLIENT(state->task), transaction_flags,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_ready_cb, state);
+ pk_client_repair_system_async (PK_CLIENT(task), transaction_flags,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_ready_cb, g_steal_pointer (>ask));
} else {
g_assert_not_reached ();
}
@@ -335,44 +304,39 @@ pk_task_package_filter_cb (PkPackage *package, gpointer user_data)
return TRUE;
}
-static void pk_task_do_async_simulate_action (PkTaskState *state);
+static void pk_task_do_async_simulate_action (GTask *gtask);
/*
* pk_task_simulate_ready_cb:
**/
static void
-pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
+pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
- PkTaskClass *klass = PK_TASK_GET_CLASS (state->task);
+ g_autoptr(GTask) gtask = G_TASK (user_data);
g_autoptr(GError) error = NULL;
g_autoptr(PkPackageSack) sack = NULL;
g_autoptr(PkPackageSack) untrusted_sack = NULL;
- g_autoptr(PkResults) results = NULL;
+ PkTask *task = g_task_get_source_object (gtask);
+ PkTaskState *state = g_task_get_task_data (gtask);
/* old results no longer valid */
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
+ g_clear_object (&state->results);
/* get the results */
- results = pk_client_generic_finish (PK_CLIENT(state->task), res, &error);
- if (results == NULL) {
+ state->results = pk_client_generic_finish (PK_CLIENT(source_object), res, &error);
+ if (state->results == NULL) {
/* handle case where this is not implemented */
if (error->code == PK_CLIENT_ERROR_NOT_SUPPORTED) {
- pk_task_do_async_action (state);
- return;
+ pk_task_do_async_action (g_steal_pointer (>ask));
+ return;
}
/* just abort */
- pk_task_generic_state_finish (state, error);
+ g_task_return_error (gtask, g_steal_pointer (&error));
return;
}
- /* we own a copy now */
- state->results = g_object_ref (results);
-
/* get exit code */
state->exit_enum = pk_results_get_exit_code (state->results);
if (state->exit_enum == PK_EXIT_ENUM_NEED_UNTRUSTED) {
@@ -380,7 +344,7 @@ pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskStat
pk_bitfield_remove (state->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
/* retry this */
- pk_task_do_async_simulate_action (state);
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
return;
}
@@ -388,13 +352,12 @@ pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskStat
/* we 'fail' with success so the application gets a
* chance to process the PackageKit-specific
* ErrorCode enumerated value and detail. */
- state->ret = TRUE;
- pk_task_generic_state_finish (state, NULL);
+ g_task_return_pointer (gtask, g_steal_pointer (&state->results), g_object_unref);
return;
}
/* get data */
- sack = pk_results_get_package_sack (results);
+ sack = pk_results_get_package_sack (state->results);
/* if we did a simulate and we got a message that a package was untrusted,
* there's no point trying to do the action with only-trusted */
@@ -406,11 +369,11 @@ pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskStat
}
/* remove all the packages we want to ignore */
- pk_package_sack_remove_by_filter (sack, pk_task_package_filter_cb, state);
+ pk_package_sack_remove_by_filter (sack, pk_task_package_filter_cb, NULL);
/* no results from simulate */
if (pk_package_sack_get_size (sack) == 0) {
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
return;
}
@@ -418,15 +381,18 @@ pk_task_simulate_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskStat
pk_package_sack_sort (sack, PK_PACKAGE_SACK_SORT_TYPE_INFO);
/* run the callback */
- klass->simulate_question (state->task, state->request, state->results);
+ PK_TASK_GET_CLASS (task)->simulate_question (task, state->request, state->results);
}
/*
* pk_task_do_async_simulate_action:
**/
static void
-pk_task_do_async_simulate_action (PkTaskState *state)
+pk_task_do_async_simulate_action (GTask *gtask)
{
+ PkTask *task = g_task_get_source_object (gtask);
+ PkTaskState *state = g_task_get_task_data (gtask);
+ GCancellable *cancellable = g_task_get_cancellable (gtask);
PkBitfield transaction_flags = state->transaction_flags;
/* so the callback knows if we are serious or not */
@@ -437,71 +403,71 @@ pk_task_do_async_simulate_action (PkTaskState *state)
if (state->role == PK_ROLE_ENUM_INSTALL_PACKAGES) {
/* simulate install async */
g_debug ("doing install");
- pk_client_install_packages_async (PK_CLIENT(state->task),
+ pk_client_install_packages_async (PK_CLIENT(task),
transaction_flags,
state->package_ids,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_UPDATE_PACKAGES) {
/* simulate update async */
g_debug ("doing update");
- pk_client_update_packages_async (PK_CLIENT(state->task),
+ pk_client_update_packages_async (PK_CLIENT(task),
transaction_flags,
state->package_ids,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REMOVE_PACKAGES) {
/* simulate remove async */
g_debug ("doing remove");
- pk_client_remove_packages_async (PK_CLIENT(state->task),
+ pk_client_remove_packages_async (PK_CLIENT(task),
transaction_flags,
state->package_ids,
state->allow_deps,
state->autoremove,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_INSTALL_FILES) {
/* simulate install async */
g_debug ("doing install files");
- pk_client_install_files_async (PK_CLIENT(state->task),
+ pk_client_install_files_async (PK_CLIENT(task),
transaction_flags,
state->files,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_UPGRADE_SYSTEM) {
/* simulate upgrade system async */
g_debug ("doing upgrade system");
- pk_client_upgrade_system_async (PK_CLIENT(state->task),
+ pk_client_upgrade_system_async (PK_CLIENT(task),
transaction_flags,
state->distro_id,
state->upgrade_kind,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else if (state->role == PK_ROLE_ENUM_REPAIR_SYSTEM) {
/* simulate repair system async */
g_debug ("doing repair system");
- pk_client_repair_system_async (PK_CLIENT(state->task),
+ pk_client_repair_system_async (PK_CLIENT(task),
transaction_flags,
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_simulate_ready_cb,
- state);
+ pk_task_simulate_ready_cb,
+ g_steal_pointer (>ask));
} else {
g_assert_not_reached ();
}
@@ -511,28 +477,23 @@ pk_task_do_async_simulate_action (PkTaskState *state)
* pk_task_install_signatures_ready_cb:
**/
static void
-pk_task_install_signatures_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
+pk_task_install_signatures_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) gtask = G_TASK (user_data);
PkTask *task = PK_TASK (source_object);
+ PkTaskState *state = g_task_get_task_data (gtask);
g_autoptr(GError) error = NULL;
- g_autoptr(PkResults) results = NULL;
/* old results no longer valid */
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
+ g_clear_object (&state->results);
/* get the results */
- results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
- if (results == NULL) {
- pk_task_generic_state_finish (state, error);
+ state->results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
+ if (state->results == NULL) {
+ g_task_return_error (gtask, g_steal_pointer (&error));
return;
}
- /* we own a copy now */
- state->results = g_object_ref (results);
-
/* get exit code */
state->exit_enum = pk_results_get_exit_code (state->results);
@@ -541,47 +502,52 @@ pk_task_install_signatures_ready_cb (GObject *source_object, GAsyncResult *res,
g_autoptr(PkError) error_code = NULL;
error_code = pk_results_get_error_code (state->results);
/* TODO: convert the PkErrorEnum to a PK_CLIENT_ERROR_* enum */
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "failed to install signature: %s", pk_error_get_details (error_code));
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "failed to install signature: %s",
+ pk_error_get_details (error_code));
return;
}
/* now try the action again */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/*
* pk_task_install_signatures:
**/
static void
-pk_task_install_signatures (PkTaskState *state)
+pk_task_install_signatures (GTask *given_gtask)
{
+ GTask *gtask = given_gtask;
+ PkTask *task = g_task_get_source_object (gtask);
+ PkTaskState *state = g_task_get_task_data (gtask);
PkRepoSignatureRequired *item;
PkSigTypeEnum type;
g_autoptr(GError) error = NULL;
g_autofree gchar *key_id = NULL;
g_autofree gchar *package_id = NULL;
g_autoptr(GPtrArray) array = NULL;
+ GCancellable *cancellable;
/* get results */
array = pk_results_get_repo_signature_required_array (state->results);
if (array == NULL || array->len == 0) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "no signatures to install");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "no signatures to install");
return;
}
/* did we get more than result? */
if (array->len > 1) {
/* TODO: support more than one signature */
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "more than one signature to install");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "more than one signature to install");
return;
}
@@ -594,37 +560,33 @@ pk_task_install_signatures (PkTaskState *state)
NULL);
/* do new async method */
- pk_client_install_signature_async (PK_CLIENT(state->task), type, key_id, package_id,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_install_signatures_ready_cb, state);
+ cancellable = g_task_get_cancellable (gtask);
+ pk_client_install_signature_async (PK_CLIENT(task), type, key_id, package_id,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_install_signatures_ready_cb, g_object_ref (gtask));
}
/*
* pk_task_accept_eulas_ready_cb:
**/
static void
-pk_task_accept_eulas_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
+pk_task_accept_eulas_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) gtask = G_TASK (user_data);
PkTask *task = PK_TASK (source_object);
+ PkTaskState *state = g_task_get_task_data (gtask);
g_autoptr(GError) error = NULL;
- g_autoptr(PkResults) results = NULL;
/* old results no longer valid */
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
+ g_clear_object (&state->results);
/* get the results */
- results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
- if (results == NULL) {
- pk_task_generic_state_finish (state, error);
+ state->results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
+ if (state->results == NULL) {
+ g_task_return_error (gtask, g_steal_pointer (&error));
return;
}
- /* we own a copy now */
- state->results = g_object_ref (results);
-
/* get exit code */
state->exit_enum = pk_results_get_exit_code (state->results);
@@ -633,45 +595,50 @@ pk_task_accept_eulas_ready_cb (GObject *source_object, GAsyncResult *res, PkTask
g_autoptr(PkError) error_code = NULL;
error_code = pk_results_get_error_code (state->results);
/* TODO: convert the PkErrorEnum to a PK_CLIENT_ERROR_* enum */
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "failed to accept eula: %s", pk_error_get_details (error_code));
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "failed to accept eula: %s",
+ pk_error_get_details (error_code));
return;
}
/* now try the action again */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/*
* pk_task_accept_eulas:
**/
static void
-pk_task_accept_eulas (PkTaskState *state)
+pk_task_accept_eulas (GTask *given_gtask)
{
+ GTask *gtask = given_gtask;
+ PkTask *task = g_task_get_source_object (gtask);
+ PkTaskState *state = g_task_get_task_data (gtask);
PkEulaRequired *item;
g_autoptr(GError) error = NULL;
const gchar *eula_id;
g_autoptr(GPtrArray) array = NULL;
+ GCancellable *cancellable;
/* get results */
array = pk_results_get_eula_required_array (state->results);
if (array == NULL || array->len == 0) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "no eulas to accept");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "no eulas to accept");
return;
}
/* did we get more than result? */
if (array->len > 1) {
/* TODO: support more than one eula */
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED, "more than one eula to accept");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "more than one eula to accept");
return;
}
@@ -680,37 +647,33 @@ pk_task_accept_eulas (PkTaskState *state)
eula_id = pk_eula_required_get_eula_id (item);
/* do new async method */
- pk_client_accept_eula_async (PK_CLIENT(state->task), eula_id,
- state->cancellable, state->progress_callback, state->progress_user_data,
- (GAsyncReadyCallback) pk_task_accept_eulas_ready_cb, state);
+ cancellable = g_task_get_cancellable (gtask);
+ pk_client_accept_eula_async (PK_CLIENT(task), eula_id,
+ cancellable, state->progress_callback, state->progress_user_data,
+ pk_task_accept_eulas_ready_cb, g_object_ref (gtask));
}
/*
* pk_task_repair_ready_cb:
**/
static void
-pk_task_repair_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
+pk_task_repair_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) gtask = G_TASK (user_data);
+ PkTaskState *state = g_task_get_task_data (gtask);
PkTask *task = PK_TASK (source_object);
g_autoptr(GError) error = NULL;
- g_autoptr(PkResults) results = NULL;
/* old results no longer valid */
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
+ g_clear_object (&state->results);
/* get the results */
- results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
- if (results == NULL) {
- pk_task_generic_state_finish (state, error);
+ state->results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
+ if (state->results == NULL) {
+ g_task_return_error (gtask, g_steal_pointer (&error));
return;
}
- /* we own a copy now */
- state->results = g_object_ref (results);
-
/* get exit code */
state->exit_enum = pk_results_get_exit_code (state->results);
@@ -719,53 +682,58 @@ pk_task_repair_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState
g_autoptr(PkError) error_code = NULL;
error_code = pk_results_get_error_code (state->results);
/* TODO: convert the PkErrorEnum to a PK_CLIENT_ERROR_* enum */
- error = g_error_new (PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_FAILED,
- "failed to repair: %s",
- pk_error_get_details (error_code));
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_FAILED,
+ "failed to repair: %s",
+ pk_error_get_details (error_code));
return;
}
/* now try the action again */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/*
* pk_task_user_accepted_idle_cb:
**/
static gboolean
-pk_task_user_accepted_idle_cb (PkTaskState *state)
+pk_task_user_accepted_idle_cb (gpointer user_data)
{
+ GTask *gtask = user_data;
+ PkTaskState *state = g_task_get_task_data (gtask);
+
/* this needs another step in the dance */
if (state->exit_enum == PK_EXIT_ENUM_KEY_REQUIRED) {
g_debug ("need to do install-sig");
- pk_task_install_signatures (state);
+ pk_task_install_signatures (gtask);
return FALSE;
}
/* this needs another step in the dance */
if (state->exit_enum == PK_EXIT_ENUM_EULA_REQUIRED) {
g_debug ("need to do accept-eula");
- pk_task_accept_eulas (state);
+ pk_task_accept_eulas (gtask);
return FALSE;
}
/* this needs another step in the dance */
if (state->exit_enum == PK_EXIT_ENUM_REPAIR_REQUIRED) {
+ GCancellable *cancellable = g_task_get_cancellable (gtask);
+ PkTask *task = g_task_get_source_object (gtask);
g_debug ("need to do repair");
- pk_client_repair_system_async (PK_CLIENT(state->task),
+ pk_client_repair_system_async (PK_CLIENT(task),
pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_NONE),
- state->cancellable,
+ cancellable,
state->progress_callback,
state->progress_user_data,
- (GAsyncReadyCallback) pk_task_repair_ready_cb, state);
+ (GAsyncReadyCallback) pk_task_repair_ready_cb, g_object_ref (gtask));
return FALSE;
}
/* doing task */
g_debug ("continuing with request %i", state->request);
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_object_ref (gtask));
return FALSE;
}
@@ -783,18 +751,18 @@ pk_task_user_accepted_idle_cb (PkTaskState *state)
gboolean
pk_task_user_accepted (PkTask *task, guint request)
{
- PkTaskState *state;
+ GTask *gtask;
GSource *idle_source;
/* get the not-yet-completed request */
- state = pk_task_find_by_request (task, request);
- if (state == NULL) {
+ gtask = pk_task_find_by_request (task, request);
+ if (gtask == NULL) {
g_warning ("request %i not found", request);
return FALSE;
}
idle_source = g_idle_source_new ();
- g_source_set_callback (idle_source, G_SOURCE_FUNC (pk_task_user_accepted_idle_cb), state, NULL);
+ g_source_set_callback (idle_source, G_SOURCE_FUNC (pk_task_user_accepted_idle_cb), g_object_ref (gtask), g_object_unref);
g_source_set_name (idle_source, "[PkTask] user-accept");
g_source_attach (idle_source, g_main_context_get_thread_default ());
return TRUE;
@@ -804,25 +772,26 @@ pk_task_user_accepted (PkTask *task, guint request)
* pk_task_user_declined_idle_cb:
**/
static gboolean
-pk_task_user_declined_idle_cb (PkTaskState *state)
+pk_task_user_declined_idle_cb (gpointer user_data)
{
- g_autoptr(GError) error = NULL;
+ GTask *gtask = user_data;
+ PkTaskState *state;
+
+ state = g_task_get_task_data (gtask);
/* the introduction is finished */
if (state->simulate) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_DECLINED_SIMULATION, "user declined simulation");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR, PK_CLIENT_ERROR_DECLINED_SIMULATION,
+ "user declined simulation");
return FALSE;
}
/* doing task */
g_debug ("declined request %i", state->request);
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_DECLINED_INTERACTION, "user declined interaction");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR, PK_CLIENT_ERROR_DECLINED_INTERACTION,
+ "user declined interaction");
return FALSE;
}
@@ -840,18 +809,18 @@ pk_task_user_declined_idle_cb (PkTaskState *state)
gboolean
pk_task_user_declined (PkTask *task, guint request)
{
- PkTaskState *state;
+ GTask *gtask;
GSource *idle_source;
/* get the not-yet-completed request */
- state = pk_task_find_by_request (task, request);
- if (state == NULL) {
+ gtask = pk_task_find_by_request (task, request);
+ if (gtask == NULL) {
g_warning ("request %i not found", request);
return FALSE;
}
idle_source = g_idle_source_new ();
- g_source_set_callback (idle_source, G_SOURCE_FUNC (pk_task_user_declined_idle_cb), state, NULL);
+ g_source_set_callback (idle_source, G_SOURCE_FUNC (pk_task_user_declined_idle_cb), g_object_ref (gtask), g_object_unref);
g_source_set_name (idle_source, "[PkTask] user-accept");
g_source_attach (idle_source, g_main_context_get_thread_default ());
return TRUE;
@@ -863,40 +832,37 @@ pk_task_user_declined (PkTask *task, guint request)
static gboolean
pk_task_retry_cancelled_transaction_cb (gpointer user_data)
{
- PkTaskState *state = (PkTaskState *) user_data;
- pk_task_do_async_action (state);
+ g_autoptr(GTask) gtask = G_TASK (user_data);
+ PkTaskState *state = g_task_get_task_data (gtask);
+
+ pk_task_do_async_action (g_steal_pointer (>ask));
state->retry_id = 0;
- return FALSE;
+ return G_SOURCE_REMOVE;
}
/*
* pk_task_ready_cb:
**/
static void
-pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
+pk_task_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
+ g_autoptr(GTask) gtask = G_TASK (user_data);
PkTask *task = PK_TASK (source_object);
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
+ PkTaskState *state = g_task_get_task_data (gtask);
gboolean interactive;
g_autoptr(GError) error = NULL;
- g_autoptr(PkResults) results = NULL;
/* old results no longer valid */
- if (state->results != NULL) {
- g_object_unref (state->results);
- state->results = NULL;
- }
+ g_clear_object (&state->results);
/* get the results */
- results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
- if (results == NULL) {
- pk_task_generic_state_finish (state, error);
+ state->results = pk_client_generic_finish (PK_CLIENT(task), res, &error);
+ if (state->results == NULL) {
+ g_task_return_error (gtask, g_steal_pointer (&error));
return;
}
- /* we own a copy now */
- state->results = g_object_ref (results);
-
/* get exit code */
state->exit_enum = pk_results_get_exit_code (state->results);
@@ -911,17 +877,16 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
/* running non-interactive */
if (!interactive) {
g_debug ("working non-interactive, so calling accept");
- pk_task_user_accepted (state->task, state->request);
+ pk_task_user_accepted (task, state->request);
return;
}
/* no support */
if (klass->untrusted_question == NULL) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_NOT_SUPPORTED,
- "could not do untrusted question as no klass support");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_NOT_SUPPORTED,
+ "could not do untrusted question as no klass support");
return;
}
@@ -936,17 +901,16 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
/* running non-interactive */
if (!interactive) {
g_debug ("working non-interactive, so calling accept");
- pk_task_user_accepted (state->task, state->request);
+ pk_task_user_accepted (task, state->request);
return;
}
/* no support */
if (klass->key_question == NULL) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_NOT_SUPPORTED,
- "could not do key question as no klass support");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_NOT_SUPPORTED,
+ "could not do key question as no klass support");
return;
}
@@ -961,16 +925,16 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
/* running non-interactive */
if (!interactive) {
g_debug ("working non-interactive, so calling accept");
- pk_task_user_accepted (state->task, state->request);
+ pk_task_user_accepted (task, state->request);
return;
}
/* no support */
if (klass->repair_question == NULL) {
- error = g_error_new (PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_NOT_SUPPORTED,
- "could not do repair question as no klass support");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_NOT_SUPPORTED,
+ "could not do repair question as no klass support");
return;
}
@@ -985,17 +949,16 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
/* running non-interactive */
if (!interactive) {
g_debug ("working non-interactive, so calling accept");
- pk_task_user_accepted (state->task, state->request);
+ pk_task_user_accepted (task, state->request);
return;
}
/* no support */
if (klass->eula_question == NULL) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_NOT_SUPPORTED,
- "could not do eula question as no klass support");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_NOT_SUPPORTED,
+ "could not do eula question as no klass support");
return;
}
@@ -1010,17 +973,17 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
/* running non-interactive */
if (!interactive) {
g_debug ("working non-interactive, so calling accept");
- pk_task_user_accepted (state->task, state->request);
+ pk_task_user_accepted (task, state->request);
+ g_task_return_pointer (gtask, g_steal_pointer (&state->results), g_object_unref);
return;
}
/* no support */
if (klass->media_change_question == NULL) {
- g_set_error (&error,
- PK_CLIENT_ERROR,
- PK_CLIENT_ERROR_NOT_SUPPORTED,
- "could not do media change question as no klass support");
- pk_task_generic_state_finish (state, error);
+ g_task_return_new_error (gtask,
+ PK_CLIENT_ERROR,
+ PK_CLIENT_ERROR_NOT_SUPPORTED,
+ "could not do media change question as no klass support");
return;
}
@@ -1033,19 +996,16 @@ pk_task_ready_cb (GObject *source_object, GAsyncResult *res, PkTaskState *state)
if (state->exit_enum == PK_EXIT_ENUM_CANCELLED_PRIORITY) {
state->retry_id = g_timeout_add (PK_TASK_TRANSACTION_CANCELLED_RETRY_TIMEOUT,
pk_task_retry_cancelled_transaction_cb,
- state);
+ g_steal_pointer (>ask));
return;
}
- /* we can't handle this, just finish the async method */
- state->ret = TRUE;
-
/* we're done */
- pk_task_generic_state_finish (state, NULL);
+ g_task_return_pointer (gtask, g_steal_pointer (&state->results), g_object_unref);
}
/**
- * pk_task_install_packages_async:
+ * pk_task_install_packages_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -1063,50 +1023,47 @@ pk_task_install_packages_async (PkTask *task, gchar **package_ids, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_INSTALL_PACKAGES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
- if (task->priv->allow_reinstall) {
+ if (priv->allow_reinstall) {
pk_bitfield_add (state->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL);
}
- if (task->priv->allow_downgrade) {
+ if (priv->allow_downgrade) {
pk_bitfield_add (state->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_DOWNGRADE);
}
state->package_ids = g_strdupv (package_ids);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* start trusted install async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_update_packages_async:
+ * pk_task_update_packages_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -1124,41 +1081,39 @@ pk_task_update_packages_async (PkTask *task, gchar **package_ids, GCancellable *
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
g_return_if_fail (PK_IS_CLIENT (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_update_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_UPDATE_PACKAGES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->package_ids = g_strdupv (package_ids);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* start trusted install async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_upgrade_system_async:
+ * pk_task_upgrade_system_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @distro_id: a distro ID such as "fedora-14"
* @upgrade_kind: a #PkUpgradeKindEnum such as %PK_UPGRADE_KIND_ENUM_COMPLETE
@@ -1184,23 +1139,18 @@ pk_task_upgrade_system_async (PkTask *task,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
g_return_if_fail (PK_IS_CLIENT (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_upgrade_system_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_UPGRADE_SYSTEM;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->distro_id = g_strdup (distro_id);
state->upgrade_kind = upgrade_kind;
@@ -1208,18 +1158,21 @@ pk_task_upgrade_system_async (PkTask *task,
state->progress_user_data = progress_user_data;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_upgrade_system_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* start trusted install async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_remove_packages_async:
+ * pk_task_remove_packages_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @allow_deps: if other dependent packages are allowed to be removed from the computer
@@ -1230,7 +1183,7 @@ pk_task_upgrade_system_async (PkTask *task,
* @callback_ready: the function to run on completion
* @user_data: the data to pass to @callback_ready
*
- * Remove a package (optionally with dependancies) from the system.
+ * Remove a package (optionally with dependencies) from the system.
* If @allow_deps is set to %FALSE, and other packages would have to be removed,
* then the transaction would fail.
*
@@ -1241,23 +1194,18 @@ pk_task_remove_packages_async (PkTask *task, gchar **package_ids, gboolean allow
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
g_return_if_fail (PK_IS_CLIENT (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_remove_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_REMOVE_PACKAGES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->allow_deps = allow_deps;
state->autoremove = autoremove;
state->package_ids = g_strdupv (package_ids);
@@ -1265,18 +1213,21 @@ pk_task_remove_packages_async (PkTask *task, gchar **package_ids, gboolean allow
state->progress_user_data = progress_user_data;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* start trusted install async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_install_files_async:
+ * pk_task_install_files_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @files: (array zero-terminated=1): a file such as "/home/hughsie/Desktop/hal-devel-0.10.0.rpm"
* @cancellable: a #GCancellable or %NULL
@@ -1295,24 +1246,19 @@ pk_task_install_files_async (PkTask *task, gchar **files, GCancellable *cancella
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
g_return_if_fail (PK_IS_CLIENT (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_files_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_INSTALL_FILES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
- if (task->priv->only_trusted)
+ if (priv->only_trusted)
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
else
state->transaction_flags = 0;
@@ -1321,18 +1267,21 @@ pk_task_install_files_async (PkTask *task, gchar **files, GCancellable *cancella
state->progress_user_data = progress_user_data;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_files_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* start trusted install async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_resolve_async:
+ * pk_task_resolve_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @packages: (array zero-terminated=1): package names to find
@@ -1351,46 +1300,43 @@ pk_task_resolve_async (PkTask *task, PkBitfield filters, gchar **packages, GCanc
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_RESOLVE;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
- if (state->task->priv->allow_downgrade)
+ if (priv->allow_downgrade)
pk_bitfield_add (state->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_DOWNGRADE);
- if (state->task->priv->allow_reinstall)
+ if (priv->allow_reinstall)
pk_bitfield_add (state->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ALLOW_REINSTALL);
state->filters = filters;
state->packages = g_strdupv (packages);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_resolve_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_search_names_async:
+ * pk_task_search_names_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @values: (array zero-terminated=1): search values
@@ -1409,39 +1355,36 @@ pk_task_search_names_async (PkTask *task, PkBitfield filters, gchar **values, GC
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_SEARCH_NAME;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->values = g_strdupv (values);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_search_names_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_search_details_async:
+ * pk_task_search_details_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @values: (array zero-terminated=1): search values
@@ -1460,39 +1403,36 @@ pk_task_search_details_async (PkTask *task, PkBitfield filters, gchar **values,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_SEARCH_DETAILS;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->values = g_strdupv (values);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_search_details_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_search_groups_async:
+ * pk_task_search_groups_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @values: (array zero-terminated=1): search values
@@ -1511,39 +1451,36 @@ pk_task_search_groups_async (PkTask *task, PkBitfield filters, gchar **values, G
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_SEARCH_GROUP;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->values = g_strdupv (values);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_search_groups_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_search_files_async:
+ * pk_task_search_files_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @values: (array zero-terminated=1): search values
@@ -1562,39 +1499,36 @@ pk_task_search_files_async (PkTask *task, PkBitfield filters, gchar **values, GC
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_SEARCH_FILE;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->values = g_strdupv (values);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_files_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_details_async:
+ * pk_task_get_details_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -1612,38 +1546,35 @@ pk_task_get_details_async (PkTask *task, gchar **package_ids, GCancellable *canc
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_DETAILS;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->package_ids = g_strdupv (package_ids);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_get_details_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_update_detail_async:
+ * pk_task_get_update_detail_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -1661,38 +1592,35 @@ pk_task_get_update_detail_async (PkTask *task, gchar **package_ids, GCancellable
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_UPDATE_DETAIL;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->package_ids = g_strdupv (package_ids);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_get_update_detail_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_download_packages_async:
+ * pk_task_download_packages_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @directory: the destination directory
@@ -1711,39 +1639,36 @@ pk_task_download_packages_async (PkTask *task, gchar **package_ids, const gchar
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_DOWNLOAD_PACKAGES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->package_ids = g_strdupv (package_ids);
state->directory = g_strdup (directory);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_download_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_updates_async:
+ * pk_task_get_updates_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @cancellable: a #GCancellable or %NULL
@@ -1761,38 +1686,35 @@ pk_task_get_updates_async (PkTask *task, PkBitfield filters, GCancellable *cance
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_UPDATES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_get_updates_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_depends_on_async:
+ * pk_task_depends_on_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -1803,7 +1725,7 @@ pk_task_get_updates_async (PkTask *task, PkBitfield filters, GCancellable *cance
* @callback_ready: the function to run on completion
* @user_data: the data to pass to @callback
*
- * Get the list of dependant packages.
+ * Get the list of dependent packages.
*
* Since: 0.6.5
**/
@@ -1812,40 +1734,37 @@ pk_task_depends_on_async (PkTask *task, PkBitfield filters, gchar **package_ids,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_DEPENDS_ON;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->package_ids = g_strdupv (package_ids);
state->recursive = recursive;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_depends_on_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_packages_async:
+ * pk_task_get_packages_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @cancellable: a #GCancellable or %NULL
@@ -1863,38 +1782,35 @@ pk_task_get_packages_async (PkTask *task, PkBitfield filters, GCancellable *canc
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_PACKAGES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_required_by_async:
+ * pk_task_required_by_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
@@ -1914,40 +1830,37 @@ pk_task_required_by_async (PkTask *task, PkBitfield filters, gchar **package_ids
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_REQUIRED_BY;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->package_ids = g_strdupv (package_ids);
state->recursive = recursive;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_what_provides_async:
+ * pk_task_what_provides_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @values: (array zero-terminated=1): values to search for
@@ -1967,39 +1880,36 @@ pk_task_what_provides_async (PkTask *task, PkBitfield filters,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_WHAT_PROVIDES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->values = g_strdupv (values);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_files_async:
+ * pk_task_get_files_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @package_ids: (array zero-terminated=1): a null terminated array of package_id structures such as "hal;0.0.1;i386;fedora"
* @cancellable: a #GCancellable or %NULL
@@ -2017,38 +1927,35 @@ pk_task_get_files_async (PkTask *task, gchar **package_ids, GCancellable *cancel
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_FILES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->package_ids = g_strdupv (package_ids);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_categories_async:
+ * pk_task_get_categories_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -2065,37 +1972,34 @@ pk_task_get_categories_async (PkTask *task, GCancellable *cancellable,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_CATEGORIES;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_refresh_cache_async:
+ * pk_task_refresh_cache_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @force: if the metadata should be deleted and re-downloaded even if it is correct
* @cancellable: a #GCancellable or %NULL
@@ -2113,38 +2017,35 @@ pk_task_refresh_cache_async (PkTask *task, gboolean force, GCancellable *cancell
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_REFRESH_CACHE;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->force = force;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_get_repo_list_async:
+ * pk_task_get_repo_list_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @filters: a bitfield of filters that can be used to limit the results
* @cancellable: a #GCancellable or %NULL
@@ -2162,38 +2063,35 @@ pk_task_get_repo_list_async (PkTask *task, PkBitfield filters, GCancellable *can
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_GET_REPO_LIST;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->filters = filters;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_repo_enable_async:
+ * pk_task_repo_enable_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @repo_id: The software repository ID
* @enabled: %TRUE or %FALSE
@@ -2212,39 +2110,36 @@ pk_task_repo_enable_async (PkTask *task, const gchar *repo_id, gboolean enabled,
PkProgressCallback progress_callback, gpointer progress_user_data,
GAsyncReadyCallback callback_ready, gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_TASK (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_install_packages_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_REPO_ENABLE;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
- state->ret = FALSE;
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->repo_id = g_strdup (repo_id);
state->enabled = enabled;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_install_packages_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
/* run task with callbacks */
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
- * pk_task_repair_system_async:
+ * pk_task_repair_system_async: (finish-func pk_task_generic_finish):
* @task: a valid #PkTask instance
* @cancellable: a #GCancellable or %NULL
* @progress_callback: (scope notified): the function to run when the progress changes
@@ -2264,36 +2159,35 @@ pk_task_repair_system_async (PkTask *task,
GAsyncReadyCallback callback_ready,
gpointer user_data)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
PkTaskState *state;
PkTaskClass *klass = PK_TASK_GET_CLASS (task);
- g_autoptr(GSimpleAsyncResult) res = NULL;
+ g_autoptr(GTask) gtask = NULL;
g_return_if_fail (PK_IS_CLIENT (task));
g_return_if_fail (callback_ready != NULL);
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- res = g_simple_async_result_new (G_OBJECT (task), callback_ready, user_data, pk_task_repair_system_async);
-
/* save state */
state = g_slice_new0 (PkTaskState);
state->role = PK_ROLE_ENUM_REPAIR_SYSTEM;
- state->res = g_object_ref (res);
- state->task = g_object_ref (task);
- if (cancellable != NULL)
- state->cancellable = g_object_ref (cancellable);
state->transaction_flags = pk_bitfield_value (PK_TRANSACTION_FLAG_ENUM_ONLY_TRUSTED);
state->progress_callback = progress_callback;
state->progress_user_data = progress_user_data;
state->request = pk_task_generate_request_id ();
+ gtask = g_task_new (task, cancellable, callback_ready, user_data);
+ g_task_set_source_tag (gtask, pk_task_repair_system_async);
g_debug ("adding state %p", state);
- g_ptr_array_add (task->priv->array, state);
+ g_hash_table_insert (priv->gtasks, GUINT_TO_POINTER (state->request), g_object_ref (gtask));
+ g_task_set_task_data (gtask, g_steal_pointer (&state), pk_task_state_free);
+
/* start trusted repair system async */
- if (task->priv->simulate && klass->simulate_question != NULL)
- pk_task_do_async_simulate_action (state);
+ if (priv->simulate && klass->simulate_question != NULL)
+ pk_task_do_async_simulate_action (g_steal_pointer (>ask));
else
- pk_task_do_async_action (state);
+ pk_task_do_async_action (g_steal_pointer (>ask));
}
/**
@@ -2311,18 +2205,21 @@ pk_task_repair_system_async (PkTask *task,
PkResults *
pk_task_generic_finish (PkTask *task, GAsyncResult *res, GError **error)
{
- GSimpleAsyncResult *simple;
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+ GTask *gtask;
+ PkTaskState *state;
g_return_val_if_fail (PK_IS_TASK (task), NULL);
- g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (res), NULL);
+ g_return_val_if_fail (g_task_is_valid (res, task), NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
- simple = G_SIMPLE_ASYNC_RESULT (res);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
+ gtask = G_TASK (res);
+ state = g_task_get_task_data (gtask);
+ /* remove from table */
+ g_debug ("remove state %p", state);
+ g_hash_table_remove (priv->gtasks, GUINT_TO_POINTER (state->request));
- return g_object_ref (g_simple_async_result_get_op_res_gpointer (simple));
+ return g_task_propagate_pointer (gtask, error);
}
/**
@@ -2337,9 +2234,15 @@ pk_task_generic_finish (PkTask *task, GAsyncResult *res, GError **error)
void
pk_task_set_simulate (PkTask *task, gboolean simulate)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_if_fail (PK_IS_TASK (task));
- task->priv->simulate = simulate;
- g_object_notify (G_OBJECT (task), "simulate");
+
+ if (priv->simulate == simulate)
+ return;
+
+ priv->simulate = simulate;
+ g_object_notify_by_pspec (G_OBJECT(task), obj_properties[PROP_SIMULATE]);
}
/**
@@ -2355,8 +2258,11 @@ pk_task_set_simulate (PkTask *task, gboolean simulate)
gboolean
pk_task_get_simulate (PkTask *task)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_val_if_fail (PK_IS_TASK (task), FALSE);
- return task->priv->simulate;
+
+ return priv->simulate;
}
/**
@@ -2372,9 +2278,15 @@ pk_task_get_simulate (PkTask *task)
void
pk_task_set_only_download (PkTask *task, gboolean only_download)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_if_fail (PK_IS_TASK (task));
- task->priv->only_download = only_download;
- g_object_notify (G_OBJECT (task), "only-download");
+
+ if (priv->only_download == only_download)
+ return;
+
+ priv->only_download = only_download;
+ g_object_notify_by_pspec (G_OBJECT(task), obj_properties[PROP_ONLY_DOWNLOAD]);
}
/**
@@ -2390,8 +2302,11 @@ pk_task_set_only_download (PkTask *task, gboolean only_download)
gboolean
pk_task_get_only_download (PkTask *task)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_val_if_fail (PK_IS_TASK (task), FALSE);
- return task->priv->only_download;
+
+ return priv->only_download;
}
@@ -2408,16 +2323,22 @@ pk_task_get_only_download (PkTask *task)
void
pk_task_set_only_trusted (PkTask *task, gboolean only_trusted)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_if_fail (PK_IS_TASK (task));
- task->priv->only_trusted = only_trusted;
- g_object_notify (G_OBJECT (task), "only-trusted");
+
+ if (priv->only_trusted == only_trusted)
+ return;
+
+ priv->only_trusted = only_trusted;
+ g_object_notify_by_pspec (G_OBJECT(task), obj_properties[PROP_ONLY_TRUSTED]);
}
/**
* pk_task_get_only_trusted:
* @task: a valid #PkTask instance
*
- * Gets if we allow only authenticated packages in the transactoin.
+ * Gets if we allow only authenticated packages in the transaction.
*
* Return value: %TRUE if we allow only authenticated packages
*
@@ -2426,8 +2347,11 @@ pk_task_set_only_trusted (PkTask *task, gboolean only_trusted)
gboolean
pk_task_get_only_trusted (PkTask *task)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_val_if_fail (PK_IS_TASK (task), FALSE);
- return task->priv->only_trusted;
+
+ return priv->only_trusted;
}
/**
@@ -2442,9 +2366,15 @@ pk_task_get_only_trusted (PkTask *task)
void
pk_task_set_allow_downgrade (PkTask *task, gboolean allow_downgrade)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_if_fail (PK_IS_TASK (task));
- task->priv->allow_downgrade = allow_downgrade;
- g_object_notify (G_OBJECT (task), "allow-downgrade");
+
+ if (priv->allow_downgrade == allow_downgrade)
+ return;
+
+ priv->allow_downgrade = allow_downgrade;
+ g_object_notify_by_pspec (G_OBJECT(task), obj_properties[PROP_ALLOW_DOWNGRADE]);
}
/**
@@ -2460,8 +2390,11 @@ pk_task_set_allow_downgrade (PkTask *task, gboolean allow_downgrade)
gboolean
pk_task_get_allow_downgrade (PkTask *task)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_val_if_fail (PK_IS_TASK (task), FALSE);
- return task->priv->allow_downgrade;
+
+ return priv->allow_downgrade;
}
/**
@@ -2476,9 +2409,15 @@ pk_task_get_allow_downgrade (PkTask *task)
void
pk_task_set_allow_reinstall (PkTask *task, gboolean allow_reinstall)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_if_fail (PK_IS_TASK (task));
- task->priv->allow_reinstall = allow_reinstall;
- g_object_notify (G_OBJECT (task), "allow-reinstall");
+
+ if (priv->allow_reinstall == allow_reinstall)
+ return;
+
+ priv->allow_reinstall = allow_reinstall;
+ g_object_notify_by_pspec (G_OBJECT (task), obj_properties[PROP_ALLOW_REINSTALL]);
}
/**
@@ -2494,8 +2433,11 @@ pk_task_set_allow_reinstall (PkTask *task, gboolean allow_reinstall)
gboolean
pk_task_get_allow_reinstall (PkTask *task)
{
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
g_return_val_if_fail (PK_IS_TASK (task), FALSE);
- return task->priv->allow_reinstall;
+
+ return priv->allow_reinstall;
}
/*
@@ -2505,13 +2447,13 @@ static void
pk_task_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
PkTask *task = PK_TASK (object);
- PkTaskPrivate *priv = task->priv;
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
switch (prop_id) {
case PROP_SIMULATE:
g_value_set_boolean (value, priv->simulate);
break;
- case PROP_ONLY_PREPARE:
+ case PROP_ONLY_DOWNLOAD:
g_value_set_boolean (value, priv->only_download);
break;
case PROP_ONLY_TRUSTED:
@@ -2536,13 +2478,13 @@ static void
pk_task_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
PkTask *task = PK_TASK (object);
- PkTaskPrivate *priv = task->priv;
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
switch (prop_id) {
case PROP_SIMULATE:
priv->simulate = g_value_get_boolean (value);
break;
- case PROP_ONLY_PREPARE:
+ case PROP_ONLY_DOWNLOAD:
priv->only_download = g_value_get_boolean (value);
break;
case PROP_ONLY_TRUSTED:
@@ -2566,7 +2508,6 @@ pk_task_set_property (GObject *object, guint prop_id, const GValue *value, GPara
static void
pk_task_class_init (PkTaskClass *klass)
{
- GParamSpec *pspec;
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = pk_task_finalize;
object_class->get_property = pk_task_get_property;
@@ -2579,10 +2520,10 @@ pk_task_class_init (PkTaskClass *klass)
*
* Since: 0.5.2
*/
- pspec = g_param_spec_boolean ("simulate", NULL, NULL,
+ obj_properties[PROP_SIMULATE] =
+ g_param_spec_boolean ("simulate", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_SIMULATE, pspec);
/**
* PkTask:only-download:
@@ -2591,10 +2532,10 @@ pk_task_class_init (PkTaskClass *klass)
*
* Since: 0.8.1
*/
- pspec = g_param_spec_boolean ("only-download", NULL, NULL,
+ obj_properties[PROP_ONLY_DOWNLOAD] =
+ g_param_spec_boolean ("only-download", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ONLY_PREPARE, pspec);
/**
* PkTask:only-trusted:
@@ -2603,10 +2544,10 @@ pk_task_class_init (PkTaskClass *klass)
*
* Since: 0.9.5
*/
- pspec = g_param_spec_boolean ("only-trusted", NULL, NULL,
+ obj_properties[PROP_ONLY_TRUSTED] =
+ g_param_spec_boolean ("only-trusted", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ONLY_TRUSTED, pspec);
/**
* PkTask:allow-reinstall:
@@ -2615,10 +2556,10 @@ pk_task_class_init (PkTaskClass *klass)
*
* Since: 1.0.2
*/
- pspec = g_param_spec_boolean ("allow-reinstall", NULL, NULL,
+ obj_properties[PROP_ALLOW_REINSTALL] =
+ g_param_spec_boolean ("allow-reinstall", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ALLOW_REINSTALL, pspec);
/**
* PkTask:allow-downgrade:
@@ -2627,12 +2568,12 @@ pk_task_class_init (PkTaskClass *klass)
*
* Since: 1.0.2
*/
- pspec = g_param_spec_boolean ("allow-downgrade", NULL, NULL,
+ obj_properties[PROP_ALLOW_DOWNGRADE] =
+ g_param_spec_boolean ("allow-downgrade", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_property (object_class, PROP_ALLOW_DOWNGRADE, pspec);
- g_type_class_add_private (klass, sizeof (PkTaskPrivate));
+ g_object_class_install_properties (object_class, PROP_LAST, obj_properties);
}
/*
@@ -2641,11 +2582,13 @@ pk_task_class_init (PkTaskClass *klass)
static void
pk_task_init (PkTask *task)
{
- task->priv = PK_TASK_GET_PRIVATE (task);
- task->priv->array = g_ptr_array_new ();
- task->priv->simulate = TRUE;
- task->priv->allow_reinstall = FALSE;
- task->priv->allow_downgrade = FALSE;
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
+ task->priv = priv;
+ priv->gtasks = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_object_unref);
+ priv->simulate = TRUE;
+ priv->allow_reinstall = FALSE;
+ priv->allow_downgrade = FALSE;
}
/*
@@ -2655,7 +2598,10 @@ static void
pk_task_finalize (GObject *object)
{
PkTask *task = PK_TASK (object);
- g_ptr_array_unref (task->priv->array);
+ PkTaskPrivate *priv = pk_task_get_instance_private (task);
+
+ g_clear_pointer (&priv->gtasks, g_hash_table_unref);
+
G_OBJECT_CLASS (pk_task_parent_class)->finalize (object);
}
diff --git a/lib/python/packagekit/meson.build b/lib/python/packagekit/meson.build
index c7a7258..c3d50c2 100644
--- a/lib/python/packagekit/meson.build
+++ b/lib/python/packagekit/meson.build
@@ -10,7 +10,7 @@ packagekit_py_sources = [
if get_option('python_backend')
enums_py = custom_target(
'enums.py',
- input: join_paths(meson.source_root(), 'lib', 'packagekit-glib2', 'pk-enum.c'),
+ input: join_paths(source_root, 'lib', 'packagekit-glib2', 'pk-enum.c'),
output: 'enums.py',
command: [
python_exec,
diff --git a/meson.build b/meson.build
index 6166955..2ff208a 100644
--- a/meson.build
+++ b/meson.build
@@ -1,14 +1,16 @@
project('PackageKit', 'c',
- version : '1.2.8',
+ version : '1.3.1',
license : 'LGPL-2.1+',
- meson_version : '>=0.50',
- default_options : ['warning_level=2', 'c_std=c99'],
+ meson_version : '>=1.0',
+ default_options : ['warning_level=2', 'c_std=gnu11'],
)
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
+source_root = meson.project_source_root()
+
glib_dep = dependency('glib-2.0', version: '>=2.62')
gobject_dep = dependency('gobject-2.0')
gio_dep = dependency('gio-2.0')
@@ -29,24 +31,22 @@ if get_option('systemd')
systemd = dependency('systemd')
endif
if systemd_system_unit_dir == ''
- systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ systemd_system_unit_dir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir')
endif
if systemd_user_unit_dir == ''
- systemd_user_unit_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
+ systemd_user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir')
endif
add_project_arguments ('-DHAVE_SYSTEMD_SD_DAEMON_H=1', language: 'c')
add_project_arguments ('-DHAVE_SYSTEMD_SD_LOGIN_H=1', language: 'c')
-else
- if get_option('offline_update')
- error('Offline updates requires Systemd, use -Dsystemd=true to enable it or -Doffline_update=false to disable offline updates')
- endif
+ add_project_arguments ('-DHAVE_SYSTEMD_SD_JOURNAL_H=1', language: 'c')
endif
elogind = []
if get_option('elogind')
elogind = dependency('elogind', version: '>=229.4')
add_project_arguments ('-DHAVE_SYSTEMD_SD_LOGIN_H=1', language: 'c')
+ add_project_arguments ('-DHAVE_SYSTEMD_SD_JOURNAL_H=1', language: 'c')
endif
if get_option('local_checkout')
@@ -101,48 +101,90 @@ config_dep = declare_dependency(
pk_db_dir = join_paths(get_option('localstatedir'), 'lib', 'PackageKit')
local_state_dir = get_option('localstatedir')
-test_data_dir = join_paths(meson.source_root(), 'tests', 'data')
+test_data_dir = join_paths(source_root, 'tests', 'data')
package_data_dir = get_option('datadir')
package_locale_dir = join_paths(get_option('prefix'), get_option('datadir'), 'locale')
pk_plugin_dir = join_paths(get_option('prefix'), get_option('libdir'), 'packagekit-backend')
-# work both in C and C++
+# default compiler flags for C and C++
add_project_arguments(
- '-Wall',
- '-Wcast-align', '-Wno-uninitialized',
- '-Wmissing-declarations',
- '-Wredundant-decls',
- '-Wpointer-arith',
- '-Wcast-align',
- '-Wwrite-strings',
- '-Winit-self',
- '-Wreturn-type',
- '-Wformat-nonliteral',
- '-Wformat-security',
- '-Wmissing-include-dirs',
- '-Wmissing-format-attribute',
- '-Wclobbered',
- '-Wempty-body',
- '-Wignored-qualifiers',
- '-Wsign-compare',
- '-Wtype-limits',
- '-Wuninitialized',
- '-Wno-unused-parameter',
+ '-Wcast-align',
+ '-Wno-uninitialized',
+ '-Werror=missing-declarations',
+ '-Wredundant-decls',
+ '-Wpointer-arith',
+ '-Wcast-align',
+ '-Wwrite-strings',
+ '-Winit-self',
+ '-Wreturn-type',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wmissing-include-dirs',
+ '-Wmissing-format-attribute',
+ '-Wclobbered',
+ '-Wempty-body',
+ '-Wignored-qualifiers',
+ '-Wsign-compare',
+ '-Wtype-limits',
+ '-Wuninitialized',
+ '-Wno-unused-parameter',
+ '-Wno-error=unused-parameter',
+ '-Werror=misleading-indentation',
+ '-Werror=return-type',
+ '-Werror=format-security',
+ '-Werror=missing-declarations',
+ '-Werror=pointer-arith',
+ '-Werror=empty-body',
+
language: ['c', 'cpp']
)
-# work only in C
+# default compiler warning/error flags for C only
add_project_arguments(
- '-Waggregate-return',
- '-Wdeclaration-after-statement',
- '-Wshadow',
- '-Wno-strict-aliasing',
- '-Winline',
- '-Wmissing-parameter-type',
- '-Woverride-init',
+ cc.get_supported_arguments([
+ '-Werror=shadow',
+ '-Werror=strict-prototypes',
+ '-Werror=missing-prototypes',
+ '-Werror=implicit-function-declaration',
+ '-Werror=int-conversion',
+ '-Werror=incompatible-pointer-types',
+ '-Werror=missing-include-dirs',
+ '-Werror=declaration-after-statement',
+ '-Waggregate-return',
+ '-Wno-strict-aliasing',
+ '-Winline',
+ '-Wmissing-parameter-type',
+ '-Woverride-init',
+ ]),
language: 'c'
)
+# default warning flags for C++ only
+add_project_arguments(
+ '-Werror=init-self',
+ language: 'cpp'
+)
+
+# maintainer mode is even stricter
+if get_option('maintainer')
+ add_project_arguments(
+ '-Werror',
+ '-Wall',
+ '-Wextra',
+ '-Wcast-align',
+ '-Wno-uninitialized',
+ '-Wempty-body',
+ '-Winit-self',
+ '-Wnull-dereference',
+ '-Wfloat-equal',
+ '-Winline',
+ '-Wno-error=comment',
+ '-Werror=format-security',
+
+ language: ['c', 'cpp']
+ )
+endif
+
subdir('po')
subdir('policy')
subdir('etc')
diff --git a/meson_options.txt b/meson_options.txt
index c864961..9411267 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,22 +1,118 @@
-option('packaging_backend', type : 'array', choices : ['alpm', 'apt', 'dnf', 'dummy', 'entropy', 'pisi', 'poldek', 'portage', 'slack', 'zypp', 'nix', 'freebsd'], value : ['dummy'], description : 'The name of the backend to use')
-option('dnf_vendor', type : 'combo', choices : ['fedora', 'mageia', 'openmandriva', 'rosa', 'opensuse'], value : 'fedora', description : 'Vendor configuration when using the dnf backend')
-option('systemd', type : 'boolean', value : true, description : 'Use systemd and logind')
-option('systemdsystemunitdir', type : 'string', value : '', description : 'Directory for systemd service files')
-option('systemduserunitdir', type : 'string', value : '', description : 'Directory for systemd user service files')
-option('offline_update', type : 'boolean', value : true, description : 'Use systemd offline update')
-option('elogind', type : 'boolean', value : false, description : 'Use elogind instead of systemd-login')
-option('gobject_introspection', type : 'boolean', value : true, description : 'Build GObject Introspection data')
-option('man_pages', type : 'boolean', value : true, description : 'Generate man pages')
-option('gtk_doc', type : 'boolean', value : false, description : 'Generate API reference')
-option('bash_completion', type : 'boolean', value : true, description : 'Bash completion')
-option('bash_command_not_found', type : 'boolean', value : true, description : 'Build Bash command-not-found functionality')
-option('packagekit_user', type : 'string', value : 'root', description : 'User for running the PackageKit daemon')
-option('local_checkout', type : 'boolean', value : false, description : 'Allow running in local checkout')
-option('gstreamer_plugin', type : 'boolean', value : true, description : 'Build gstreamer plugin functionality')
-option('gtk_module', type : 'boolean', value : true, description : 'Build GTK+-3 module functionality')
-option('cron', type : 'boolean', value : true, description : 'Build cron background functionality')
-option('dbus_sys', type : 'string', value : '', description : 'D-BUS system.d directory')
-option('dbus_services', type : 'string', value : '', description : 'D-BUS system-services directory')
-option('python_backend', type : 'boolean', value : true, description : 'Provide a python backend')
-option('pythonpackagedir', type : 'string', value : '', description : 'Location for python modules')
-option('daemon_tests', type : 'boolean', value : true, description : 'Test the daemon using the dummy backend')
+option('maintainer',
+ type : 'boolean',
+ value : false,
+ description : 'Enable maintainer mode (use strict compiler flags, e.g. -Werror)'
+)
+
+option('packaging_backend',
+ type : 'array',
+ choices : ['alpm', 'apt', 'dnf', 'dummy', 'entropy', 'pisi', 'poldek', 'portage', 'slack', 'zypp', 'nix', 'freebsd'],
+ value : ['dummy'],
+ description : 'The name of the backend to use'
+)
+option('dnf_vendor',
+ type : 'combo',
+ choices : ['fedora', 'mageia', 'openmandriva', 'rosa', 'opensuse'],
+ value : 'fedora',
+ description : 'Vendor configuration when using the dnf backend'
+)
+
+option('systemd',
+ type : 'boolean',
+ value : true, description : 'Use systemd and logind'
+)
+option('systemdsystemunitdir',
+ type : 'string',
+ value : '',
+ description : 'Directory for systemd service files'
+)
+option('systemduserunitdir',
+ type : 'string',
+ value : '',
+ description : 'Directory for systemd user service files'
+)
+option('offline_update',
+ type : 'boolean',
+ value : true,
+ description : 'Use systemd offline update'
+)
+option('elogind',
+ type : 'boolean',
+ value : false,
+ description : 'Use elogind instead of systemd-login'
+)
+option('gobject_introspection',
+ type : 'boolean',
+ value : true,
+ description : 'Build GObject Introspection data'
+)
+option('man_pages',
+ type : 'boolean',
+ value : true,
+ description : 'Generate man pages'
+)
+option('gtk_doc',
+ type : 'boolean',
+ value : false,
+ description : 'Generate API reference'
+)
+option('bash_completion',
+ type : 'boolean',
+ value : true,
+ description : 'Bash completion'
+)
+option('bash_command_not_found',
+ type : 'boolean',
+ value : true,
+ description : 'Build Bash command-not-found functionality'
+)
+option('packagekit_user',
+ type : 'string',
+ value : 'root',
+ description : 'User for running the PackageKit daemon'
+)
+option('local_checkout',
+ type : 'boolean',
+ value : false,
+ description : 'Allow running in local checkout'
+)
+option('gstreamer_plugin',
+ type : 'boolean',
+ value : true,
+ description : 'Build gstreamer plugin functionality'
+)
+option('gtk_module',
+ type : 'boolean',
+ value : true,
+ description : 'Build GTK+-3 module functionality'
+)
+option('cron',
+ type : 'boolean',
+ value : true,
+ description : 'Build cron background functionality'
+)
+option('dbus_sys',
+ type : 'string',
+ value : '',
+ description : 'D-BUS system.d directory'
+)
+option('dbus_services',
+ type : 'string',
+ value : '',
+ description : 'D-BUS system-services directory'
+)
+option('python_backend',
+ type : 'boolean',
+ value : true,
+ description : 'Provide a python backend'
+)
+option('pythonpackagedir',
+ type : 'string',
+ value : '',
+ description : 'Location for python modules'
+)
+option('daemon_tests',
+ type : 'boolean',
+ value : true,
+ description : 'Test the daemon using the dummy backend'
+)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index b354aa0..457f078 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -8,6 +8,7 @@ contrib/command-not-found/pk-command-not-found.c
lib/packagekit-glib2/pk-console-shared.c
lib/packagekit-glib2/pk-debug.c
lib/packagekit-glib2/pk-enum.c
+lib/packagekit-glib2/pk-progress-bar.c
lib/packagekit-glib2/pk-task-text.c
policy/org.freedesktop.packagekit.policy.in
src/pk-direct.c
diff --git a/po/ar.po b/po/ar.po
index b09df30..1319635 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# zayed , 2022
+# zayed , 2022,2024
msgid ""
msgstr ""
"Project-Id-Version: PackageKit\n"
@@ -70,6 +70,42 @@ msgstr "المؤلف"
msgid "Automatically remove unused dependencies"
msgstr "أزل الاعتماديات غير المستعملة بشكل آلي"
+#. TRANSLATORS: if the repo is disabled
+msgid "Disabled"
+msgstr "معطلة"
+
+#. TRANSLATORS: if the repo is enabled
+msgid "Enabled"
+msgstr "ممكنة"
+
+#. TRANSLATORS: we failed to get any results, which is pretty
+#. * fatal in my book
+msgid "Fatal error"
+msgstr "خطأ فادح"
+
+#. TRANSLATORS: we asked to install a package
+#. * that could not be found in any repo
+msgid "Package not found"
+msgstr "الحزمة غير موجودة"
+
+#. TRANSLATORS: the percentage complete of the transaction
+msgid "Percentage"
+msgstr "النسبة"
+
+#. TRANSLATORS: the results from the transaction
+msgid "Results:"
+msgstr "النتيجة:"
+
+#. TRANSLATORS: the status of the transaction (e.g. downloading)
+msgid "Status"
+msgstr "الحالة"
+
+#. TRANSLATORS: details about the update, date the update
+#. * was updated
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Updated"
+msgstr "محدثة"
+
#. TRANSLATORS: transaction state, waiting for user to type in a password
msgid "Waiting for authentication"
msgstr "في انتظار الاستيثاق"
diff --git a/po/be.po b/po/be.po
new file mode 100644
index 0000000..ba6a122
--- /dev/null
+++ b/po/be.po
@@ -0,0 +1,1446 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PackageKit package.
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: PackageKit\n"
+"Report-Msgid-Bugs-To: \n"
+"Language-Team: Belarusian (http://app.transifex.com/freedesktop/packagekit/language/be/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: be\n"
+"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
+
+msgid "(seconds)"
+msgstr "(секунд)"
+
+#. TRANSLATORS: The user specified
+#. * an invalid action
+msgid "A correct role is required"
+msgstr "Патрабуецца ўказаць правільную ролю"
+
+#. TRANSLATORS: the user did not
+#. * specify anything about what to
+#. * download or where
+msgid "A destination directory and the package names to download are required"
+msgstr "Патрабуецца ўказаць каталог прызначэння і назвы пакетаў, якія неабходна спампаваць"
+
+msgid "A filename is required"
+msgstr "Патрабуецца ўказаць назву файла"
+
+#. TRANSLATORS: the user did not
+#. * specify what they wanted to install
+msgid "A filename to install is required"
+msgstr "Патрабуецца ўказаць назву файла, які неабходна ўсталяваць"
+
+#. TRANSLATORS: geeky error, real
+#. * users won't see this
+msgid "A licence identifier (eula-id) is required"
+msgstr "Патрабуецца ўказаць ідэнтыфікатар ліцэнзіі (eula-id)"
+
+#. TRANSLATORS: The user did not
+#. * provide a package name
+msgid "A package name is required"
+msgstr "Патрабуецца ўказаць назву пакета"
+
+#. TRANSLATORS: the user did not
+#. * specify what they wanted to install
+msgid "A package name to install is required"
+msgstr "Патрабуецца ўказаць назву пакета, які неабходна ўсталяваць"
+
+#. TRANSLATORS: the user did not
+#. * specify what they wanted to remove
+msgid "A package name to remove is required"
+msgstr "Патрабуецца ўказаць назву пакета, які неабходна выдаліць"
+
+#. TRANSLATORS: The user did not
+#. * specify a package name
+msgid "A package name to resolve is required"
+msgstr "Патрабуецца ўказаць назву пакета для развязвання"
+
+#. TRANSLATORS: each package
+#. * "provides" certain things, e.g.
+#. * mime(gstreamer-decoder-mp3),
+#. * the user didn't specify it
+msgid "A package provide string is required"
+msgstr "Патрабуецца ўказаць радок зместу (provide) пакета"
+
+msgid "A repo id and autoremove required"
+msgstr "Патрабуецца ўказаць ідэнтыфікатар сховішча і autoremove"
+
+msgid "A repo name, parameter and value are required"
+msgstr "Патрабуецца ўказаць назву сховішча, параметр і значэнне"
+
+#. TRANSLATORS: The user did not
+#. * specify a repository name
+msgid "A repository name is required"
+msgstr "Патрабуецца ўказаць назву рэпазіторыя"
+
+#. TRANSLATORS: the user
+#. * needs to provide a search term
+#. TRANSLATORS: the user needs
+#. * to provide a search term
+msgid "A search term is required"
+msgstr "Патрабуецца ўказаць слова для пошуку"
+
+#. TRANSLATORS: a search type can
+#. * be name, details, file, etc
+msgid "A search type is required, e.g. name"
+msgstr "Патрабуецца ўказаць тып пошуку, напрыклад name"
+
+#. TRANSLATORS: geeky error, real
+#. * users won't see this
+msgid "A type, key_id and package_id are required"
+msgstr "Патрабуецца ўказаць тып, ідэнтыфікатар ключа і ідэнтыфікатар пакета"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to accept new
+#. licence agreements.
+#. - Change this to 'auth_admin' for environments where users should not
+#. be given the option to make legal decisions.
+msgid "Accept EULA"
+msgstr "Прыняць ліцэнзійнае пагадненне"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Accepting EULA"
+msgstr "Прыняцце пагаднення"
+
+#. TRANSLATORS: these are packages touched by the transaction
+msgid "Affected packages:"
+msgstr "Закранутыя пакеты:"
+
+#. TRANSLATORS: these are packages touched by the transaction
+msgid "Affected packages: None"
+msgstr "Закранутыя пакеты: Няма"
+
+#. TRANSLATORS: the EULA text itself (long and boring)
+msgid "Agreement"
+msgstr "Ліцэнзійнае пагадненне"
+
+#. TRANSLATORS: this is a command alias
+#, c-format
+msgid "Alias to %s"
+msgstr "Псеўданім для %s"
+
+#. command line argument, do we allow package downgrades
+msgid "Allow packages to be downgraded during transaction"
+msgstr "Дазволіць падчас трансакцыі паніжэнне версіі пакетаў"
+
+msgid "Allow packages to be reinstalled during transaction"
+msgstr "Дазволіць падчас трансакцыі пераўсталяванне пакетаў"
+
+#. command line argument, do we ask questions
+msgid "Allow untrusted packages to be installed."
+msgstr "Дазволіць усталяванне ненадзейных пакетаў."
+
+#. TRANSLATORS: The user didn't
+#. * specify what action to use
+msgid "An action, e.g. 'update-packages' is required"
+msgstr "Патрабуецца ўказаць дзеянне, напрыклад «update-packages»"
+
+#. TRANSLATORS: a package requires the application to be restarted
+msgid "Application restart required by:"
+msgstr "Патрабуе перазапуску праграмы:"
+
+msgid "Authentication is required to accept a EULA"
+msgstr "Каб прыняць ліцэнзійнае пагадненне, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to cancel a task that was not started by yourself"
+msgstr "Каб скасаваць чужую задачу, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to change software repository parameters"
+msgstr "Каб змяніць параметры рэпазіторыя праграм, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to clear the offline updates message"
+msgstr "Каб ачысціць паведамленне пазасеткавага абнаўлення, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to consider a key used for signing software as trusted"
+msgstr "Каб пазначыць ключ, якім падпісана праграма, як давераны, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to downgrade software"
+msgstr "Каб панізіць версію праграмы, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to install software"
+msgstr "Каб прыняць усталяваць праграму, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to install untrusted software"
+msgstr "Каб усталяваць ненадзейную праграму, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to refresh the system repositories"
+msgstr "Каб абнавіць рэпазіторыі сістэмы, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to reinstall software"
+msgstr "Каб зноў усталяваць наяўны пакет, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to remove software"
+msgstr "Каб выдаліць пакет, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to repair the installed software"
+msgstr "Каб аднавіць сістэму, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to set the network proxy used for downloading software"
+msgstr "Каб задаць проксі-сервер, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to trigger offline updates"
+msgstr "Каб запусціць пазасеткавыя абнаўленні, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to update software"
+msgstr "Каб абнавіць праграмнае забеспячэнне, патрабуецца аўтэнтыфікацыя"
+
+msgid "Authentication is required to upgrade the operating system"
+msgstr "Каб абнавіць сістэму, патрабуецца аўтэнтыфікацыя"
+
+#. TRANSLATORS: this is the author of the backend
+msgid "Author"
+msgstr "Аўтар"
+
+msgid "Automatically remove unused dependencies"
+msgstr "Аўтаматычна выдаляць непатрэбныя залежнасці"
+
+#. TRANSLATORS: The state of a package, i.e. not installed
+msgid "Available"
+msgstr "Даступны"
+
+#. TRANSLATORS: The type of update
+msgid "Blocked"
+msgstr "Заблакіраванае"
+
+#. TRANSLATORS: The type of update
+msgid "Bug fix"
+msgstr "Выпраўленне памылак"
+
+#. TRANSLATORS: details about the update, the bugzilla URLs
+msgid "Bugzilla"
+msgstr "Bugzilla"
+
+#. TRANSLATORS: details about the update, the CVE URLs
+msgid "CVE"
+msgstr "CVE"
+
+#. SECURITY:
+#. - Normal users are allowed to cancel their own task without
+#. authentication, but a different user id needs the admin password
+#. to cancel another users task.
+msgid "Cancel foreign task"
+msgstr "Скасаваць чужую задачу"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Canceling"
+msgstr "Скасаванне"
+
+#. TRANSLATORS: transaction state, in the process of cancelling
+msgid "Cancelling"
+msgstr "Скасоўванне"
+
+#. TRANSLATORS: this is the group category name
+msgid "Category"
+msgstr "Катэгорыя"
+
+#. SECURITY:
+#. - Normal users require admin authentication to enable or disable
+#. software repositories as this can be used to enable new updates or
+#. install different versions of software.
+msgid "Change software repository parameters"
+msgstr "Змяніць параметры рэпазіторыя праграм"
+
+#. TRANSLATORS: details about the update, the changelog for
+#. * the package
+msgid "Changes"
+msgstr "Змены"
+
+#. TRANSLATORS: transaction state, we are checking executable files currently
+#. in use
+msgid "Checking applications in use"
+msgstr "Пошук праграм, якія цяпер выкарыстоўваюцца"
+
+#. TRANSLATORS: transaction state, we are checking for libraries currently in
+#. use
+msgid "Checking libraries in use"
+msgstr "Пошук бібліятэк, якія цяпер выкарыстоўваюцца"
+
+#. TRANSLATORS: transaction state, checking if we have all the security keys
+#. for the operation
+msgid "Checking signatures"
+msgstr "Праверка подпісаў"
+
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Cleaned up"
+msgstr "Ачышчаны"
+
+#. TRANSLATORS: The action of the package, in present tense
+msgid "Cleaning up"
+msgstr "Ачыстка"
+
+#. TRANSLATORS: transaction state, removing old packages, and cleaning config
+#. files
+msgid "Cleaning up packages"
+msgstr "Ачыстка пакетаў"
+
+#. SECURITY:
+#. - Normal users are able to clear the updates message that is
+#. shown after an updates are applied at boot time.
+msgid "Clear offline update message"
+msgstr "Ачысціць паведамленне пазасеткавага абнаўлення"
+
+#. TRANSLATORS: Generic failure of what they asked to do
+msgid "Command failed"
+msgstr "Не ўдалося выканаць каманду"
+
+#. TRANSLATORS: this is The command line used to do the action
+msgid "Command line"
+msgstr "Камандны радок"
+
+msgid "Command not found, valid commands are:"
+msgstr "Каманда не знойдзена, магчымыя каманды:"
+
+#. TRANSLATORS: transaction state, when we're writing to the system package
+#. database
+msgid "Committing changes"
+msgstr "Зацвярджэнне змен"
+
+msgid "Config file was not found."
+msgstr "Файл канфігурацыі не знойдзены."
+
+#. TRANSLATORS: transaction state, we are copying package files before or
+#. after the transaction
+msgid "Copying files"
+msgstr "Капіяванне файлаў"
+
+msgid "Debugging Options"
+msgstr "Параметры адладкі"
+
+#. TRANSLATORS: this is the description of the backend
+msgid "Description"
+msgstr "Апісанне"
+
+#. TRANSLATORS: this is a header for the package that can be updated
+msgid "Details about the update:"
+msgstr "Звесткі пра абнаўленне:"
+
+#. TRANSLATORS: the directory does
+#. * not exist, so we can't continue
+msgid "Directory not found"
+msgstr "Каталог не знойдзены"
+
+#. TRANSLATORS: if we should not monitor how long we are inactive for
+msgid "Disable the idle timer"
+msgstr "Адключыць лічыльнік часу бяздзейнасці"
+
+#. TRANSLATORS: if the repo is disabled
+msgid "Disabled"
+msgstr "Адключана"
+
+#. TRANSLATORS: this is the distro, e.g. Fedora 10
+msgid "Distribution"
+msgstr "Дыстрыбутыў"
+
+msgid "Do not install these packages unless you are sure it is safe to do so."
+msgstr "Не ўсталёўвайце гэтыя пакеты, калі не ўпэўнены ў іх бяспечнасці."
+
+msgid "Do not install this package unless you are sure it is safe to do so."
+msgstr "Не ўсталёўвайце гэты пакет, калі не ўпэўнены ў яго бяспечнасці."
+
+msgid "Do not update these packages unless you are sure it is safe to do so."
+msgstr "Не абнаўляйце гэтыя пакеты, калі не ўпэўнены ў іх бяспечнасці."
+
+msgid "Do not update this package unless you are sure it is safe to do so."
+msgstr "Не абнаўляйце гэты пакет, калі не ўпэўнены ў яго бяспечнасці."
+
+#. TRANSLATORS: ask the user if they've read and accepted the EULA
+msgid "Do you accept this agreement?"
+msgstr "Прыняць пагадненне?"
+
+#. TRANSLATORS: ask the user if they want to import
+msgid "Do you accept this signature?"
+msgstr "Прыняць гэты подпіс?"
+
+#. TRANSLATORS: ask the user if they are comfortable installing insecure
+#. packages
+msgid "Do you want to allow installing of unsigned software?"
+msgstr "Дазволіць ўсталяванне праграм без подпісу?"
+
+#. TRANSLATORS: don't unset environment variables, used for debugging
+msgid "Don't clear environment on startup"
+msgstr "Не ачышчаць асяроддзе падчас запуску"
+
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Downloaded"
+msgstr "Спампавана"
+
+#. TRANSLATORS: The action of the package, in present tense
+msgid "Downloading"
+msgstr "Спампоўванне"
+
+#. TRANSLATORS: downloading repo data so we can search
+msgid "Downloading details about the software repositories."
+msgstr "Спампоўванне звестак пра рэпазіторыі праграмнага забеспячэння."
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading file lists"
+msgstr "Спампоўванне спісаў файлаў"
+
+#. TRANSLATORS: downloading file lists so we can search
+msgid "Downloading filelists (this may take some time to complete)."
+msgstr "Спампоўванне спісаў файлаў (гэта зойме некаторы час)."
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading groups"
+msgstr "Спампоўванне груп"
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading list of packages"
+msgstr "Спампоўванне спіса пакетаў"
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading lists of changes"
+msgstr "Спампоўванне спісаў змен"
+
+#. TRANSLATORS: transaction state, downloading package files
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Downloading packages"
+msgstr "Спампоўванне пакетаў"
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading repository information"
+msgstr "Спампоўванне інфармацыі аб рэпазіторыіі"
+
+#. TRANSLATORS: transaction state, downloading metadata
+msgid "Downloading update information"
+msgstr "Спампоўванне інфармацыі пра абнаўленні"
+
+#. TRANSLATORS: this is The duration of the transaction
+msgid "Duration"
+msgstr "Працягласць"
+
+#. TRANSLATORS: if the repo is enabled
+msgid "Enabled"
+msgstr "Уключана"
+
+#. TRANSLATORS: this is another name for a software licence that has to be
+#. read before installing
+msgid "End user licence agreement required"
+msgstr "Патрабуецца ліцэнзійнае пагадненне"
+
+#. TRANSLATORS: The type of update
+msgid "Enhancement"
+msgstr "Паляпшэнне"
+
+#. TRANSLATORS: exit after we've started up, used for user profiling
+msgid "Exit after a small delay"
+msgstr "Выйсці пасля невялікай затрымкі"
+
+#. TRANSLATORS: exit straight away, used for automatic profiling
+msgid "Exit after the engine has loaded"
+msgstr "Выйсці пасля загрузкі рухавіка"
+
+#. TRANSLATORS: The user used
+#. * 'pkcon install dave.rpm' rather than
+#. * 'pkcon install-local dave.rpm'
+#, c-format
+msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
+msgstr "Чакалася назва пакета, але атрыманы файл. Паспрабуйце выкарыстаць каманду «pkcon install-local %s»."
+
+#. TRANSLATORS: we failed to contact the daemon
+msgid "Failed to contact PackageKit"
+msgstr "Не ўдалося звязацца з PackageKit"
+
+msgid "Failed to get daemon state"
+msgstr "Не ўдалося атрымаць стан дэмана"
+
+msgid "Failed to get properties"
+msgstr "Не ўдалося атрымаць уласцівасці"
+
+#. TRANSLATORS: we keep a database updated with the time that an
+#. * action was last executed
+msgid "Failed to get the time since this action was last completed"
+msgstr "Не ўдалося атрымаць час, калі было выканана гэта дзеянне"
+
+#. TRANSLATORS: we failed to install the package
+msgid "Failed to install packages"
+msgstr "Не ўдалося ўсталяваць пакет"
+
+#. TRANSLATORS: we failed to launch the executable, the error follows
+msgid "Failed to launch:"
+msgstr "Не ўдалося запусціць:"
+
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "Не ўдалося загрузіць файл канфігурацыі: %s"
+
+#. TRANSLATORS: cannot load the backend the user specified
+msgid "Failed to load the backend"
+msgstr "Не ўдалося загрузіць унутраную частку"
+
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "Не ўдалося загрузіць унутраную частку: %s"
+
+#. TRANSLATORS: probably not yet installed
+msgid "Failed to load the config file"
+msgstr "Не ўдалося загрузіць файл канфігурацыі"
+
+#. TRANSLATORS: the user didn't read the man page
+msgid "Failed to parse arguments"
+msgstr "Не ўдалося разабраць аргументы"
+
+#. TRANSLATORS: we failed to contact the daemon
+msgid "Failed to parse command line"
+msgstr "Не ўдалося разабраць аргументы каманднага радка"
+
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "Не ўдалося выканаць развязванне auto: %s"
+
+#. TRANSLATORS: we failed to find the package, this shouldn't happen
+msgid "Failed to search for file"
+msgstr "Не ўдалося знайсці файл"
+
+#. TRANSLATORS: cannot unload the backend the user specified
+msgid "Failed to unload the backend"
+msgstr "Не ўдалося выгрузіць унутраную частку"
+
+msgid "False"
+msgstr "Не"
+
+#. TRANSLATORS: we failed to get any results, which is pretty
+#. * fatal in my book
+msgid "Fatal error"
+msgstr "Фатальная памылка"
+
+#. TRANSLATORS: There was an error
+#. * getting the list of packages.
+#. * The filename follows
+#, c-format
+msgid "File already exists: %s"
+msgstr "Файл ужо існуе: %s"
+
+#. TRANSLATORS: transaction state, all done!
+msgid "Finished"
+msgstr "Завершана"
+
+#. TRANSLATORS: transaction state, generating a list of packages installed on
+#. the system
+msgid "Generating package lists"
+msgstr "Стварэнне спіса пакетаў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting categories"
+msgstr "Атрыманне катэгорый"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting dependencies"
+msgstr "Атрыманне залежнасцей"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting details"
+msgstr "Атрыманне звестак"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting file list"
+msgstr "Атрыманне спіса файлаў"
+
+#. TRANSLATORS: transaction state, getting data from a server
+msgid "Getting information"
+msgstr "Атрыманне інфармацыі"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting packages"
+msgstr "Атрыманне пакетаў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting provides"
+msgstr "Атрыманне даных пра змест"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting repositories"
+msgstr "Атрыманне рэпазіторыяў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting requires"
+msgstr "Атрыманне патрабаванняў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting system upgrades"
+msgstr "Атрыманне абнаўленняў сістэмы"
+
+#. TRANSLATORS: the transaction failed in a way we could not expect
+msgid "Getting the list of files failed"
+msgstr "Не ўдалося атрымаць спіс файлаў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting transactions"
+msgstr "Атрыманне трансакцый"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting update details"
+msgstr "Атрыманне звестак абнаўленняў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting updates"
+msgstr "Атрыманне абнаўленняў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting upgrades"
+msgstr "Атрыманне абнаўленняў"
+
+#. TRANSLATORS: this is group identifier
+msgid "ID"
+msgstr "Ідэнтыфікатар"
+
+#. TRANSLATORS: this is preferred icon for the group
+msgid "Icon"
+msgstr "Значок"
+
+#. TRANSLATORS: The type of update
+msgid "Important"
+msgstr "Важнае"
+
+#. SECURITY
+#. - Normal users require admin authentication to reinstall packages.
+#. - Authorization to install packages does not imply permissions to
+#. reinstall them and vice versa.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install already installed package again"
+msgstr "Усталяваць наяўны пакет зноў"
+
+#. SECURITY
+#. - Normal users require admin authentication to downgrade packages.
+#. - User authorized to downgrade signed packages is authorized to install
+#. them as well.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install older version of installed package"
+msgstr "Усталяваць больш старую версію наяўнага пакета"
+
+#. TRANSLATORS: command description
+msgid "Install package"
+msgstr "Усталяваць пакет"
+
+#. TRANSLATORS: as the user if we want to install a package to provide the
+#. command
+#, c-format
+msgid "Install package '%s' to provide command '%s'?"
+msgstr "Усталяваць пакет «%s», які забяспечыць выкананне каманды «%s»?"
+
+#. SECURITY:
+#. - Normal users need authentication to install signed packages
+#. from signed repositories, because otherwise the system is
+#. only as secure as the least-secure package available in the
+#. repositories.
+msgid "Install signed package"
+msgstr "Усталяваць падпісаны пакет"
+
+#. command line argument, do we ask questions
+msgid "Install the packages without asking for confirmation"
+msgstr "Усталяваць пакеты без пацвярджэння"
+
+#. SECURITY:
+#. - Normal users require admin authentication to install untrusted or
+#. unrecognised packages, as allowing users to do this without a
+#. password would be a massive security hole.
+#. - This is not retained as each package should be authenticated.
+msgid "Install untrusted local file"
+msgstr "Усталяваць ненадзейны лакальны файл"
+
+#. TRANSLATORS: The state of a package
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Installed"
+msgstr "Усталяваны"
+
+#. TRANSLATORS: The action of the package, in present tense
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Installing"
+msgstr "Усталяванне"
+
+#. TRANSLATORS: this is the message we send plymouth to
+#. * advise of the new percentage completion when installing system upgrades
+msgid "Installing System Upgrade"
+msgstr "Усталяванне абнаўлення сістэмы"
+
+#. TRANSLATORS: this is the message we send plymouth to
+#. * advise of the new percentage completion when installing updates
+msgid "Installing Updates"
+msgstr "Усталяванне абнаўленняў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Installing files"
+msgstr "Усталяванне файлаў"
+
+#. TRANSLATORS: transaction state, installing packages
+msgid "Installing packages"
+msgstr "Усталяванне пакетаў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Installing signature"
+msgstr "Усталяванне подпісу"
+
+#. TRANSLATORS: we've started doing offline system upgrade
+msgid "Installing system upgrade; this could take a while..."
+msgstr "Усталяванне абнаўленняў сістэмы, гэта зойме некаторы час..."
+
+#. TRANSLATORS: transaction state, installing updates
+msgid "Installing updates"
+msgstr "Усталяванне абнаўленняў"
+
+#. TRANSLATORS: we've started doing offline updates
+msgid "Installing updates; this could take a while..."
+msgstr "Усталяванне абнаўленняў, гэта зойме некаторы час..."
+
+#. TRANSLATORS: details about the update, date the update
+#. * was issued
+msgid "Issued"
+msgstr "Выдадзены"
+
+#. TRANSLATORS: the key ID, usually a few hex digits
+msgid "Key ID"
+msgstr "Ідэнтыфікатар ключа"
+
+#. TRANSLATORS: the timestamp (a bit like a machine readable time)
+msgid "Key Timestamp"
+msgstr "Часавы адбітак ключа"
+
+#. TRANSLATORS: the key URL
+msgid "Key URL"
+msgstr "URL ключа"
+
+#. TRANSLATORS: the key fingerprint, again, yet more hex
+msgid "Key fingerprint"
+msgstr "Адбітак ключа"
+
+#. TRANSLATORS: the username of the key
+msgid "Key user"
+msgstr "Карыстальнік ключа"
+
+#. TRANSLATORS: transaction state, loading databases
+msgid "Loading cache"
+msgstr "Загрузка кэшу"
+
+#. TRANSLATORS: loading package cache so we can search
+msgid "Loading list of packages."
+msgstr "Загрузка спіса пакетаў."
+
+#. TRANSLATORS: the user needs to change media inserted into the computer
+msgid "Media change required"
+msgstr "Патрабуецца памяняць носьбіт"
+
+#. TRANSLATORS: the media label, usually like 'disk-1of3'
+msgid "Media label"
+msgstr "Метка носьбіта"
+
+#. TRANSLATORS: the type, e.g. DVD, CD, etc
+msgid "Media type"
+msgstr "Тып носьбіта"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Modifying repository"
+msgstr "Змяненне рэпазіторыя"
+
+#. TRANSLATORS: more than one package could be found that matched,
+#. * to follow is a list of possible packages
+msgid "More than one package matches:"
+msgstr "Знойдзена больш за адзін пакет:"
+
+#. TRANSLATORS: this is the name of the parent group
+#. TRANSLATORS: this is the name of the backend
+msgid "Name"
+msgstr "Назва"
+
+#. TRANSLATORS: This where the package has no files
+msgid "No files"
+msgstr "Няма файлаў"
+
+#. TRANSLATORS: there are no updates, so nothing to do
+msgid "No packages require updating to newer versions."
+msgstr "Няма пакетаў, якім патрабуецца абнаўленне да больш новай версіі."
+
+#. TRANSLATORS: we couldn't find anything
+msgid "No packages were found"
+msgstr "Пакеты не знойдзены"
+
+#. TRANSLATORS: The type of update
+msgid "Normal"
+msgstr "Звычайнае"
+
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Obsoleted"
+msgstr "Замешчаны"
+
+#. TRANSLATORS: details about the update, any packages that
+#. * this update obsoletes
+msgid "Obsoletes"
+msgstr "Замяшчае"
+
+#. TRANSLATORS: The action of the package, in present tense
+msgid "Obsoleting"
+msgstr "Замяшчэнне"
+
+#. TRANSLATORS: transaction state, obsoleting old packages
+msgid "Obsoleting packages"
+msgstr "Замяшчэнне пакетаў"
+
+#. TRANSLATORS: The user tried to use an
+#. * unsupported option on the command line
+#, c-format
+msgid "Option '%s' is not supported"
+msgstr "Каманда «%s» не падтрымліваецца"
+
+#. TRANSLATORS: details about the update, package name and version
+#. TRANSLATORS: the package that is being processed
+#. TRANSLATORS: the package that is not signed by a known key
+#. TRANSLATORS: the package name that was trying to be installed
+msgid "Package"
+msgstr "Пакет"
+
+#. TRANSLATORS: This a list of details about the package
+msgid "Package description"
+msgstr "Апісанне пакета"
+
+#. TRANSLATORS: This a list files contained in the package
+msgid "Package files"
+msgstr "Файлы пакета"
+
+#. TRANSLATORS: we asked to install a package
+#. * that could not be found in any repo
+msgid "Package not found"
+msgstr "Пакет не знойдзены"
+
+#. TRANSLATORS: program name
+msgid "PackageKit"
+msgstr "PackageKit"
+
+#. TRANSLATORS: This is the header to the --help menu
+msgid "PackageKit Console Interface"
+msgstr "Кансольны інтэрфейс PackageKit"
+
+#. TRANSLATORS: this is a program that monitors PackageKit
+msgid "PackageKit Monitor"
+msgstr "Манітор PackageKit"
+
+#. TRANSLATORS: describing the service that is running
+msgid "PackageKit service"
+msgstr "Сэрвіс PackageKit"
+
+#. TRANSLATORS: Show the user a list of packages that provide this command
+msgid "Packages providing this file are:"
+msgstr "Файл пастаўляецца з гэтымі пакетамі:"
+
+#. TRANSLATORS: a backend is the system package tool, e.g. dnf, apt
+msgid "Packaging backend to use, e.g. dummy"
+msgstr "Унутраны сродак працы з пакетамі, напрыклад «dummy»"
+
+#. TRANSLATORS: this is the parent group
+msgid "Parent"
+msgstr "Бацькоўская"
+
+#. TRANSLATORS: the percentage complete of the transaction
+msgid "Percentage"
+msgstr "Працэнт"
+
+#. TRANSLATORS: ask the user to choose a file to run
+msgid "Please choose a command to run"
+msgstr "Выберыце каманду для запуску"
+
+#. TRANSLATORS: ask the user to choose a file to install
+msgid "Please choose a package to install"
+msgstr "Выберыце пакет для ўсталявання"
+
+#. TRANSLATORS: This finds out which package in the list to use
+msgid "Please choose the correct package: "
+msgstr "Выберыце патрэбны пакет: "
+
+#, c-format
+msgid "Please enter a number from 1 to %i: "
+msgstr "Увядзіце лік ад 1 да %i: "
+
+#. TRANSLATORS: ask the user to insert the media
+msgid "Please insert the correct media"
+msgstr "Устаўце прыдатны носьбіт"
+
+#. TRANSLATORS: a package needs to restart the session (due to security)
+msgid "Please logout and login to complete the update as important security updates have been installed."
+msgstr "Выйдзіце з сеанса і ўвайдзіце зноў, каб завяршыць усталяванне важных абнаўленняў бяспекі."
+
+#. TRANSLATORS: a package needs to restart the session
+msgid "Please logout and login to complete the update."
+msgstr "Выйдзіце з сеанса і ўвайдзіце зноў, каб завяршыць абнаўленне."
+
+#. TRANSLATORS: a package needs to restart their system (due to security)
+msgid "Please restart the computer to complete the update as important security updates have been installed."
+msgstr "Перазапусціце камп'ютар, каб завяршыць усталяванне важных абнаўленняў бяспекі."
+
+#. TRANSLATORS: a package needs to restart their system
+msgid "Please restart the computer to complete the update."
+msgstr "Перазапусціце камп'ютар, каб завяршыць абнаўленне."
+
+#. command line argument, do we just download or apply changes
+msgid "Prepare the transaction by downloading packages only"
+msgstr "Падрыхтаваць трансакцыю толькі пасля спампоўвання пакетаў"
+
+#. TRANSLATORS: There follows a list of packages downloaded and ready
+#. * to be updated
+msgid "Prepared updates:"
+msgstr "Падрыхтаваныя абнаўленні:"
+
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "Print to screen a machine readable output, rather than using animated widgets"
+msgstr "Вывад на экран у машынным фармаце, замест выкарыстання аніміраваных віджэтаў"
+
+#. TRANSLATORS: ask the user if the proposed changes are okay
+msgid "Proceed with changes?"
+msgstr "Выканаць змены?"
+
+#. TRANSLATORS: transaction state, is querying data
+msgid "Querying"
+msgstr "Запытваецца"
+
+#. TRANSLATORS: this is the users real name, e.g. "Richard Hughes"
+msgid "Real name"
+msgstr "Сапраўднае імя"
+
+#. TRANSLATORS: we've finished doing offline updates
+msgid "Rebooting after installing updates…"
+msgstr "Перазапуск пасля ўсталявання абнаўленняў…"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to refresh the
+#. cache, as this doesn't actually install or remove software.
+msgid "Refresh system repositories"
+msgstr "Абнавіць рэпазіторыі сістэмы"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache"
+msgstr "Абнавіць кэш"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache (forced)"
+msgstr "Абнавіць кэш (прымусова)"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Refreshing cache"
+msgstr "Абнаўленне кэшу"
+
+#. TRANSLATORS: transaction state, refreshing internal lists
+msgid "Refreshing software list"
+msgstr "Абнаўленне спіса праграм"
+
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Reinstalled"
+msgstr "Пераўсталяваны"
+
+#. TRANSLATORS: The action of the package, in present tense
+msgid "Reinstalling"
+msgstr "Пераўсталяванне"
+
+#. SECURITY:
+#. - Normal users require admin authentication to remove packages as
+#. this can make the system unbootable or stop other applications from
+#. working.
+#. - Be sure to close the tool used to remove the packages after the
+#. admin authentication has been obtained, otherwise packages can still
+#. be removed. If this is not possible, change this authentication to
+#. 'auth_admin'.
+#. TRANSLATORS: command description
+msgid "Remove package"
+msgstr "Выдаліць пакет"
+
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Removed"
+msgstr "Выдалены"
+
+#. TRANSLATORS: The action of the package, in present tense
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Removing"
+msgstr "Выдаленне"
+
+#. TRANSLATORS: transaction state, removing packages
+msgid "Removing packages"
+msgstr "Выдаленне пакетаў"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Removing repository"
+msgstr "Выдаленне рэпазіторыя"
+
+#. TRANSLATORS: transaction state, repackaging delta files
+msgid "Repackaging files"
+msgstr "Перапакаванне файлаў"
+
+#. SECURITY:
+#. - Normal users require admin authentication to repair the system
+#. since this can make the system unbootable or stop other
+#. applications from working.
+msgid "Repair System"
+msgstr "Аднавіць сістэму"
+
+#. TRANSLATORS: transaction state, requesting data from a server
+msgid "Requesting data"
+msgstr "Запытанне даных"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Resolving"
+msgstr "Развязванне"
+
+#. TRANSLATORS: transaction state, checking the transaction before we do it
+msgid "Resolving dependencies"
+msgstr "Развязванне залежнасцей"
+
+#. TRANSLATORS: details about the update, if the package
+#. * requires a restart
+msgid "Restart"
+msgstr "Перазапуск"
+
+#. TRANSLATORS: the results from the transaction
+msgid "Results:"
+msgstr "Вынікі:"
+
+#. TRANSLATORS: this is the transactions role, e.g. "update-packages"
+msgid "Role"
+msgstr "Роля"
+
+#. TRANSLATORS: Ask the user if we should run the similar command
+msgid "Run similar command:"
+msgstr "Выканайце падобную каманду:"
+
+#. TRANSLATORS: command line argument, this command is not a priority
+msgid "Run the command using idle network bandwidth and also using less power"
+msgstr "Выконваць каманду калі сетка не задзейнічана і спажываючы менш энергіі"
+
+#. TRANSLATORS: transaction state, just started
+msgid "Running"
+msgstr "Выконваецца"
+
+#. TRANSLATORS: transaction state, we are running hooks before or after the
+#. transaction
+msgid "Running hooks"
+msgstr "Запуск апрацоўшчыкаў"
+
+#. TRANSLATORS: transaction state, scanning for running processes
+msgid "Scanning applications"
+msgstr "Пошук праграм"
+
+#. TRANSLATORS: command description
+msgid "Search by details"
+msgstr "Пошук па звестках"
+
+#. TRANSLATORS: command description
+msgid "Search by files"
+msgstr "Пошук па файлах"
+
+#. TRANSLATORS: command description
+msgid "Search by names"
+msgstr "Пошук па назве"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Searching by details"
+msgstr "Пошук па звестках"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Searching by file"
+msgstr "Пошук па файлах"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Searching by name"
+msgstr "Пошук па назве"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Searching groups"
+msgstr "Пошук па групах"
+
+#. TRANSLATORS: The type of update
+msgid "Security"
+msgstr "Бяспека"
+
+#. TRANSLATORS: a package requires the session to be restarted
+#. * due to a security update
+msgid "Session restart (security) required:"
+msgstr "Патрабуе перазапуску сеанса (бяспека):"
+
+#. TRANSLATORS: a package requires the session to be restarted
+msgid "Session restart required:"
+msgstr "Патрабуе перазапуску сеанса:"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to set the proxy
+#. used for downloading packages.
+msgid "Set network proxy"
+msgstr "Задаць проксі-сервер"
+
+#. TRANSLATORS: command description
+msgid "Set repository options"
+msgstr "Задаць параметры рэпазіторыя"
+
+#. TRANSLATORS: command line argument, use a filter to narrow down results
+msgid "Set the filter, e.g. installed"
+msgstr "Задаць значэнне фільтра, напрыклад «installed»"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Setting data"
+msgstr "Наладжванне даных"
+
+#. TRANSLATORS: turn on all debugging
+msgid "Show debugging information for all files"
+msgstr "Паказаць адладачную інфармацыю для ўсіх файлаў"
+
+msgid "Show debugging options"
+msgstr "Паказаць параметры адладкі"
+
+#. TRANSLATORS: command line argument, just show the version string
+msgid "Show the program version and exit"
+msgstr "Паказаць версію праграмы і выйсці"
+
+#. TRANSLATORS: show version
+msgid "Show version and exit"
+msgstr "Паказаць версію і выйсці"
+
+#. TRANSLATORS: we've finished doing offline updates
+msgid "Shutting down after installing updates…"
+msgstr "Выключэнне пасля ўсталявання абнаўленняў…"
+
+#. TRANSLATORS: tell the user what we think the command is
+msgid "Similar command is:"
+msgstr "Падобная каманда:"
+
+#. TRANSLATORS: show the user a list of commands that they could have meant
+#. TRANSLATORS: show the user a list of commands we could run
+msgid "Similar commands are:"
+msgstr "Падобныя каманды:"
+
+#. TRANSLATORS: the package repository name
+msgid "Software source name"
+msgstr "Назва крыніцы праграм"
+
+#. TRANSLATORS: the package repository is signed by a key that is not
+#. recognised
+msgid "Software source signature required"
+msgstr "Патрабуецца подпіс крыніцы праграм"
+
+#. TRANSLATORS: transaction state, the daemon is in the process of starting
+msgid "Starting"
+msgstr "Запуск"
+
+#. TRANSLATORS: details about the update, the ongoing state
+#. * of the update
+msgid "State"
+msgstr "Стан"
+
+#. TRANSLATORS: the status of the transaction (e.g. downloading)
+msgid "Status"
+msgstr "Стан"
+
+#. these are commands we can use with pkcon
+msgid "Subcommands:"
+msgstr "Падкаманды:"
+
+#. TRANSLATORS: this is if the transaction succeeded or not
+msgid "Succeeded"
+msgstr "Паспяхова"
+
+#. TRANSLATORS: Show the user a list of packages that they can install to
+#. provide this command
+msgid "Suitable packages are:"
+msgstr "Прыдатныя пакеты:"
+
+#. TRANSLATORS: this is any summary text describing the upgrade
+#. TRANSLATORS: this is the summary of the group
+msgid "Summary"
+msgstr "Зводка"
+
+#. TRANSLATORS: a package requires the system to be restarted
+#. * due to a security update
+msgid "System restart (security) required by:"
+msgstr "Патрабуе перазапуску сістэмы (бяспека):"
+
+#. TRANSLATORS: a package requires the system to be restarted
+msgid "System restart required by:"
+msgstr "Патрабуе перазапуску сістэмы:"
+
+#. TRANSLATORS: this is the time the transaction was started in system
+#. timezone
+msgid "System time"
+msgstr "Сістэмны час"
+
+#. TRANSLATORS: transaction state, when we're doing a test transaction
+msgid "Testing changes"
+msgstr "Праверка змен"
+
+#. TRANSLATORS: the media description, usually like 'Fedora 12 disk 5'
+msgid "Text"
+msgstr "Тэкст"
+
+#. TRANSLATORS: tell the user we've not done anything
+msgid "The agreement was not accepted."
+msgstr "Ліцэнзійнае пагадненне не прынята."
+
+#. TRANSLATORS: tell the user we've not done anything as they are lazy
+msgid "The correct media was not inserted."
+msgstr "Прыдатны носьбіт не ўстаўлены."
+
+#. TRANSLATORS: This is when the daemon crashed, and we are up
+#. * shit creek without a paddle
+msgid "The daemon crashed mid-transaction!"
+msgstr "Дэман аварыйна завяршыў працу падчас выканання трансакцыі!"
+
+#. TRANSLATORS: The user specified
+#. * an incorrect filter
+msgid "The filter specified was invalid"
+msgstr "Указаны няправільны фільтр"
+
+#. TRANSLATORS: When processing, untrusted and non-verified packages may be
+#. encountered
+msgid "The following packages are untrusted:"
+msgstr "Наступныя пакеты ненадзейныя:"
+
+#. TRANSLATORS: When processing, we might have to downgrade other dependencies
+msgid "The following packages have to be downgraded:"
+msgstr "Версія наступных пакетаў павінна быць паніжана:"
+
+#. TRANSLATORS: When processing, we might have to install other dependencies
+msgid "The following packages have to be installed:"
+msgstr "Наступныя пакеты павінны быць усталяваны:"
+
+#. TRANSLATORS: When processing, we might have to obsolete other dependencies
+msgid "The following packages have to be obsoleted:"
+msgstr "Наступныя пакеты павінны быць замешчаны:"
+
+#. TRANSLATORS: When processing, we might have to reinstall other dependencies
+msgid "The following packages have to be reinstalled:"
+msgstr "Наступныя пакеты павінны быць пераўсталяваны:"
+
+#. TRANSLATORS: When processing, we might have to remove other dependencies
+msgid "The following packages have to be removed:"
+msgstr "Наступныя пакеты павінны быць выдалены:"
+
+#. TRANSLATORS: When processing, we might have to update other dependencies
+msgid "The following packages have to be updated:"
+msgstr "Наступныя пакеты павінны быць абноўлены:"
+
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Максімальны час выкарыстання кэшу метаданых (у секундах). Значэнне -1, каб выкарыстоўваць толькі кэш, 1 — каб перазагружаць кэш."
+
+#. TRANSLATORS: tell the user what package provides the command
+msgid "The package providing this file is:"
+msgstr "Файл пастаўляецца з гэтым пакетам:"
+
+#. TRANSLATORS: The network settings could not be sent
+msgid "The proxy could not be set"
+msgstr "Не ўдалося задаць параметры проксі-сервера"
+
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "Магчыма, выбраныя пакеты ўжо ўсталяваны."
+
+#. TRANSLATORS: tell the user we've not done anything
+msgid "The signature was not accepted."
+msgstr "Подпіс не прыняты."
+
+#. TRANSLATORS: is not GPG signed
+msgid "The software is not from a trusted source."
+msgstr "Праграмнае забеспячэнне не з давернай крыніцы."
+
+#. TRANSLATORS: tell the user we didn't do anything
+msgid "The transaction did not proceed."
+msgstr "Трансакцыя не была выканана."
+
+#. TRANSLATORS: the transaction failed in a way we could
+#. * not expect
+#. TRANSLATORS: the transaction failed in a way we could not expect
+msgid "The transaction failed"
+msgstr "Не ўдалося выканаць трансакцыю"
+
+#. TRANSLATORS: tell the user we've not done anything
+msgid "The unsigned software will not be installed."
+msgstr "Праграмы без подпісу не будуць усталяваны."
+
+#. TRANSLATORS: the user asked to update everything,
+#. * but there is nothing that can be updated
+msgid "There are no packages to update."
+msgstr "Няма пакетаў для абнаўлення."
+
+#. TRANSLATORS: print a message when there are no updates
+msgid "There are no updates available at this time."
+msgstr "У гэты час абнаўленняў няма."
+
+msgid "There are no upgrades available at this time."
+msgstr "У гэты час абнаўленняў няма."
+
+#. TRANSLATORS: There was an error getting the list
+#. * of files for the package. The detailed error follows
+#. TRANSLATORS: There was an error getting the
+#. * dependencies for the package. The detailed error follows
+#. TRANSLATORS: There was an error getting the
+#. * details about the package. The detailed error follows
+#. TRANSLATORS: The package name was not found in
+#. * any software repositories. The detailed error follows
+#, c-format
+msgid "This tool could not find all the packages: %s"
+msgstr "Інструменту не ўдалося знайсці ўсе пакеты: %s"
+
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "Інструменту не ўдалося знайсці ні аднаго даступнага пакета."
+
+#. TRANSLATORS: There was an error finding a package
+#. * for installation. The detailed error follows.
+#, c-format
+msgid "This tool could not find any available package: %s"
+msgstr "Інструменту не ўдалося знайсці ні аднаго даступнага пакета: %s"
+
+#. TRANSLATORS: There was an error getting the list
+#. * of files for the package. The detailed error follows
+#, c-format
+msgid "This tool could not find the installed package: %s"
+msgstr "Інструменту не ўдалося знайсці ўсталяваны пакет: %s"
+
+#. TRANSLATORS: There was an error getting the list
+#. * of files for the package. The detailed error follows
+#, c-format
+msgid "This tool could not find the package: %s"
+msgstr "Інструменту не ўдалося знайсці пакет: %s"
+
+#. TRANSLATORS: this is the time since this role was used
+msgid "Time since"
+msgstr "Прайшло часу"
+
+#. TRANSLATORS: this is an atomic transaction
+#. TRANSLATORS: the role is the point of the transaction,
+#. * e.g. update-packages
+msgid "Transaction"
+msgstr "Трансакцыя"
+
+#. SECURITY:
+#. - Normal users are able to ask updates to be installed at
+#. early boot time without a password.
+#. SECURITY:
+#. - Normal users require admin authentication to upgrade the system
+#. to a new distribution since this can make the system unbootable or
+#. stop other applications from working.
+msgid "Trigger offline updates"
+msgstr "Запусціць пазасеткавыя абнаўленні"
+
+#. TRANSLATORS: The type of update
+msgid "Trivial"
+msgstr "Дробнае"
+
+msgid "True"
+msgstr "Так"
+
+#. SECURITY:
+#. - Normal users require admin authentication to add signing keys.
+#. - This implies adding an explicit trust, and should not be granted
+#. without a secure authentication.
+#. - This is not kept as each package should be authenticated.
+msgid "Trust a key used for signing software"
+msgstr "Давяраць ключу, якім падпісана праграма"
+
+#. TRANSLATORS: this is type of update, stable or testing
+msgid "Type"
+msgstr "Тып"
+
+#. TRANSLATORS: The state of a package, i.e. not installed
+msgid "Unavailable"
+msgstr "Недаступны"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Unknown role type"
+msgstr "Невядомы тып ролі"
+
+#. TRANSLATORS: This is when the transaction status is not known
+msgid "Unknown state"
+msgstr "Невядомы стан"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to update the
+#. system as the packages will be signed, and the action is required
+#. to update the system when unattended.
+#. - Changing this to anything other than 'yes' will break unattended
+#. updates.
+msgid "Update software"
+msgstr "Абнавіць праграмнае забеспячэнне"
+
+#. TRANSLATORS: details about the update, any description of
+#. * the update
+msgid "Update text"
+msgstr "Тэкст да абнаўлення"
+
+#. TRANSLATORS: details about the update, date the update
+#. * was updated
+#. TRANSLATORS: The action of the package, in past tense
+msgid "Updated"
+msgstr "Абноўлена"
+
+#. TRANSLATORS: details about the update, any packages that
+#. * this update updates
+msgid "Updates"
+msgstr "Абнаўляе"
+
+#. TRANSLATORS: The action of the package, in present tense
+msgid "Updating"
+msgstr "Абнаўленне"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Updating packages"
+msgstr "Абнаўленне пакетаў"
+
+#. TRANSLATORS: transaction state, we are updating the list of processes
+msgid "Updating running applications"
+msgstr "Абнаўленне спіса запушчаных праграм"
+
+#. SECURITY:
+#. - Normal users require admin authentication to upgrade the disto as
+#. this can make the system unbootable or stop other applications from
+#. working.
+msgid "Upgrade System"
+msgstr "Абнавіць сістэму"
+
+#. TRANSLATORS: this is the user ID of the user that started the action
+msgid "User ID"
+msgstr "Ідэнтыфікатар карыстальніка"
+
+msgid "User aborted selection"
+msgstr "Выбар перарваны карыстальнікам"
+
+#. TRANSLATORS: this is the username, e.g. hughsie
+msgid "Username"
+msgstr "Імя карыстальніка"
+
+#. TRANSLATORS: details about the update, the vendor URLs
+#. TRANSLATORS: the vendor (e.g. vmware) that is providing the EULA
+msgid "Vendor"
+msgstr "Пастаўшчык"
+
+#. TRANSLATORS: transaction state, waiting for user to type in a password
+msgid "Waiting for authentication"
+msgstr "Чаканне аўтэнтыфікацыі"
+
+#. TRANSLATORS: transaction state, when we're waiting for the native tools to
+#. exit
+msgid "Waiting for package manager lock"
+msgstr "Чаканне блакіравання кіраўніка пакетаў"
+
+#. TRANSLATORS: waiting for native lock
+msgid "Waiting for package manager lock."
+msgstr "Чаканне блакіравання кіраўніка пакетаў."
+
+#. TRANSLATORS: transaction state, the transaction is waiting for another to
+#. complete
+msgid "Waiting in queue"
+msgstr "Чаканне чаргі"
+
+#. TRANSLATORS: The user did not provide a distro name
+msgid "You need to specify a list file to create"
+msgstr "Патрабуецца ўказаць файл спіса, які неабходна стварыць"
+
+#. TRANSLATORS: the prefix of all the output telling the user
+#. * why it's not executing. NOTE: this is lowercase to mimic
+#. * the style of bash itself -- apologies
+msgid "command not found"
+msgstr "каманда не знойдзена"
diff --git a/po/cs.po b/po/cs.po
index 0b04140..e20d973 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -10,6 +10,7 @@
# fri, 2011
# Jozef Mlích , 2015
# Marek Černocký , 2013-2016,2018
+# Pavel Borecki , 2024
# Petr Kovar , 2015
# Richard Hughes , 2011
# Vojtech Smejkal , 2008
@@ -247,7 +248,7 @@ msgstr "Ruší se"
#. TRANSLATORS: this is the group category name
msgid "Category"
-msgstr "Skupina"
+msgstr "Kategorie"
#. SECURITY:
#. - Normal users require admin authentication to enable or disable
@@ -312,7 +313,7 @@ msgid "Committing changes"
msgstr "Zařazjí se změny"
msgid "Config file was not found."
-msgstr "Soubor s nastavením nebyl nalezen."
+msgstr "Soubor s nastaveními nebyl nalezen."
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
@@ -328,7 +329,7 @@ msgstr "Popis"
#. TRANSLATORS: this is a header for the package that can be updated
msgid "Details about the update:"
-msgstr "Podrobnosti k aktualizaci:"
+msgstr "Podrobnosti o aktualizaci:"
#. TRANSLATORS: the directory does
#. * not exist, so we can't continue
@@ -479,7 +480,7 @@ msgstr "Selhalo spuštění:"
#. TRANSLATORS: The placeholder is an error message
#, c-format
msgid "Failed to load config file: %s"
-msgstr "Selhalo načtení souboru s nastavením: %s"
+msgstr "Nezdařilo se načtení souboru s nastaveními: %s"
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
@@ -602,7 +603,7 @@ msgstr "Získávají se povýšení"
#. TRANSLATORS: this is group identifier
msgid "ID"
-msgstr "ID"
+msgstr "Identif."
#. TRANSLATORS: this is preferred icon for the group
msgid "Icon"
@@ -848,7 +849,7 @@ msgstr "Výkonná část, která se má použít, např. dummy"
#. TRANSLATORS: this is the parent group
msgid "Parent"
-msgstr "Nadřazený"
+msgstr "Nadřazené"
#. TRANSLATORS: the percentage complete of the transaction
msgid "Percentage"
@@ -1231,6 +1232,10 @@ msgstr "Následující balíčky musí být odebrány:"
msgid "The following packages have to be updated:"
msgstr "Následující balíčky musí být aktualizovány:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Nejdelší umožněné stáří mezipaměti metadat (v sekundách). Pokud má být používána pouze mezipaměť, použijte -1 (pokud má být mezipaměť přenačtena znovu, pak 1)."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Balíček poskytující tento soubor je:"
@@ -1409,7 +1414,7 @@ msgstr "Povýšení systému"
#. TRANSLATORS: this is the user ID of the user that started the action
msgid "User ID"
-msgstr "ID uživatele"
+msgstr "Identif. uživatele"
msgid "User aborted selection"
msgstr "Uživatel přerušil výběr"
diff --git a/po/de.po b/po/de.po
index b810d19..5e1bad9 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@
# Christian , 2009,2011
# Daniela Kugelmann , 2008
# 5527760c8f29b02a470a5ee3b26b73e8_231f8d9 , 2012-2013
-# Ettore Atalan , 2014-2015,2017-2018,2022-2023
+# Ettore Atalan , 2014-2015,2017-2018,2022-2024
# Fabian Affolter , 2008-2009
# hpeters , 2009
# Holger Wansing , 2006
@@ -1238,6 +1238,10 @@ msgstr "Die folgenden Pakete müssen entfernt werden:"
msgid "The following packages have to be updated:"
msgstr "Die folgenden Pakete müssen aktualisiert werden:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Das maximale Alter des Metadaten-Caches (in Sekunden). -1 verwenden, um nur den Cache zu verwenden, 1, um den Cache neu zu laden."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Das folgende Paket stellt diese Datei bereit:"
diff --git a/po/en_GB.po b/po/en_GB.po
index 2a47c83..286e711 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Andi Chandler , 2014-2017,2022-2023
+# Andi Chandler , 2014-2017,2022-2024
# Bruce Cowan , 2012-2013,2018
# Chris Leonard , 2012
# Richard Hughes , 2011
@@ -1226,6 +1226,10 @@ msgstr "The following packages have to be removed:"
msgid "The following packages have to be updated:"
msgstr "The following packages have to be updated:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "The package providing this file is:"
diff --git a/po/es.po b/po/es.po
index cf50b2f..d5b71b9 100644
--- a/po/es.po
+++ b/po/es.po
@@ -3,15 +3,15 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Adolfo Jayme-Barrientos, 2014
-# Adolfo Jayme-Barrientos, 2013
-# Adolfo Jayme-Barrientos, 2019
-# Adolfo Jayme-Barrientos, 2015
-# Adolfo Jayme-Barrientos, 2014
+# Adolfo Jayme Barrientos, 2014
+# Adolfo Jayme Barrientos, 2013
+# Adolfo Jayme Barrientos, 2019
+# Adolfo Jayme Barrientos, 2015
+# Adolfo Jayme Barrientos, 2014
# Daniel Cabrera , 2011, 2012
# 0f759dd1ea6c4c76cedc299039ca4f23_7584d04 <454cc45058db9632179dc8079c0c1af3_5311>, 2012-2013
# Fernando Gonzalez Blanco , 2009
-# Francisco Serrador, 2022-2023
+# Francisco Serrador, 2022-2024
# Javier Alejandro Castro , 2008
# Jorge González , 2011
# Richard Hughes , 2011
@@ -139,10 +139,10 @@ msgstr "Alias a %s"
#. command line argument, do we allow package downgrades
msgid "Allow packages to be downgraded during transaction"
-msgstr "Permitir desactualizar paquetes durante la operación"
+msgstr "Permitir degradar paquetes durante la transacción"
msgid "Allow packages to be reinstalled during transaction"
-msgstr "Permitir reinstalar paquetes durante la operación"
+msgstr "Permitir reinstalar paquetes durante la transacción"
#. command line argument, do we ask questions
msgid "Allow untrusted packages to be installed."
@@ -604,7 +604,7 @@ msgstr "Obteniendo versiones nuevas"
#. TRANSLATORS: this is group identifier
msgid "ID"
-msgstr "Id"
+msgstr "ID"
#. TRANSLATORS: this is preferred icon for the group
msgid "Icon"
@@ -713,7 +713,7 @@ msgstr "Emitido"
#. TRANSLATORS: the key ID, usually a few hex digits
msgid "Key ID"
-msgstr "Identificador de la clave"
+msgstr "ID de la clave"
#. TRANSLATORS: the timestamp (a bit like a machine readable time)
msgid "Key Timestamp"
@@ -1014,7 +1014,7 @@ msgstr "Resultados:"
#. TRANSLATORS: this is the transactions role, e.g. "update-packages"
msgid "Role"
-msgstr "Función"
+msgstr "Rol"
#. TRANSLATORS: Ask the user if we should run the similar command
msgid "Run similar command:"
@@ -1090,7 +1090,7 @@ msgstr "Establecer opciones del repositorio"
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
-msgstr "Establecer el filtro, p. ej. instalado"
+msgstr "Establecer el filtro, p.ej. instalado"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Setting data"
@@ -1233,6 +1233,10 @@ msgstr "Los paquetes siguientes deben desinstalarse:"
msgid "The following packages have to be updated:"
msgstr "Los paquetes siguientes deben actualizarse:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "La edad del caché de metadatos máximo (en segundos). Utilice -1 para utilizar solamente caché, 1 para recargar caché."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "El paquete que proporciona este archivo es:"
diff --git a/po/eu.po b/po/eu.po
index f56c14c..28a2294 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# assar , 2015-2016,2019,2023
+# assar , 2015-2016,2019,2023-2024
# assar , 2013-2015
# assar , 2012
# Richard Hughes , 2011
@@ -1225,6 +1225,10 @@ msgstr "Hurrengo paketeak kendu behar dira:"
msgid "The following packages have to be updated:"
msgstr "Hurrengo paketeak eguneratu behar dira:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Metadatu-cachearen gehieneko adina (segundotan). Erabili -1 cachea soilik erabiltzeko, 1 cachea kargatzeko."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Fitxategi honetaz hornitzen duen paketea hau da:"
diff --git a/po/fi.po b/po/fi.po
index cebe898..5ea46bd 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -4,8 +4,9 @@
#
# Translators:
# Jiri Grönroos , 2012-2013,2015-2018,2022
-# Kimmo Kujansuu , 2019,2022-2023
+# Kimmo Kujansuu , 2019,2022-2024
# Richard Hughes , 2011
+# Ricky Tigg, 2024
# Ville-Pekka Vainio , 2011
# Ville Skyttä , 2011
msgid ""
@@ -307,7 +308,7 @@ msgid "Committing changes"
msgstr "Toteutetaan muutoksia"
msgid "Config file was not found."
-msgstr "Asetustiedostoa ei löydy."
+msgstr "Kokoonpanotiedostoa ei löydy."
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
@@ -474,7 +475,7 @@ msgstr "Käynnistys epäonnistui:"
#. TRANSLATORS: The placeholder is an error message
#, c-format
msgid "Failed to load config file: %s"
-msgstr "Asetustiedoston lataaminen epäonnistui: %s"
+msgstr "Kokoonpanotiedoston lataaminen epäonnistui: %s"
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
@@ -487,7 +488,7 @@ msgstr "Taustaosan lataaminen epäonnistui: %s"
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
-msgstr "Asetustiedoston lataaminen epäonnistui"
+msgstr "Kokoonpanotiedoston lataaminen epäonnistui"
#. TRANSLATORS: the user didn't read the man page
msgid "Failed to parse arguments"
@@ -1226,6 +1227,10 @@ msgstr "Seuraavat paketit on poistettava:"
msgid "The following packages have to be updated:"
msgstr "Seuraavat paketit on päivitettävä:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Metatietojen välimuistin enimmäisikä (sekunteina). Käytä -1 käyttääksesi vain välimuistia, 1 lataa välimuistin uudelleen."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Tämän tiedoston tarjoava paketti on:"
diff --git a/po/he.po b/po/he.po
index c3d20e7..1709345 100644
--- a/po/he.po
+++ b/po/he.po
@@ -5,7 +5,7 @@
# Translators:
# 63f334ffc0709ba0fc2361b80bf3c0f0_00ffd1e , 2021
# Richard Hughes , 2011
-# Yaron Shahrabani , 2012,2021
+# Yaron Shahrabani , 2012,2021,2024
msgid ""
msgstr ""
"Project-Id-Version: PackageKit\n"
@@ -15,7 +15,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: he\n"
-"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;\n"
+"Plural-Forms: nplurals=3; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: 2;\n"
msgid "(seconds)"
msgstr "(שניות)"
@@ -304,6 +304,9 @@ msgstr "הפקודה לא נמצאה, הפקודות הזמינות הן:"
msgid "Committing changes"
msgstr "מבצע שינויים"
+msgid "Config file was not found."
+msgstr "קובץ ההגדרות לא נמצא."
+
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
@@ -466,10 +469,20 @@ msgstr "כשל בהתקנת החבילות: %s"
msgid "Failed to launch:"
msgstr "לא ניתן להפעיל: %s"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "טעינת קובץ ההגדרות נכשלה: %s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
msgstr "טעינת המנגנון נכשלה"
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "טעינת המנגנון נכשלה: %s"
+
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
msgstr "טעינת קובץ ההגדרות נכשל"
@@ -482,6 +495,12 @@ msgstr "פענוח הארגומנטים נכשל"
msgid "Failed to parse command line"
msgstr "פענוח שורת הפקודה נכשל"
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "פענוח הביטוי ‚auto’ (אוטומטית) נכשל: %s"
+
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
msgstr "חיפוש אחר קובץ נכשל"
@@ -1205,6 +1224,10 @@ msgstr "יש להסיר את החבילות הבאות:"
msgid "The following packages have to be updated:"
msgstr "יש לעדכן את החבילות הבאות:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "גיל נתוני העל המרבי (בשניות). יש להשתמש ב־-1 כדי להשתמש במטמון בלבד או ב־1 כדי לרענן את המטמון."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "החבילה המספקת את הקובץ הזה:"
@@ -1213,6 +1236,11 @@ msgstr "החבילה המספקת את הקובץ הזה:"
msgid "The proxy could not be set"
msgstr "לא ניתן להגדיר את המתווך"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "כנראה שהחבילות הנבחרות כבר מותקנות."
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "החתימה נדחתה."
@@ -1259,6 +1287,10 @@ msgstr "אין שדרוגים זמינים נכון לעכשיו."
msgid "This tool could not find all the packages: %s"
msgstr "הכלי הזה לא הצליח למצוא את כל החבילות: %s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "הכלי הזה לא הצליח למצוא חבילות זמינות כלשהן."
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
diff --git a/po/hi.po b/po/hi.po
index 3d7b9de..554252f 100644
--- a/po/hi.po
+++ b/po/hi.po
@@ -5,6 +5,7 @@
# Translators:
# Rajesh Ranjan , 2009
# Richard Hughes , 2011
+# Scrambled777 , 2024
msgid ""
msgstr ""
"Project-Id-Version: PackageKit\n"
@@ -22,75 +23,81 @@ msgstr "(सेकेंड)"
#. TRANSLATORS: The user specified
#. * an invalid action
msgid "A correct role is required"
-msgstr "सही भूमिका जरूरी है"
+msgstr "एक सही भूमिका की आवश्यकता है"
#. TRANSLATORS: the user did not
#. * specify anything about what to
#. * download or where
msgid "A destination directory and the package names to download are required"
-msgstr "गंतव्य निर्देशिका और फिर डाउनलोड करने के लिए संकुल नाम जरूरी है"
+msgstr "डाउनलोड करने के लिए एक गंतव्य निर्देशिका और पैकेज नाम आवश्यक हैं"
+
+msgid "A filename is required"
+msgstr "एक फाइल नाम आवश्यक है"
#. TRANSLATORS: the user did not
#. * specify what they wanted to install
msgid "A filename to install is required"
-msgstr "संस्थापित करने के लिए फाइलनाम जरूरी है"
+msgstr "स्थापित करने के लिए एक फाइल नाम आवश्यक है"
#. TRANSLATORS: geeky error, real
#. * users won't see this
msgid "A licence identifier (eula-id) is required"
-msgstr "लाइसेंस पहचानकर्ता (eula-id) जरूरी है"
+msgstr "एक लाइसेंस पहचानकर्ता (eula-id) आवश्यक है"
#. TRANSLATORS: The user did not
#. * provide a package name
msgid "A package name is required"
-msgstr "संकुल नाम जरूरी है"
+msgstr "एक पैकेज नाम आवश्यक है"
#. TRANSLATORS: the user did not
#. * specify what they wanted to install
msgid "A package name to install is required"
-msgstr "संस्थापित करने के लिए संकुल नाम जरूरी है"
+msgstr "स्थापित करने के लिए एक पैकेज नाम आवश्यक है"
#. TRANSLATORS: the user did not
#. * specify what they wanted to remove
msgid "A package name to remove is required"
-msgstr "हटाने के लिए संकुल नाम जरूरी है"
+msgstr "हटाने के लिए एक पैकेज नाम आवश्यक है"
#. TRANSLATORS: The user did not
#. * specify a package name
msgid "A package name to resolve is required"
-msgstr "हल किया पैकेज नाम जरूरी है"
+msgstr "समाधान के लिए एक पैकेज नाम आवश्यक है"
#. TRANSLATORS: each package
#. * "provides" certain things, e.g.
#. * mime(gstreamer-decoder-mp3),
#. * the user didn't specify it
msgid "A package provide string is required"
-msgstr "संकुल प्रदत्त स्ट्रिंग जरूरी है"
+msgstr "एक पैकेज प्रदत्त स्ट्रिंग आवश्यक है"
+
+msgid "A repo id and autoremove required"
+msgstr "एक रेपो id और autoremove आवश्यक है"
msgid "A repo name, parameter and value are required"
-msgstr "रेपो नाम, पैरामीटर और मान जरूरी है"
+msgstr "एक रेपो नाम, पैरामीटर और मान आवश्यक हैं"
#. TRANSLATORS: The user did not
#. * specify a repository name
msgid "A repository name is required"
-msgstr "रिपाजिटरी नाम जरूरी है"
+msgstr "एक रिपॉजिटरी नाम आवश्यक है"
#. TRANSLATORS: the user
#. * needs to provide a search term
#. TRANSLATORS: the user needs
#. * to provide a search term
msgid "A search term is required"
-msgstr "खोज पद जरूरी है"
+msgstr "एक खोज शब्द आवश्यक है"
#. TRANSLATORS: a search type can
#. * be name, details, file, etc
msgid "A search type is required, e.g. name"
-msgstr "खोज प्रकार जरूरी है, उदा. name"
+msgstr "खोज प्रकार आवश्यक है, उदा. नाम"
#. TRANSLATORS: geeky error, real
#. * users won't see this
msgid "A type, key_id and package_id are required"
-msgstr "प्रकार, key_id और package_id जरूरी है"
+msgstr "एक प्रकार, key_id और package_id आवश्यक हैं"
#. SECURITY:
#. - Normal users do not require admin authentication to accept new
@@ -102,29 +109,99 @@ msgstr "EULA स्वीकारें"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Accepting EULA"
-msgstr "EULA स्वीकार कर रहा है"
+msgstr "EULA स्वीकार कर रहे हैं"
#. TRANSLATORS: these are packages touched by the transaction
msgid "Affected packages:"
-msgstr "प्रभावित संकुल:"
+msgstr "प्रभावित पैकेज:"
#. TRANSLATORS: these are packages touched by the transaction
msgid "Affected packages: None"
-msgstr "प्रभावित संकुल: कुछ नहीं"
+msgstr "प्रभावित पैकेज: कोई नहीं"
#. TRANSLATORS: the EULA text itself (long and boring)
msgid "Agreement"
-msgstr "मसौदा"
+msgstr "समझौता"
+
+#. TRANSLATORS: this is a command alias
+#, c-format
+msgid "Alias to %s"
+msgstr "%s को उपनाम"
+
+#. command line argument, do we allow package downgrades
+msgid "Allow packages to be downgraded during transaction"
+msgstr "लेनदेन के दौरान पैकेजों को डाउनग्रेड करने की अनुमति दें"
+
+msgid "Allow packages to be reinstalled during transaction"
+msgstr "लेनदेन के दौरान पैकेजों को पुनः स्थापित करने की अनुमति दें"
+
+#. command line argument, do we ask questions
+msgid "Allow untrusted packages to be installed."
+msgstr "अविश्वसनीय पैकेजों को स्थापित करने की अनुमति दें।"
+
+#. TRANSLATORS: The user didn't
+#. * specify what action to use
+msgid "An action, e.g. 'update-packages' is required"
+msgstr "एक कार्रवाई, उदा. 'update-packages' आवश्यक है"
#. TRANSLATORS: a package requires the application to be restarted
msgid "Application restart required by:"
-msgstr "अनुप्रयोग पुनःप्रारंभ इसके द्वारा जरूरी:"
+msgstr "अनुप्रयोग पुनः प्रारंभ करने की आवश्यकता है:"
msgid "Authentication is required to accept a EULA"
-msgstr "EULA स्वीकार करने के लिए प्रमाणीकरण जरूरी है"
+msgstr "EULA को स्वीकार करने के लिए प्रमाणीकरण आवश्यक है"
msgid "Authentication is required to cancel a task that was not started by yourself"
-msgstr "कोई कार्य अस्वीकार करने के लिए प्रमाणीकरण जरूरी है जो आपके द्वारा आरंभ नहीं किया गया है"
+msgstr "किसी ऐसे कार्य को रद्द करने के लिए प्रमाणीकरण की आवश्यकता होती है जो स्वयं द्वारा शुरू नहीं किया गया था"
+
+msgid "Authentication is required to change software repository parameters"
+msgstr "सॉफ़्टवेयर रिपॉजिटरी पैरामीटर बदलने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to clear the offline updates message"
+msgstr "ऑफ़लाइन अद्यतन संदेश साफ़ करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to consider a key used for signing software as trusted"
+msgstr "सॉफ़्टवेयर पर हस्ताक्षर करने के लिए प्रयुक्त कुंजी को विश्वसनीय मानने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to downgrade software"
+msgstr "सॉफ़्टवेयर को डाउनग्रेड करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to install software"
+msgstr "सॉफ़्टवेयर स्थापित करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to install untrusted software"
+msgstr "अविश्वसनीय सॉफ़्टवेयर स्थापित करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to refresh the system repositories"
+msgstr "सिस्टम रिपॉजिटरी को ताजा करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to reinstall software"
+msgstr "सॉफ़्टवेयर को पुनः स्थापित करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to remove software"
+msgstr "सॉफ़्टवेयर को हटाने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to repair the installed software"
+msgstr "स्थापित सॉफ़्टवेयर को सुधारने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to set the network proxy used for downloading software"
+msgstr "सॉफ़्टवेयर डाउनलोड करने के लिए प्रयुक्त नेटवर्क प्रॉक्सी निर्धारित करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to trigger offline updates"
+msgstr "ऑफ़लाइन अद्यतन ट्रिगर करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to update software"
+msgstr "सॉफ़्टवेयर अद्यतन करने के लिए प्रमाणीकरण आवश्यक है"
+
+msgid "Authentication is required to upgrade the operating system"
+msgstr "ऑपरेटिंग सिस्टम को अपग्रेड करने के लिए प्रमाणीकरण आवश्यक है"
+
+#. TRANSLATORS: this is the author of the backend
+msgid "Author"
+msgstr "लेखक"
+
+msgid "Automatically remove unused dependencies"
+msgstr "अप्रयुक्त निर्भरताओं को स्वचालित रूप से हटा दें"
#. TRANSLATORS: The state of a package, i.e. not installed
msgid "Available"
@@ -132,7 +209,11 @@ msgstr "उपलब्ध"
#. TRANSLATORS: The type of update
msgid "Blocked"
-msgstr "रोका गया"
+msgstr "अवरुद्ध"
+
+#. TRANSLATORS: The type of update
+msgid "Bug fix"
+msgstr "बग समाधान"
#. TRANSLATORS: details about the update, the bugzilla URLs
msgid "Bugzilla"
@@ -151,16 +232,23 @@ msgstr "बाहरी कार्य रद्द करें"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Canceling"
-msgstr "रद्द कर रहा है"
+msgstr "रद्द कर रहे हैं"
#. TRANSLATORS: transaction state, in the process of cancelling
msgid "Cancelling"
-msgstr "रद्द कर रहा है"
+msgstr "रद्द कर रहे हैं"
#. TRANSLATORS: this is the group category name
msgid "Category"
msgstr "श्रेणी"
+#. SECURITY:
+#. - Normal users require admin authentication to enable or disable
+#. software repositories as this can be used to enable new updates or
+#. install different versions of software.
+msgid "Change software repository parameters"
+msgstr "सॉफ़्टवेयर रिपॉजिटरी पैरामीटर बदलें"
+
#. TRANSLATORS: details about the update, the changelog for
#. * the package
msgid "Changes"
@@ -169,17 +257,17 @@ msgstr "परिवर्तन"
#. TRANSLATORS: transaction state, we are checking executable files currently
#. in use
msgid "Checking applications in use"
-msgstr "प्रयोग में अनुप्रयोगों को जाँच रहा है"
+msgstr "प्रयोग में अनुप्रयोगों को जांच कर रहे हैं"
#. TRANSLATORS: transaction state, we are checking for libraries currently in
#. use
msgid "Checking libraries in use"
-msgstr "प्रयोग में लाइब्रेरी जाँच रहा है"
+msgstr "उपयोग में लायब्रेरियों की जांच कर रहे हैं"
#. TRANSLATORS: transaction state, checking if we have all the security keys
#. for the operation
msgid "Checking signatures"
-msgstr "हस्ताक्षर जाँच रहा है"
+msgstr "हस्ताक्षरों की जांच कर रहे हैं"
#. TRANSLATORS: The action of the package, in past tense
msgid "Cleaned up"
@@ -187,34 +275,50 @@ msgstr "साफ किया गया"
#. TRANSLATORS: The action of the package, in present tense
msgid "Cleaning up"
-msgstr "साफ कर रहा है"
+msgstr "साफ कर रहे हैं"
#. TRANSLATORS: transaction state, removing old packages, and cleaning config
#. files
msgid "Cleaning up packages"
-msgstr "संकुल साफ कर रहा है"
+msgstr "पैकेज साफ़ कर रहे हैं"
+
+#. SECURITY:
+#. - Normal users are able to clear the updates message that is
+#. shown after an updates are applied at boot time.
+msgid "Clear offline update message"
+msgstr "ऑफ़लाइन अद्यतन संदेश साफ़ करें"
#. TRANSLATORS: Generic failure of what they asked to do
msgid "Command failed"
-msgstr "कमांड असफल"
+msgstr "कमांड विफल"
#. TRANSLATORS: this is The command line used to do the action
msgid "Command line"
msgstr "कमांड लाइन"
+msgid "Command not found, valid commands are:"
+msgstr "कमांड नहीं मिला, मान्य कमांड हैं:"
+
#. TRANSLATORS: transaction state, when we're writing to the system package
#. database
msgid "Committing changes"
-msgstr "परिवर्तन सौंप रहा है"
+msgstr "परवर्तनों को कमिट कर रहे हैं"
+
+msgid "Config file was not found."
+msgstr "विन्यास फाइल नहीं मिली।"
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
-msgstr "फ़ाइल की नक़ल ले रहा है"
+msgstr "फाइलें कॉपी कर रहे हैं"
msgid "Debugging Options"
msgstr "डिबगिंग विकल्प"
+#. TRANSLATORS: this is the description of the backend
+msgid "Description"
+msgstr "विवरण"
+
#. TRANSLATORS: this is a header for the package that can be updated
msgid "Details about the update:"
msgstr "अद्यतन के बारे में विवरण:"
@@ -222,11 +326,11 @@ msgstr "अद्यतन के बारे में विवरण:"
#. TRANSLATORS: the directory does
#. * not exist, so we can't continue
msgid "Directory not found"
-msgstr "निर्देशिका नहीं मिला"
+msgstr "निर्देशिका नहीं मिली"
#. TRANSLATORS: if we should not monitor how long we are inactive for
msgid "Disable the idle timer"
-msgstr "निष्क्रिय टाइमर निष्क्रिय करें"
+msgstr "निष्क्रिय टाइमर अक्षम करें"
#. TRANSLATORS: if the repo is disabled
msgid "Disabled"
@@ -237,70 +341,78 @@ msgid "Distribution"
msgstr "वितरण"
msgid "Do not install these packages unless you are sure it is safe to do so."
-msgstr "इन संकुलों को अद्यतन मत करें जब तक वाकई ऐसा करने के लिए सुरक्षित है."
+msgstr "इन पैकेजों को तब तक स्थापित न करें जब तक आप आश्वस्त न हों कि ऐसा करना सुरक्षित है।"
msgid "Do not install this package unless you are sure it is safe to do so."
-msgstr "इस संकुल संस्थापित मत करें जब तक वाकई ऐसा करने के लिए सुरक्षित है."
+msgstr "इस पैकेज को तब तक स्थापित न करें जब तक कि आप सुनिश्चित न हों कि ऐसा करना सुरक्षित है।"
msgid "Do not update these packages unless you are sure it is safe to do so."
-msgstr "इस संकुलों को अद्यतन मत करें जब तक वाकई ऐसा करने के लिए सुरक्षित है."
+msgstr "इन पैकेजों को तब तक अद्यतन न करें जब तक आप आश्वस्त न हों कि ऐसा करना सुरक्षित है।"
msgid "Do not update this package unless you are sure it is safe to do so."
-msgstr "इस संकुल को अद्यतन मत करें जब तक वाकई ऐसा करने के लिए सुरक्षित है."
+msgstr "इस पैकेज को तब तक अद्यतन न करें जब तक आप आश्वस्त न हों कि ऐसा करना सुरक्षित है।"
#. TRANSLATORS: ask the user if they've read and accepted the EULA
msgid "Do you accept this agreement?"
-msgstr "क्या आप इस मसौदे को स्वीकार करते हैं?"
+msgstr "क्या आप इस समझौते को स्वीकार करते हैं?"
#. TRANSLATORS: ask the user if they want to import
msgid "Do you accept this signature?"
-msgstr "क्या आप यह हस्ताक्षर स्वीकार करते हैं?"
+msgstr "क्या आप इस हस्ताक्षर को स्वीकार करते हैं?"
#. TRANSLATORS: ask the user if they are comfortable installing insecure
#. packages
msgid "Do you want to allow installing of unsigned software?"
-msgstr "क्या आप अहस्ताक्षरित सॉफ़्टवेयर के संस्थापन की अनुमति देते हैं?"
+msgstr "क्या आप अहस्ताक्षरित सॉफ़्टवेयर के स्थापना की अनुमति देना चाहते हैं?"
+
+#. TRANSLATORS: don't unset environment variables, used for debugging
+msgid "Don't clear environment on startup"
+msgstr "शुरुआत पर वातावरण साफ़ न करें"
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
-msgstr "डाउनलोडेड"
+msgstr "डाउनलोड किया गया"
#. TRANSLATORS: The action of the package, in present tense
msgid "Downloading"
msgstr "डाउनलोड किया जा रहा है"
+#. TRANSLATORS: downloading repo data so we can search
+msgid "Downloading details about the software repositories."
+msgstr "सॉफ़्टवेयर रिपॉजिटरी के बारे में विवरण डाउनलोड किया जा रहा है।"
+
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading file lists"
-msgstr "फ़ाइल सूची डाउनलोड कर रहा है"
+msgstr "फाइल सूचियां डाउनलोड कर रहे हैं"
#. TRANSLATORS: downloading file lists so we can search
msgid "Downloading filelists (this may take some time to complete)."
-msgstr "फ़ाइललिस्ट डाउनलोड कर रहा है (यह पूरा होने में कुछ समय ले सकता है)."
+msgstr "फाइललिस्ट डाउनलोड डाउनलोड हो रही हैं (इसे पूरा होने में कुछ समय लग सकता है)।"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading groups"
-msgstr "समूह डाउनलोड किया जा रहा है"
+msgstr "समूह डाउनलोड कर रहे हैं"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading list of packages"
-msgstr "संकुल सूची डाउनलोड कर रहा है"
+msgstr "पैकेजों की सूची डाउनलोड कर रहे हैं"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading lists of changes"
-msgstr "परिवर्तन सूची डाउनलोड कर रहा है"
+msgstr "परिवर्तनों की सूचियां डाउनलोड कर रहे हैं"
#. TRANSLATORS: transaction state, downloading package files
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Downloading packages"
-msgstr "संकुल डाउनलोड कर रहा है"
+msgstr "पैकेज डाउनलोड कर रहे हैं"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading repository information"
-msgstr "रिपोजिटरी सूचना डाउनलोड कर रहा है"
+msgstr "रिपोजिटरी जानकारी डाउनलोड कर रहे हैं"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading update information"
-msgstr "अद्यतन सूचना डाउनलोड कर रहा है"
+msgstr "अद्यतन जानकारी डाउनलोड कर रहे हैं"
#. TRANSLATORS: this is The duration of the transaction
msgid "Duration"
@@ -313,7 +425,7 @@ msgstr "सक्षम"
#. TRANSLATORS: this is another name for a software licence that has to be
#. read before installing
msgid "End user licence agreement required"
-msgstr "अंत्य उपयोक्ता लाइसेंस मसौदा जरूरी"
+msgstr "अंतिम उपयोक्ता लाइसेंस समझौता आवश्यक है"
#. TRANSLATORS: The type of update
msgid "Enhancement"
@@ -327,29 +439,75 @@ msgstr "कुछ देर के बाद बाहर निकलें"
msgid "Exit after the engine has loaded"
msgstr "इंजन लोड होने के बाद बाहर निकलें"
+#. TRANSLATORS: The user used
+#. * 'pkcon install dave.rpm' rather than
+#. * 'pkcon install-local dave.rpm'
+#, c-format
+msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
+msgstr "अपेक्षित पैकेज नाम, वास्तव में फाइल मिल गई। इसके बजाय 'pkcon install-local %s' का उपयोग करने का प्रयास करें।"
+
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to contact PackageKit"
msgstr "PackageKit से संपर्क करने में विफल"
msgid "Failed to get daemon state"
-msgstr "डेमॉन स्थिति पाने में विफल."
+msgstr "डेमॉन स्थिति प्राप्त करने में विफल"
+
+msgid "Failed to get properties"
+msgstr "गुण प्राप्त करने में विफल"
#. TRANSLATORS: we keep a database updated with the time that an
#. * action was last executed
msgid "Failed to get the time since this action was last completed"
-msgstr "समय पाने में विफल क्योंकि यह काम अंतिम में पूरा किया गया था"
+msgstr "यह कार्रवाई अंतिम बार पूरी होने के बाद से समय नहीं मिल सका"
#. TRANSLATORS: we failed to install the package
msgid "Failed to install packages"
-msgstr "संकुलों को संस्थापित नहीं करने में विफल"
+msgstr "पैकेज स्थापित करने में विफल"
#. TRANSLATORS: we failed to launch the executable, the error follows
msgid "Failed to launch:"
msgstr "लॉन्च करने में विफल:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "विन्यास फाइल लोड करने में विफल: %s"
+
+#. TRANSLATORS: cannot load the backend the user specified
+msgid "Failed to load the backend"
+msgstr "बैकेंड लोड करने में विफल"
+
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "बैकेंड लोड करने में विफल: %s"
+
+#. TRANSLATORS: probably not yet installed
+msgid "Failed to load the config file"
+msgstr "विन्यास फाइल लोड करने में विफल"
+
+#. TRANSLATORS: the user didn't read the man page
+msgid "Failed to parse arguments"
+msgstr "तर्कों का विश्लेषण करने में विफल"
+
+#. TRANSLATORS: we failed to contact the daemon
+msgid "Failed to parse command line"
+msgstr "कमांड लाइन विश्लेषण करने में विफल"
+
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "auto समाधान नहीं किया जा सका: %s"
+
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
-msgstr "फाइल के लिए खोजने में विफल"
+msgstr "फाइल खोजने में विफल"
+
+#. TRANSLATORS: cannot unload the backend the user specified
+msgid "Failed to unload the backend"
+msgstr "बैकेंड अनलोड करने में विफल"
msgid "False"
msgstr "गलत"
@@ -359,6 +517,13 @@ msgstr "गलत"
msgid "Fatal error"
msgstr "गंभीर त्रुटि"
+#. TRANSLATORS: There was an error
+#. * getting the list of packages.
+#. * The filename follows
+#, c-format
+msgid "File already exists: %s"
+msgstr "फाइल पहले से मौजूद है: %s"
+
#. TRANSLATORS: transaction state, all done!
msgid "Finished"
msgstr "समाप्त"
@@ -366,59 +531,67 @@ msgstr "समाप्त"
#. TRANSLATORS: transaction state, generating a list of packages installed on
#. the system
msgid "Generating package lists"
-msgstr "संकुल सूची बना रहा है"
+msgstr "पैकेज सूचियां तैयार कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting categories"
-msgstr "श्रेणियाँ पा रहा है"
+msgstr "श्रेणियां प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting dependencies"
-msgstr "निर्भरता पा रहा है"
+msgstr "निर्भरताएं प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting details"
-msgstr "विवरण पा रहा है"
+msgstr "विवरण प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting file list"
-msgstr "फ़ाइल सूची पा रहा है"
+msgstr "फाइल सूची प्राप्त कर रहे हैं"
#. TRANSLATORS: transaction state, getting data from a server
msgid "Getting information"
-msgstr "सूचना पा रहा है"
+msgstr "जानकारी प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting packages"
-msgstr "संकुल पा रहा है"
+msgstr "पैकेज प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting provides"
-msgstr "प्रदान पा रहा है"
+msgstr "प्रदान प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting repositories"
-msgstr "रिपोजिटरी पा रहा है"
+msgstr "रिपॉजिटरी प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting requires"
-msgstr "जरूरी सूची पा रहा है"
+msgstr "आवश्यक प्राप्त कर रहे हैं"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Getting system upgrades"
+msgstr "सिस्टम अपग्रेड प्राप्त कर रहे हैं"
+
+#. TRANSLATORS: the transaction failed in a way we could not expect
+msgid "Getting the list of files failed"
+msgstr "फाइलों की सूची प्राप्त करना विफल रहा"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting transactions"
-msgstr "लेनदेन पा रहा है"
+msgstr "लेनदेन प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting update details"
-msgstr "अद्यतन विवरण पा रहा है"
+msgstr "अद्यतन विवरण प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting updates"
-msgstr "अद्यतन पा रहा है"
+msgstr "अद्यतन प्राप्त कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting upgrades"
-msgstr "उन्नयन पा रहा है"
+msgstr "अपग्रेड प्राप्त कर रहे हैं"
#. TRANSLATORS: this is group identifier
msgid "ID"
@@ -432,11 +605,33 @@ msgstr "प्रतीक"
msgid "Important"
msgstr "महत्वपूर्ण"
+#. SECURITY
+#. - Normal users require admin authentication to reinstall packages.
+#. - Authorization to install packages does not imply permissions to
+#. reinstall them and vice versa.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install already installed package again"
+msgstr "पहले से स्थापित पैकेज को दोबारा स्थापित करें"
+
+#. SECURITY
+#. - Normal users require admin authentication to downgrade packages.
+#. - User authorized to downgrade signed packages is authorized to install
+#. them as well.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install older version of installed package"
+msgstr "स्थापित पैकेज का पुराना संस्करण स्थापित करें"
+
+#. TRANSLATORS: command description
+msgid "Install package"
+msgstr "पैकेज स्थापित करे"
+
#. TRANSLATORS: as the user if we want to install a package to provide the
#. command
#, c-format
msgid "Install package '%s' to provide command '%s'?"
-msgstr "संकुल '%s' को '%s' कमांड को देने के लिए संस्थापित करें?"
+msgstr "'%2$s' कमांड प्रदान करने के लिए पैकेज '%1$s' स्थापित करें?"
#. SECURITY:
#. - Normal users need authentication to install signed packages
@@ -444,11 +639,11 @@ msgstr "संकुल '%s' को '%s' कमांड को देने क
#. only as secure as the least-secure package available in the
#. repositories.
msgid "Install signed package"
-msgstr "हस्ताक्षरित संकुल संस्थापित करें"
+msgstr "हस्ताक्षरित पैकेज स्थापित करें"
#. command line argument, do we ask questions
msgid "Install the packages without asking for confirmation"
-msgstr "संपुष्टि के लिए संकुलों को बिना पूछे संस्थापित करें"
+msgstr "पुष्टिकरण मांगे बिना पैकेज स्थापित करें"
#. SECURITY:
#. - Normal users require admin authentication to install untrusted or
@@ -456,33 +651,51 @@ msgstr "संपुष्टि के लिए संकुलों को
#. password would be a massive security hole.
#. - This is not retained as each package should be authenticated.
msgid "Install untrusted local file"
-msgstr "अविश्वसनीय स्थानीय फाइल संस्थापित करें"
+msgstr "अविश्वसनीय स्थानीय फाइल स्थापित करें"
#. TRANSLATORS: The state of a package
#. TRANSLATORS: The action of the package, in past tense
msgid "Installed"
-msgstr "संस्थापित"
+msgstr "स्थापित"
#. TRANSLATORS: The action of the package, in present tense
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Installing"
-msgstr "संस्थापित किया जा रहा है"
+msgstr "स्थापित कर रहे हैं"
+
+#. TRANSLATORS: this is the message we send plymouth to
+#. * advise of the new percentage completion when installing system upgrades
+msgid "Installing System Upgrade"
+msgstr "सिस्टम अपग्रेड स्थापित किये जा रहें हैं"
+
+#. TRANSLATORS: this is the message we send plymouth to
+#. * advise of the new percentage completion when installing updates
+msgid "Installing Updates"
+msgstr "अद्यतन स्थापित किये जा रहें हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Installing files"
-msgstr "फ़ाइल संस्थापित कर रहा है"
+msgstr "फाइलें स्थापित कर रहे हैं"
#. TRANSLATORS: transaction state, installing packages
msgid "Installing packages"
-msgstr "संकुल अधिष्ठापित कर रहा है"
+msgstr "पैकेज स्थापित कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Installing signature"
-msgstr "हस्ताक्षर संस्थापित कर रहा है"
+msgstr "हस्ताक्षर स्थापित कर रहे हैं"
+
+#. TRANSLATORS: we've started doing offline system upgrade
+msgid "Installing system upgrade; this could take a while..."
+msgstr "सिस्टम अपग्रेड स्थापित कर रहें हैं; इसमें कुछ समय लग सकता है..."
#. TRANSLATORS: transaction state, installing updates
msgid "Installing updates"
-msgstr "अद्यतन संस्थापित कर रहा है"
+msgstr "अद्यतन स्थापित कर रहे हैं"
+
+#. TRANSLATORS: we've started doing offline updates
+msgid "Installing updates; this could take a while..."
+msgstr "अद्यतन स्थापित कर रहें हैं; इसमें कुछ समय लग सकता है..."
#. TRANSLATORS: details about the update, date the update
#. * was issued
@@ -491,7 +704,7 @@ msgstr "निर्गत"
#. TRANSLATORS: the key ID, usually a few hex digits
msgid "Key ID"
-msgstr "कुंजी आईडी"
+msgstr "कुंजी ID"
#. TRANSLATORS: the timestamp (a bit like a machine readable time)
msgid "Key Timestamp"
@@ -499,7 +712,7 @@ msgstr "कुंजी टाइमस्टैंप"
#. TRANSLATORS: the key URL
msgid "Key URL"
-msgstr "मुख्य URL"
+msgstr "कुंजी URL"
#. TRANSLATORS: the key fingerprint, again, yet more hex
msgid "Key fingerprint"
@@ -507,32 +720,36 @@ msgstr "कुंजी फिंगरप्रिंट"
#. TRANSLATORS: the username of the key
msgid "Key user"
-msgstr "मुख्य उपयोक्ता"
+msgstr "कुंजी उपयोक्ता"
#. TRANSLATORS: transaction state, loading databases
msgid "Loading cache"
-msgstr "कैशे लोड कर रहा है"
+msgstr "कैशे लोड कर रहे हैं"
#. TRANSLATORS: loading package cache so we can search
msgid "Loading list of packages."
-msgstr "संकुल सूची डाउनलोड कर रहा है."
+msgstr "पैकेजों की सूची लोड हो रही है।"
#. TRANSLATORS: the user needs to change media inserted into the computer
msgid "Media change required"
-msgstr "मीडिया परिवर्तन जरूरी"
+msgstr "मीडिया परिवर्तन आवश्यक है"
#. TRANSLATORS: the media label, usually like 'disk-1of3'
msgid "Media label"
-msgstr "मीडिया स्तर"
+msgstr "मीडिया लेबल"
#. TRANSLATORS: the type, e.g. DVD, CD, etc
msgid "Media type"
msgstr "मीडिया प्रकार"
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Modifying repository"
+msgstr "रिपॉजिटरी को संशोधित कर रहे हैं"
+
#. TRANSLATORS: more than one package could be found that matched,
#. * to follow is a list of possible packages
msgid "More than one package matches:"
-msgstr "एक से अधिक संकुल मेल खाता है:"
+msgstr "एक से अधिक पैकेज मेल खाते हैं:"
#. TRANSLATORS: this is the name of the parent group
#. TRANSLATORS: this is the name of the backend
@@ -541,7 +758,15 @@ msgstr "नाम"
#. TRANSLATORS: This where the package has no files
msgid "No files"
-msgstr "कोई फ़ाइल नहीं"
+msgstr "कोई फाइल नहीं"
+
+#. TRANSLATORS: there are no updates, so nothing to do
+msgid "No packages require updating to newer versions."
+msgstr "किसी भी पैकेज को नए संस्करण में अद्यतन करने की आवश्यकता नहीं है।"
+
+#. TRANSLATORS: we couldn't find anything
+msgid "No packages were found"
+msgstr "कोई पैकेज नहीं मिला"
#. TRANSLATORS: The type of update
msgid "Normal"
@@ -549,20 +774,20 @@ msgstr "सामान्य"
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
-msgstr "पुराना"
+msgstr "अप्रचलित"
#. TRANSLATORS: details about the update, any packages that
#. * this update obsoletes
msgid "Obsoletes"
-msgstr "पुराना"
+msgstr "अप्रचलित"
#. TRANSLATORS: The action of the package, in present tense
msgid "Obsoleting"
-msgstr "पुराना"
+msgstr "अप्रचलित कर रहे हैं"
#. TRANSLATORS: transaction state, obsoleting old packages
msgid "Obsoleting packages"
-msgstr "संकुल को पुराना कर रहा है"
+msgstr "पैकेज अप्रचलित कर रहे हैं"
#. TRANSLATORS: The user tried to use an
#. * unsupported option on the command line
@@ -570,17 +795,33 @@ msgstr "संकुल को पुराना कर रहा है"
msgid "Option '%s' is not supported"
msgstr "विकल्प '%s' समर्थित नहीं है"
+#. TRANSLATORS: details about the update, package name and version
+#. TRANSLATORS: the package that is being processed
+#. TRANSLATORS: the package that is not signed by a known key
+#. TRANSLATORS: the package name that was trying to be installed
+msgid "Package"
+msgstr "पैकेज"
+
#. TRANSLATORS: This a list of details about the package
msgid "Package description"
-msgstr "संकुल विवरण"
+msgstr "पैकेज विवरण"
#. TRANSLATORS: This a list files contained in the package
msgid "Package files"
-msgstr "संकुल फ़ाइल"
+msgstr "पैकेज फाइलें"
+
+#. TRANSLATORS: we asked to install a package
+#. * that could not be found in any repo
+msgid "Package not found"
+msgstr "पैकेज नहीं मिला"
+
+#. TRANSLATORS: program name
+msgid "PackageKit"
+msgstr "PackageKit"
#. TRANSLATORS: This is the header to the --help menu
msgid "PackageKit Console Interface"
-msgstr "पैकेजकिट कंसोल अंतरफलक"
+msgstr "PackageKit कंसोल इंटरफ़ेस"
#. TRANSLATORS: this is a program that monitors PackageKit
msgid "PackageKit Monitor"
@@ -592,11 +833,11 @@ msgstr "PackageKit सेवा"
#. TRANSLATORS: Show the user a list of packages that provide this command
msgid "Packages providing this file are:"
-msgstr "इस फ़ाइल को देने वाला संकुल:"
+msgstr "यह फाइल प्रदान करने वाले पैकेज हैं:"
#. TRANSLATORS: a backend is the system package tool, e.g. dnf, apt
msgid "Packaging backend to use, e.g. dummy"
-msgstr "प्रयोग के लिए बैकेंड को पैकेजिंग, उदा. dummy"
+msgstr "उपयोग के लिए पैकेजिंग बैकेंड, उदा. dummy"
#. TRANSLATORS: this is the parent group
msgid "Parent"
@@ -612,39 +853,48 @@ msgstr "चलाने के लिए कमांड चुनें"
#. TRANSLATORS: ask the user to choose a file to install
msgid "Please choose a package to install"
-msgstr "संस्थापित करने के लिए कोई संकुल चुनें"
+msgstr "कृपया स्थापित करने के लिए एक पैकेज चुनें"
#. TRANSLATORS: This finds out which package in the list to use
msgid "Please choose the correct package: "
-msgstr "कृपया सही संकुल चुनें: "
+msgstr "कृपया सही पैकेज चुनें:"
#, c-format
msgid "Please enter a number from 1 to %i: "
-msgstr "1 से %i तक की संख्या कृपया दाखिल करें: "
+msgstr "कृपया 1 से %i तक कोई संख्या दर्ज करें: "
#. TRANSLATORS: ask the user to insert the media
msgid "Please insert the correct media"
-msgstr "कृपया सही मीडिया डालें"
+msgstr "कृपया सही मीडिया सम्मिलित करें"
#. TRANSLATORS: a package needs to restart the session (due to security)
msgid "Please logout and login to complete the update as important security updates have been installed."
-msgstr "कृपया अद्यतन पूरी करने के लिए लॉगआउट व लॉगिन होएँ क्योंकि किसी महत्वपूर्ण सुरक्षा अद्यतन को संस्थापित किया जाना है."
+msgstr "अद्यतन पूरा करने के लिए कृपया लॉगआउट करें और लॉगिन करें क्योंकि महत्वपूर्ण सुरक्षा अद्यतन स्थापित हो गए हैं।"
#. TRANSLATORS: a package needs to restart the session
msgid "Please logout and login to complete the update."
-msgstr "कृपया अद्यतन पूरा करने के लिए लॉगआउट और लॉगिन करें"
+msgstr "कृपया अद्यतन पूरा करने के लिए लॉगआउट और लॉगिन करें।"
#. TRANSLATORS: a package needs to restart their system (due to security)
msgid "Please restart the computer to complete the update as important security updates have been installed."
-msgstr "कृपया अद्यतन पूरी करने के लिए कंप्यूटर पुनःप्रारंभ करें क्योंकि कोई महत्वपूर्ण सुरक्षा अद्यतन को संस्थापित किया जाना है."
+msgstr "अद्यतन को पूरा करने के लिए कृपया कंप्यूटर को पुनरारंभ करें क्योंकि महत्वपूर्ण सुरक्षा अद्यतन स्थापित किए गए हैं।"
#. TRANSLATORS: a package needs to restart their system
msgid "Please restart the computer to complete the update."
-msgstr "कृपया अद्यतन पूरी करने के लिए कंप्यूटर पुनःप्रारंभ करें."
+msgstr "अद्यतन पूरा करने के लिए कृपया कंप्यूटर को पुनः आरंभ करें।"
+
+#. command line argument, do we just download or apply changes
+msgid "Prepare the transaction by downloading packages only"
+msgstr "केवल पैकेज डाउनलोड करके लेनदेन तैयार करें"
+
+#. TRANSLATORS: There follows a list of packages downloaded and ready
+#. * to be updated
+msgid "Prepared updates:"
+msgstr "तैयार किए गए अद्यतन:"
#. TRANSLATORS: command line argument, just output without fancy formatting
msgid "Print to screen a machine readable output, rather than using animated widgets"
-msgstr "मशीन द्वारा पठनीय आउटपुट रूप में स्क्रीन पर छापें, बजाय चलंत छवि के प्रयोग के"
+msgstr "एनिमेटेड विजेट का उपयोग करने के बजाय मशीन पठनीय आउटपुट को स्क्रीन पर प्रिंट करें"
#. TRANSLATORS: ask the user if the proposed changes are okay
msgid "Proceed with changes?"
@@ -658,21 +908,39 @@ msgstr "प्रश्न कर रहा है"
msgid "Real name"
msgstr "वास्तविक नाम"
+#. TRANSLATORS: we've finished doing offline updates
+msgid "Rebooting after installing updates…"
+msgstr "अद्यतन स्थापित करने के बाद रीबूट किया जा रहा है…"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to refresh the
+#. cache, as this doesn't actually install or remove software.
+msgid "Refresh system repositories"
+msgstr "सिस्टम रिपॉजिटरी को ताजा करें"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache"
+msgstr "कैशे ताजा करें"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache (forced)"
+msgstr "कैशे ताजा करें (बलपूर्वक)"
+
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Refreshing cache"
-msgstr "कैश ताज़ा कर रहा है"
+msgstr "कैशे ताजा कर रहे हैं"
#. TRANSLATORS: transaction state, refreshing internal lists
msgid "Refreshing software list"
-msgstr "सॉफ़्टवेयर सूची ताज़ा कर रहा है"
+msgstr "सॉफ़्टवेयर सूची ताजा कर रहे हैं"
#. TRANSLATORS: The action of the package, in past tense
msgid "Reinstalled"
-msgstr "फिर संस्थापित"
+msgstr "पुनर्स्थापित"
#. TRANSLATORS: The action of the package, in present tense
msgid "Reinstalling"
-msgstr "फिर संस्थापित कर रहा है..."
+msgstr "पुनः स्थापित कर रहे हैं"
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
@@ -684,41 +952,52 @@ msgstr "फिर संस्थापित कर रहा है..."
#. 'auth_admin'.
#. TRANSLATORS: command description
msgid "Remove package"
-msgstr "संकुल हटाएँ"
+msgstr "पैकेज हटाएं"
#. TRANSLATORS: The action of the package, in past tense
msgid "Removed"
-msgstr "मिटाया"
+msgstr "हटाया गया"
#. TRANSLATORS: The action of the package, in present tense
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Removing"
-msgstr "संकुल हटा रहा है"
+msgstr "हटा कर रहे हैं"
#. TRANSLATORS: transaction state, removing packages
msgid "Removing packages"
-msgstr "संकुल हटा रहा है"
+msgstr "पैकेज हटा रहे हैं"
+
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Removing repository"
+msgstr "रिपोजिटरी हटा रहे हैं"
#. TRANSLATORS: transaction state, repackaging delta files
msgid "Repackaging files"
-msgstr "फ़ाइल पुनर्संकुलित कर रहा है"
+msgstr "फाइलों को पुनः पैक कर रहे हैं"
+
+#. SECURITY:
+#. - Normal users require admin authentication to repair the system
+#. since this can make the system unbootable or stop other
+#. applications from working.
+msgid "Repair System"
+msgstr "सिस्टम सुधारें"
#. TRANSLATORS: transaction state, requesting data from a server
msgid "Requesting data"
-msgstr "आंकड़ा के लिए निवेदन कर रहा है"
+msgstr "डेटा का अनुरोध कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Resolving"
-msgstr "हल कर रहा है"
+msgstr "समाधान कर रहे हैं"
#. TRANSLATORS: transaction state, checking the transaction before we do it
msgid "Resolving dependencies"
-msgstr "निर्भरता हल कर रहा है"
+msgstr "निर्भरताओं का समाधान कर रहे हैं"
#. TRANSLATORS: details about the update, if the package
#. * requires a restart
msgid "Restart"
-msgstr "फिर से चालू करें"
+msgstr "पुनः प्रारंभ करें"
#. TRANSLATORS: the results from the transaction
msgid "Results:"
@@ -730,35 +1009,52 @@ msgstr "भूमिका"
#. TRANSLATORS: Ask the user if we should run the similar command
msgid "Run similar command:"
-msgstr "समान कमांड चलाएँ:"
+msgstr "समान कमांड चलाएं:"
#. TRANSLATORS: command line argument, this command is not a priority
msgid "Run the command using idle network bandwidth and also using less power"
-msgstr "निष्क्रिय संजाल बैंडबिड्थ और कम बिजली के प्रयोग से कमांड चलाएँ"
+msgstr "निष्क्रिय नेटवर्क बैंडविड्थ का उपयोग करके और कम बिजली का उपयोग करके कमांड चलाएं"
#. TRANSLATORS: transaction state, just started
msgid "Running"
msgstr "चल रहा है"
+#. TRANSLATORS: transaction state, we are running hooks before or after the
+#. transaction
+msgid "Running hooks"
+msgstr "हुक चला रहे हैं"
+
#. TRANSLATORS: transaction state, scanning for running processes
msgid "Scanning applications"
-msgstr "अनुप्रयोग स्कैन कर रहा है"
+msgstr "अनुप्रयोगों को स्कैन कर रहे हैं"
+
+#. TRANSLATORS: command description
+msgid "Search by details"
+msgstr "विवरण द्वारा खोजें"
+
+#. TRANSLATORS: command description
+msgid "Search by files"
+msgstr "फाइलों द्वारा खोजें"
+
+#. TRANSLATORS: command description
+msgid "Search by names"
+msgstr "नाम से खोजें"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by details"
-msgstr "विवरण से खोजें"
+msgstr "विवरण द्वारा खोज रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by file"
-msgstr "फ़ाइल खोज रहा है"
+msgstr "फाइल द्वारा खोज रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by name"
-msgstr "नाम से खोजें"
+msgstr "नाम द्वारा खोज रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching groups"
-msgstr "समूह खोज रहा है"
+msgstr "समूह खोज रहे हैं"
#. TRANSLATORS: The type of update
msgid "Security"
@@ -767,44 +1063,52 @@ msgstr "सुरक्षा"
#. TRANSLATORS: a package requires the session to be restarted
#. * due to a security update
msgid "Session restart (security) required:"
-msgstr "तंत्र पुनःप्रारंभ (सुरक्षा) जरूरी:"
+msgstr "सत्र पुनरारंभ (सुरक्षा) आवश्यक:"
#. TRANSLATORS: a package requires the session to be restarted
msgid "Session restart required:"
-msgstr "सत्र पुनःप्रारंभ जरूरी:"
+msgstr "सत्र पुनरारंभ आवश्यक:"
#. SECURITY:
#. - Normal users do not require admin authentication to set the proxy
#. used for downloading packages.
msgid "Set network proxy"
-msgstr "संजाल प्रॉक्सी सेट करें"
+msgstr "नेटवर्क प्रॉक्सी निर्धारित करें"
+
+#. TRANSLATORS: command description
+msgid "Set repository options"
+msgstr "रिपोजिटरी विकल्प निर्धारित करें"
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
-msgstr "फ़िल्टर सेट करें, उदा. संस्थापित"
+msgstr "फिल्टर निर्धारित करें, उदा. स्थापित"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Setting data"
-msgstr "आंकड़ा सेट कर रहा है"
+msgstr "डेटा निर्धारित कर रहे हैं"
#. TRANSLATORS: turn on all debugging
msgid "Show debugging information for all files"
-msgstr "डिबगिंग सूचना सभी फ़ाइलों के लिए दिखाएँ"
+msgstr "सभी फाइलों के लिए डिबगिंग जानकारी दिखाएं"
msgid "Show debugging options"
-msgstr "डिबगिंग विकल्प दिखाएँ"
+msgstr "डिबगिंग विकल्प दिखाएं"
#. TRANSLATORS: command line argument, just show the version string
msgid "Show the program version and exit"
-msgstr "प्रोग्राम संस्करण दिखाएँ और बाहर निकलें"
+msgstr "प्रोग्राम संस्करण दिखाएं और बाहर निकलें"
#. TRANSLATORS: show version
msgid "Show version and exit"
-msgstr "संस्करण दिखाएँ और बाहर निकलें"
+msgstr "संस्करण दिखाएं और बाहर निकलें"
+
+#. TRANSLATORS: we've finished doing offline updates
+msgid "Shutting down after installing updates…"
+msgstr "अद्यतन स्थापित करने के बाद बंद हो रहा है…"
#. TRANSLATORS: tell the user what we think the command is
msgid "Similar command is:"
-msgstr "उसी तरह का कमांड है:"
+msgstr "समान कमांड है:"
#. TRANSLATORS: show the user a list of commands that they could have meant
#. TRANSLATORS: show the user a list of commands we could run
@@ -813,12 +1117,12 @@ msgstr "समान कमांड हैं:"
#. TRANSLATORS: the package repository name
msgid "Software source name"
-msgstr "सॉफ़्टवेयर स्रोत नाम"
+msgstr "सॉफ़्टवेयर स्रोत का नाम"
#. TRANSLATORS: the package repository is signed by a key that is not
#. recognised
msgid "Software source signature required"
-msgstr "सॉफ़्टवेयर स्रोत हस्ताक्षर जरूरी"
+msgstr "सॉफ़्टवेयर स्रोत हस्ताक्षर आवश्यक है"
#. TRANSLATORS: transaction state, the daemon is in the process of starting
msgid "Starting"
@@ -844,7 +1148,7 @@ msgstr "सफल"
#. TRANSLATORS: Show the user a list of packages that they can install to
#. provide this command
msgid "Suitable packages are:"
-msgstr "उपयुक्त संकुल हैं:"
+msgstr "उपयुक्त पैकेज हैं:"
#. TRANSLATORS: this is any summary text describing the upgrade
#. TRANSLATORS: this is the summary of the group
@@ -854,11 +1158,11 @@ msgstr "सारांश"
#. TRANSLATORS: a package requires the system to be restarted
#. * due to a security update
msgid "System restart (security) required by:"
-msgstr "तंत्र पुनःप्रारंभ (सुरक्षा) इनके द्वारा जरूरी:"
+msgstr "सिस्टम पुनरारंभ (सुरक्षा) इसके लिए आवश्यक है:"
#. TRANSLATORS: a package requires the system to be restarted
msgid "System restart required by:"
-msgstr "तंत्र पुनःप्रारंभ इनके द्वारा जरूरी:"
+msgstr "सिस्टम पुनरारंभ की आवश्यकता है:"
#. TRANSLATORS: this is the time the transaction was started in system
#. timezone
@@ -867,7 +1171,7 @@ msgstr "सिस्टम समय"
#. TRANSLATORS: transaction state, when we're doing a test transaction
msgid "Testing changes"
-msgstr "परिवर्तन जाँच रहा है"
+msgstr "परवर्तनों का परीक्षण कर रहे हैं"
#. TRANSLATORS: the media description, usually like 'Fedora 12 disk 5'
msgid "Text"
@@ -875,57 +1179,79 @@ msgstr "पाठ"
#. TRANSLATORS: tell the user we've not done anything
msgid "The agreement was not accepted."
-msgstr "हस्ताक्षर स्वीकार नहीं किया गया था."
+msgstr "समझौता स्वीकार नहीं किया गया।"
#. TRANSLATORS: tell the user we've not done anything as they are lazy
msgid "The correct media was not inserted."
-msgstr "सही मीडिया नहीं डाला गया था."
+msgstr "सही मीडिया सम्मिलित नहीं किया गया था।"
#. TRANSLATORS: This is when the daemon crashed, and we are up
#. * shit creek without a paddle
msgid "The daemon crashed mid-transaction!"
-msgstr "यह डेमॉन मध्य विनिमय में क्रैश कर गया!"
+msgstr "लेन-देन के बीच में डेमॉन क्रैश हो गया!"
#. TRANSLATORS: The user specified
#. * an incorrect filter
msgid "The filter specified was invalid"
-msgstr "निर्दिष्ट फिल्टर अवैध था"
+msgstr "निर्दिष्ट फिल्टर अमान्य था"
+
+#. TRANSLATORS: When processing, untrusted and non-verified packages may be
+#. encountered
+msgid "The following packages are untrusted:"
+msgstr "निम्नलिखित पैकेज अविश्वसनीय हैं:"
#. TRANSLATORS: When processing, we might have to downgrade other dependencies
msgid "The following packages have to be downgraded:"
-msgstr "निम्नलिखित संकुल को फिर पदावनत किया जाने वाला है:"
+msgstr "निम्नलिखित पैकेजों को डाउनग्रेड करना होगा:"
#. TRANSLATORS: When processing, we might have to install other dependencies
msgid "The following packages have to be installed:"
-msgstr "निम्नलिखित संकुल को संस्थापित किया जाने वाला है:"
+msgstr "निम्नलिखित पैकेजों को स्थापित करना होगा:"
+
+#. TRANSLATORS: When processing, we might have to obsolete other dependencies
+msgid "The following packages have to be obsoleted:"
+msgstr "निम्नलिखित पैकेजों को अप्रचलित किया जाना चाहिए:"
#. TRANSLATORS: When processing, we might have to reinstall other dependencies
msgid "The following packages have to be reinstalled:"
-msgstr "निम्नलिखित संकुल को फिर संस्थापित किया जाने वाला है:"
+msgstr "निम्नलिखित पैकेजों को पुनः स्थापित करना होगा:"
#. TRANSLATORS: When processing, we might have to remove other dependencies
msgid "The following packages have to be removed:"
-msgstr "निम्नलिखित संकुल को हटाया जाने वाला है:"
+msgstr "निम्नलिखित पैकेजों को हटाना होगा:"
#. TRANSLATORS: When processing, we might have to update other dependencies
msgid "The following packages have to be updated:"
-msgstr "निम्नलिखित संकुल को अद्यतन किया जाना है:"
+msgstr "निम्नलिखित पैकेजों को अद्यतन करना होगा:"
+
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "अधिकतम मेटाडेटा कैशे आयु (सेकेंड में)। केवल कैशे का उपयोग करने के लिए -1 का उपयोग करें, कैशे को पुनः लोड करने के लिए 1 का उपयोग करें।"
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
-msgstr "इस फ़ाइल को देने वाला संकुल:"
+msgstr "यह फाइल प्रदान करने वाला पैकेज है:"
+
+#. TRANSLATORS: The network settings could not be sent
+msgid "The proxy could not be set"
+msgstr "प्रॉक्सी निर्धारित नहीं किया जा सका"
+
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "चयनित पैकेज पहले से ही स्थापित हो सकते हैं।"
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
-msgstr "हस्ताक्षर स्वीकार नहीं किया गया था."
+msgstr "हस्ताक्षर स्वीकार नहीं किये गये।"
#. TRANSLATORS: is not GPG signed
msgid "The software is not from a trusted source."
-msgstr "यह सॉफ्टवेयर भरोसेमंद स्रोत से नहीं है."
+msgstr "सॉफ़्टवेयर किसी विश्वसनीय स्रोत से नहीं है।"
#. TRANSLATORS: tell the user we didn't do anything
msgid "The transaction did not proceed."
-msgstr "लेनदेन नहीं आगे बढ़ा."
+msgstr "लेनदेन नहीं आगे बढ़ा।"
#. TRANSLATORS: the transaction failed in a way we could
#. * not expect
@@ -935,11 +1261,19 @@ msgstr "लेनदेन विफल"
#. TRANSLATORS: tell the user we've not done anything
msgid "The unsigned software will not be installed."
-msgstr "अहस्ताक्षरित सॉफ़्टवेयर संस्थापित नहीं किया जाएगा."
+msgstr "अहस्ताक्षरित सॉफ़्टवेयर स्थापित नहीं किया जाएगा।"
+
+#. TRANSLATORS: the user asked to update everything,
+#. * but there is nothing that can be updated
+msgid "There are no packages to update."
+msgstr "अद्यतन करने के लिए कोई पैकेज नहीं हैं।"
#. TRANSLATORS: print a message when there are no updates
msgid "There are no updates available at this time."
-msgstr "इस समय कोई अद्यतन उपलब्ध नहीं है."
+msgstr "इस समय कोई अद्यतन उपलब्ध नहीं है।"
+
+msgid "There are no upgrades available at this time."
+msgstr "इस समय कोई अपग्रेड उपलब्ध नहीं है।"
#. TRANSLATORS: There was an error getting the list
#. * of files for the package. The detailed error follows
@@ -951,25 +1285,33 @@ msgstr "इस समय कोई अद्यतन उपलब्ध नह
#. * any software repositories. The detailed error follows
#, c-format
msgid "This tool could not find all the packages: %s"
-msgstr "यह औजार संकुल को नहीं ढ़ूँढ़ सका: %s"
+msgstr "यह टूल सभी पैकेज नहीं खोज सका: %s"
+
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "इस टूल को कोई उपलब्ध पैकेज नहीं मिल सका।"
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
msgid "This tool could not find any available package: %s"
-msgstr "यह औजार किसी उपलब्ध संकुल को नहीं ढूँढ़ सका: %s"
+msgstr "इस टूल को कोई भी उपलब्ध पैकेज नहीं मिल सका: %s"
#. TRANSLATORS: There was an error getting the list
#. * of files for the package. The detailed error follows
#, c-format
msgid "This tool could not find the installed package: %s"
-msgstr "यह औजार संस्थापित संकुल को नहीं ढूँढ सका: %s"
+msgstr "यह टूल स्थापित पैकेज नहीं खोज सका: %s"
#. TRANSLATORS: There was an error getting the list
#. * of files for the package. The detailed error follows
#, c-format
msgid "This tool could not find the package: %s"
-msgstr "यह औजार संकुल को नहीं ढूँढ़ सका: %s"
+msgstr "यह टूल पैकेज नहीं खोज सका: %s"
+
+#. TRANSLATORS: this is the time since this role was used
+msgid "Time since"
+msgstr "तब से समय"
#. TRANSLATORS: this is an atomic transaction
#. TRANSLATORS: the role is the point of the transaction,
@@ -977,16 +1319,38 @@ msgstr "यह औजार संकुल को नहीं ढूँढ़
msgid "Transaction"
msgstr "लेनदेन"
+#. SECURITY:
+#. - Normal users are able to ask updates to be installed at
+#. early boot time without a password.
+#. SECURITY:
+#. - Normal users require admin authentication to upgrade the system
+#. to a new distribution since this can make the system unbootable or
+#. stop other applications from working.
+msgid "Trigger offline updates"
+msgstr "ऑफ़लाइन अद्यतन ट्रिगर करें"
+
#. TRANSLATORS: The type of update
msgid "Trivial"
-msgstr "बेकार"
+msgstr "मामूली"
msgid "True"
msgstr "सही"
+#. SECURITY:
+#. - Normal users require admin authentication to add signing keys.
+#. - This implies adding an explicit trust, and should not be granted
+#. without a secure authentication.
+#. - This is not kept as each package should be authenticated.
+msgid "Trust a key used for signing software"
+msgstr "सॉफ़्टवेयर पर हस्ताक्षर करने के लिए उपयोग की जाने वाली कुंजी पर विश्वास करें"
+
#. TRANSLATORS: this is type of update, stable or testing
msgid "Type"
-msgstr "क़िस्म"
+msgstr "प्रकार"
+
+#. TRANSLATORS: The state of a package, i.e. not installed
+msgid "Unavailable"
+msgstr "अनुपलब्ध"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Unknown role type"
@@ -996,16 +1360,25 @@ msgstr "अज्ञात भूमिका प्रकार"
msgid "Unknown state"
msgstr "अज्ञात स्थिति"
+#. SECURITY:
+#. - Normal users do not require admin authentication to update the
+#. system as the packages will be signed, and the action is required
+#. to update the system when unattended.
+#. - Changing this to anything other than 'yes' will break unattended
+#. updates.
+msgid "Update software"
+msgstr "सॉफ्टवेयर अद्यतन करें"
+
#. TRANSLATORS: details about the update, any description of
#. * the update
msgid "Update text"
-msgstr "पाठ अद्यतन करें"
+msgstr "अद्यतन पाठ"
#. TRANSLATORS: details about the update, date the update
#. * was updated
#. TRANSLATORS: The action of the package, in past tense
msgid "Updated"
-msgstr "अद्यतन किया गया"
+msgstr "अद्यतित"
#. TRANSLATORS: details about the update, any packages that
#. * this update updates
@@ -1014,23 +1387,33 @@ msgstr "अद्यतन"
#. TRANSLATORS: The action of the package, in present tense
msgid "Updating"
-msgstr "अद्यतन कर रहा है"
+msgstr "अद्यतन कर रहे हैं"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Updating packages"
-msgstr "संकुल अद्यतन कर रहा है"
+msgstr "पैकेज अद्यतन कर रहे हैं"
#. TRANSLATORS: transaction state, we are updating the list of processes
msgid "Updating running applications"
-msgstr "कार्यशील अनुप्रयोग अद्यतन रहा है"
+msgstr "चालू अनुप्रयोगों को अद्यतन कर रहे हैं"
+
+#. SECURITY:
+#. - Normal users require admin authentication to upgrade the disto as
+#. this can make the system unbootable or stop other applications from
+#. working.
+msgid "Upgrade System"
+msgstr "सिस्टम अपग्रेड करें"
#. TRANSLATORS: this is the user ID of the user that started the action
msgid "User ID"
msgstr "उपयोक्ता ID"
+msgid "User aborted selection"
+msgstr "उपयोक्ता ने चयन निरस्त कर दिया"
+
#. TRANSLATORS: this is the username, e.g. hughsie
msgid "Username"
-msgstr "उपयोक्ता नाम"
+msgstr "उपयोक्तानाम"
#. TRANSLATORS: details about the update, the vendor URLs
#. TRANSLATORS: the vendor (e.g. vmware) that is providing the EULA
@@ -1039,18 +1422,28 @@ msgstr "विक्रेता"
#. TRANSLATORS: transaction state, waiting for user to type in a password
msgid "Waiting for authentication"
-msgstr "सत्यापन के लिए प्रतीक्षारत"
+msgstr "प्रमाणीकरण की प्रतीक्षा की जा रही है"
#. TRANSLATORS: transaction state, when we're waiting for the native tools to
#. exit
msgid "Waiting for package manager lock"
-msgstr "संकुल प्रबंधक लॉक के लिए प्रतीक्षारत"
+msgstr "पैकेज मैनेजर लॉक की प्रतीक्षा कर रहे हैं"
#. TRANSLATORS: waiting for native lock
msgid "Waiting for package manager lock."
-msgstr "संकुल प्रबंधक लॉक के लिए प्रतीक्षारत."
+msgstr "पैकेज मैनेजर लॉक की प्रतीक्षा की जा रही है।"
#. TRANSLATORS: transaction state, the transaction is waiting for another to
#. complete
msgid "Waiting in queue"
msgstr "कतार में प्रतीक्षा"
+
+#. TRANSLATORS: The user did not provide a distro name
+msgid "You need to specify a list file to create"
+msgstr "बनाने के लिए आपको एक सूची फाइल निर्दिष्ट करनी होगी"
+
+#. TRANSLATORS: the prefix of all the output telling the user
+#. * why it's not executing. NOTE: this is lowercase to mimic
+#. * the style of bash itself -- apologies
+msgid "command not found"
+msgstr "कमांड नहीं मिला"
diff --git a/po/id.po b/po/id.po
index cc7bb17..aa54afc 100644
--- a/po/id.po
+++ b/po/id.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Andika Triwidada , 2011-2018
+# Andika Triwidada , 2011-2018,2024
# Dichi Al Faridi , 2010
# dirgita , 2014
# Richard Hughes , 2011
@@ -305,6 +305,9 @@ msgstr "Perintah tak ditemukan, perintah yang valid adalah:"
msgid "Committing changes"
msgstr "Menerapkan perubahan"
+msgid "Config file was not found."
+msgstr "Berkas konfig tidak ditemukan."
+
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
@@ -467,10 +470,20 @@ msgstr "Gagal memasang paket"
msgid "Failed to launch:"
msgstr "Gagal meluncurkan:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "Gagal memuat berkas konfig: %s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
msgstr "Gagal memuat backend"
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "Gagal memuat backend: %s"
+
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
msgstr "Gagal memuat berkas konfig"
@@ -483,6 +496,12 @@ msgstr "Gagal mengurai argumen"
msgid "Failed to parse command line"
msgstr "Gagal mengurai baris perintah"
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "Gagal mengurai auto: %s"
+
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
msgstr "Gagal mencari berkas"
@@ -1206,6 +1225,10 @@ msgstr "Paket berikut mesti dihapus:"
msgid "The following packages have to be updated:"
msgstr "Paket berikut mesti dimutakhirkan:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Umur singgahan metadata maksimum (dalam detik). Gunakan -1 untuk hanya memakai singgahan, 1 untuk memuat ulang singgahan."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Paket yang menyediakan berkas ini adalah:"
@@ -1214,6 +1237,11 @@ msgstr "Paket yang menyediakan berkas ini adalah:"
msgid "The proxy could not be set"
msgstr "Proksi tak dapat ditata"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "Paket yang dipilih mungkin sudah terpasang."
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "Tanda tangan tak diterima."
@@ -1260,6 +1288,10 @@ msgstr "Tidak ada peningkatan tersedia saat ini."
msgid "This tool could not find all the packages: %s"
msgstr "Alat ini tidak bisa menemukan semua paket: %s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "Alat ini tidak dapat menemukan paket yang tersedia."
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
diff --git a/po/ja.po b/po/ja.po
index 70ef069..389f153 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -4,12 +4,14 @@
#
# Translators:
# Green , 2021
+# Green , 2024
# hyuugabaru , 2009
# Kiyoto Hashida , 2009
# Nobuhiro Iwamatsu , 2022
# Ooyama Yosiyuki , 2015
# Ooyama Yosiyuki , 2021
# Richard Hughes , 2011
+# Ryo Nakano, 2024
# Takuro Onoue , 2021
# e93ed3aa97dec2eb31063731872555fc_1460a05 <71305a0095156d8e18373a5b7cfeb79e_8587>, 2011-2013
msgid ""
@@ -35,7 +37,7 @@ msgstr "正しいロールが必要です"
#. * specify anything about what to
#. * download or where
msgid "A destination directory and the package names to download are required"
-msgstr "ダウンロードする宛先ディレクトリーとパッケージ名が必要です"
+msgstr "ダウンロード先のディレクトリとパッケージ名が必要です"
msgid "A filename is required"
msgstr "ファイル名は必須です"
@@ -81,12 +83,12 @@ msgid "A repo id and autoremove required"
msgstr "リポジトリIDと自動削除が必要です"
msgid "A repo name, parameter and value are required"
-msgstr "リポジトリー名と、パラメーター、値が必要です"
+msgstr "リポジトリ名と、パラメータ、値が必要です"
#. TRANSLATORS: The user did not
#. * specify a repository name
msgid "A repository name is required"
-msgstr "リポジトリー名が必要です"
+msgstr "リポジトリ名が必要です"
#. TRANSLATORS: the user
#. * needs to provide a search term
@@ -143,7 +145,7 @@ msgstr "トランザクション中にパッケージを再インストールで
#. command line argument, do we ask questions
msgid "Allow untrusted packages to be installed."
-msgstr "信頼できないパッケージのインストールを許可します。"
+msgstr "信頼できないパッケージのインストールを許可する。"
#. TRANSLATORS: The user didn't
#. * specify what action to use
@@ -207,7 +209,7 @@ msgid "Author"
msgstr "著者"
msgid "Automatically remove unused dependencies"
-msgstr "未使用の依存関係を自動的に削除します"
+msgstr "未使用の依存関係を自動的に削除する"
#. TRANSLATORS: The state of a package, i.e. not installed
msgid "Available"
@@ -246,7 +248,7 @@ msgstr "キャンセル中"
#. TRANSLATORS: this is the group category name
msgid "Category"
-msgstr "カテゴリー"
+msgstr "カテゴリ"
#. SECURITY:
#. - Normal users require admin authentication to enable or disable
@@ -319,7 +321,7 @@ msgid "Copying files"
msgstr "ファイル複写中"
msgid "Debugging Options"
-msgstr "デバッギングオプション"
+msgstr "デバッグオプション"
#. TRANSLATORS: this is the description of the backend
msgid "Description"
@@ -332,7 +334,7 @@ msgstr "更新の詳細:"
#. TRANSLATORS: the directory does
#. * not exist, so we can't continue
msgid "Directory not found"
-msgstr "ディレクトリーが見つかりません"
+msgstr "ディレクトリが見つかりません"
#. TRANSLATORS: if we should not monitor how long we are inactive for
msgid "Disable the idle timer"
@@ -347,29 +349,29 @@ msgid "Distribution"
msgstr "ディストリビューション"
msgid "Do not install these packages unless you are sure it is safe to do so."
-msgstr "実行が安全なことを確信できない限りはこれらのパッケージ群をインストールしないで下さい。"
+msgstr "安全だという確証がない限り、これらのパッケージ群をインストールしないでください。"
msgid "Do not install this package unless you are sure it is safe to do so."
-msgstr "実行が安全なことを確信できない限りはこのパッケージをインストールしないで下さい。"
+msgstr "安全だという確証がない限り、このパッケージをインストールしないでください。"
msgid "Do not update these packages unless you are sure it is safe to do so."
-msgstr "実行が安全なことを確信できない限りはこれらのパッケージ群を更新しないで下さい。"
+msgstr "安全だという確証がない限り、これらのパッケージ群を更新しないでください。"
msgid "Do not update this package unless you are sure it is safe to do so."
-msgstr "実行が安全なことを確信できない限りはこのパッケージを更新しないで下さい。"
+msgstr "安全だという確証がない限り、このパッケージを更新しないでください。"
#. TRANSLATORS: ask the user if they've read and accepted the EULA
msgid "Do you accept this agreement?"
-msgstr "この同意書を承認しますか?"
+msgstr "この同意書を承認しますか?"
#. TRANSLATORS: ask the user if they want to import
msgid "Do you accept this signature?"
-msgstr "この署名を承認しますか?"
+msgstr "この署名を承認しますか?"
#. TRANSLATORS: ask the user if they are comfortable installing insecure
#. packages
msgid "Do you want to allow installing of unsigned software?"
-msgstr "署名無しのソフトウェアのインストールを許可しますか?"
+msgstr "署名無しのソフトウェアのインストールを許可しますか?"
#. TRANSLATORS: don't unset environment variables, used for debugging
msgid "Don't clear environment on startup"
@@ -414,7 +416,7 @@ msgstr "パッケージをダウンロード中"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading repository information"
-msgstr "レポジトリ情報をダウンロード中"
+msgstr "リポジトリ情報をダウンロード中"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading update information"
@@ -431,7 +433,7 @@ msgstr "有効"
#. TRANSLATORS: this is another name for a software licence that has to be
#. read before installing
msgid "End user licence agreement required"
-msgstr "エンドユーザーライセンス同意書が必要です"
+msgstr "エンドユーザーライセンスに同意が必要です"
#. TRANSLATORS: The type of update
msgid "Enhancement"
@@ -450,11 +452,11 @@ msgstr "エンジンがロードされてから終了"
#. * 'pkcon install-local dave.rpm'
#, c-format
msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
-msgstr "予期されるパッケージ名は実際にはファイルを持ちます。代わりに 'pkcon install-local %s' を 試して下さい。"
+msgstr "パッケージ名が想定される箇所で、ファイルが入力されました。代わりに 'pkcon install-local %s' を使用してみてください。"
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to contact PackageKit"
-msgstr "PackageKit への接触に失敗"
+msgstr "PackageKit への接続に失敗"
msgid "Failed to get daemon state"
msgstr "デーモンの状態を得るのに失敗しました"
@@ -649,7 +651,7 @@ msgstr "署名付きのパッケージをインストール"
#. command line argument, do we ask questions
msgid "Install the packages without asking for confirmation"
-msgstr "確認を要求せずにパッケージをインストール"
+msgstr "確認を要求せずにパッケージをインストールする"
#. SECURITY:
#. - Normal users require admin authentication to install untrusted or
@@ -827,11 +829,11 @@ msgstr "PackageKit"
#. TRANSLATORS: This is the header to the --help menu
msgid "PackageKit Console Interface"
-msgstr "PackageKit コンソールインターフェース"
+msgstr "PackageKit コンソールインタフェース"
#. TRANSLATORS: this is a program that monitors PackageKit
msgid "PackageKit Monitor"
-msgstr "PackageKit モニター"
+msgstr "PackageKit モニタ"
#. TRANSLATORS: describing the service that is running
msgid "PackageKit service"
@@ -863,35 +865,35 @@ msgstr "インストールするパッケージを選んでください"
#. TRANSLATORS: This finds out which package in the list to use
msgid "Please choose the correct package: "
-msgstr "現在のパッケージを選択して下さい: "
+msgstr "適切なパッケージを選択してください: "
#, c-format
msgid "Please enter a number from 1 to %i: "
-msgstr "1 から %i までの数字を1つ入力して下さい: "
+msgstr "1 から %i までの数字を 1 つ入力してください: "
#. TRANSLATORS: ask the user to insert the media
msgid "Please insert the correct media"
-msgstr "適切なメディアを挿入して下さい"
+msgstr "適切なメディアを挿入してください"
#. TRANSLATORS: a package needs to restart the session (due to security)
msgid "Please logout and login to complete the update as important security updates have been installed."
-msgstr "重大なセキュリティー更新がインストールされたので、更新を完了するためにログアウトとログインを行って下さい。"
+msgstr "重大なセキュリティ更新がインストールされたので、更新を完了するために再ログインしてください。"
#. TRANSLATORS: a package needs to restart the session
msgid "Please logout and login to complete the update."
-msgstr "更新を完了するためにログアウトし、ログインしてください。"
+msgstr "更新を完了するために再ログインしてください。"
#. TRANSLATORS: a package needs to restart their system (due to security)
msgid "Please restart the computer to complete the update as important security updates have been installed."
-msgstr "重大なセキュリティー更新がインストールされたので、更新を完了するためにコンピューターを再起動してください。"
+msgstr "重大なセキュリティ更新がインストールされたので、更新を完了するためにコンピュータを再起動してください。"
#. TRANSLATORS: a package needs to restart their system
msgid "Please restart the computer to complete the update."
-msgstr "更新を完了するためにコンピューターを再起動してください。"
+msgstr "更新を完了するためにコンピュータを再起動してください。"
#. command line argument, do we just download or apply changes
msgid "Prepare the transaction by downloading packages only"
-msgstr "パッケージをダウンロードのみ実行することにより、トランザクションを準備します"
+msgstr "パッケージをダウンロードのみ実行することにより、トランザクションを準備する"
#. TRANSLATORS: There follows a list of packages downloaded and ready
#. * to be updated
@@ -900,11 +902,11 @@ msgstr "準備されたアップデート:"
#. TRANSLATORS: command line argument, just output without fancy formatting
msgid "Print to screen a machine readable output, rather than using animated widgets"
-msgstr "動画のウィジェットの使用ではなく、マシン可読の出力を画面に表示"
+msgstr "アニメーション表示の代わりに、マシンリーダブルな出力を画面に表示する"
#. TRANSLATORS: ask the user if the proposed changes are okay
msgid "Proceed with changes?"
-msgstr "変更したまま継続しますか?"
+msgstr "変更を適用しますか?"
#. TRANSLATORS: transaction state, is querying data
msgid "Querying"
@@ -1019,7 +1021,7 @@ msgstr "よく似たコマンドを実行:"
#. TRANSLATORS: command line argument, this command is not a priority
msgid "Run the command using idle network bandwidth and also using less power"
-msgstr "遊休のネットワークバンド幅とより少ない電力を使用してコマンドを実行"
+msgstr "アイドル状態のネットワーク帯域幅とより少ない電力を使用してコマンドを実行する"
#. TRANSLATORS: transaction state, just started
msgid "Running"
@@ -1064,12 +1066,12 @@ msgstr "グループ検索中"
#. TRANSLATORS: The type of update
msgid "Security"
-msgstr "セキュリティー"
+msgstr "セキュリティ"
#. TRANSLATORS: a package requires the session to be restarted
#. * due to a security update
msgid "Session restart (security) required:"
-msgstr "セッション再起動 (セキュリティー) が必要:"
+msgstr "セッション再起動 (セキュリティ) が必要:"
#. TRANSLATORS: a package requires the session to be restarted
msgid "Session restart required:"
@@ -1087,7 +1089,7 @@ msgstr "リポジトリオプションの設定"
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
-msgstr "インストール済などのフィルターを設定"
+msgstr "フィルタを設定する (例: installed)"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Setting data"
@@ -1095,14 +1097,14 @@ msgstr "データを設定中"
#. TRANSLATORS: turn on all debugging
msgid "Show debugging information for all files"
-msgstr "全てのファイル用にデバッグ情報を表示"
+msgstr "すべてのファイルに対してデバッグ情報を表示する"
msgid "Show debugging options"
msgstr "デバッグオプションを表示"
#. TRANSLATORS: command line argument, just show the version string
msgid "Show the program version and exit"
-msgstr "プログラムのバージョンを表示して終了"
+msgstr "プログラムのバージョンを表示して終了する"
#. TRANSLATORS: show version
msgid "Show version and exit"
@@ -1110,7 +1112,7 @@ msgstr "バージョンを表示して終了"
#. TRANSLATORS: we've finished doing offline updates
msgid "Shutting down after installing updates…"
-msgstr "更新のインストール後にシャットダウン…"
+msgstr "更新をインストールしたのでシャットダウンします…"
#. TRANSLATORS: tell the user what we think the command is
msgid "Similar command is:"
@@ -1164,7 +1166,7 @@ msgstr "概要"
#. TRANSLATORS: a package requires the system to be restarted
#. * due to a security update
msgid "System restart (security) required by:"
-msgstr "以下によりシステム再起動 (セキュリティー) が必要です:"
+msgstr "以下によりシステム再起動 (セキュリティ) が必要です:"
#. TRANSLATORS: a package requires the system to be restarted
msgid "System restart required by:"
@@ -1199,7 +1201,7 @@ msgstr "トランザクション中にデーモンがクラッシュしました
#. TRANSLATORS: The user specified
#. * an incorrect filter
msgid "The filter specified was invalid"
-msgstr "指定されたフィルターは無効です"
+msgstr "指定されたフィルタは無効です"
#. TRANSLATORS: When processing, untrusted and non-verified packages may be
#. encountered
@@ -1230,13 +1232,17 @@ msgstr "以下のパッケージは削除されるべきものです:"
msgid "The following packages have to be updated:"
msgstr "以下のパッケージは更新されるべきものです:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "メタデータ・キャッシュの最大保存期間 (秒) です。キャッシュのみを使用する場合は -1、キャッシュをリロードする場合は 1 を使用します。"
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "このファイルを提供しているパッケージは:"
#. TRANSLATORS: The network settings could not be sent
msgid "The proxy could not be set"
-msgstr "プロキシーを設定できませんでした。"
+msgstr "プロキシを設定できませんでした。"
#. TRANSLATORS: There was an error finding a package
#. * for installation, it may already be installed.
@@ -1253,7 +1259,7 @@ msgstr "ソフトウェアは信頼できるソースのものではありませ
#. TRANSLATORS: tell the user we didn't do anything
msgid "The transaction did not proceed."
-msgstr "トランザクションは進展しませんでした。"
+msgstr "トランザクションは実行されませんでした。"
#. TRANSLATORS: the transaction failed in a way we could
#. * not expect
@@ -1429,11 +1435,11 @@ msgstr "認証を待ち受け中"
#. TRANSLATORS: transaction state, when we're waiting for the native tools to
#. exit
msgid "Waiting for package manager lock"
-msgstr "パッケージマネージャロックを待ち受け中"
+msgstr "パッケージマネージャのロックを待ち受け中"
#. TRANSLATORS: waiting for native lock
msgid "Waiting for package manager lock."
-msgstr "パッケージマネージャーのロックを待っています。"
+msgstr "パッケージマネージャのロックを待っています。"
#. TRANSLATORS: transaction state, the transaction is waiting for another to
#. complete
diff --git a/po/ko.po b/po/ko.po
index a778ac5..844e93a 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -5,7 +5,7 @@
# Translators:
# Seong-ho Cho , 2013
# Seong-ho Cho , 2011
-# Seong-ho Cho , 2011,2013-2017,2022
+# Seong-ho Cho , 2011,2013-2017,2022,2024
# Shinjo Park , 2012,2015,2018-2019
msgid ""
msgstr ""
@@ -1225,6 +1225,10 @@ msgstr "다음 패키지를 제거해야 합니다:"
msgid "The following packages have to be updated:"
msgstr "다음 패키지를 갱신해야 합니다:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "메타데이터 최대 캐시 기한(초 단위)입니다. 캐시만 사용하려면 -1 값을, 캐시를 다시 불러오려면 1을 설정하십시오."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "이 파일이 포함된 패키지:"
diff --git a/po/lt.po b/po/lt.po
index 9a7318c..8741a49 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -8,6 +8,7 @@
# Mantas Kriaučiūnas Baltix , 2011,2014
# Mantas Kriaučiūnas Baltix , 2011,2014
# Moo, 2021-2022
+# Moo, 2023-2024
# Richard Hughes , 2011
msgid ""
msgstr ""
@@ -123,6 +124,17 @@ msgstr "Paveikti paketai: nėra"
msgid "Agreement"
msgstr "Sutikimas"
+#. command line argument, do we allow package downgrades
+msgid "Allow packages to be downgraded during transaction"
+msgstr "Leisti operacijos metu sendinti paketus į senesnes versijas"
+
+msgid "Allow packages to be reinstalled during transaction"
+msgstr "Leisti operacijos metu diegti paketus iš naujo"
+
+#. command line argument, do we ask questions
+msgid "Allow untrusted packages to be installed."
+msgstr "Leisti diegti nepatikimus paketus"
+
#. TRANSLATORS: The user didn't
#. * specify what action to use
msgid "An action, e.g. 'update-packages' is required"
@@ -151,6 +163,9 @@ msgstr "Atnaujinimams atsijungus sukelti būtina patvirtinti tapatybę"
msgid "Author"
msgstr "Autorius"
+msgid "Automatically remove unused dependencies"
+msgstr "Automatiškai šalinti nenaudojamas priklausomybes"
+
#. TRANSLATORS: The state of a package, i.e. not installed
msgid "Available"
msgstr "Prieinamas"
@@ -159,6 +174,10 @@ msgstr "Prieinamas"
msgid "Blocked"
msgstr "Blokuotas"
+#. TRANSLATORS: The type of update
+msgid "Bug fix"
+msgstr "Klaidų pataisymas"
+
#. TRANSLATORS: details about the update, the bugzilla URLs
msgid "Bugzilla"
msgstr "Bugzilla"
@@ -186,6 +205,13 @@ msgstr "Atšaukiama"
msgid "Category"
msgstr "Kategorija"
+#. SECURITY:
+#. - Normal users require admin authentication to enable or disable
+#. software repositories as this can be used to enable new updates or
+#. install different versions of software.
+msgid "Change software repository parameters"
+msgstr "Keisti programinės įrangos saugyklos parametrus"
+
#. TRANSLATORS: details about the update, the changelog for
#. * the package
msgid "Changes"
@@ -233,6 +259,9 @@ msgstr "Komandos įvykdyti nepavyko"
msgid "Command line"
msgstr "Komandų eilutė"
+msgid "Command not found, valid commands are:"
+msgstr "Komanda nerasta. Tinkamos komandos yra:"
+
#. TRANSLATORS: transaction state, when we're writing to the system package
#. database
msgid "Committing changes"
@@ -311,6 +340,10 @@ msgstr "Atsiųstas"
msgid "Downloading"
msgstr "Atsiunčiamas"
+#. TRANSLATORS: downloading repo data so we can search
+msgid "Downloading details about the software repositories."
+msgstr "Atsiunčiama išsamesnė informacija apie programinės įrangos saugyklas."
+
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading file lists"
msgstr "Atsiunčiami failų sąrašai"
@@ -404,9 +437,17 @@ msgstr "Nepavyko paleisti:"
msgid "Failed to load config file: %s"
msgstr "Nepavyko įkelti konfigūracijos failo: %s"
+#. TRANSLATORS: probably not yet installed
+msgid "Failed to load the config file"
+msgstr "Nepavyko įkelti konfigūracijos failo"
+
+#. TRANSLATORS: the user didn't read the man page
+msgid "Failed to parse arguments"
+msgstr "Nepavyko išnagrinėti argumentų"
+
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to parse command line"
-msgstr "Nepavyko perskaityti komandų eilutės"
+msgstr "Nepavyko išnagrinėti komandų eilutės"
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
@@ -508,6 +549,24 @@ msgstr "Piktograma"
msgid "Important"
msgstr "Svarbus"
+#. SECURITY
+#. - Normal users require admin authentication to reinstall packages.
+#. - Authorization to install packages does not imply permissions to
+#. reinstall them and vice versa.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install already installed package again"
+msgstr "Dar kartą įdiegti jau įdiegtą paketą"
+
+#. SECURITY
+#. - Normal users require admin authentication to downgrade packages.
+#. - User authorized to downgrade signed packages is authorized to install
+#. them as well.
+#. - If a package in question is not trusted, user's permission to install
+#. untrusted package will be checked as well.
+msgid "Install older version of installed package"
+msgstr "Įdiegti senesnę įdiegto paketo versiją"
+
#. TRANSLATORS: command description
msgid "Install package"
msgstr "Įdiegti paketą"
@@ -627,6 +686,10 @@ msgstr "Laikmenos etiketė"
msgid "Media type"
msgstr "Laikmenos tipas"
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Modifying repository"
+msgstr "Modifikuojama saugykla"
+
#. TRANSLATORS: more than one package could be found that matched,
#. * to follow is a list of possible packages
msgid "More than one package matches:"
@@ -758,12 +821,16 @@ msgstr "Atnaujinimui užbaigti, atsijunkite ir vėl prisijunkite."
#. TRANSLATORS: a package needs to restart their system (due to security)
msgid "Please restart the computer to complete the update as important security updates have been installed."
-msgstr "Atnaujinimui užbaigti, paleiskite sistemą iš naujo - buvo įdiegta svarbių saugumo atnaujinimų."
+msgstr "Atnaujinimui užbaigti, paleiskite sistemą iš naujo – buvo įdiegta svarbių saugumo atnaujinimų."
#. TRANSLATORS: a package needs to restart their system
msgid "Please restart the computer to complete the update."
msgstr "Atnaujinimui užbaigti, paleiskite sistemą iš naujo."
+#. command line argument, do we just download or apply changes
+msgid "Prepare the transaction by downloading packages only"
+msgstr "Paruošti operaciją tik atsiunčiant paketus"
+
#. TRANSLATORS: There follows a list of packages downloaded and ready
#. * to be updated
msgid "Prepared updates:"
@@ -787,7 +854,21 @@ msgstr "Tikrasis vardas"
#. TRANSLATORS: we've finished doing offline updates
msgid "Rebooting after installing updates…"
-msgstr "Perleidžiama po atnaujinimų diegimo…"
+msgstr "Paleidžiama iš naujo po atnaujinimų diegimo…"
+
+#. SECURITY:
+#. - Normal users do not require admin authentication to refresh the
+#. cache, as this doesn't actually install or remove software.
+msgid "Refresh system repositories"
+msgstr "Įkelti sistemos saugyklas iš naujo"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache"
+msgstr "Įkelti podėlį iš naujo"
+
+#. TRANSLATORS: command description
+msgid "Refresh the cache (forced)"
+msgstr "Įkelti podėlį iš naujo (priverstinai)"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Refreshing cache"
@@ -830,6 +911,10 @@ msgstr "Šalinamas"
msgid "Removing packages"
msgstr "Šalinami paketai"
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Removing repository"
+msgstr "Šalinama saugykla"
+
#. TRANSLATORS: transaction state, repackaging delta files
msgid "Repackaging files"
msgstr "Perpakuojami failai"
@@ -878,10 +963,27 @@ msgstr "Paleisti komandą naudojant laisvą tinklo ryšį ir naudojant mažiau e
msgid "Running"
msgstr "Vykdoma"
+#. TRANSLATORS: transaction state, we are running hooks before or after the
+#. transaction
+msgid "Running hooks"
+msgstr "Vykdomos gaudyklės"
+
#. TRANSLATORS: transaction state, scanning for running processes
msgid "Scanning applications"
msgstr "Apžvelgiamos programos"
+#. TRANSLATORS: command description
+msgid "Search by details"
+msgstr "Ieškoti pagal išsamesnę informaciją"
+
+#. TRANSLATORS: command description
+msgid "Search by files"
+msgstr "Ieškoti pagal failus"
+
+#. TRANSLATORS: command description
+msgid "Search by names"
+msgstr "Ieškoti pagal pavadinimus"
+
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by details"
msgstr "Ieškoma pagal informaciją"
@@ -905,11 +1007,11 @@ msgstr "Saugumo"
#. TRANSLATORS: a package requires the session to be restarted
#. * due to a security update
msgid "Session restart (security) required:"
-msgstr "Paleisti seansą iš naujo (saugumo sumetimais) reikalauja:"
+msgstr "Reikia paleisti seansą iš naujo (saugumo sumetimais):"
#. TRANSLATORS: a package requires the session to be restarted
msgid "Session restart required:"
-msgstr "Paleisti seansą iš naujo reikalauja:"
+msgstr "Reikia paleisti seansą iš naujo:"
#. SECURITY:
#. - Normal users do not require admin authentication to set the proxy
@@ -917,6 +1019,10 @@ msgstr "Paleisti seansą iš naujo reikalauja:"
msgid "Set network proxy"
msgstr "Nustatyti įgaliotąjį tinklo serverį"
+#. TRANSLATORS: command description
+msgid "Set repository options"
+msgstr "Nustatyti saugyklos parinktis"
+
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
msgstr "Nustatyti filtrą, pvz., įdiegta"
@@ -1026,7 +1132,7 @@ msgstr "Tinkama laikmena nebuvo įdėta."
#. TRANSLATORS: This is when the daemon crashed, and we are up
#. * shit creek without a paddle
msgid "The daemon crashed mid-transaction!"
-msgstr "Tarnyba nulūžo atliekant operaciją!"
+msgstr "Tarnyba užstrigo atliekant operaciją!"
#. TRANSLATORS: The user specified
#. * an incorrect filter
@@ -1046,6 +1152,10 @@ msgstr "Šie paketai turi būti pasendinti į senesnes versijas:"
msgid "The following packages have to be installed:"
msgstr "Šie paketai turi būti įdiegti:"
+#. TRANSLATORS: When processing, we might have to obsolete other dependencies
+msgid "The following packages have to be obsoleted:"
+msgstr "Šie paketai turės tapti pasenę:"
+
#. TRANSLATORS: When processing, we might have to reinstall other dependencies
msgid "The following packages have to be reinstalled:"
msgstr "Šie paketai turi būti įdiegti iš naujo:"
@@ -1066,6 +1176,11 @@ msgstr "Paketas, suteikiantis šį failą yra:"
msgid "The proxy could not be set"
msgstr "Nepavyko nustatyti įgaliotosios programos"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "Gali būti, kad pasirinkti paketai jau yra įdiegti."
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "Parašas nepriimtas."
@@ -1076,7 +1191,7 @@ msgstr "Ši programinė įranga nėra iš patikimos saugyklos."
#. TRANSLATORS: tell the user we didn't do anything
msgid "The transaction did not proceed."
-msgstr "Operacija neprasidėjo."
+msgstr "Operacija nebuvo tęsiama."
#. TRANSLATORS: the transaction failed in a way we could
#. * not expect
@@ -1112,6 +1227,10 @@ msgstr "Šiuo metu nėra atnaujinimų."
msgid "This tool could not find all the packages: %s"
msgstr "Šiai priemonei nepavyko rasti visų paketų: %s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "Šiam įrankiui nepavyko rasti jokių prieinamų paketų."
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
@@ -1153,10 +1272,22 @@ msgstr "Kasdienis"
msgid "True"
msgstr "Teigiama"
+#. SECURITY:
+#. - Normal users require admin authentication to add signing keys.
+#. - This implies adding an explicit trust, and should not be granted
+#. without a secure authentication.
+#. - This is not kept as each package should be authenticated.
+msgid "Trust a key used for signing software"
+msgstr "Pasitikėti programinės įrangos pasirašymui naudojamu raktu"
+
#. TRANSLATORS: this is type of update, stable or testing
msgid "Type"
msgstr "Tipas"
+#. TRANSLATORS: The state of a package, i.e. not installed
+msgid "Unavailable"
+msgstr "Neprieinamas"
+
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Unknown role type"
msgstr "Nežinomas vaidmens tipas"
diff --git a/po/meson.build b/po/meson.build
index e35de4e..ef4da1a 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -6,7 +6,7 @@ i18n.gettext(
run_target('fix-translations',
command: [
- join_paths(meson.source_root(), 'contrib/fix_translations.py'),
- join_paths(meson.source_root(), 'po')
+ join_paths(source_root, 'contrib/fix_translations.py'),
+ join_paths(source_root, 'po')
]
)
diff --git a/po/pl.po b/po/pl.po
index fd175d0..db2deb8 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -3,7 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Piotr Drąg , 2011-2018,2022
+# Piotr Drąg , 2011-2018,2022-2023,2025
# Richard Hughes , 2011
msgid ""
msgstr ""
@@ -16,6 +16,16 @@ msgstr ""
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%i%%"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%i%%)"
+
msgid "(seconds)"
msgstr "(sekundy)"
@@ -368,6 +378,10 @@ msgstr "Pozwolić na instalowanie niepodpisanego oprogramowania?"
msgid "Don't clear environment on startup"
msgstr "Bez czyszczenia środowiska podczas uruchamiania"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Instalacja starszej wersji"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "Pobierano"
@@ -604,6 +618,10 @@ msgstr "Ikona"
msgid "Important"
msgstr "Ważna"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Instalacja"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -771,6 +789,10 @@ msgstr "Nie odnaleziono żadnych pakietów"
msgid "Normal"
msgstr "Zwykła"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Zastąpienie"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
msgstr "Zastąpiono"
@@ -941,6 +963,10 @@ msgstr "Zainstalowano ponownie"
msgid "Reinstalling"
msgstr "Ponowne instalowanie"
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Usunięcie"
+
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
#. this can make the system unbootable or stop other applications from
@@ -1223,6 +1249,10 @@ msgstr "Następujące pakiety muszą zostać usunięte:"
msgid "The following packages have to be updated:"
msgstr "Następujące pakiety muszą zostać zaktualizowane:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Maksymalny czas przechowywania metadanych w pamięci podręcznej (w sekundach). Wartość -1 oznacza używanie wyłącznie pamięci podręcznej, wartość 1 spowoduje ponowne wczytanie pamięci podręcznej."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Pakiet dostarczający ten plik:"
diff --git a/po/pt.po b/po/pt.po
index 41b64d9..da7dc06 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -4,7 +4,8 @@
#
# Translators:
# Juliano de Souza Camargo , 2020
-# Pedro Albuquerque , 2015
+# Luis Filipe Teixeira , 2025
+# Pedro Albuquerque , 2015
# Peter J. Mello , 2023
# Richard Hughes , 2011
# Rui Gouveia , 2010
@@ -1226,6 +1227,10 @@ msgstr "Os seguintes pacotes precisam de ser removidos:"
msgid "The following packages have to be updated:"
msgstr "Os seguintes pacotes precisam de ser atualizados:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "A duração máxima da cache de metadados (em segundos). Utilize -1 para utilizar apenas a cache, 1 para recarregar a cache."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "O pacote que fornece este ficheiro é o:"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 42e4d83..5f1e457 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -3,10 +3,11 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
+# F Bausch, 2024
# Igor Pires Soares , 2008-2010
# Rafael Fontenelle , 2012-2014
# Rafael Fontenelle , 2017
-# Rafael Fontenelle , 2015-2018,2022
+# Rafael Fontenelle , 2015-2018,2022,2025
# Richard Hughes , 2011
# ufa , 2012
# ufa , 2012
@@ -21,6 +22,16 @@ msgstr ""
"Language: pt_BR\n"
"Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%i%%"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%i%%)"
+
msgid "(seconds)"
msgstr "(segundos)"
@@ -308,6 +319,9 @@ msgstr "Comando não encontrado, comandos válidos são:"
msgid "Committing changes"
msgstr "Submetendo alterações"
+msgid "Config file was not found."
+msgstr "O arquivo de configuração não foi encontrado."
+
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
@@ -370,6 +384,10 @@ msgstr "Você deseja permitir a instalação de softwares não assinados?"
msgid "Don't clear environment on startup"
msgstr "Não limpe o ambiente no início"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Desatualizar"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "Baixado"
@@ -470,10 +488,20 @@ msgstr "Falha ao instalar pacotes"
msgid "Failed to launch:"
msgstr "Falha ao executar:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "Falha ao carregar o arquivo de configuração: %s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
msgstr "Falha ao carregar o backend"
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "Falha ao carregar o backend: %s"
+
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
msgstr "Falha ao carregar o arquivo de configuração"
@@ -486,6 +514,12 @@ msgstr "Falha ao analisar argumentos"
msgid "Failed to parse command line"
msgstr "Falha ao processar a linha de comando"
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "Falha ao resolver auto: %s"
+
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
msgstr "Falha ao pesquisar pelo arquivo"
@@ -590,6 +624,10 @@ msgstr "Ícone"
msgid "Important"
msgstr "Importante"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Instalar"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -757,6 +795,10 @@ msgstr "Nenhuma pacote foi encontrado"
msgid "Normal"
msgstr "Normal"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Obsoleto"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
msgstr "Obsoleto"
@@ -927,6 +969,10 @@ msgstr "Reinstalado"
msgid "Reinstalling"
msgstr "Reinstalando"
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Remover"
+
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
#. this can make the system unbootable or stop other applications from
@@ -1128,7 +1174,7 @@ msgstr "Subcomandos:"
#. TRANSLATORS: this is if the transaction succeeded or not
msgid "Succeeded"
-msgstr "Concluído"
+msgstr "Bem-sucedido"
#. TRANSLATORS: Show the user a list of packages that they can install to
#. provide this command
@@ -1195,7 +1241,7 @@ msgstr "Os seguintes pacotes têm que ser instalados:"
#. TRANSLATORS: When processing, we might have to obsolete other dependencies
msgid "The following packages have to be obsoleted:"
-msgstr "Os seguintes pacotes têm se tornar obsoletos:"
+msgstr "Os seguintes pacotes têm que ser tornados obsoletos:"
#. TRANSLATORS: When processing, we might have to reinstall other dependencies
msgid "The following packages have to be reinstalled:"
@@ -1209,6 +1255,10 @@ msgstr "Os seguintes pacotes têm que ser removidos:"
msgid "The following packages have to be updated:"
msgstr "Os seguintes pacotes têm que ser atualizados:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "A idade máxima do cache de metadados (em segundos). Use -1 para usar somente o cache, 1 para recarregar o cache."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "O pacote que fornece esse arquivo é:"
diff --git a/po/ro.po b/po/ro.po
index 635156d..18186a6 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -3,6 +3,7 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
+# Remus-Gabriel Chelu , 2024-2025
# Richard Hughes , 2011
# Sergiu Bivol , 2020
msgid ""
@@ -16,6 +17,16 @@ msgstr ""
"Language: ro\n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%i%%"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%i%%)"
+
msgid "(seconds)"
msgstr "(secunde)"
@@ -28,15 +39,15 @@ msgstr "Este necesar un rol corect"
#. * specify anything about what to
#. * download or where
msgid "A destination directory and the package names to download are required"
-msgstr "Sunt necesare un dosar de destinație și denumirile pachetelor de descărcat"
+msgstr "Sunt necesare un dosar de destinație și numele pachetelor de descărcat"
msgid "A filename is required"
-msgstr "Este necesară o denumire de fișier"
+msgstr "Este necesar un nume de fișier"
#. TRANSLATORS: the user did not
#. * specify what they wanted to install
msgid "A filename to install is required"
-msgstr "Este necesară o denumire de fișier de instalat"
+msgstr "Este necesar un nume de fișier pentru instalare"
#. TRANSLATORS: geeky error, real
#. * users won't see this
@@ -46,40 +57,40 @@ msgstr "Este necesar un identificator de licență (eula-id)"
#. TRANSLATORS: The user did not
#. * provide a package name
msgid "A package name is required"
-msgstr "Este necesară o denumire de pachet"
+msgstr "Este necesar un nume de pachet"
#. TRANSLATORS: the user did not
#. * specify what they wanted to install
msgid "A package name to install is required"
-msgstr "Este necesară o denumire de pachet de instalat"
+msgstr "Este necesar un nume de pachet pentru instalare"
#. TRANSLATORS: the user did not
#. * specify what they wanted to remove
msgid "A package name to remove is required"
-msgstr "Este necesară o denumire de pachet de eliminat"
+msgstr "Este necesar un nume de pachet de eliminat"
#. TRANSLATORS: The user did not
#. * specify a package name
msgid "A package name to resolve is required"
-msgstr "Este necesară o denumire de pachet de rezolvat"
+msgstr "Este necesar un nume de pachet de rezolvat"
#. TRANSLATORS: each package
#. * "provides" certain things, e.g.
#. * mime(gstreamer-decoder-mp3),
#. * the user didn't specify it
msgid "A package provide string is required"
-msgstr "Este necesar un șir de furnizori de pachete"
+msgstr "Este necesar un șir cu ce furnizează (ce conține) pachetul"
msgid "A repo id and autoremove required"
-msgstr "Trebuiesc un identificator de depozit și „autoremove”"
+msgstr "Se necesită un id de depozit și comanda «autoremove»"
msgid "A repo name, parameter and value are required"
-msgstr "Trebuiesc o denumire de depozit, parametru și valoare"
+msgstr "Sunt necesare un nume de depozit, un parametru și o valoare"
#. TRANSLATORS: The user did not
#. * specify a repository name
msgid "A repository name is required"
-msgstr "Este necesară o denumire de depozit"
+msgstr "Este necesar un nume de depozit"
#. TRANSLATORS: the user
#. * needs to provide a search term
@@ -91,7 +102,7 @@ msgstr "Este necesar un termen de căutare"
#. TRANSLATORS: a search type can
#. * be name, details, file, etc
msgid "A search type is required, e.g. name"
-msgstr "Este necesar un tip de căutare, de ex.: denumire"
+msgstr "Este necesar un tip de căutare, de exemplu: nume"
#. TRANSLATORS: geeky error, real
#. * users won't see this
@@ -136,12 +147,12 @@ msgstr "Permite reinstalarea pachetelor în timpul tranzacției"
#. command line argument, do we ask questions
msgid "Allow untrusted packages to be installed."
-msgstr "Permite instalarea pachetelor fără încredere acordată."
+msgstr "Permite instalarea pachetelor care nu sunt de încredere."
#. TRANSLATORS: The user didn't
#. * specify what action to use
msgid "An action, e.g. 'update-packages' is required"
-msgstr "Trebuie o acțiune, cum ar fi „update-packages”"
+msgstr "Este necesară o acțiune, de exemplu, „update-packages”."
#. TRANSLATORS: a package requires the application to be restarted
msgid "Application restart required by:"
@@ -151,46 +162,46 @@ msgid "Authentication is required to accept a EULA"
msgstr "Este necesară autentificarea pentru a accepta EULA"
msgid "Authentication is required to cancel a task that was not started by yourself"
-msgstr "Este necesară autentificarea pentru a anula o sarcină ce nu a fost pornită de tine"
+msgstr "Este necesară autentificarea pentru a anula o sarcină ce nu a fost pornită de dvs."
msgid "Authentication is required to change software repository parameters"
-msgstr "Este necesară autentificarea pentru a schimba parametrii depozitului de programe"
+msgstr "Este necesară autentificarea pentru a schimba parametrii depozitului de software"
msgid "Authentication is required to clear the offline updates message"
-msgstr "Este necesară autentificarea pentru a curăța mesajul despre actualizări offline"
+msgstr "Este necesară autentificarea pentru a curăța mesajul despre actualizările fără conectare la Internet"
msgid "Authentication is required to consider a key used for signing software as trusted"
-msgstr "Este necesară autentificarea pentru a acorda încredere unei chei folosite la semnarea programelor"
+msgstr "Este necesară autentificarea pentru a acorda încredere unei chei folosite la semnarea software-ului"
msgid "Authentication is required to downgrade software"
-msgstr "Este necesară autentificarea pentru a retrograda programe"
+msgstr "Este necesară autentificarea pentru a retrograda software"
msgid "Authentication is required to install software"
-msgstr "Este necesară autentificarea pentru a instala programe"
+msgstr "Este necesară autentificarea pentru a instala software"
msgid "Authentication is required to install untrusted software"
-msgstr "Este necesară autentificarea pentru a instala programe fără încredere"
+msgstr "Este necesară autentificarea pentru a instala software nesigur"
msgid "Authentication is required to refresh the system repositories"
msgstr "Este necesară autentificarea pentru a împrospăta depozitele sistemului"
msgid "Authentication is required to reinstall software"
-msgstr "Este necesară autentificarea pentru a reinstala programe"
+msgstr "Este necesară autentificarea pentru a reinstala software"
msgid "Authentication is required to remove software"
-msgstr "Este necesară autentificarea pentru a elimina programe"
+msgstr "Este necesară autentificarea pentru a elimina software"
msgid "Authentication is required to repair the installed software"
-msgstr "Este necesară autentificarea pentru a repara programele instalate"
+msgstr "Este necesară autentificarea pentru a repara software-ul instalat"
msgid "Authentication is required to set the network proxy used for downloading software"
msgstr "Este necesară autentificarea pentru a stabili proxy-ul de rețea folosit la descărcarea programelor"
msgid "Authentication is required to trigger offline updates"
-msgstr "Este necesară autentificarea pentru a declanșa actualizări offline"
+msgstr "Este necesară autentificarea pentru a declanșa actualizări fără conectare la Internet"
msgid "Authentication is required to update software"
-msgstr "Este necesară autentificarea pentru a actualiza programe"
+msgstr "Este necesară autentificarea pentru a actualiza software"
msgid "Authentication is required to upgrade the operating system"
msgstr "Este necesară autentificarea pentru a înnoi sistemul de operare"
@@ -246,7 +257,7 @@ msgstr "Categorie"
#. software repositories as this can be used to enable new updates or
#. install different versions of software.
msgid "Change software repository parameters"
-msgstr "Schimbă parametrii depozitului de programe"
+msgstr "Schimbă parametrii depozitului de software"
#. TRANSLATORS: details about the update, the changelog for
#. * the package
@@ -266,7 +277,7 @@ msgstr "Se verifică bibliotecile în uz"
#. TRANSLATORS: transaction state, checking if we have all the security keys
#. for the operation
msgid "Checking signatures"
-msgstr "Se verifică semnături"
+msgstr "Se verifică semnăturile"
#. TRANSLATORS: The action of the package, in past tense
msgid "Cleaned up"
@@ -279,13 +290,13 @@ msgstr "Se curăță"
#. TRANSLATORS: transaction state, removing old packages, and cleaning config
#. files
msgid "Cleaning up packages"
-msgstr "Se curăță pachete"
+msgstr "Se curăță pachetele"
#. SECURITY:
#. - Normal users are able to clear the updates message that is
#. shown after an updates are applied at boot time.
msgid "Clear offline update message"
-msgstr "Curăță mesajul despre actualizare offline"
+msgstr "Curăță mesajul despre actualizarea fără conectare la Internet"
#. TRANSLATORS: Generic failure of what they asked to do
msgid "Command failed"
@@ -296,12 +307,15 @@ msgid "Command line"
msgstr "Linia de comandă"
msgid "Command not found, valid commands are:"
-msgstr "Comanda nu a fost găsită, comenzi valide sunt:"
+msgstr "Comanda nu a fost găsită, comenzile valide sunt:"
#. TRANSLATORS: transaction state, when we're writing to the system package
#. database
msgid "Committing changes"
-msgstr "Se comit modificările"
+msgstr "Se efectueazăt modificările"
+
+msgid "Config file was not found."
+msgstr "Fișierul de configurare nu a fost găsit."
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
@@ -337,16 +351,16 @@ msgid "Distribution"
msgstr "Distribuție"
msgid "Do not install these packages unless you are sure it is safe to do so."
-msgstr "Nu instalați aceste pachete decât dacă aveți certitudinea că e sigur să faceți asta."
+msgstr "Nu instalați aceste pachete decât dacă aveți certitudinea că este sigur să faceți asta."
msgid "Do not install this package unless you are sure it is safe to do so."
-msgstr "Nu instalați acest pachet decât dacă aveți certitudinea că e sigur să faceți asta."
+msgstr "Nu instalați acest pachet decât dacă aveți certitudinea că este sigur să faceți asta."
msgid "Do not update these packages unless you are sure it is safe to do so."
-msgstr "Nu actualizați aceste pachete decât dacă aveți certitudinea că e sigur să faceți asta."
+msgstr "Nu actualizați aceste pachete decât dacă aveți certitudinea că este sigur să faceți asta."
msgid "Do not update this package unless you are sure it is safe to do so."
-msgstr "Nu actualizați acest pachet decât dacă aveți certitudinea că e sigur să faceți asta."
+msgstr "Nu actualizați acest pachet decât dacă aveți certitudinea că este sigur să faceți asta."
#. TRANSLATORS: ask the user if they've read and accepted the EULA
msgid "Do you accept this agreement?"
@@ -365,6 +379,10 @@ msgstr "Doriți să permiteți instalarea programelor nesemnate?"
msgid "Don't clear environment on startup"
msgstr "Nu curăța mediul la pornire"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Retrogradare"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "Descărcat"
@@ -375,7 +393,7 @@ msgstr "Se descarcă"
#. TRANSLATORS: downloading repo data so we can search
msgid "Downloading details about the software repositories."
-msgstr "Se descarcă detalii despre depozitele cu programe."
+msgstr "Se descarcă detaliile despre depozitele cu software."
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading file lists"
@@ -400,7 +418,7 @@ msgstr "Se descarcă listele cu modificări"
#. TRANSLATORS: transaction state, downloading package files
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Downloading packages"
-msgstr "Se descarcă pachete"
+msgstr "Se descarcă pachetele"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading repository information"
@@ -408,7 +426,7 @@ msgstr "Se descarcă informații din depozit"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading update information"
-msgstr "Se descarcă informații despre actualizări"
+msgstr "Se descarcă informațiile despre actualizări"
#. TRANSLATORS: this is The duration of the transaction
msgid "Duration"
@@ -429,18 +447,18 @@ msgstr "Îmbunătățire"
#. TRANSLATORS: exit after we've started up, used for user profiling
msgid "Exit after a small delay"
-msgstr "Ieși după o mică întârziere"
+msgstr "Iese după o mică întârziere"
#. TRANSLATORS: exit straight away, used for automatic profiling
msgid "Exit after the engine has loaded"
-msgstr "Ieși după ce motorul a fost încărcat"
+msgstr "Iese după ce motorului de împachetare/despachetare a pachetelor a fost încărcat"
#. TRANSLATORS: The user used
#. * 'pkcon install dave.rpm' rather than
#. * 'pkcon install-local dave.rpm'
#, c-format
msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
-msgstr "Se aștepta denumire de pachet, dar s-a primit fișier. Încercați să folosiți „pkcon install-local %s” în loc."
+msgstr "Se aștepta un nume de pachet, dar s-a primit fișier. Încercați să folosiți «pkcon install-local %s» în loc."
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to contact PackageKit"
@@ -465,9 +483,19 @@ msgstr "Instalarea pachetelor a eșuat"
msgid "Failed to launch:"
msgstr "Pornirea a eșuat:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "Încărcarea fișierului de configurare a eșuat: %s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
-msgstr "Încărcarea platformei a eșuat"
+msgstr "Încărcarea motorului de împachetare/despachetare a pachetelor a eșuat"
+
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "Încărcarea motorului de împachetare/despachetare a pachetelor a eșuat: %s"
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
@@ -475,19 +503,25 @@ msgstr "Încărcarea fișierului de configurare a eșuat"
#. TRANSLATORS: the user didn't read the man page
msgid "Failed to parse arguments"
-msgstr "Parcurgerea argumentelor a eșuat"
+msgstr "Analizarea argumentelor a eșuat"
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to parse command line"
-msgstr "Parcurgerea liniei de comandă a eșuat"
+msgstr "Analizarea datelor din linia de comandă a eșuat"
+
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "Nu s-a reușit să se rezolve automat: %s"
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
-msgstr "Eroare la căutarea fișierului"
+msgstr "Căutarea fișierului a eșuat"
#. TRANSLATORS: cannot unload the backend the user specified
msgid "Failed to unload the backend"
-msgstr "Descărcarea platformei a eșuat"
+msgstr "Descărcarea motorului de împachetare/despachetare a pachetelor a eșuat"
msgid "False"
msgstr "Fals"
@@ -511,7 +545,7 @@ msgstr "Încheiat"
#. TRANSLATORS: transaction state, generating a list of packages installed on
#. the system
msgid "Generating package lists"
-msgstr "Se generează liste de pachete"
+msgstr "Se generează listele de pachete"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting categories"
@@ -539,7 +573,7 @@ msgstr "Se obțin pachetele"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting provides"
-msgstr "Se obțin furnizările"
+msgstr "Se obține lista fișierelor ce sunt furnizate de către pachet(e)"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Getting repositories"
@@ -585,6 +619,10 @@ msgstr "Pictogramă"
msgid "Important"
msgstr "Importantă"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Instalează"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -601,7 +639,7 @@ msgstr "Instalează pachet deja instalat din nou"
#. - If a package in question is not trusted, user's permission to install
#. untrusted package will be checked as well.
msgid "Install older version of installed package"
-msgstr "Instalează versiune mai veche a pachetului instalat"
+msgstr "Instalează versiunea mai veche a pachetului instalat"
#. TRANSLATORS: command description
msgid "Install package"
@@ -611,7 +649,7 @@ msgstr "Instalează pachetul"
#. command
#, c-format
msgid "Install package '%s' to provide command '%s'?"
-msgstr "Instalează pachetul „%s” pentru a furniza comanda „%s”?"
+msgstr "Doriți să instalați pachetul „%s” pentru a furniza comanda „%s”?"
#. SECURITY:
#. - Normal users need authentication to install signed packages
@@ -631,7 +669,7 @@ msgstr "Instalează pachetele fără a cere confirmare"
#. password would be a massive security hole.
#. - This is not retained as each package should be authenticated.
msgid "Install untrusted local file"
-msgstr "Instalează pachet local fără încredere"
+msgstr "Instalează pachet local nesigur"
#. TRANSLATORS: The state of a package
#. TRANSLATORS: The action of the package, in past tense
@@ -651,7 +689,7 @@ msgstr "Se instalează înnoirea sistemului"
#. TRANSLATORS: this is the message we send plymouth to
#. * advise of the new percentage completion when installing updates
msgid "Installing Updates"
-msgstr "Se instalează actualizări"
+msgstr "Se instalează actualizările"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Installing files"
@@ -659,7 +697,7 @@ msgstr "Se instalează fișiere"
#. TRANSLATORS: transaction state, installing packages
msgid "Installing packages"
-msgstr "Se instalează pachete"
+msgstr "Se instalează pachetele"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Installing signature"
@@ -671,11 +709,11 @@ msgstr "Se instalează înnoirea sistemului, aceasta ar putea dura..."
#. TRANSLATORS: transaction state, installing updates
msgid "Installing updates"
-msgstr "Se instalează actualizări"
+msgstr "Se instalează actualizările"
#. TRANSLATORS: we've started doing offline updates
msgid "Installing updates; this could take a while..."
-msgstr "Se instalează actualizări, aceasta ar putea dura..."
+msgstr "Se instalează actualizările, aceasta ar putea dura..."
#. TRANSLATORS: details about the update, date the update
#. * was issued
@@ -684,7 +722,7 @@ msgstr "Emis"
#. TRANSLATORS: the key ID, usually a few hex digits
msgid "Key ID"
-msgstr "ID cheie"
+msgstr "ID-ul cheii"
#. TRANSLATORS: the timestamp (a bit like a machine readable time)
msgid "Key Timestamp"
@@ -692,7 +730,7 @@ msgstr "Amprentă temporală cheie"
#. TRANSLATORS: the key URL
msgid "Key URL"
-msgstr "URL cheie"
+msgstr "Adresa URL a cheii"
#. TRANSLATORS: the key fingerprint, again, yet more hex
msgid "Key fingerprint"
@@ -700,11 +738,11 @@ msgstr "Amprentă cheie"
#. TRANSLATORS: the username of the key
msgid "Key user"
-msgstr "Utilizator cheie"
+msgstr "Utilizatorul cheii"
#. TRANSLATORS: transaction state, loading databases
msgid "Loading cache"
-msgstr "Se încarcă cache-ul"
+msgstr "Se încarcă conținutul spațiului de prestocare (cache)"
#. TRANSLATORS: loading package cache so we can search
msgid "Loading list of packages."
@@ -712,15 +750,15 @@ msgstr "Se încarcă listă de pachete."
#. TRANSLATORS: the user needs to change media inserted into the computer
msgid "Media change required"
-msgstr "Este necesară schimbarea suportului"
+msgstr "Este necesară schimbarea suportului de date"
#. TRANSLATORS: the media label, usually like 'disk-1of3'
msgid "Media label"
-msgstr "Etichetă suport"
+msgstr "Etichetă suport date"
#. TRANSLATORS: the type, e.g. DVD, CD, etc
msgid "Media type"
-msgstr "Tip suport"
+msgstr "Tip suport date"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Modifying repository"
@@ -742,7 +780,7 @@ msgstr "Niciun fișier"
#. TRANSLATORS: there are no updates, so nothing to do
msgid "No packages require updating to newer versions."
-msgstr "Niciun pachet nu se cere actualizat la versiuni mai noi."
+msgstr "Niciun pachet nu necesită actualizarea la versiuni mai noi."
#. TRANSLATORS: we couldn't find anything
msgid "No packages were found"
@@ -752,28 +790,32 @@ msgstr "Nu a fost găsit niciun pachet"
msgid "Normal"
msgstr "Normală"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Obsolet"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
-msgstr "Învechit"
+msgstr "Marcat ca învechit"
#. TRANSLATORS: details about the update, any packages that
#. * this update obsoletes
msgid "Obsoletes"
-msgstr "Învechește"
+msgstr "Învechite"
#. TRANSLATORS: The action of the package, in present tense
msgid "Obsoleting"
-msgstr "Se învechește"
+msgstr "Se marchează ca învechit"
#. TRANSLATORS: transaction state, obsoleting old packages
msgid "Obsoleting packages"
-msgstr "Se învechesc pachete"
+msgstr "Se marchează ca învechite, pachetele anterioare"
#. TRANSLATORS: The user tried to use an
#. * unsupported option on the command line
#, c-format
msgid "Option '%s' is not supported"
-msgstr "Opțiunea „%s” nu este susținută"
+msgstr "Opțiunea „%s” nu este acceptată"
#. TRANSLATORS: details about the update, package name and version
#. TRANSLATORS: the package that is being processed
@@ -801,7 +843,7 @@ msgstr "PackageKit"
#. TRANSLATORS: This is the header to the --help menu
msgid "PackageKit Console Interface"
-msgstr "Interfață PackageKit pentru consolă"
+msgstr "Interfața pentru consolă a PackageKit"
#. TRANSLATORS: this is a program that monitors PackageKit
msgid "PackageKit Monitor"
@@ -817,7 +859,7 @@ msgstr "Pachetele care furnizează fișierul acesta sunt:"
#. TRANSLATORS: a backend is the system package tool, e.g. dnf, apt
msgid "Packaging backend to use, e.g. dummy"
-msgstr "Platforma de împachetare de folosit, de ex.: dummy"
+msgstr "Sistemul de împachetare de folosit, de exemplu: „dummy”"
#. TRANSLATORS: this is the parent group
msgid "Parent"
@@ -833,7 +875,7 @@ msgstr "Alegeți o comandă pe care să o rulați"
#. TRANSLATORS: ask the user to choose a file to install
msgid "Please choose a package to install"
-msgstr "Alege un pachet pentru a fi instalat"
+msgstr "Alegeți un pachet pentru a fi instalat"
#. TRANSLATORS: This finds out which package in the list to use
msgid "Please choose the correct package: "
@@ -845,7 +887,7 @@ msgstr "Introduceți un număr între 1 și %i: "
#. TRANSLATORS: ask the user to insert the media
msgid "Please insert the correct media"
-msgstr "Introduceți suportul corect"
+msgstr "Introduceți suportul de date corect"
#. TRANSLATORS: a package needs to restart the session (due to security)
msgid "Please logout and login to complete the update as important security updates have been installed."
@@ -890,7 +932,7 @@ msgstr "Nume real"
#. TRANSLATORS: we've finished doing offline updates
msgid "Rebooting after installing updates…"
-msgstr "Se repornește după instalarea actualizărilor..."
+msgstr "Se repornește după instalarea actualizărilor…"
#. SECURITY:
#. - Normal users do not require admin authentication to refresh the
@@ -900,19 +942,19 @@ msgstr "Împrospătează depozitele sistemului"
#. TRANSLATORS: command description
msgid "Refresh the cache"
-msgstr "Împrospătează cache-ul"
+msgstr "Împrospătează conținutul spațiului de prestocare (cache)"
#. TRANSLATORS: command description
msgid "Refresh the cache (forced)"
-msgstr "Împrospătează cache-ul (forțat)"
+msgstr "Împrospătează conținutul spațiului de prestocare „cache” (forțat)"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Refreshing cache"
-msgstr "Se împrospătează cache-ul"
+msgstr "Se împrospătează conținutul spațiului de prestocare (cache)"
#. TRANSLATORS: transaction state, refreshing internal lists
msgid "Refreshing software list"
-msgstr "Se împrospătează lista de programe"
+msgstr "Se împrospătează lista de software"
#. TRANSLATORS: The action of the package, in past tense
msgid "Reinstalled"
@@ -922,6 +964,10 @@ msgstr "Reinstalat"
msgid "Reinstalling"
msgstr "Se reinstalează"
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Elimină"
+
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
#. this can make the system unbootable or stop other applications from
@@ -932,7 +978,7 @@ msgstr "Se reinstalează"
#. 'auth_admin'.
#. TRANSLATORS: command description
msgid "Remove package"
-msgstr "Elimină un pachet"
+msgstr "Elimină pachetul"
#. TRANSLATORS: The action of the package, in past tense
msgid "Removed"
@@ -945,7 +991,7 @@ msgstr "Se elimină"
#. TRANSLATORS: transaction state, removing packages
msgid "Removing packages"
-msgstr "Se elimină pachete"
+msgstr "Se elimină pachetele"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Removing repository"
@@ -972,7 +1018,7 @@ msgstr "Se rezolvă"
#. TRANSLATORS: transaction state, checking the transaction before we do it
msgid "Resolving dependencies"
-msgstr "Se rezolvă dependențe"
+msgstr "Se rezolvă dependențele"
#. TRANSLATORS: details about the update, if the package
#. * requires a restart
@@ -1002,7 +1048,7 @@ msgstr "Se rulează"
#. TRANSLATORS: transaction state, we are running hooks before or after the
#. transaction
msgid "Running hooks"
-msgstr "Se execută rutinele"
+msgstr "Se execută scripturile aferente tranzacției"
#. TRANSLATORS: transaction state, scanning for running processes
msgid "Scanning applications"
@@ -1018,7 +1064,7 @@ msgstr "Caută după fișiere"
#. TRANSLATORS: command description
msgid "Search by names"
-msgstr "Caută după denumiri"
+msgstr "Caută după nume"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by details"
@@ -1030,7 +1076,7 @@ msgstr "Se caută după fișier"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching by name"
-msgstr "Se caută după denumire"
+msgstr "Se caută după nume"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Searching groups"
@@ -1053,7 +1099,7 @@ msgstr "Este necesară repornirea sesiunii:"
#. - Normal users do not require admin authentication to set the proxy
#. used for downloading packages.
msgid "Set network proxy"
-msgstr "Definește proxy de rețea"
+msgstr "Definește proxy-ul de rețea"
#. TRANSLATORS: command description
msgid "Set repository options"
@@ -1061,30 +1107,30 @@ msgstr "Stabilește opțiunile depozitului"
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
-msgstr "Definiți filtrul, de ex. instalat"
+msgstr "Definește filtrul, de exemplu: instalat"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Setting data"
-msgstr "Se stabilesc date"
+msgstr "Se configurează datele"
#. TRANSLATORS: turn on all debugging
msgid "Show debugging information for all files"
msgstr "Arată informații de depanare pentru toate fișierele"
msgid "Show debugging options"
-msgstr "Arată opțiuni de depanare"
+msgstr "Arată opțiunile de depanare"
#. TRANSLATORS: command line argument, just show the version string
msgid "Show the program version and exit"
-msgstr "Arată versiunea programului și ieși"
+msgstr "Arată versiunea programului și iese"
#. TRANSLATORS: show version
msgid "Show version and exit"
-msgstr "Arată versiunea și ieși"
+msgstr "Arată versiunea și iese"
#. TRANSLATORS: we've finished doing offline updates
msgid "Shutting down after installing updates…"
-msgstr "Se oprește după instalarea actualizărilor..."
+msgstr "Se oprește calculatorul după instalarea actualizărilor…"
#. TRANSLATORS: tell the user what we think the command is
msgid "Similar command is:"
@@ -1097,7 +1143,7 @@ msgstr "Comenzile similare sunt:"
#. TRANSLATORS: the package repository name
msgid "Software source name"
-msgstr "Denumirea sursei de programe"
+msgstr "Numele sursei de software"
#. TRANSLATORS: the package repository is signed by a key that is not
#. recognised
@@ -1128,7 +1174,7 @@ msgstr "Reușit"
#. TRANSLATORS: Show the user a list of packages that they can install to
#. provide this command
msgid "Suitable packages are:"
-msgstr "Pachetele compatibile sunt:"
+msgstr "Pachetele adecvate sunt:"
#. TRANSLATORS: this is any summary text describing the upgrade
#. TRANSLATORS: this is the summary of the group
@@ -1163,7 +1209,7 @@ msgstr "Acordul nu a fost acceptat."
#. TRANSLATORS: tell the user we've not done anything as they are lazy
msgid "The correct media was not inserted."
-msgstr "Suportul corect nu a fost introdus."
+msgstr "Nu a fost introdus suportul de date corect."
#. TRANSLATORS: This is when the daemon crashed, and we are up
#. * shit creek without a paddle
@@ -1173,7 +1219,7 @@ msgstr "Demonul a eșuat în mijlocul tranzacției!"
#. TRANSLATORS: The user specified
#. * an incorrect filter
msgid "The filter specified was invalid"
-msgstr "Filtrul specificat a fost nevalid"
+msgstr "Filtrul specificat nu este valid"
#. TRANSLATORS: When processing, untrusted and non-verified packages may be
#. encountered
@@ -1190,7 +1236,7 @@ msgstr "Următoarele pachete trebuiesc instalate:"
#. TRANSLATORS: When processing, we might have to obsolete other dependencies
msgid "The following packages have to be obsoleted:"
-msgstr "Următoarele pachete trebuiesc învechite:"
+msgstr "Următoarele pachete trebuiesc marcate ca învechite:"
#. TRANSLATORS: When processing, we might have to reinstall other dependencies
msgid "The following packages have to be reinstalled:"
@@ -1204,6 +1250,10 @@ msgstr "Următoarele pachete trebuiesc eliminate:"
msgid "The following packages have to be updated:"
msgstr "Următoarele pachete trebuiesc actualizate:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Vechimea maximă a spațiului de prestocare (cache) a metadatelor (în secunde). Utilizați „-1” pentru a utiliza numai spațiul de prestocare, „1” pentru a reîncărca conținutul spațiului de prestocare."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Pachetul care furnizează fișierul acesta este:"
@@ -1212,13 +1262,18 @@ msgstr "Pachetul care furnizează fișierul acesta este:"
msgid "The proxy could not be set"
msgstr "Proxy-ul nu a putut fi definit"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "Este posibil ca pachetele selectate să fie deja instalate."
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "Semnătura nu a fost acceptată."
#. TRANSLATORS: is not GPG signed
msgid "The software is not from a trusted source."
-msgstr "Programul nu este dintr-o sursă de încredere."
+msgstr "Software-ul nu este dintr-o sursă de încredere."
#. TRANSLATORS: tell the user we didn't do anything
msgid "The transaction did not proceed."
@@ -1232,7 +1287,7 @@ msgstr "Tranzacția a eșuat"
#. TRANSLATORS: tell the user we've not done anything
msgid "The unsigned software will not be installed."
-msgstr "Programul nesemnat nu va fi instalat."
+msgstr "Software-ul nesemnat nu va fi instalat."
#. TRANSLATORS: the user asked to update everything,
#. * but there is nothing that can be updated
@@ -1258,6 +1313,10 @@ msgstr "Nu sunt înnoiri disponibile în acest moment."
msgid "This tool could not find all the packages: %s"
msgstr "Această unealtă nu a putut găsi toate pachetele: %s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "Această unealtă nu a putut găsi niciun pachet disponibil."
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
@@ -1294,7 +1353,7 @@ msgstr "Tranzacție"
#. to a new distribution since this can make the system unbootable or
#. stop other applications from working.
msgid "Trigger offline updates"
-msgstr "Declanșează actualizări offline"
+msgstr "Declanșează actualizări fără conectare la Internet"
#. TRANSLATORS: The type of update
msgid "Trivial"
@@ -1309,7 +1368,7 @@ msgstr "Adevărat"
#. without a secure authentication.
#. - This is not kept as each package should be authenticated.
msgid "Trust a key used for signing software"
-msgstr "Acordă încredere unei chei folosite la semnarea programelor"
+msgstr "Acordă încredere unei chei folosite la semnarea software-ului"
#. TRANSLATORS: this is type of update, stable or testing
msgid "Type"
@@ -1334,7 +1393,7 @@ msgstr "Stare necunoscută"
#. - Changing this to anything other than 'yes' will break unattended
#. updates.
msgid "Update software"
-msgstr "Actualizează programe"
+msgstr "Actualizează software-ul"
#. TRANSLATORS: details about the update, any description of
#. * the update
@@ -1350,7 +1409,7 @@ msgstr "Actualizat"
#. TRANSLATORS: details about the update, any packages that
#. * this update updates
msgid "Updates"
-msgstr "Actualizează"
+msgstr "Actualizări"
#. TRANSLATORS: The action of the package, in present tense
msgid "Updating"
@@ -1358,7 +1417,7 @@ msgstr "Se actualizează"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Updating packages"
-msgstr "Se actualizează pachete"
+msgstr "Se actualizează pachetele"
#. TRANSLATORS: transaction state, we are updating the list of processes
msgid "Updating running applications"
@@ -1376,16 +1435,16 @@ msgid "User ID"
msgstr "ID utilizator"
msgid "User aborted selection"
-msgstr "Utilizatorul a abandonat alegerea"
+msgstr "Utilizatorul a anulat selecția"
#. TRANSLATORS: this is the username, e.g. hughsie
msgid "Username"
-msgstr "Nume de utilizator"
+msgstr "Nume utilizator"
#. TRANSLATORS: details about the update, the vendor URLs
#. TRANSLATORS: the vendor (e.g. vmware) that is providing the EULA
msgid "Vendor"
-msgstr "Vânzător"
+msgstr "Furnizor"
#. TRANSLATORS: transaction state, waiting for user to type in a password
msgid "Waiting for authentication"
@@ -1394,16 +1453,16 @@ msgstr "Se așteaptă autentificarea"
#. TRANSLATORS: transaction state, when we're waiting for the native tools to
#. exit
msgid "Waiting for package manager lock"
-msgstr "Se așteaptă lacătul gestionarului de pachete"
+msgstr "Se așteaptă blocarea efectuată de gestionarul de pachete."
#. TRANSLATORS: waiting for native lock
msgid "Waiting for package manager lock."
-msgstr "Se așteaptă lacătul gestionarului de pachete."
+msgstr "Se așteaptă blocarea gestionarului de pachete."
#. TRANSLATORS: transaction state, the transaction is waiting for another to
#. complete
msgid "Waiting in queue"
-msgstr "Se așteaptă în coadă"
+msgstr "Se așteaptă la coadă"
#. TRANSLATORS: The user did not provide a distro name
msgid "You need to specify a list file to create"
diff --git a/po/ru.po b/po/ru.po
index da8637d..bb44ba7 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -9,6 +9,7 @@
# Misha Shnurapet , 2011-2012
# Misha Shnurapet , 2010
# Richard Hughes , 2011
+# Sergej A. , 2023
# Serge Vylekzhanin , 2014-2018
# Sergej A. , 2022
# Sergej A. , 2022
@@ -1235,6 +1236,10 @@ msgstr "Следующие пакеты должны быть удалены:"
msgid "The following packages have to be updated:"
msgstr "Следующие пакеты должны быть обновлены:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Максимальный возраст кэша метаданных (в секундах). Значение -1 для использования только кэшированных данных; значение 1 - перезагрузка кэша."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Пакет, предоставляющий этот файл:"
diff --git a/po/sl.po b/po/sl.po
index 0a33bbd..cacc582 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -4,6 +4,7 @@
#
# Translators:
# FIRST AUTHOR , 2010
+# Jure Repinc , 2024
# Martin Srebotnjak , 2012-2015,2021-2022
msgid ""
msgstr ""
@@ -1223,6 +1224,10 @@ msgstr "Naslednje pakete je treba odstraniti:"
msgid "The following packages have to be updated:"
msgstr "Posodobiti je treba naslednje pakete:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Najvišja starost predpomnilnika metapodatkov (v sekundah). Uporabite -1 samo za uporabo predpomnilnika, 1 za ponovno nalaganje predpomnilnika."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Paket, ki zagotavlja to datoteko, je:"
diff --git a/po/sq.po b/po/sq.po
index 0599755..0f98062 100644
--- a/po/sq.po
+++ b/po/sq.po
@@ -22,6 +22,12 @@ msgstr "(sekonda)"
msgid "A correct role is required"
msgstr "Është i domosdoshëm një rol i saktë"
+#. TRANSLATORS: the user did not
+#. * specify anything about what to
+#. * download or where
+msgid "A destination directory and the package names to download are required"
+msgstr "Një drejtori vendndodhje dhe emrat e paketave për t’u shkarkuar janë të domosdoshëm"
+
msgid "A filename is required"
msgstr "Emër kartele i domosdoshëm"
@@ -138,6 +144,12 @@ msgstr "Që të anulohet një akt i nisur jo prej jush, lypset mirëfilltësim"
msgid "Authentication is required to change software repository parameters"
msgstr "Që të ndryshohen parametra deposh software-i, lypset mirëfilltësim"
+msgid "Authentication is required to clear the offline updates message"
+msgstr "Që të spastrohen mesazhe përditësimesh pa qenë në linjë, duhet bërë mirëfilltësimi"
+
+msgid "Authentication is required to consider a key used for signing software as trusted"
+msgstr "Që një kyç të peshohet si i besueshëm për nënshkrim software-i, është e domosdoshme të bëhet mirëfilltësimi"
+
msgid "Authentication is required to downgrade software"
msgstr "Që software-i të kalohet në version më të vjetër, lypset mirëfilltësim"
@@ -162,6 +174,9 @@ msgstr "Që të riparohet software i instaluar, lypset mirëfilltësim"
msgid "Authentication is required to set the network proxy used for downloading software"
msgstr "Që të ujdiset ndërmjetës i përdorur për shkarkim software-i, lypset mirëfilltësim"
+msgid "Authentication is required to trigger offline updates"
+msgstr "Që të shkaktohen përditësime pa qenë në linjë, duhet bërë mirëfilltësimi"
+
msgid "Authentication is required to update software"
msgstr "Që të përditësohet software, lypset mirëfilltësim"
@@ -269,6 +284,9 @@ msgstr "S’u gjet urdhër, urdhrat e vlefshëm janë:"
msgid "Committing changes"
msgstr "Po depozitohen ndryshime"
+msgid "Config file was not found."
+msgstr "S’u gjet kartelë formësimi."
+
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
@@ -339,10 +357,18 @@ msgstr "U shkarkua"
msgid "Downloading"
msgstr "Po shkarkohet"
+#. TRANSLATORS: downloading repo data so we can search
+msgid "Downloading details about the software repositories."
+msgstr "Po shkarkohen hollësi rreth depove të software-it."
+
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading file lists"
msgstr "Po shkarkohem lista kartelash"
+#. TRANSLATORS: downloading file lists so we can search
+msgid "Downloading filelists (this may take some time to complete)."
+msgstr "Po shkarkohen lista kartelash (kjo mund të dojë ca kohë të plotësohet)."
+
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading groups"
msgstr "Po shkarkohen grupe"
@@ -376,6 +402,11 @@ msgstr "Kohëzgjatje"
msgid "Enabled"
msgstr "Të aktivizuar"
+#. TRANSLATORS: this is another name for a software licence that has to be
+#. read before installing
+msgid "End user licence agreement required"
+msgstr "Pranimi i licencës së përdoruesit është i domosdoshëm"
+
#. TRANSLATORS: The type of update
msgid "Enhancement"
msgstr "Thellim"
@@ -418,10 +449,20 @@ msgstr "S’u arrit të instalohen paketa"
msgid "Failed to launch:"
msgstr "S’u arrit të nisej:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "S’u arrit të ngarkohet kartelë formësimi: %s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
msgstr "S’u arrit të ngarkohej pjesa e pasme"
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "S’u arrit të ngarkohej mekanizmi i pasmë: %s"
+
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
msgstr "S’u arrit të ngarkohej kartelë formësimesh"
@@ -909,6 +950,10 @@ msgstr "Rol"
msgid "Run similar command:"
msgstr "Xhironi urdhër të ngjashëm:"
+#. TRANSLATORS: command line argument, this command is not a priority
+msgid "Run the command using idle network bandwidth and also using less power"
+msgstr "Xhiroje urdhrin duke përdorur gjerësi bande rrjeti jo me ngarkesë dhe duke përdorur gjithashtu më pak energji"
+
#. TRANSLATORS: transaction state, just started
msgid "Running"
msgstr "Po xhiron"
@@ -972,6 +1017,10 @@ msgstr "Rregulloni mundësi depoje"
msgid "Set the filter, e.g. installed"
msgstr "Caktoni filtrin, p.sh., e instaluar"
+#. TRANSLATORS: The role of the transaction, in present tense
+msgid "Setting data"
+msgstr "Po ujdisen të dhëna"
+
#. TRANSLATORS: turn on all debugging
msgid "Show debugging information for all files"
msgstr "Shfaq hollësi diagnostikimi për krejt kartelat"
@@ -1109,6 +1158,10 @@ msgstr "Paketat vijuese duhet të hiqen:"
msgid "The following packages have to be updated:"
msgstr "Paketat vijuese duhet të përditësohen:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Maksimum moshe fshehtine tejtëdhënash (në sekonda). Përdorni -1, që të përdoret vetëm fshehtinë, 1 që të ringarkohet fshehtina."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Paketa që furnizon këtë kartelë është:"
@@ -1117,6 +1170,11 @@ msgstr "Paketa që furnizon këtë kartelë është:"
msgid "The proxy could not be set"
msgstr "Ndërmjetësi s’u ujdis dot"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "Paketat e përzgjedhura mund të jenë instaluar tashmë."
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "Nënshkrimi s’u pranua."
@@ -1163,6 +1221,10 @@ msgstr "Tani s’ka përmirësime gati."
msgid "This tool could not find all the packages: %s"
msgstr "Ky mjet s’gjeti dot krejt paketat: %s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "Ky mjet s’gjeti dot ndonjë paketë të gatshme."
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
@@ -1273,6 +1335,9 @@ msgstr "Përmirëso Sistemin"
msgid "User ID"
msgstr "ID Përdoruesi"
+msgid "User aborted selection"
+msgstr "Përdoruesi ndërpreu përzgjedhjen"
+
#. TRANSLATORS: this is the username, e.g. hughsie
msgid "Username"
msgstr "Emër përdoruesi"
diff --git a/po/sv.po b/po/sv.po
index d032b3b..0658b10 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -3,10 +3,10 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Anders Jonsson , 2014,2017,2019,2022
+# Anders Jonsson , 2014,2017,2019,2022-2023,2025
# Daniel Nylander , 2008-2011
-# Josef Andersson , 2017-2018
-# Luna Jernberg , 2022
+# Josef Andersson , 2017-2018
+# Luna Jernberg , 2022
# Richard Hughes , 2011
# Sebastian Rasmussen , 2015
# Sebastian Rasmussen , 2015-2016
@@ -21,6 +21,16 @@ msgstr ""
"Language: sv\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%i%%"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%i%%)"
+
msgid "(seconds)"
msgstr "(sekunder)"
@@ -373,6 +383,10 @@ msgstr "Vill du tillåta installation av osignerad programvara?"
msgid "Don't clear environment on startup"
msgstr "Rensa inte miljön vid start"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Nedgradera"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "Hämtat"
@@ -609,6 +623,10 @@ msgstr "Ikon"
msgid "Important"
msgstr "Viktig"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Installera"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -776,6 +794,10 @@ msgstr "Inga paket hittades"
msgid "Normal"
msgstr "Normal"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Föråldrat"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
msgstr "Föråldrat"
@@ -946,6 +968,10 @@ msgstr "Ominstallerat"
msgid "Reinstalling"
msgstr "Installerar om"
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Ta bort"
+
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
#. this can make the system unbootable or stop other applications from
@@ -1228,6 +1254,10 @@ msgstr "Följande paket måste tas bort:"
msgid "The following packages have to be updated:"
msgstr "Följande paket måste uppdateras:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Maximal cacheålder för metadata (i sekunder). Använd -1 för att endast använda cache, 1 för att läsa in cache igen."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Paketet som tillhandahåller denna fil är:"
diff --git a/po/tr.po b/po/tr.po
index e9edb22..f7f207a 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -3,12 +3,12 @@
# This file is distributed under the same license as the PackageKit package.
#
# Translators:
-# Emir SARI, 2023
+# Emir SARI, 2023,2025
# Muhammet Kara , 2014
# Muhammet Kara , 2014
# Necdet Yücel , 2012,2015-2016
# Richard Hughes , 2011
-# Sabri Ünal , 2023
+# b83946de5835331df42b9ffcc43e6a33_05e65cd <73a30e0a984b2291d4915f37112ad292_814039>, 2023-2024
# Serdar Sağlam , 2020
# yunus kaba , 2019
msgid ""
@@ -22,6 +22,16 @@ msgstr ""
"Language: tr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%%%i"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%%%i)"
+
msgid "(seconds)"
msgstr "(saniye)"
@@ -97,7 +107,7 @@ msgstr "Bir arama terimi gerekiyor"
#. TRANSLATORS: a search type can
#. * be name, details, file, etc
msgid "A search type is required, e.g. name"
-msgstr "Bir arama türü gerekiyor; örn. ad"
+msgstr "Bir arama türü gerekiyor; örneğin, ad"
#. TRANSLATORS: geeky error, real
#. * users won't see this
@@ -147,7 +157,7 @@ msgstr "Güvenilmeyen paketlerin kurulmasına izin verin."
#. TRANSLATORS: The user didn't
#. * specify what action to use
msgid "An action, e.g. 'update-packages' is required"
-msgstr "'update-packages' gibi bir eylem gerekiyor"
+msgstr "“update-packages” gibi bir eylem gerekiyor"
#. TRANSLATORS: a package requires the application to be restarted
msgid "Application restart required by:"
@@ -374,6 +384,10 @@ msgstr "İmzalanmamış yazılımların kurulmasına izin veriyor musunuz?"
msgid "Don't clear environment on startup"
msgstr "Açılışta ortamı temizleme"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Düşür"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "İndirildi"
@@ -384,7 +398,7 @@ msgstr "İndiriliyor"
#. TRANSLATORS: downloading repo data so we can search
msgid "Downloading details about the software repositories."
-msgstr "Yazılım depolarıyla ilgili ayrıntıları indir."
+msgstr "Yazılım depolarıyla ilgili ayrıntılar indiriliyor…"
#. TRANSLATORS: transaction state, downloading metadata
msgid "Downloading file lists"
@@ -442,18 +456,18 @@ msgstr "Küçük bir gecikme sonrasında çık"
#. TRANSLATORS: exit straight away, used for automatic profiling
msgid "Exit after the engine has loaded"
-msgstr "İşletke yüklendikten sonra çık"
+msgstr "Motor yüklendikten sonra çık"
#. TRANSLATORS: The user used
#. * 'pkcon install dave.rpm' rather than
#. * 'pkcon install-local dave.rpm'
#, c-format
msgid "Expected package name, actually got file. Try using 'pkcon install-local %s' instead."
-msgstr "Paket adı bekleniyordu, dosya alındı. Bunun yerine 'pkcon install-local %s' kullanmayı deneyin."
+msgstr "Paket adı bekleniyordu, dosya alındı. Bunun yerine “pkcon install-local %s” kullanmayı deneyin."
#. TRANSLATORS: we failed to contact the daemon
msgid "Failed to contact PackageKit"
-msgstr "PackageKit'e bağlanılamadı"
+msgstr "PackageKit’e bağlanılamadı"
msgid "Failed to get daemon state"
msgstr "Art alan hizmeti durumu alınamadı"
@@ -527,7 +541,7 @@ msgstr "Onulmaz hata"
#. * The filename follows
#, c-format
msgid "File already exists: %s"
-msgstr "Böyle bir dosya halihazırda var: %s"
+msgstr "Dosya zaten var: %s"
#. TRANSLATORS: transaction state, all done!
msgid "Finished"
@@ -610,6 +624,10 @@ msgstr "Simge"
msgid "Important"
msgstr "Önemli"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Kur"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -636,7 +654,7 @@ msgstr "Paket kur"
#. command
#, c-format
msgid "Install package '%s' to provide command '%s'?"
-msgstr "'%s' paketi '%s' komutunu sağlaması için kurulsun mu?"
+msgstr "“%s” paketi “%s” komutunu sağlaması için kurulsun mu?"
#. SECURITY:
#. - Normal users need authentication to install signed packages
@@ -692,7 +710,7 @@ msgstr "İmza kuruluyor"
#. TRANSLATORS: we've started doing offline system upgrade
msgid "Installing system upgrade; this could take a while..."
-msgstr "Sistem yükseltmesi kuruluyor, bu işlem biraz vakit alabilir..."
+msgstr "Sistem yükseltmesi kuruluyor; bu, biraz vakit alabilir…"
#. TRANSLATORS: transaction state, installing updates
msgid "Installing updates"
@@ -700,7 +718,7 @@ msgstr "Güncellemeler kuruluyor"
#. TRANSLATORS: we've started doing offline updates
msgid "Installing updates; this could take a while..."
-msgstr "Güncellemeler kuruluyor, bu biraz vakit alabilir..."
+msgstr "Güncellemeler kuruluyor; bu, biraz vakit alabilir…"
#. TRANSLATORS: details about the update, date the update
#. * was issued
@@ -717,7 +735,7 @@ msgstr "Anahtar zaman damgası"
#. TRANSLATORS: the key URL
msgid "Key URL"
-msgstr "Anahtar URL'si"
+msgstr "Anahtar URL’si"
#. TRANSLATORS: the key fingerprint, again, yet more hex
msgid "Key fingerprint"
@@ -733,7 +751,7 @@ msgstr "Önbellek yükleniyor"
#. TRANSLATORS: loading package cache so we can search
msgid "Loading list of packages."
-msgstr "Paketlerin listesi yükleniyor."
+msgstr "Paketlerin listesi yükleniyor…"
#. TRANSLATORS: the user needs to change media inserted into the computer
msgid "Media change required"
@@ -754,7 +772,7 @@ msgstr "Depo değiştiriliyor"
#. TRANSLATORS: more than one package could be found that matched,
#. * to follow is a list of possible packages
msgid "More than one package matches:"
-msgstr "Birden fazla paket eşleşiyor:"
+msgstr "Birden çok paket eşleşiyor:"
#. TRANSLATORS: this is the name of the parent group
#. TRANSLATORS: this is the name of the backend
@@ -777,9 +795,13 @@ msgstr "Hiçbir paket bulunamadı"
msgid "Normal"
msgstr "Normal"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Eski"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
-msgstr "Gereksiz Yapıldı"
+msgstr "Gereksiz yapıldı"
#. TRANSLATORS: details about the update, any packages that
#. * this update obsoletes
@@ -798,7 +820,7 @@ msgstr "Paketler gereksiz olarak işaretleniyor"
#. * unsupported option on the command line
#, c-format
msgid "Option '%s' is not supported"
-msgstr "'%s' seçeneği desteklenmiyor"
+msgstr "“%s” seçeneği desteklenmiyor"
#. TRANSLATORS: details about the update, package name and version
#. TRANSLATORS: the package that is being processed
@@ -874,7 +896,7 @@ msgstr "Lütfen doğru ortamı yerleştirin"
#. TRANSLATORS: a package needs to restart the session (due to security)
msgid "Please logout and login to complete the update as important security updates have been installed."
-msgstr "Önemli güvenlik güncellemeleri kurulduğundan güncellemeyi tamamlamak için lütfen çıkış yapın ve tekrar oturum açın."
+msgstr "Önemli güvenlik güncellemeleri kurulduğundan güncellemeyi tamamlamak için lütfen oturumunuzu kapatın ve yeniden oturum açın."
#. TRANSLATORS: a package needs to restart the session
msgid "Please logout and login to complete the update."
@@ -890,7 +912,7 @@ msgstr "Lütfen güncelleme işlemini tamamlamak için bilgisayarınızı yenide
#. command line argument, do we just download or apply changes
msgid "Prepare the transaction by downloading packages only"
-msgstr "İletimi sadece paketleri indirecek biçimde ayarla"
+msgstr "İşlemi yalnızca paketleri indirecek biçimde ayarla"
#. TRANSLATORS: There follows a list of packages downloaded and ready
#. * to be updated
@@ -915,7 +937,7 @@ msgstr "Gerçek ad"
#. TRANSLATORS: we've finished doing offline updates
msgid "Rebooting after installing updates…"
-msgstr "Güncellemeler kuruldu, bilgisayar yeniden başlatılıyor..."
+msgstr "Güncellemeler kuruldu, bilgisayar yeniden başlatılıyor…"
#. SECURITY:
#. - Normal users do not require admin authentication to refresh the
@@ -941,11 +963,15 @@ msgstr "Yazılım listesi yenileniyor"
#. TRANSLATORS: The action of the package, in past tense
msgid "Reinstalled"
-msgstr "Yeniden Kuruldu"
+msgstr "Yeniden kuruldu"
#. TRANSLATORS: The action of the package, in present tense
msgid "Reinstalling"
-msgstr "Yeniden Kuruluyor"
+msgstr "Yeniden kuruluyor"
+
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Kaldır"
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
@@ -1086,7 +1112,7 @@ msgstr "Depo seçeneklerini ayarla"
#. TRANSLATORS: command line argument, use a filter to narrow down results
msgid "Set the filter, e.g. installed"
-msgstr "Süzgeci ayarla; örn. kurulu"
+msgstr "Süzgeci ayarla; örneğin, kurulu"
#. TRANSLATORS: The role of the transaction, in present tense
msgid "Setting data"
@@ -1229,6 +1255,10 @@ msgstr "Aşağıdaki paketler kaldırılmalıdır:"
msgid "The following packages have to be updated:"
msgstr "Aşağıdaki paketler yükseltilmelidir:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "En büyük üst veri önbelleği yaşı (saniye türünden). Yalnızca önbelleği kullanmak için -1, önbelleği yeniden yüklemek için 1 kullanın."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Bu dosyayı içeren paket:"
@@ -1258,7 +1288,7 @@ msgstr "İşlem sürdürülemedi."
#. * not expect
#. TRANSLATORS: the transaction failed in a way we could not expect
msgid "The transaction failed"
-msgstr "İletim başarısız"
+msgstr "İşlem başarısız"
#. TRANSLATORS: tell the user we've not done anything
msgid "The unsigned software will not be installed."
@@ -1432,7 +1462,7 @@ msgstr "Paket yöneticisi kilidi bekleniyor"
#. TRANSLATORS: waiting for native lock
msgid "Waiting for package manager lock."
-msgstr "Paket yöneticisinin kilitlenmesi bekleniyor."
+msgstr "Paket yöneticisi kilidi bekleniyor…"
#. TRANSLATORS: transaction state, the transaction is waiting for another to
#. complete
diff --git a/po/uk.po b/po/uk.po
index 70103e2..1257390 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -4,7 +4,7 @@
#
# Translators:
# Richard Hughes , 2011
-# Yuri Chornoivan , 2009-2018,2022
+# Yuri Chornoivan , 2009-2018,2022-2023,2025
msgid ""
msgstr ""
"Project-Id-Version: PackageKit\n"
@@ -16,6 +16,16 @@ msgstr ""
"Language: uk\n"
"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%"
+#, c-format
+msgid "%i%%"
+msgstr "%i%%"
+
+#. TRANSLATORS: this is a percentage value we use in messages, e.g. "90%.
+#, c-format
+msgid "(%i%%)"
+msgstr "(%i%%)"
+
msgid "(seconds)"
msgstr "(секунд)"
@@ -368,6 +378,10 @@ msgstr "Бажаєте дозволити встановлення непідп
msgid "Don't clear environment on startup"
msgstr "Не очищувати середовище під час запуску"
+#. TRANSLATORS: The state of a package: package is to be downgraded
+msgid "Downgrade"
+msgstr "Зниження версії"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Downloaded"
msgstr "Звантажено"
@@ -604,6 +618,10 @@ msgstr "Значок"
msgid "Important"
msgstr "Важливе"
+#. TRANSLATORS: The state of a package: to be installed with the next action
+msgid "Install"
+msgstr "Встановити"
+
#. SECURITY
#. - Normal users require admin authentication to reinstall packages.
#. - Authorization to install packages does not imply permissions to
@@ -771,6 +789,10 @@ msgstr "Пакунків не знайдено"
msgid "Normal"
msgstr "Звичайне"
+#. TRANSLATORS: The state of a package: package is obsolete
+msgid "Obsolete"
+msgstr "Застарілий"
+
#. TRANSLATORS: The action of the package, in past tense
msgid "Obsoleted"
msgstr "Став застарілим"
@@ -941,6 +963,10 @@ msgstr "Перевстановлено"
msgid "Reinstalling"
msgstr "Перевстановлення"
+#. TRANSLATORS: The state of a package: to be removed with the next action
+msgid "Remove"
+msgstr "Вилучити"
+
#. SECURITY:
#. - Normal users require admin authentication to remove packages as
#. this can make the system unbootable or stop other applications from
@@ -1223,6 +1249,10 @@ msgstr "Наведені нижче пакунки буде вилучено:"
msgid "The following packages have to be updated:"
msgstr "Слід оновити такі пакунки:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "Максимальний вік кешу метаданих (у секундах). Скористайтеся -1, щоб використовувати лише кешовані дані; 1 — перезавантажити кеш."
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "Пакунком, що містити цей файл є:"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index d8b6abe..b4f3d84 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -4,6 +4,7 @@
#
# Translators:
# Cheng-Chia Tseng , 2011-2015,2017-2018
+# Kisaragi Hiu , 2024
# Richard Hughes , 2011
# Terry Chuang , 2008-2009
msgid ""
@@ -304,6 +305,9 @@ msgstr "找不到指令,有效的指令為:"
msgid "Committing changes"
msgstr "正在遞交變更"
+msgid "Config file was not found."
+msgstr "找不到組態檔。"
+
#. TRANSLATORS: transaction state, we are copying package files before or
#. after the transaction
msgid "Copying files"
@@ -466,10 +470,20 @@ msgstr "軟體包安裝失敗"
msgid "Failed to launch:"
msgstr "啟動失敗:"
+#. TRANSLATORS: The placeholder is an error message
+#, c-format
+msgid "Failed to load config file: %s"
+msgstr "載入組態檔失敗:%s"
+
#. TRANSLATORS: cannot load the backend the user specified
msgid "Failed to load the backend"
msgstr "載入後端失敗"
+#. TRANSLATORS: cannot load the backend the user specified
+#, c-format
+msgid "Failed to load the backend: %s"
+msgstr "載入後端失敗:%s"
+
#. TRANSLATORS: probably not yet installed
msgid "Failed to load the config file"
msgstr "載入組態檔失敗"
@@ -482,6 +496,12 @@ msgstr "引數解析失敗"
msgid "Failed to parse command line"
msgstr "無法解析指令列"
+#. TRANSLATORS: The placeholder is an error message.
+#. * `auto` is a potential value of the DefaultBackend= configuration key.
+#, c-format
+msgid "Failed to resolve auto: %s"
+msgstr "解析 auto 失敗:%s"
+
#. TRANSLATORS: we failed to find the package, this shouldn't happen
msgid "Failed to search for file"
msgstr "搜尋檔案失敗"
@@ -1205,6 +1225,10 @@ msgstr "下列軟體包必須移除:"
msgid "The following packages have to be updated:"
msgstr "下列軟體包必須更新:"
+#. TRANSLATORS: command line argument, just output without fancy formatting
+msgid "The maximum metadata cache age (in seconds). Use -1 to use only cache, 1 to reload cache."
+msgstr "中繼資料快取年歲上限(單位為秒)。使用 -1 來只用快取,1 來重新載入快取。"
+
#. TRANSLATORS: tell the user what package provides the command
msgid "The package providing this file is:"
msgstr "提供此檔案的軟體包為:"
@@ -1213,6 +1237,11 @@ msgstr "提供此檔案的軟體包為:"
msgid "The proxy could not be set"
msgstr "無法設定代理"
+#. TRANSLATORS: There was an error finding a package
+#. * for installation, it may already be installed.
+msgid "The selected packages may already be installed."
+msgstr "所選的軟體包可能皆已安裝。"
+
#. TRANSLATORS: tell the user we've not done anything
msgid "The signature was not accepted."
msgstr "簽章未被接受。"
@@ -1259,6 +1288,10 @@ msgstr "此刻尚無升級可用。"
msgid "This tool could not find all the packages: %s"
msgstr "此工具無法找到所有軟體包:%s"
+#. TRANSLATORS: We were unable to find a package for installation.
+msgid "This tool could not find any available package."
+msgstr "此工具沒有找到任何可用的軟體包。"
+
#. TRANSLATORS: There was an error finding a package
#. * for installation. The detailed error follows.
#, c-format
diff --git a/policy/meson.build b/policy/meson.build
index dfeed17..14880cf 100644
--- a/policy/meson.build
+++ b/policy/meson.build
@@ -6,5 +6,5 @@ i18n.merge_file(
install: true,
install_dir: join_paths(get_option('datadir'), 'polkit-1', 'actions') ,
type: 'xml',
- po_dir: join_paths(meson.source_root(), 'po')
+ po_dir: join_paths(source_root, 'po')
)
diff --git a/src/meson.build b/src/meson.build
index a47169c..4aef360 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -2,7 +2,7 @@ packagekit_src_include = include_directories('.')
pk_resources = gnome.compile_resources(
'pk-resources', 'packagekit.gresource.xml',
- source_dir: join_paths(meson.source_root(), 'data'),
+ source_dir: join_paths(source_root, 'data'),
c_name: 'pk'
)
@@ -119,7 +119,7 @@ pk_self_test_exec = executable(
'-DTESTDATADIR="@0@"'.format(test_data_dir),
'-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
'-DLOCALSTATEDIR="@0@"'.format(local_state_dir),
- '-DSOURCEROOTDIR="@0@"'.format(meson.source_root()),
+ '-DSOURCEROOTDIR="@0@"'.format(source_root),
]
)
@@ -128,7 +128,7 @@ test(
pk_self_test_exec,
depends: packagekit_test_py,
env: [
- 'PYTHONPATH=@0@'.format(join_paths(meson.build_root(), 'lib', 'python')),
+ 'PYTHONPATH=@0@'.format(join_paths(meson.project_build_root(), 'lib', 'python')),
],
timeout: 360,
)
diff --git a/src/org.freedesktop.PackageKit.xml b/src/org.freedesktop.PackageKit.xml
index 3fa1090..0e2811f 100644
--- a/src/org.freedesktop.PackageKit.xml
+++ b/src/org.freedesktop.PackageKit.xml
@@ -476,6 +476,17 @@
+
+
+
+
+
+ This signal is emitted when the set of installed apps has potentially changed.
+
+
+
+
+
@@ -580,6 +591,76 @@
+
+
+
+
+
+ If the last offline action was completed successfully, returns a list
+ of packages that were processed, a type of the action done and the
+ unix timestamp when the action was finished.
+ Otherwise returns an error code and error description.
+
+
+
+
+
+
+
+ A boolean value representing success.
+
+
+
+
+
+
+
+
+ An array of package IDs.
+
+
+
+
+
+
+
+
+ The role enum, e.g. update-system
+
+
+
+
+
+
+
+
+ The unix timestamp when the operation was completed.
+
+
+
+
+
+
+
+
+ A PackageKit error code. The value of this argument is undefined
+ if the "success" argument returned true.
+
+
+
+
+
+
+
+
+ A detailed error description. The value of this argument is undefined
+ if the "success" argument returned true.
+
+
+
+
+
+
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 8b49d09..b9c8670 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -208,6 +208,7 @@ struct PkBackendPrivate
G_DEFINE_TYPE (PkBackend, pk_backend, G_TYPE_OBJECT)
enum {
+ SIGNAL_INSTALLED_CHANGED,
SIGNAL_REPO_LIST_CHANGED,
SIGNAL_UPDATES_CHANGED,
SIGNAL_LAST
@@ -680,6 +681,8 @@ pk_backend_installed_db_changed_cb (gpointer user_data)
g_warning ("failed to invalidate: %s", error->message);
}
backend->priv->installed_db_changed_id = 0;
+ g_debug ("emitting installed-changed");
+ g_signal_emit (backend, signals [SIGNAL_INSTALLED_CHANGED], 0);
return FALSE;
}
@@ -1094,6 +1097,11 @@ pk_backend_class_init (PkBackendClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = pk_backend_finalize;
+ signals [SIGNAL_INSTALLED_CHANGED] =
+ g_signal_new ("installed-changed",
+ G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL, g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
signals [SIGNAL_REPO_LIST_CHANGED] =
g_signal_new ("repo-list-changed",
G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST,
diff --git a/src/pk-dbus.c b/src/pk-dbus.c
index 311270c..b6d98f5 100644
--- a/src/pk-dbus.c
+++ b/src/pk-dbus.c
@@ -257,12 +257,6 @@ pk_dbus_get_session (PkDbus *dbus, const gchar *sender)
goto out;
}
- /* no ConsoleKit? */
- if (dbus->priv->proxy_session == NULL) {
- g_warning ("no ConsoleKit, so cannot get session");
- goto out;
- }
-
/* get pid */
pid = pk_dbus_get_pid (dbus, sender);
if (pid == G_MAXUINT) {
@@ -276,6 +270,11 @@ pk_dbus_get_session (PkDbus *dbus, const gchar *sender)
if (session == NULL)
g_warning ("failed to get session for pid %u", pid);
#else
+ /* no ConsoleKit? */
+ if (dbus->priv->proxy_session == NULL) {
+ g_warning ("no ConsoleKit, so cannot get session");
+ goto out;
+ }
/* get session from ConsoleKit */
value = g_dbus_proxy_call_sync (dbus->priv->proxy_session,
"GetSessionForUnixProcess",
diff --git a/src/pk-engine.c b/src/pk-engine.c
index c910c1f..347aee5 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -98,10 +98,9 @@ struct PkEnginePrivate
guint owner_id;
GDBusNodeInfo *introspection;
GDBusConnection *connection;
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
GDBusProxy *logind_proxy;
gint logind_fd;
-#endif
+ gboolean logind_tried;
};
enum {
@@ -256,7 +255,6 @@ pk_engine_emit_offline_property_changed (PkEngine *engine,
static void
pk_engine_inhibit (PkEngine *engine)
{
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
g_autoptr(GError) error = NULL;
g_autoptr(GUnixFDList) out_fd_list = NULL;
g_autoptr(GVariant) res = NULL;
@@ -297,19 +295,16 @@ pk_engine_inhibit (PkEngine *engine)
}
engine->priv->logind_fd = g_unix_fd_list_get (out_fd_list, 0, NULL);
g_debug ("opened logind fd %i", engine->priv->logind_fd);
-#endif
}
static void
pk_engine_uninhibit (PkEngine *engine)
{
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
if (engine->priv->logind_fd == 0)
return;
g_debug ("closed logind fd %i", engine->priv->logind_fd);
close (engine->priv->logind_fd);
engine->priv->logind_fd = 0;
-#endif
}
static void
@@ -328,6 +323,21 @@ pk_engine_set_locked (PkEngine *engine, gboolean is_locked)
g_variant_new_boolean (is_locked));
}
+static void
+pk_engine_backend_installed_changed_cb (PkBackend *backend, PkEngine *engine)
+{
+ g_return_if_fail (PK_IS_ENGINE (engine));
+
+ g_debug ("emitting InstalledChanged");
+ g_dbus_connection_emit_signal (engine->priv->connection,
+ NULL,
+ PK_DBUS_PATH,
+ PK_DBUS_INTERFACE,
+ "InstalledChanged",
+ NULL,
+ NULL);
+}
+
static void
pk_engine_backend_repo_list_changed_cb (PkBackend *backend, PkEngine *engine)
{
@@ -686,7 +696,7 @@ pk_engine_set_proxy (PkEngine *engine,
/* check length of http */
len = pk_strlen (proxy_http, 1024);
- if (len == 1024) {
+ if (len >= 1024) {
error = g_error_new_literal (PK_ENGINE_ERROR,
PK_ENGINE_ERROR_CANNOT_SET_PROXY,
"http proxy was too long");
@@ -696,7 +706,7 @@ pk_engine_set_proxy (PkEngine *engine,
/* check length of ftp */
len = pk_strlen (proxy_ftp, 1024);
- if (len == 1024) {
+ if (len >= 1024) {
error = g_error_new_literal (PK_ENGINE_ERROR,
PK_ENGINE_ERROR_CANNOT_SET_PROXY,
"ftp proxy was too long");
@@ -1006,6 +1016,15 @@ _g_variant_new_maybe_string (const gchar *value)
return g_variant_new_string (value);
}
+static gboolean
+pk_engine_offline_is_triggered (const gchar *filename)
+{
+ /* look at the symlink target */
+ g_autofree gchar *link = NULL;
+ link = g_file_read_link (PK_OFFLINE_TRIGGER_FILENAME, NULL);
+ return g_strcmp0 (link, filename) == 0;
+}
+
static GVariant *
pk_engine_offline_get_property (GDBusConnection *connection_, const gchar *sender,
const gchar *object_path, const gchar *interface_name,
@@ -1036,18 +1055,12 @@ pk_engine_offline_get_property (GDBusConnection *connection_, const gchar *sende
return g_variant_new_boolean (ret);
}
- /* look at the symlink target */
if (g_strcmp0 (property_name, "UpdateTriggered") == 0) {
- g_autofree gchar *link = NULL;
- link = g_file_read_link (PK_OFFLINE_TRIGGER_FILENAME, NULL);
- return g_variant_new_boolean (g_strcmp0 (link, PK_OFFLINE_PREPARED_FILENAME) == 0);
+ return g_variant_new_boolean (pk_engine_offline_is_triggered (PK_OFFLINE_PREPARED_FILENAME));
}
- /* look at the symlink target */
if (g_strcmp0 (property_name, "UpgradeTriggered") == 0) {
- g_autofree gchar *link = NULL;
- link = g_file_read_link (PK_OFFLINE_TRIGGER_FILENAME, NULL);
- return g_variant_new_boolean (g_strcmp0 (link, PK_OFFLINE_PREPARED_UPGRADE_FILENAME) == 0);
+ return g_variant_new_boolean (pk_engine_offline_is_triggered (PK_OFFLINE_PREPARED_UPGRADE_FILENAME));
}
if (g_strcmp0 (property_name, "PreparedUpgrade") == 0) {
@@ -1662,6 +1675,15 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
tmp);
return;
}
+ if (pk_engine_offline_is_triggered (PK_OFFLINE_PREPARED_FILENAME)) {
+ /* already triggered, just update the action without authentication */
+ if (pk_offline_auth_set_action (action, &error))
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ else
+ g_dbus_method_invocation_return_gerror (invocation, error);
+ return;
+ }
+
helper = g_new0 (PkEngineOfflineAsyncHelper, 1);
helper->engine = g_object_ref (engine);
helper->role = PK_ENGINE_OFFLINE_ROLE_TRIGGER;
@@ -1689,6 +1711,15 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
tmp);
return;
}
+ if (pk_engine_offline_is_triggered (PK_OFFLINE_PREPARED_UPGRADE_FILENAME)) {
+ /* already triggered, just update the action without authentication */
+ if (pk_offline_auth_set_action (action, &error))
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ else
+ g_dbus_method_invocation_return_gerror (invocation, error);
+ return;
+ }
+
helper = g_new0 (PkEngineOfflineAsyncHelper, 1);
helper->engine = g_object_ref (engine);
helper->role = PK_ENGINE_OFFLINE_ROLE_TRIGGER_UPGRADE;
@@ -1724,9 +1755,55 @@ pk_engine_offline_method_call (GDBusConnection *connection_, const gchar *sender
g_dbus_method_invocation_return_value (invocation, value);
return;
}
+ if (g_strcmp0 (method_name, "GetResults") == 0) {
+ g_autoptr(PkResults) results = NULL;
+ g_autoptr(PkPackageSack) results_sack = NULL;
+ gboolean success = FALSE;
+ PkErrorEnum error_code = PK_ERROR_ENUM_UNKNOWN;
+ g_autofree gchar *error_msg = NULL;
+ g_autoptr(PkError) pk_error = NULL;
+ GVariant *value = NULL;
+
+ results = pk_offline_get_results (&error);
+ if (results == NULL) {
+ g_dbus_method_invocation_return_error (invocation,
+ PK_ENGINE_ERROR,
+ PK_ENGINE_ERROR_INVALID_STATE,
+ "%s", error->message);
+ return;
+ }
+
+ pk_error = pk_results_get_error_code (results);
+ success = pk_results_get_exit_code (results) == PK_EXIT_ENUM_SUCCESS;
+ if (!success) {
+ pk_error = pk_results_get_error_code (results);
+ if (pk_error == NULL) {
+ error_code = PK_ERROR_ENUM_UNKNOWN;
+ error_msg = g_strdup ("Offline update failed without error_code set");
+ } else {
+ error_code = pk_error_get_code (pk_error),
+ error_msg = g_strdup (pk_error_get_details (pk_error));
+ }
+ }
+
+ results_sack = pk_results_get_package_sack (results);
+
+ if (error_msg == NULL)
+ error_msg = g_strdup("");
+
+ value = g_variant_new ("(b^asutus)",
+ success,
+ pk_package_sack_get_ids (results_sack),
+ pk_results_get_role (results),
+ pk_offline_get_results_mtime (&error),
+ error_code,
+ error_msg);
+
+ g_dbus_method_invocation_return_value (invocation, value);
+ return;
+ }
}
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
static void
pk_engine_proxy_logind_cb (GObject *source_object,
GAsyncResult *res,
@@ -1734,12 +1811,28 @@ pk_engine_proxy_logind_cb (GObject *source_object,
{
g_autoptr(GError) error = NULL;
PkEngine *engine = PK_ENGINE (user_data);
+ GDBusConnection* connection;
engine->priv->logind_proxy = g_dbus_proxy_new_finish (res, &error);
- if (engine->priv->logind_proxy == NULL)
- g_warning ("failed to connect to logind: %s", error->message);
+ // https://gitlab.gnome.org/GNOME/glib/-/issues/879
+ if (g_dbus_proxy_get_name_owner (engine->priv->logind_proxy) == NULL) {
+ g_warning ("failed to connect to logind: %s", error ? error->message : "no such service");
+ if (!engine->priv->logind_tried) {
+ engine->priv->logind_tried = TRUE;
+ connection = g_dbus_proxy_get_connection (engine->priv->logind_proxy);
+ g_clear_object (&engine->priv->logind_proxy);
+ g_dbus_proxy_new (connection,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+ NULL,
+ "org.freedesktop.ConsoleKit",
+ "/org/freedesktop/ConsoleKit",
+ "org.freedesktop.ConsoleKit.Manager",
+ NULL, /* GCancellable */
+ pk_engine_proxy_logind_cb,
+ engine);
+ }
+ }
}
-#endif
static void
pk_engine_on_bus_acquired_cb (GDBusConnection *connection,
@@ -1762,7 +1855,6 @@ pk_engine_on_bus_acquired_cb (GDBusConnection *connection,
/* save copy for emitting signals */
engine->priv->connection = g_object_ref (connection);
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
/* connect to logind */
g_dbus_proxy_new (connection,
G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
@@ -1773,7 +1865,6 @@ pk_engine_on_bus_acquired_cb (GDBusConnection *connection,
NULL, /* GCancellable */
pk_engine_proxy_logind_cb,
engine);
-#endif
/* register org.freedesktop.PackageKit */
registration_id = g_dbus_connection_register_object (connection,
@@ -1908,13 +1999,11 @@ pk_engine_finalize (GObject *object)
if (engine->priv->connection != NULL)
g_object_unref (engine->priv->connection);
-#ifdef HAVE_SYSTEMD_SD_LOGIN_H
/* uninhibit */
if (engine->priv->logind_fd != 0)
close (engine->priv->logind_fd);
if (engine->priv->logind_proxy != NULL)
g_object_unref (engine->priv->logind_proxy);
-#endif
/* compulsory gobjects */
g_timer_destroy (engine->priv->timer);
@@ -1942,6 +2031,8 @@ pk_engine_new (GKeyFile *conf)
engine = g_object_new (PK_TYPE_ENGINE, NULL);
engine->priv->conf = g_key_file_ref (conf);
engine->priv->backend = pk_backend_new (engine->priv->conf);
+ g_signal_connect (engine->priv->backend, "installed-changed",
+ G_CALLBACK (pk_engine_backend_installed_changed_cb), engine);
g_signal_connect (engine->priv->backend, "repo-list-changed",
G_CALLBACK (pk_engine_backend_repo_list_changed_cb), engine);
g_signal_connect (engine->priv->backend, "updates-changed",
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 5c24462..f67d483 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -2484,7 +2484,7 @@ pk_transaction_strvalidate (const gchar *text, GError **error)
"Invalid input passed to daemon: zero length string");
return FALSE;
}
- if (length > 1024) {
+ if (length >= 1024) {
g_set_error (error, PK_TRANSACTION_ERROR, PK_TRANSACTION_ERROR_INPUT_INVALID,
"Invalid input passed to daemon: input too long: %u", length);
return FALSE;
@@ -2536,7 +2536,7 @@ pk_transaction_search_check_item (const gchar *values, GError **error)
"Invalid search containing '?'");
return FALSE;
}
- if (size == 1024) {
+ if (size >= 1024) {
g_set_error_literal (error,
PK_TRANSACTION_ERROR,
PK_TRANSACTION_ERROR_SEARCH_INVALID,
diff --git a/src/run-pk.sh b/src/run-pk.sh
index a56fd14..71c327a 100755
--- a/src/run-pk.sh
+++ b/src/run-pk.sh
@@ -8,12 +8,12 @@
# (at your option) any later version.
# check some important things are installed systemwide
-if [ ! -e "/etc/dbus-1/system.d/org.freedesktop.PackageKit.conf" ]; then
- echo "You need to install the DBus policy. Use sudo cp ../data/org.freedesktop.PackageKit.conf /etc/dbus-1/system.d"
+if [ ! -e "/usr/share/dbus-1/system.d/org.freedesktop.PackageKit.conf" ]; then
+ echo "You need to install the DBus policy. Use sudo cp ../data/org.freedesktop.PackageKit.conf /usr/share/dbus-1/system.d/"
exit 1
fi
if [ ! -e "/usr/share/polkit-1/actions/org.freedesktop.packagekit.policy" ]; then
- echo "You need to install the PolicyKit rules. Use sudo cp ../policy/org.freedesktop.packagekit.policy /usr/share/polkit-1/actions"
+ echo "You need to install the PolicyKit rules. Use sudo cp ../policy/org.freedesktop.packagekit.policy /usr/share/polkit-1/actions/"
exit 1
fi
@@ -26,5 +26,4 @@ else
fi
export G_DEBUG=fatal_criticals
killall packagekitd
-./packagekitd --verbose --disable-timer --keep-environment --backend=$BACKEND
-
+./src/packagekitd --verbose --disable-timer --keep-environment --backend=$BACKEND
diff --git a/tests/ci/Dockerfile-debian b/tests/ci/Dockerfile-debian
index 623ecbe..bf29e8b 100644
--- a/tests/ci/Dockerfile-debian
+++ b/tests/ci/Dockerfile-debian
@@ -1,17 +1,35 @@
-FROM debian:bookworm
-
-# allow fetching source packages
-RUN echo "deb-src http://deb.debian.org/debian/ bookworm main" >> /etc/apt/sources.list
+FROM debian:trixie
# prepare
RUN apt-get update -qq
-# install build essentials
-RUN apt-get install -yq build-essential
+# install essentials
+RUN apt-get install -yq eatmydata build-essential
-# install PackageKit dependencies
-RUN apt-get build-dep -yq packagekit
-RUN apt-get install -yq meson appstream
+# install build dependencies
+RUN eatmydata apt-get install -yq --no-install-recommends \
+ appstream \
+ bash-completion \
+ gettext \
+ gir1.2-glib-2.0 \
+ gobject-introspection \
+ gtk-doc-tools \
+ libappstream-dev \
+ libapt-pkg-dev \
+ libarchive-dev \
+ libgirepository1.0-dev \
+ libglib2.0-dev \
+ libgstreamer-plugins-base1.0-dev \
+ libgtk-3-dev \
+ libplymouth-dev \
+ libpolkit-gobject-1-dev \
+ libsqlite3-dev \
+ libsystemd-dev \
+ meson \
+ pkgconf \
+ polkitd \
+ systemd-dev \
+ valac
# finish
RUN mkdir /build
diff --git a/tests/ci/Dockerfile-fedora b/tests/ci/Dockerfile-fedora
index 3b1fc0f..a19e7ad 100644
--- a/tests/ci/Dockerfile-fedora
+++ b/tests/ci/Dockerfile-fedora
@@ -1,17 +1,26 @@
-FROM fedora:38
+FROM fedora:latest
RUN dnf -y update
RUN dnf -y install \
dnf-plugins-core \
libdnf-devel \
+ libdnf5-devel \
redhat-rpm-config \
meson \
gcc \
+ gcc-c++ \
ninja-build \
dbus-daemon \
+ sdbus-cpp-devel \
appstream \
appstream-devel
RUN dnf -y builddep PackageKit
+# install dependencies for 'alpm' backend
+RUN dnf -y install libalpm-devel
+
+# install dependencies for 'zypp' backend
+RUN dnf -y install libzypp-devel
+
RUN mkdir /build
WORKDIR /build
diff --git a/tests/ci/build-and-test.sh b/tests/ci/build-and-test.sh
index 65a07aa..a0f7ad2 100755
--- a/tests/ci/build-and-test.sh
+++ b/tests/ci/build-and-test.sh
@@ -6,16 +6,22 @@ if [ -d "build" ]; then
fi
set -x
-meson build \
+meson setup build \
-Dlocal_checkout=true \
+ -Dmaintainer=true \
-Ddaemon_tests=true \
$@
+DUMMY_DESTDIR=/tmp/install-root/
+rm -rf $DUMMY_DESTDIR
+
# Build & Install
ninja -C build
-DESTDIR=/tmp/install_root/ ninja -C build install
+DESTDIR=$DUMMY_DESTDIR ninja -C build install
# Run tests
mkdir -p /run/dbus/
dbus-daemon --system --print-address
-meson test -C build -v --print-errorlogs
+meson test -C build \
+ -v \
+ --print-errorlogs