public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Patch: Fixes import fail with sources already imported
Date: Mon, 10 Aug 2026 21:44:21 GMT	[thread overview]
Message-ID: <178639826118.1.9117207488060170403.rpms-rpkg-fc0d2a16d7b2@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : fc0d2a16d7b2e8bf056971c78125a8a720348493
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2021-11-29T01:44:55+00:00
            Stats  : +55/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/fc0d2a16d7b2e8bf056971c78125a8a720348493?branch=1.70-1

            Log:
            Patch: Fixes import fail with sources already imported

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0005-Fixes-import-fail-with-sources-already-imported.patch b/0005-Fixes-import-fail-with-sources-already-imported.patch
new file mode 100644
index 0000000..c80ff60
--- /dev/null
+++ b/0005-Fixes-import-fail-with-sources-already-imported.patch
@@ -0,0 +1,50 @@
+From f1f74e256cde220f04c41d6c86460d64cd3026b2 Mon Sep 17 00:00:00 2001
+From: Dominik Rumian <drumian@redhat.com>
+Date: Wed, 15 Sep 2021 12:10:03 +0200
+Subject: [PATCH] Fixes import fail with sources already imported
+
+Fixes: #573
+JIRA: RHELCMP-6481
+
+Signed-off-by: Dominik Rumian <drumian@redhat.com>
+---
+ pyrpkg/cli.py     | 5 ++++-
+ tests/test_cli.py | 6 +-----
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py
+index 6aa8f27..fafada6 100644
+--- a/pyrpkg/cli.py
++++ b/pyrpkg/cli.py
+@@ -2144,7 +2144,10 @@ class cliClient(object):
+     def import_srpm(self):
+         uploadfiles = self.cmd.import_srpm(self.args.srpm)
+         if uploadfiles:
+-            self.cmd.upload(uploadfiles, replace=True, offline=self.args.offline)
++            try:
++                self.cmd.upload(uploadfiles, replace=True, offline=self.args.offline)
++            except AlreadyUploadedError:
++                self.log.info("All sources were already uploaded.")
+         if not self.args.skip_diffs:
+             self.cmd.diff(cached=True)
+         self.log.info('--------------------------------------------')
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index 887917c..90c2067 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -1531,11 +1531,7 @@ class TestImportSrpm(LookasideCacheMock, CliTestCase):
+ 
+     def test_import(self):
+         self.assert_import_srpm(self.chaos_repo)
+-        # Exception is not a functionality issue. There is no problem with
+-        # uploading same file twice in a test however, the upload method checks
+-        # if file has been already uploaded.
+-        six.assertRaisesRegex(self, AlreadyUploadedError, r'File already uploaded',
+-                              self.assert_import_srpm, self.cloned_repo_path)
++        self.assert_import_srpm(self.cloned_repo_path)
+ 
+     def test_import_gating_and_rpmlintrc_exception(self):
+         # Add three additional files to the repo. Former gating.yaml and package.rpmlintrc are
+-- 
+2.31.1
+

diff --git a/rpkg.spec b/rpkg.spec
index f91a0c6..11d1df9 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.63
-Release:        3%{?dist}
+Release:        4%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -21,6 +21,7 @@ Patch1:         0001-Do-not-use-pytest-related-dependencies-temporarily.patch
 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
 
 # RHEL7 is currently the only release that is built for Python 2.
 %if 0%{?fedora} || 0%{?rhel} > 7
@@ -244,6 +245,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
 
 
 %changelog
+* Mon Nov 29 2021 Ondřej Nosek <onosek@redhat.com> - 1.63-4
+- Patch: Fixes import fail with sources already imported
+
 * Mon Sep 13 2021 Ondřej Nosek <onosek@redhat.com> - 1.63-3
 - Add python-requests-kerberos as a new dependency for RHEL packages
 - Patch: Print SpecFile parsing debug info

                 reply	other threads:[~2026-08-10 21:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178639826118.1.9117207488060170403.rpms-rpkg-fc0d2a16d7b2@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