mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
register "_service" file, in case it got created
This commit is contained in:
parent
1ca862308b
commit
ac5990fbd0
@ -4536,10 +4536,12 @@ def stripETxml(node):
|
|||||||
|
|
||||||
def addDownloadUrlService(url):
|
def addDownloadUrlService(url):
|
||||||
service_file = os.path.join(os.getcwd(), '_service')
|
service_file = os.path.join(os.getcwd(), '_service')
|
||||||
|
addfile = False
|
||||||
if os.path.exists( service_file ):
|
if os.path.exists( service_file ):
|
||||||
services = ET.parse(os.path.join(os.getcwd(), '_service')).getroot()
|
services = ET.parse(os.path.join(os.getcwd(), '_service')).getroot()
|
||||||
else:
|
else:
|
||||||
services = ET.fromstring("<services />")
|
services = ET.fromstring("<services />")
|
||||||
|
addfile = True
|
||||||
stripETxml( services )
|
stripETxml( services )
|
||||||
si = Serviceinfo()
|
si = Serviceinfo()
|
||||||
s = si.addDownloadUrl(services, url)
|
s = si.addDownloadUrl(services, url)
|
||||||
@ -4551,6 +4553,8 @@ def addDownloadUrlService(url):
|
|||||||
f = open(service_file, 'wb')
|
f = open(service_file, 'wb')
|
||||||
f.write(reparsed.toprettyxml(indent=" "))
|
f.write(reparsed.toprettyxml(indent=" "))
|
||||||
f.close()
|
f.close()
|
||||||
|
if addfile:
|
||||||
|
addFiles( ['_service'] )
|
||||||
|
|
||||||
# download file
|
# download file
|
||||||
si.execute(os.getcwd())
|
si.execute(os.getcwd())
|
||||||
|
Loading…
Reference in New Issue
Block a user