public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Accept auto-generated sources in pre-push checks
Date: Mon, 10 Aug 2026 21:44:50 GMT [thread overview]
Message-ID: <178639829087.1.12190924480141887494.rpms-rpkg-3b3ba6c05a9f@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rpkg
Branch : 1.70-1
Commit : 3b3ba6c05a9f5211c7ef947732678d6a8459e57a
Author : Lubomír Sedlář <lsedlar@redhat.com>
Date : 2025-10-17T09:29:39+02:00
Stats : +87/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rpkg/c/3b3ba6c05a9f5211c7ef947732678d6a8459e57a?branch=1.70-1
Log:
Accept auto-generated sources in pre-push checks
Resolve: https://bugzilla.redhat.com/show_bug.cgi?id=2403510
---
diff --git a/757.patch b/757.patch
new file mode 100644
index 0000000..1e64c66
--- /dev/null
+++ b/757.patch
@@ -0,0 +1,82 @@
+From 0a2a54318ef5f57142a8fab05370e6824b0645da Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Oct 13 2025 09:59:52 +0000
+Subject: Accept auto-generated sources in pre-push checks
+
+
+The patch-git tool creates source files during spec file parsing.
+
+<https://gitlab.com/redhat/centos-stream/rpms/glibc/-/blob/c10s/patch-git.lua>
+
+With this change, the pre-push check recognizes the "auto-generated-/"
+source file prefix, so that patch-git can use it to bypass the check.
+(The rpmbuild tool ignores directory names.)
+
+Signed-off-by: Florian Weimer <fweimer@redhat.com>
+
+---
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index a4e8b23..ee74fdc 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -4617,6 +4617,13 @@ class Commands(object):
+ match = SpecFile.sourcefile_expression.match(line)
+ if match:
+ file_location = match.group('val')
++ if file_location.startswith('auto-generated/'):
++ # This source file is auto-generated during SRPM
++ # construction. It is not expected to be listed
++ # in source/checked into Git. Skip it for the
++ # pre-push check.
++ continue
++
+ # find out the format of the source file path. From URL use just the file name.
+ # We want to keep hierarchy of the files if possible
+ res = urllib.parse.urlparse(file_location)
+diff --git a/tests/commands/test_pre_push_check.py b/tests/commands/test_pre_push_check.py
+index 0e9aaf7..df7d2b4 100644
+--- a/tests/commands/test_pre_push_check.py
++++ b/tests/commands/test_pre_push_check.py
+@@ -105,3 +105,40 @@ Patch3: d.patch
+ with open('sources', 'r') as f:
+ expected_sources_content = f.read().strip()
+ self.assertEqual(expected_sources_content, sources_content)
++
++ def test_push_is_not_blocked_with_autogenerated_sources(self):
++ """
++ Check that auto-generated/ source lines in the spec file
++ do not result in push failures.
++ """
++ # Track SPEC and a.patch in Git.
++ spec_file = self.module + ".spec"
++ with open(spec_file, 'w') as f:
++ f.write(SPECFILE_TEMPLATE % '''Patch0: a.patch
++Patch2: c.patch
++Source1: auto-generated/patch-git-generated-commit.txt
++''')
++
++ for patch_file in ('a.patch', 'c.patch',
++ 'patch-git-generated-commit.txt'):
++ with open(patch_file, 'w') as f:
++ f.write(patch_file)
++
++ # Track c.patch in sources
++ sources_file = SourcesFile(self.cmd.sources_filename,
++ self.cmd.source_entry_type)
++ file_hash = self.cmd.lookasidecache.hash_file('c.patch')
++ sources_file.add_entry(self.cmd.lookasidehash, 'c.patch', file_hash)
++ sources_file.write()
++
++ self.cmd.repo.index.add([spec_file, 'a.patch', 'sources'])
++ self.cmd.repo.index.commit('add SPEC and patches')
++
++ # The test attempts to connect to the lookaside cache.
++
++ def patch_remote_file_exists_head(name, filename, hash, hashtype):
++ return filename == 'c.patch'
++
++ with patch.object(self.cmd.lookasidecache, 'remote_file_exists_head',
++ patch_remote_file_exists_head):
++ self.cmd.pre_push_check("HEAD")
+
diff --git a/rpkg.spec b/rpkg.spec
index a3b7596..8f75de7 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
Name: rpkg
Version: 1.68
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: Python library for interacting with rpm+git
# Automatically converted from old format: GPLv2+ and LGPLv2 - review is highly recommended.
@@ -53,6 +53,7 @@ Patch5: 0005-type-fix-typo-in-requirements-README.patch
Patch6: 0006-install-add-rpmbuild-arguments-with-and-without.patch
Patch7: 0007-srpm-man-page-generation-fixed.patch
Patch8: 0008-Add-mock-configuration-option-to-build-and-srpm.patch
+Patch9: https://pagure.io/rpkg/pull-request/757.patch
%description
Python library for interacting with rpm+git
@@ -283,6 +284,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
%changelog
+* Fri Oct 17 2025 Lubomír Sedlář <lsedlar@redhat.com> - 1.68-9
+- Accept auto-generated sources in pre-push checks
+
* Fri Sep 19 2025 Python Maint <python-maint@redhat.com> - 1.68-8
- Rebuilt for Python 3.14.0rc3 bytecode
next reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 21:44 [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-08-10 21:44 [rpms/rpkg] 1.70-1: Accept auto-generated sources in pre-push checks
2026-08-10 21:44
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178639829087.1.12190924480141887494.rpms-rpkg-3b3ba6c05a9f@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox