From 1a90c9d4b280030e843dacddbfd9d13b2fa843c1 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Dec 19 2021 21:38:39 +0000 Subject: Accept also ~/.config/mock/.cfg files This has been originally reported by Maxwell G in: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/BNQ2TFWODJW3JSOBAG26AZQBOS5HHZMD/ Signed-off-by: Pavel Raiskup --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index 9884622..c153f16 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -2830,7 +2830,9 @@ class Commands(object): if not root: root = self.mockconfig chroot_cfg = '/etc/mock/%s.cfg' % root - if not os.path.exists(chroot_cfg): + home_chroot_cfg = '~/.config/mock/%s.cfg' % root + home_chroot_cfg = os.path.expanduser(home_chroot_cfg) + if not os.path.exists(chroot_cfg) and not os.path.exists(home_chroot_cfg): self.log.debug('Mock config %s was not found. Going to' ' request koji to create new one.', chroot_cfg) try: