Skip to content

Commit

Permalink
Merge branch 'PackageKit:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tnut committed Nov 16, 2023
2 parents 8d05372 + 28fb802 commit ca18e11
Show file tree
Hide file tree
Showing 81 changed files with 3,966 additions and 470 deletions.
6 changes: 5 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ Backend: dnf
Richard Hughes <richard@hughsie.com>
Neal Gompa <ngompa13@gmail.com>

Backend: freebsd
Gleb Popov <arrowd@FreeBSD.org>

Backend: pisi
S.Çağlar Onur <caglar@pardus.org.tr>
Pisilinux Team <admin@pisilinux.org>
Erkan IŞIK <erkanisik@pisilinux.org>

Backend: poldek
Marcin Banasiak <megabajt@pld-linux.org>
Expand Down
37 changes: 34 additions & 3 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
Version 1.2.8
~~~~~~~~~~~~~
Released: 2023-11-08

Libraries:
* offline-updates: Make package update list deduplication more efficient (Matthias Klumpp)
* offline-updates: Add only one entry per package to 'offline-update-competed' file (sid)
* PkClient: Replace the GSimpleAsyncResult with the GTask API (Corentin Noël)
* pk-client: Fix use-before-set of PkProgress on cancellation (Philip Withnall)
* pk-client: Move cancellable disconnect to dispose (Philip Withnall)
* pk-client: Rework refcounting for PkClientState (Philip Withnall)

Backends:
* apt/dnf: Adjust for upcoming AppStream 1.0 API (Matthias Klumpp)
* dnf: Avoid downloading caches multiple times in one call (Alessandro Astone)
* dnf: Better weigh the progress of download-only transactions (Alessandro Astone)
* dnf: Remove unused import from backends/dnf/notify_packagekit.py (Gordon Messmer)
* Revive PiSi backend (Erkan IŞIK)
* freebsd: Add new FreeBSD backend (Gleb Popov)

Bugfixes:
* tests: Exclusively use g_assert_true (Matthias Klumpp)
* tests: Avoid bashisms in sh by using bash (Matthias Klumpp)
* transaction: We only need to emit finished when we were committed (Matthias Klumpp)

Miscellaneous:
* tests: Restructure, enable daemon tests on CI (Matthias Klumpp)
* ci: Modernize & launch dbus-daemon (Matthias Klumpp)
* transaction: replace defunct www.packagekit.org URL with freedesktop URL (Corentin Noël)
* docs: Update outdated offline-updates.txt (sid)

Version 1.2.7
~~~~~~~~~~~~~
Released: 2023-08-26
Expand Down Expand Up @@ -765,7 +796,7 @@ Backends:
- portage: use PackagekitProgress as an iterable (Gilles Dartiguelongue)
- portage: use python idioms (Gilles Dartiguelongue)
- python: make PackagekitProgress an Iterable (Gilles Dartiguelongue)
- python: set steps on PackagekitProgress instanciation (Gilles Dartiguelongue)
- python: set steps on PackagekitProgress instantiation (Gilles Dartiguelongue)
- zypp: Raise priority of ZYPP stack updates if a security patch is shadowed (bsc#951592) (Michael Andres)

New Features:
Expand Down Expand Up @@ -2315,7 +2346,7 @@ Backends:
- apt: Raise exceptions in the backend code instead of calling PackageKitBaseBackend.error directly (Sebastian Heinlein)
- apt: remove encoding mangling - should be handled by packagekit.backend already (Sebastian Heinlein)
- apt: remove oboslete files (Sebastian Heinlein)
- apt: Respect the ROOT environement variable (Sebastian Heinlein)
- apt: Respect the ROOT environment variable (Sebastian Heinlein)
- apt: Start with updating the backend on several places (Sebastian Heinlein)
- apt: Too many API and style fixes to count (Sebastian Heinlein)
- apt: Use the apt.progress.base.InstallProgress abilities to handle dpkg progress (Sebastian Heinlein)
Expand Down Expand Up @@ -6631,7 +6662,7 @@ Released: 2007-11-10
- Replace the g_strjoinv and use pk_strbuild_va to append a va_list to fix
a crash on i86_64 (Richard Hughes)
- Immediate exit has to wait a few cycles for registration (Richard Hughes)
- Check for existance of apt_pkg python module with apt backend (Tom Parker)
- Check for existence of apt_pkg python module with apt backend (Tom Parker)
- yum: Emit no-cache in resolve if the cache is invalid (Tim Lauridsen)
- Correct typos and thinkos, and add a few more application notes to the
developer documentation (Richard Hughes)
Expand Down
12 changes: 6 additions & 6 deletions RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ 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.2.8.. | grep -i -v trivial | grep -v Merge > NEWS.new

--------------------------------------------------------------------------------
Version 1.2.8
Version 1.3.0
~~~~~~~~~~~~~
Released: 2023-xx-xx

Expand Down Expand Up @@ -35,8 +35,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.0"
export release_tag="v1.3.0"

git commit -a -m "Release ${release_version}"
git tag -s -f -m "Release ${release_version}" "${release_tag}"
Expand All @@ -45,7 +45,7 @@ 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

Expand All @@ -67,7 +67,7 @@ git push
9. Send an email to packagekit@lists.freedesktop.org

=================================================
PackageKit 1.2.8 released!
PackageKit 1.3.0 released!

Tarballs available here: https://www.freedesktop.org/software/PackageKit/releases/

Expand Down
13 changes: 11 additions & 2 deletions backends/apt/apt-job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,16 +1460,25 @@ void AptJob::providesMimeType(PkgList &output, gchar **values)

/* search for mimetypes for all values */
for (guint i = 0; values[i] != NULL; i++) {
#if AS_CHECK_VERSION(1,0,0)
g_autoptr(AsComponentBox) result = NULL;
#else
g_autoptr(GPtrArray) result = NULL;

#endif
if (m_cancel)
break;

#if AS_CHECK_VERSION(1,0,0)
result = as_pool_get_components_by_provided_item (pool, AS_PROVIDED_KIND_MEDIATYPE, values[i]);
for (guint j = 0; j < as_component_box_len (result); j++) {
const gchar *pkgname;
AsComponent *cpt = as_component_box_index (result, j);
#else
result = as_pool_get_components_by_provided_item (pool, AS_PROVIDED_KIND_MEDIATYPE, values[i]);
for (guint j = 0; j < result->len; j++) {
const gchar *pkgname;
AsComponent *cpt = AS_COMPONENT (g_ptr_array_index (result, j));

#endif
/* sanity check */
pkgname = as_component_get_pkgname (cpt);
if (pkgname == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion backends/dnf/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
appstream_dep = dependency('appstream-glib')
appstream_dep = dependency('appstream', version: '>=0.14.0')
dnf_dep = dependency('libdnf', version: '>=0.43.1')
rpm_dep = dependency('rpm')
c_args = ['-DG_LOG_DOMAIN="PackageKit-DNF"']
Expand Down
1 change: 0 additions & 1 deletion backends/dnf/notify_packagekit.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import dbus
import dnf
from dnfpluginscore import _


class NotifyPackagekit(dnf.Plugin):
Expand Down
23 changes: 10 additions & 13 deletions backends/dnf/pk-backend-dnf-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <gmodule.h>
#include <glib.h>
#include <appstream-glib.h>
#include <appstream.h>
#include <libdnf/libdnf.h>

#include "pk-shared.h"
Expand Down Expand Up @@ -92,18 +92,15 @@ dnf_utils_refresh_repo_appstream (DnfRepo *repo, GError **error)
const gchar *as_basenames[] = { "appstream", "appstream-icons", NULL };
for (guint i = 0; as_basenames[i] != NULL; i++) {
const gchar *tmp = dnf_repo_get_filename_md (repo, as_basenames[i]);
if (tmp != NULL) {
#if AS_CHECK_VERSION(0,3,4)
if (!as_utils_install_filename (AS_UTILS_LOCATION_CACHE,
tmp,
dnf_repo_get_id (repo),
NULL,
error)) {
return FALSE;
}
#else
g_warning ("need to install AppStream metadata %s", tmp);
#endif
if (tmp == NULL)
continue;

if (!as_utils_install_metadata_file (AS_METADATA_LOCATION_CACHE,
tmp,
dnf_repo_get_id (repo),
NULL,
error)) {
return FALSE;
}
}
return TRUE;
Expand Down
1 change: 0 additions & 1 deletion backends/dnf/pk-backend-dnf-refresh.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <string.h>
#include <appstream-glib.h>
#include <unistd.h>
#include <stdlib.h>

Expand Down
20 changes: 15 additions & 5 deletions backends/dnf/pk-backend-dnf.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <glib.h>
#include <glib/gstdio.h>
#include <string.h>
#include <appstream-glib.h>

#include <pk-backend.h>
#include <packagekit-glib2/pk-common-private.h>
Expand Down Expand Up @@ -1706,6 +1705,9 @@ pk_backend_refresh_cache_thread (PkBackendJob *job,
/* invalidate the sack cache after downloading new metadata */
pk_backend_sack_cache_invalidate (backend, "downloaded new metadata");

/* We just downloaded our cache, avoid doing so again */
pk_backend_job_set_cache_age(job, G_MAXUINT);

/* regenerate the libsolv metadata */
state_local = dnf_state_get_child (job_data->state);
sack = dnf_utils_create_sack_for_filters (job, 0,
Expand Down Expand Up @@ -2419,10 +2421,18 @@ pk_backend_transaction_download_commit (PkBackendJob *job,
}

/* set state */
ret = dnf_state_set_steps (state, error,
50, /* download */
50, /* install/remove */
-1);
if (pk_bitfield_contain (job_data->transaction_flags,
PK_TRANSACTION_FLAG_ENUM_ONLY_DOWNLOAD)) {
ret = dnf_state_set_steps (state, error,
90, /* download */
10, /* transaction test */
-1);
} else {
ret = dnf_state_set_steps (state, error,
50, /* download */
50, /* install/remove */
-1);
}
if (!ret)
return FALSE;

Expand Down
64 changes: 64 additions & 0 deletions backends/freebsd/DedupPackageJobEmitter.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (C) Serenity Cybersecurity, LLC <license@futurecrew.ru>
* Author: Gleb Popov <arrowd@FreeBSD.org>
*
* Licensed under the GNU General Public License Version 2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#pragma once

#include <string>
#include <unordered_set>

#include <pkg.h>
#include <pk-backend.h>

#include "PackageView.hpp"

class DedupPackageJobEmitter
{
public:
DedupPackageJobEmitter(PkBackendJob* _job) : job(_job) {}

void emitPackageJob(struct pkg* pkg, std::optional<PkInfoEnum> typeOverride = std::nullopt) {
PackageView pkgView(pkg);

std::string packageKitId = pkgView.packageKitId();

if (alreadyEmitted.count (packageKitId))
return;

PkInfoEnum pk_type = pkg_type (pkg) == PKG_INSTALLED
? PK_INFO_ENUM_INSTALLED
: PK_INFO_ENUM_AVAILABLE;
if (typeOverride.has_value())
pk_type = typeOverride.value();

pk_backend_job_package (job, pk_type, packageKitId.c_str(), pkgView.comment());

alreadyEmitted.insert(packageKitId);
}

void markAsEmitted(struct pkg* pkg) {
PackageView pkgView(pkg);
alreadyEmitted.insert(pkgView.packageKitId());
}

private:
std::unordered_set<std::string> alreadyEmitted;
PkBackendJob* job;
};

0 comments on commit ca18e11

Please sign in to comment.