public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fedpkg] 1.48-1: Allow branch requests for epel9-next
@ 2026-08-10 21:45 Carl George
  0 siblings, 0 replies; only message in thread
From: Carl George @ 2026-08-10 21:45 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/fedpkg
            Branch : 1.48-1
            Commit : e3950c61acdf3a4b9287311910ab1105f2a8f181
            Author : Carl George <carl@george.computer>
            Date   : 2021-11-08T15:48:43-06:00
            Stats  : +146/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/fedpkg/c/e3950c61acdf3a4b9287311910ab1105f2a8f181?branch=1.48-1

            Log:
            Allow branch requests for epel9-next

This is a backport of upstream commit 8af1152be8311963d67360d1e6a3cfaa3accf8dd.

---
diff --git a/0002-Add-support-for-epel9-next.patch b/0002-Add-support-for-epel9-next.patch
new file mode 100644
index 0000000..ce76f92
--- /dev/null
+++ b/0002-Add-support-for-epel9-next.patch
@@ -0,0 +1,140 @@
+From 8af1152be8311963d67360d1e6a3cfaa3accf8dd Mon Sep 17 00:00:00 2001
+From: Carl George <carl@george.computer>
+Date: Fri, 1 Oct 2021 15:18:57 -0500
+Subject: [PATCH] Add support for epel9-next
+
+This modifies the assert_valid_epel_package function to check
+the CentOS Stream compose metadata to determine if a package name
+is valid for EPEL or not.  A similar change was made to fedscm-admin.
+
+JIRA: RHELCMP-6846
+Relates: https://pagure.io/fedscm-admin/pull-request/72
+Merges: https://pagure.io/fedpkg/pull-request/453
+
+Signed-off-by: Carl George <carl@george.computer>
+---
+ fedpkg/utils.py | 106 ++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 71 insertions(+), 35 deletions(-)
+
+diff --git a/fedpkg/utils.py b/fedpkg/utils.py
+index 4671b50..cbd8268 100644
+--- a/fedpkg/utils.py
++++ b/fedpkg/utils.py
+@@ -339,43 +339,79 @@ def assert_valid_epel_package(name, branch):
+     """
+     # Extract any digits in the branch name to determine the EL version
+     version = ''.join([i for i in branch if re.match(r'\d', i)])
+-    url = ('https://infrastructure.fedoraproject.org/repo/json/pkg_el{0}.json'
+-           .format(version))
+-    error_msg = ('The connection to infrastructure.fedoraproject.org failed '
+-                 'while trying to determine if this is a valid EPEL package.')
+-    try:
+-        rv = requests.get(url, timeout=60)
+-    except ConnectionError as error:
+-        error_msg += ' The error was: {0}'.format(str(error))
+-        raise rpkgError(error_msg)
+ 
+-    if not rv.ok:
+-        raise rpkgError(error_msg + ' The status code was: {0}'.format(
+-            rv.status_code))
++    # Starting with epel9 and epel9-next, check against CentOS compose metadata.
++    if int(version) >= 9:
++        # Currently we only have a latest symlink.  In the future we'll need
++        # separate latest symlinks that include the major version.
++        # https://bugzilla.redhat.com/show_bug.cgi?id=2005139
++        url = 'https://composes.stream.centos.org/production/' \
++              'latest-CentOS-Stream/compose/metadata/rpms.json'
++        error_msg = ('The connection to composes.stream.centos.org failed while '
++                     'trying to determine if this is a valid EPEL package.')
++        try:
++            rv = requests.get(url, timeout=60)
++        except ConnectionError as error:
++            error_msg += ' The error was: {0}'.format(str(error))
++            raise rpkgError(error_msg)
++        if not rv.ok:
++            raise rpkgError(error_msg + ' The status code was: {0}'.format(
++                rv.status_code))
+ 
+-    rv_json = rv.json()
+-    # Remove noarch from this because noarch is treated specially
+-    all_arches = set(rv_json['arches']) - set(['noarch'])
+-    # On EL6, also remove ppc and i386 as many packages will
+-    # have these arches missing and cause false positives
+-    if int(version) == 6:
+-        all_arches = all_arches - set(['ppc', 'i386'])
+-    # On EL7 and later, also remove ppc and i686 as many packages will
+-    # have these arches missing and cause false positives
+-    elif int(version) >= 7:
+-        all_arches = all_arches - set(['ppc', 'i686'])
+-
+-    error_msg_two = (
+-        'This package is already an EL package and is built on all supported '
+-        'arches, therefore, it cannot be in EPEL. If this is a mistake or you '
+-        'have an exception, please contact the Release Engineering team.')
+-    for pkg_name, pkg_info in rv_json['packages'].items():
+-        # If the EL package is noarch only or is available on all supported
+-        # arches, then don't allow an EPEL branch
+-        if pkg_name == name:
+-            pkg_arches = set(pkg_info['arch'])
+-            if pkg_arches == set(['noarch']) or not (all_arches - pkg_arches):
+-                raise rpkgError(error_msg_two)
++        rv_json = rv.json()
++        pkg_names = {
++            # convert name-epoch:version-release.arch key to just the name
++            nevra.rsplit('.', maxsplit=1)[0].rsplit('-', maxsplit=2)[0]
++            # only packages from these repos are forbidden in epel
++            for repo in ['BaseOS', 'AppStream', 'CRB']
++            for arch in rv_json['payload']['rpms'][repo].keys()
++            for nevra in rv_json['payload']['rpms'][repo][arch].keys()
++        }
++        error_msg_two = (
++            'This package is already an EL package, therefore it cannot be in '
++            'EPEL. If this is a mistake or you have an exception, please '
++            'contact the Release Engineering team.')
++        if name in pkg_names:
++            raise rpkgError(error_msg_two)
++
++    else:
++        url = ('https://infrastructure.fedoraproject.org/repo/json/pkg_el{0}.json'
++               .format(version))
++        error_msg = ('The connection to infrastructure.fedoraproject.org failed '
++                     'while trying to determine if this is a valid EPEL package.')
++        try:
++            rv = requests.get(url, timeout=60)
++        except ConnectionError as error:
++            error_msg += ' The error was: {0}'.format(str(error))
++            raise rpkgError(error_msg)
++
++        if not rv.ok:
++            raise rpkgError(error_msg + ' The status code was: {0}'.format(
++                rv.status_code))
++
++        rv_json = rv.json()
++        # Remove noarch from this because noarch is treated specially
++        all_arches = set(rv_json['arches']) - set(['noarch'])
++        # On EL6, also remove ppc and i386 as many packages will
++        # have these arches missing and cause false positives
++        if int(version) == 6:
++            all_arches = all_arches - set(['ppc', 'i386'])
++        # On EL7 and later, also remove ppc and i686 as many packages will
++        # have these arches missing and cause false positives
++        elif int(version) >= 7:
++            all_arches = all_arches - set(['ppc', 'i686'])
++
++        error_msg_two = (
++            'This package is already an EL package and is built on all supported '
++            'arches, therefore, it cannot be in EPEL. If this is a mistake or you '
++            'have an exception, please contact the Release Engineering team.')
++        for pkg_name, pkg_info in rv_json['packages'].items():
++            # If the EL package is noarch only or is available on all supported
++            # arches, then don't allow an EPEL branch
++            if pkg_name == name:
++                pkg_arches = set(pkg_info['arch'])
++                if pkg_arches == set(['noarch']) or not (all_arches - pkg_arches):
++                    raise rpkgError(error_msg_two)
+ 
+ 
+ def assert_new_tests_repo(name, dist_git_url):
+-- 
+2.31.1
+

diff --git a/fedpkg.spec b/fedpkg.spec
index 123c683..7972ebe 100644
--- a/fedpkg.spec
+++ b/fedpkg.spec
@@ -5,7 +5,7 @@
 
 Name:           fedpkg
 Version:        1.41
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Fedora utility for working with dist-git
 
 License:        GPLv2+
@@ -14,6 +14,8 @@ Source0:        https://pagure.io/releases/fedpkg/%{name}-%{version}.tar.bz2
 
 BuildArch:      noarch
 Patch1:         0001-Do-not-use-pytest-related-dependencies-temporarily.patch
+# https://pagure.io/fedpkg/pull-request/453
+Patch2:         0002-Add-support-for-epel9-next.patch
 
 # RHEL7 is currently the only release that is built for Python 2.
 %if 0%{?fedora} || 0%{?rhel} > 7
@@ -143,6 +145,9 @@ mv %{buildroot}%{compdir}/fedpkg.bash %{buildroot}%{compdir}/fedpkg
 
 
 %changelog
+* Mon Nov 08 2021 Carl George <carl@george.computer> - 1.41-2
+- Allow branch requests for epel9-next
+
 * Wed Aug 25 2021 Ondřej Nosek <onosek@redhat.com> - 1.41-1
 - Look for bug number in commit message instead of changelog (zebob.m)
 - Add default configuration for `resultsdir` (oturpe)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-10 21:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-10 21:45 [rpms/fedpkg] 1.48-1: Allow branch requests for epel9-next Carl George

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox