summaryrefslogtreecommitdiff
path: root/0015-Ignore-missing-spec-file-in-pre-push-hook.patch
blob: b32833cc4f6ee5c4e2d77b75111357b32ccb01bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From 3ebfeae20c74de0ca4b26b22135e1996265ea4ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= <lsedlar@redhat.com>
Date: Wed, 5 Apr 2023 11:41:23 +0200
Subject: [PATCH 2/6] Ignore missing spec file in pre-push hook
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

For modules or containers there will be no spec file, and there is
nothing to block the push on.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
---
 pyrpkg/__init__.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
index ecb99c9..d3a7a1c 100644
--- a/pyrpkg/__init__.py
+++ b/pyrpkg/__init__.py
@@ -4471,7 +4471,12 @@ class Commands(object):
             # Assume, that specfile names are same in the active branch
             # and in the pushed branch (git checkout f37 && git push origin rawhide)
             # in this case 'f37' is active branch and 'rawhide' is pushed branch.
-            specfile_path_absolute = os.path.join(self.layout.specdir, self.spec)
+            try:
+                specfile_path_absolute = os.path.join(self.layout.specdir, self.spec)
+            except rpkgError:
+                # No specfile found, nothing to check
+                return
+
             # convert to relative path
             specfile_path = os.path.relpath(specfile_path_absolute, start=self.path)
             cmd = ['spectool', '-l', os.path.join(clone_dir, specfile_path)]
-- 
2.39.2