public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Chenxiong Qi <cqi@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Backport to make osbs optional
Date: Mon, 10 Aug 2026 21:43:43 GMT	[thread overview]
Message-ID: <178639822388.1.740101952108072816.rpms-rpkg-abf4aea1c63b@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : abf4aea1c63b5d4f46fc284dfa317da67d569399
            Author : Chenxiong Qi <cqi@redhat.com>
            Date   : 2017-06-16T17:43:07+08:00
            Stats  : +87/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/abf4aea1c63b5d4f46fc284dfa317da67d569399?branch=1.70-1

            Log:
            Backport to make osbs optional

Backport from upstream. This change is included in future 1.50. After
it gets released, remove these two patches.

---
diff --git a/0001-make-osbs-dependency-optional.patch b/0001-make-osbs-dependency-optional.patch
new file mode 100644
index 0000000..a4b1b16
--- /dev/null
+++ b/0001-make-osbs-dependency-optional.patch
@@ -0,0 +1,34 @@
+From 00d51625fca26938eab9c1a0f2f7e83227ea3559 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pavel=20=C5=A0imerda?= <pavlix@pavlix.net>
+Date: Wed, 5 Oct 2016 10:52:37 +0000
+Subject: [PATCH 1/2] make osbs dependency optional
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Pavel Šimerda <pavlix@pavlix.net>
+---
+ pyrpkg/__init__.py | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index 66dd7e2..bdd7f70 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -27,8 +27,11 @@ import sys
+ import tempfile
+ import koji.ssl.SSLCommon
+ 
+-from osbs.api import OSBS
+-from osbs.conf import Configuration
++try:
++    from osbs.api import OSBS
++    from osbs.conf import Configuration
++except ImportError:
++    pass
+ from six.moves import configparser
+ from six.moves import urllib
+ 
+-- 
+2.7.5
+

diff --git a/0002-Make-osbs-support-optional.patch b/0002-Make-osbs-support-optional.patch
new file mode 100644
index 0000000..1c10ea5
--- /dev/null
+++ b/0002-Make-osbs-support-optional.patch
@@ -0,0 +1,45 @@
+From 93b8fe10cec88aa7051a9eb8f7041b7be0edf661 Mon Sep 17 00:00:00 2001
+From: Chenxiong Qi <cqi@redhat.com>
+Date: Wed, 24 May 2017 13:41:26 +0800
+Subject: [PATCH 2/2] Make osbs support optional
+
+Signed-off-by: Chenxiong Qi <cqi@redhat.com>
+---
+ pyrpkg/__init__.py | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index bdd7f70..3a1d544 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -27,11 +27,6 @@ import sys
+ import tempfile
+ import koji.ssl.SSLCommon
+ 
+-try:
+-    from osbs.api import OSBS
+-    from osbs.conf import Configuration
+-except ImportError:
+-    pass
+ from six.moves import configparser
+ from six.moves import urllib
+ 
+@@ -2491,6 +2486,15 @@ class Commands(object):
+ 
+     def osbs_build(self, config_file, config_section, target_override=False,
+                    yum_repourls=[], nowait=False):
++        # Because docker image should be built via Koji not in OSBS directly,
++        # it is not necessary to make osbs as a hard dependency
++        try:
++            from osbs.api import OSBS
++            from osbs.conf import Configuration
++        except ImportError:
++            raise rpkgError('Before building docker image in OSBS directly, '
++                            'please install python-osbs-client in advance.')
++
+         self.check_repo()
+         os_conf = Configuration(conf_file=config_file, conf_section=config_section)
+         build_conf = Configuration(conf_file=config_file, conf_section=config_section)
+-- 
+2.7.5
+

diff --git a/rpkg.spec b/rpkg.spec
index 4430adb..948e12d 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -3,12 +3,14 @@
 
 Name:           rpkg
 Version:        1.49
-Release:        2%{?dist}
+Release:        3%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
 URL:            https://pagure.io/rpkg
 Source0:        https://pagure.io/releases/rpkg/%{name}-%{version}.tar.gz
+Patch0:         0001-make-osbs-dependency-optional.patch
+Patch1:         0002-Make-osbs-support-optional.patch
 BuildArch:      noarch
 
 Requires:       mock
@@ -68,6 +70,8 @@ A python library for managing RPM package sources in a git repository.
 
 %prep
 %setup -q
+%patch0 -p1
+%patch1 -p1
 
 
 %build
@@ -107,6 +111,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/%{name}
 
 %changelog
+* Fri Jun 16 2017 Chenxiong Qi <cqi@redhat.com> - 1.49-3
+- Backport to make osbs optional
+
 * Mon Mar 27 2017 Chenxiong Qi <cqi@redhat.com> - 1.49-2
 - Rebuilt to rename pyrpkg to python2-rpkg
 

                 reply	other threads:[~2026-08-10 21:43 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=178639822388.1.740101952108072816.rpms-rpkg-abf4aea1c63b@fedoraproject.org \
    --to=cqi@redhat.com \
    --cc=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