1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-03-01 13:42:12 +01:00

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
This commit is contained in:
Adrian Schröter 2023-07-04 15:52:59 +02:00
parent 17dbe25a71
commit 445c93300b
No known key found for this signature in database
GPG Key ID: 918D8C954C08DB67

View File

@ -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)