From 3ebfeae20c74de0ca4b26b22135e1996265ea4ce Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Apr 05 2023 09:41:39 +0000 Subject: Ignore missing spec file in pre-push hook 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ář --- 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)]