mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-25 22:36:13 +01:00
support project wide source services
This commit is contained in:
parent
373727ba55
commit
e5333f0b23
1
NEWS
1
NEWS
@ -15,6 +15,7 @@
|
|||||||
- "my requests" is doing faster and complete server side lookup now if available
|
- "my requests" is doing faster and complete server side lookup now if available
|
||||||
- "review" command has been extended to handle reviews by project or by package maintainers
|
- "review" command has been extended to handle reviews by project or by package maintainers
|
||||||
- support for new source service modes: disabled, trylocal and localonly
|
- support for new source service modes: disabled, trylocal and localonly
|
||||||
|
- support project wide source services
|
||||||
|
|
||||||
0.130
|
0.130
|
||||||
- new "revert" command to restore the original working copy file (without
|
- new "revert" command to restore the original working copy file (without
|
||||||
|
@ -4663,7 +4663,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
command = args[0]
|
command = args[0]
|
||||||
|
|
||||||
if command == "remoterun" or command == "r":
|
if command == "remoterun" or command == "rr":
|
||||||
print runservice(apiurl, project, package)
|
print runservice(apiurl, project, package)
|
||||||
|
|
||||||
if command == "run" or command == "localrun" or command == "disabledrun" or command == "lr" or command == "dr" or command == "r":
|
if command == "run" or command == "localrun" or command == "disabledrun" or command == "lr" or command == "dr" or command == "r":
|
||||||
|
13
osc/core.py
13
osc/core.py
@ -247,13 +247,14 @@ class Serviceinfo:
|
|||||||
"""creates an empty serviceinfo instance"""
|
"""creates an empty serviceinfo instance"""
|
||||||
self.services = None
|
self.services = None
|
||||||
|
|
||||||
def read(self, serviceinfo_node):
|
def read(self, serviceinfo_node, append=False):
|
||||||
"""read in the source services <services> element passed as
|
"""read in the source services <services> element passed as
|
||||||
elementtree node.
|
elementtree node.
|
||||||
"""
|
"""
|
||||||
if serviceinfo_node == None:
|
if serviceinfo_node == None:
|
||||||
return
|
return
|
||||||
self.services = []
|
if not append:
|
||||||
|
self.services = []
|
||||||
services = serviceinfo_node.findall('service')
|
services = serviceinfo_node.findall('service')
|
||||||
|
|
||||||
for service in services:
|
for service in services:
|
||||||
@ -273,6 +274,13 @@ class Serviceinfo:
|
|||||||
msg = 'invalid service format:\n%s' % ET.tostring(serviceinfo_node)
|
msg = 'invalid service format:\n%s' % ET.tostring(serviceinfo_node)
|
||||||
raise oscerr.APIError(msg)
|
raise oscerr.APIError(msg)
|
||||||
|
|
||||||
|
def readProjectFile(self, apiurl, project):
|
||||||
|
# download project wide _service file, we don't store it yet
|
||||||
|
u = makeurl(apiurl, ['source', project, "_project", "_service"])
|
||||||
|
f = http_GET(u)
|
||||||
|
root = ET.parse(f).getroot()
|
||||||
|
self.read(root, True)
|
||||||
|
|
||||||
def addVerifyFile(self, serviceinfo_node, filename):
|
def addVerifyFile(self, serviceinfo_node, filename):
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
@ -2033,6 +2041,7 @@ rev: %s
|
|||||||
service = ET.parse(os.path.join(self.absdir, '_service')).getroot()
|
service = ET.parse(os.path.join(self.absdir, '_service')).getroot()
|
||||||
si = Serviceinfo()
|
si = Serviceinfo()
|
||||||
si.read(service)
|
si.read(service)
|
||||||
|
si.readProjectFile(self.apiurl, self.prjname)
|
||||||
si.execute(self.absdir, mode)
|
si.execute(self.absdir, mode)
|
||||||
|
|
||||||
def prepare_filelist(self):
|
def prepare_filelist(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user