From 445c93300b3ff9f6cdcb71bc5b952b682e3540a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 4 Jul 2023 15:52:59 +0200 Subject: [PATCH] Fix local service execution of scmsync packages read _service file even when it is not tracked. This is the case in scmsync case. I am not aware of a situation where it would break, when the local _service file exists but is not tracked yet. osc#1350 --- osc/core.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/osc/core.py b/osc/core.py index 91467c5b..3e5277a5 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2630,14 +2630,13 @@ rev: %s os.chdir(self.absdir) # e.g. /usr/lib/obs/service/verify_file fails if not inside the project dir. si = Serviceinfo() if os.path.exists('_service'): - if self.filenamelist.count('_service') or self.filenamelist_unvers.count('_service'): - try: - service = ET.parse(os.path.join(self.absdir, '_service')).getroot() - except ET.ParseError as v: - line, column = v.position - print('XML error in _service file on line %s, column %s' % (line, column)) - sys.exit(1) - si.read(service) + try: + service = ET.parse(os.path.join(self.absdir, '_service')).getroot() + except ET.ParseError as v: + line, column = v.position + print('XML error in _service file on line %s, column %s' % (line, column)) + sys.exit(1) + si.read(service) si.getProjectGlobalServices(self.apiurl, self.prjname, self.name) r = si.execute(self.absdir, mode, singleservice, verbose) os.chdir(curdir)