public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Some patches
Date: Mon, 10 Aug 2026 21:44:21 GMT [thread overview]
Message-ID: <178639826165.1.11068631628509822095.rpms-rpkg-fbeaedc842e4@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/rpkg
Branch : 1.70-1
Commit : fbeaedc842e4e6f3f0c2547d4afa36bd29a30bbb
Author : Ondřej Nosek <onosek@redhat.com>
Date : 2021-12-01T00:45:43+00:00
Stats : +132/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/rpkg/c/fbeaedc842e4e6f3f0c2547d4afa36bd29a30bbb?branch=1.70-1
Log:
Some patches
- Continue execution if specfile parsing fails
- Consider Patch tags in specfile parser
Signed-off-by: Ondřej Nosek <onosek@redhat.com>
---
diff --git a/0006-Consider-Patch-tags-in-specfile-parser.patch b/0006-Consider-Patch-tags-in-specfile-parser.patch
new file mode 100644
index 0000000..6b045cb
--- /dev/null
+++ b/0006-Consider-Patch-tags-in-specfile-parser.patch
@@ -0,0 +1,67 @@
+From bb12945220cc99e8797bb1ced74cdc0e7efb4df0 Mon Sep 17 00:00:00 2001
+From: Otto Urpelainen <oturpe@iki.fi>
+Date: Tue, 5 Oct 2021 08:50:28 +0300
+Subject: [PATCH] Consider Patch tags in specfile parser
+
+Patch files can be uploaded to the lookaside cache and referred
+to by Patch tags in the specfile.
+The specfile parser did not consider this case, leading to an error
+if a dist-git repo has such confiration. Fixed by parsing
+the patch tags.
+
+Resolves rhbz#2010518
+
+Signed-off-by: Otto Urpelainen <oturpe@iki.fi>
+---
+ pyrpkg/spec.py | 5 +++--
+ tests/test_spec.py | 11 ++++++++---
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/pyrpkg/spec.py b/pyrpkg/spec.py
+index a276120..bd862f1 100644
+--- a/pyrpkg/spec.py
++++ b/pyrpkg/spec.py
+@@ -14,8 +14,9 @@ from pyrpkg.errors import rpkgError
+
+ class SpecFile(object):
+ """Simple specfile parser that finds source file names"""
+-
+- sourcefile_expression = re.compile(r'^source[0-9]*:\s*(?P<val>.*)\s*$', re.IGNORECASE)
++ sourcefile_expression = re.compile(
++ r'^((source[0-9]*|patch[0-9]*):\s*(?P<val>.*))\s*$',
++ re.IGNORECASE)
+
+ def __init__(self, spec, sourcedir):
+ self.spec = spec
+diff --git a/tests/test_spec.py b/tests/test_spec.py
+index 196b470..eefc475 100644
+--- a/tests/test_spec.py
++++ b/tests/test_spec.py
+@@ -36,8 +36,11 @@ class SpecFileTestCase(unittest.TestCase):
+ spec_fd.write(
+ "Source0: https://example.com/tarball.tar.gz\n"
+ "Source1: https://example.com/subdir/LICENSE.txt\n"
+- "Source2: https://another.domain.com/source.tar.gz\n"
+- "Source3: local.txt\n")
++ "source2: https://another.domain.com/source.tar.gz\n"
++ "SOURCE3: local.txt\n"
++ "\n"
++ "patch0: local.patch\n"
++ "PAtch999: https://remote.patch-sourcce.org/another-patch.bz2\n")
+ spec_fd.close()
+
+ s = spec.SpecFile(self.specfile, self.workdir)
+@@ -46,7 +49,9 @@ class SpecFileTestCase(unittest.TestCase):
+ "tarball.tar.gz",
+ "LICENSE.txt",
+ "source.tar.gz",
+- "local.txt"]
++ "local.txt",
++ "local.patch",
++ "another-patch.bz2"]
+ self.assertEqual(len(actual), len(expected))
+ self.assertTrue(all([a == b for a, b in zip(actual, expected)]))
+
+--
+2.31.1
+
diff --git a/0007-Continue-execution-if-specfile-parsing-fails.patch b/0007-Continue-execution-if-specfile-parsing-fails.patch
new file mode 100644
index 0000000..4e84bb1
--- /dev/null
+++ b/0007-Continue-execution-if-specfile-parsing-fails.patch
@@ -0,0 +1,58 @@
+From 7ede78fc7b8fae2e78c700f39eb68df1696e107f Mon Sep 17 00:00:00 2001
+From: Otto Urpelainen <oturpe@iki.fi>
+Date: Tue, 12 Oct 2021 20:48:43 +0300
+Subject: [PATCH] Continue execution if specfile parsing fails
+
+The unused sources detection feature implemented by class SpecFile
+is simply an optimization to avoid downloading unused sources.
+The parsing is quite different from other steps performed by rpkg,
+which also meant it can fail in new ways.
+To avoid situations where an error in this optimization step prevents
+usage that would otherwise succeed, this commit changes handling
+of such errors from exiting to logging the situation and continuing
+with the assumption that all sources in the sources file may
+be needed.
+
+Resolves: #583
+JIRA: RHELCMP-7087
+Merges: https://pagure.io/rpkg/pull-request/581
+
+Signed-off-by: Otto Urpelainen <oturpe@iki.fi>
+---
+ pyrpkg/__init__.py | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 23bca5b..2edcb09 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -2042,8 +2042,15 @@ class Commands(object):
+ outdir = self.path
+
+ sourcesf = SourcesFile(self.sources_filename, self.source_entry_type)
+- specf = SpecFile(os.path.join(self.layout.specdir, self.spec),
+- self.layout.sourcedir)
++
++ try:
++ specf = SpecFile(os.path.join(self.layout.specdir, self.spec),
++ self.layout.sourcedir)
++ spec_parsed = True
++ except Exception:
++ self.log.warn("Parsing specfile for used sources failed. "
++ "Falling back to downloading all sources.")
++ spec_parsed = False
+
+ args = dict()
+ if self.lookaside_request_params:
+@@ -2062,7 +2069,7 @@ class Commands(object):
+ "Error: Attempting a download '{0}' that would override a git tracked file. "
+ "Either remove the corresponding line from 'sources' file to keep the git "
+ "tracked one or 'git rm' the file to allow the download.".format(outfile))
+- if (entry.file not in specf.sources):
++ if (spec_parsed and entry.file not in specf.sources):
+ self.log.info("Not downloading unused %s" % entry.file)
+ continue
+ self.lookasidecache.download(
+--
+2.31.1
+
diff --git a/rpkg.spec b/rpkg.spec
index 11d1df9..d24ac7f 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
Name: rpkg
Version: 1.63
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Python library for interacting with rpm+git
License: GPLv2+ and LGPLv2
@@ -22,6 +22,8 @@ Patch2: 0002-Use-six-library-in-tests.patch
Patch3: 0003-Pass-sourcedir-to-rpmspec-when-specfile-is-parsed.patch
Patch4: 0004-Print-SpecFile-parsing-debug-info.patch
Patch5: 0005-Fixes-import-fail-with-sources-already-imported.patch
+Patch6: 0006-Consider-Patch-tags-in-specfile-parser.patch
+Patch7: 0007-Continue-execution-if-specfile-parsing-fails.patch
# RHEL7 is currently the only release that is built for Python 2.
%if 0%{?fedora} || 0%{?rhel} > 7
@@ -245,6 +247,10 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
%changelog
+* Wed Dec 01 2021 Ondřej Nosek <onosek@redhat.com> - 1.63-5
+- Patch: Continue execution if specfile parsing fails
+- Patch: Consider Patch tags in specfile parser
+
* Mon Nov 29 2021 Ondřej Nosek <onosek@redhat.com> - 1.63-4
- Patch: Fixes import fail with sources already imported
next reply other threads:[~2026-08-10 21:44 UTC|newest]
Thread overview: 2+ 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: Some patches
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=178639826165.1.11068631628509822095.rpms-rpkg-fbeaedc842e4@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