public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpkg] 1.70-1: Patch: Do not generate pre-push hook script in some cases
@ 2026-08-10 21:44 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-10 21:44 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : 8c7be4434e1894ba636e5780df584e1641422dbf
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2023-03-10T00:11:52+00:00
            Stats  : +42/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/8c7be4434e1894ba636e5780df584e1641422dbf?branch=1.70-1

            Log:
            Patch: Do not generate pre-push hook script in some cases

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

---
diff --git a/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
new file mode 100644
index 0000000..3369959
--- /dev/null
+++ b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
@@ -0,0 +1,37 @@
+From 30f189736137a50da4b740acf775ff6675a15a70 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Wed, 8 Mar 2023 16:39:16 +0100
+Subject: [PATCH] Do not generate pre-push hook script in some cases
+
+Some rpkg users don't use fedpkg or similar tool for cloning
+and therefore there is no tool to execute the pre-push-check
+function. Do not generate the hook script in this case.
+
+Fixes: #665
+JIRA: RHELCMP-11392
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index acdad22..776cb21 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -1795,6 +1795,13 @@ class Commands(object):
+         for possible user mistakes.
+         """
+         tool_name = os.path.basename(sys.argv[0])  # rhpkg|fedpkg|...
++        if not tool_name:
++            # empty argv - this functionality is not executed from x-pkg tool
++            # and therefore there isn't a program that can run pre-push-check.
++            # Example: the COPR team executes 'clone' by their own script.
++            self.log.debug('Pre-push hook script was NOT added - missing '
++                           'the packaging tool like fedpkg, rhpkg, ...')
++            return
+         hook_content = textwrap.dedent("""
+             #!/bin/bash
+ 
+-- 
+2.39.2
+

diff --git a/rpkg.spec b/rpkg.spec
index 4c557e0..50604bf 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.66
-Release:        3%{?dist}
+Release:        4%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -39,6 +39,7 @@ Patch3:         0003-Remove-Environment-Markers-syntax.patch
 %endif
 Patch4:         0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch
 Patch5:         0005-container-build-update-signing-intent-help-for-OSBS-.patch
+Patch6:         0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
 
 %description
 Python library for interacting with rpm+git
@@ -255,6 +256,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
 
 
 %changelog
+* Fri Mar 10 2023 Ondřej Nosek <onosek@redhat.com> - 1.66-4
+- Patch: Do not generate pre-push hook script in some cases
+
 * Wed Mar 1 2023 Ondřej Nosek <onosek@redhat.com> - 1.66-3
 - Patch: Process source URLs with fragment in pre-push hook
 - Patch: container-build: update --signing-intent help for OSBS 2

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

only message in thread, other threads:[~2026-08-10 21:44 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:44 [rpms/rpkg] 1.70-1: Patch: Do not generate pre-push hook script in some cases 

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