#20 Determine the default plugin path at configure time, rather than runtime
Closed 2 years ago by churchyard. Opened 2 years ago by churchyard.
rpms/ churchyard/dnf pr1782  into  rawhide

file added
+37
@@ -0,0 +1,37 @@ 

+ From 7800d565c36cb75c16597f9292d047a981aa3ca3 Mon Sep 17 00:00:00 2001

+ From: Petr Viktorin <pviktori@redhat.com>

+ Date: Fri, 2 Jul 2021 13:57:44 +0200

+ Subject: [PATCH] Determine the PLUGINPATH at configure time, rather than

+  runtime

+ 

+ The sysconfig.get_path() function should be used to determine where

+ files *should* be installed, not necessarily where they *have* been

+ installed.

+ For DNF specifically, these locations might differ, since system

+ packages (RPMs) might use different locations than packages installed

+ by tools like pip, setuptools and distutils.

+ ---

+  dnf/const.py.in | 3 +--

+  1 file changed, 1 insertion(+), 2 deletions(-)

+ 

+ diff --git a/dnf/const.py.in b/dnf/const.py.in

+ index 5c1fef0fd5..bcadc80410 100644

+ --- a/dnf/const.py.in

+ +++ b/dnf/const.py.in

+ @@ -19,7 +19,6 @@

+  #

+  

+  from __future__ import unicode_literals

+ -import sysconfig

+  

+  CONF_FILENAME='/etc/dnf/dnf.conf' # :api

+  CONF_AUTOMATIC_FILENAME='/etc/dnf/automatic.conf'

+ @@ -50,7 +49,7 @@ VERBOSE_LEVEL=6

+  PREFIX=NAME.lower()

+  PROGRAM_NAME=NAME.lower()  # Deprecated - no longer used, Argparser prints program name based on sys.argv

+  PLUGINCONFPATH = '/etc/dnf/plugins'  # :api

+ -PLUGINPATH = '%s/dnf-plugins' % sysconfig.get_path('purelib')

+ +PLUGINPATH = '@PYTHON_INSTALL_DIR@/dnf-plugins'

+  VERSION='@DNF_VERSION@'

+  USER_AGENT = "dnf/%s" % VERSION

+  

file modified
+9 -1
@@ -66,12 +66,17 @@ 

  

  Name:           dnf

  Version:        4.8.0

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        %{pkg_summary}

  # For a breakdown of the licensing, see PACKAGE-LICENSING

  License:        GPLv2+

  URL:            https://github.com/rpm-software-management/dnf

  Source0:        %{url}/archive/%{version}/%{name}-%{version}.tar.gz

+ 

+ # Determine the default plugin path at configure time, rather than runtime

+ # Merged upstream, part of 4.9.0

+ Patch1782:      %{url}/pull/1782.patch

+ 

  BuildArch:      noarch

  BuildRequires:  cmake

  BuildRequires:  gettext
@@ -361,6 +366,9 @@ 

  %{python3_sitelib}/%{name}/automatic/

  

  %changelog

+ * Wed Sep 22 2021 Miro Hrončok <mhroncok@redhat.com> - 4.8.0-3

+ - Determine the default plugin path at configure time, rather than runtime

+ 

  * Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.8.0-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

The sysconfig.get_path() function should be used to determine where
files should be installed, not necessarily where they have been
installed.
For DNF specifically, these locations might differ, since system
packages (RPMs) might use different locations than packages installed
by tools like pip, setuptools and distutils.

I don't need this merged right away, but for the impact check of https://src.fedoraproject.org/rpms/python3.10/pull-request/63 I needed to backport this locally. So I went ahead and opened the PR.

Hi, I rebased dnf to 4.9.0 which contains the patch. It's already in rawhide, and pending in other Fedora versions.

Pull-Request has been closed by churchyard

2 years ago
Metadata