mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-28 23:46:13 +01:00
- cleanup: removed useless objects
This commit is contained in:
parent
81bf93f4f2
commit
046d4c37e1
@ -358,8 +358,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
|
|
||||||
project_dir = localdir = os.getcwd()
|
project_dir = localdir = os.getcwd()
|
||||||
if is_project_dir(localdir):
|
if is_project_dir(localdir):
|
||||||
project = Project(localdir).name
|
project = store_read_project(localdir)
|
||||||
apiurl = Project(localdir).apiurl
|
apiurl = store_read_apiurl(localdir)
|
||||||
else:
|
else:
|
||||||
sys.exit('This command must be called in a checked out project.')
|
sys.exit('This command must be called in a checked out project.')
|
||||||
patchinfo = None
|
patchinfo = None
|
||||||
@ -724,20 +724,20 @@ class Osc(cmdln.Cmdln):
|
|||||||
import cgi
|
import cgi
|
||||||
# submit requests for multiple packages are currently handled via multiple requests
|
# submit requests for multiple packages are currently handled via multiple requests
|
||||||
# They could be also one request with multiple actions, but that avoids to accepts parts of it.
|
# They could be also one request with multiple actions, but that avoids to accepts parts of it.
|
||||||
project = Project(os.getcwd())
|
project = store_read_project(os.curdir)
|
||||||
apiurl = project.apiurl
|
apiurl = store_read_apiurl(os.curdir)
|
||||||
|
|
||||||
sr_ids = []
|
sr_ids = []
|
||||||
pi = []
|
pi = []
|
||||||
pac = []
|
pac = []
|
||||||
targetprojects = []
|
targetprojects = []
|
||||||
# loop via all packages for checking their state
|
# loop via all packages for checking their state
|
||||||
for p in meta_get_packagelist(apiurl, project.name):
|
for p in meta_get_packagelist(apiurl, project):
|
||||||
if p.startswith("_patchinfo:"):
|
if p.startswith("_patchinfo:"):
|
||||||
pi.append(p)
|
pi.append(p)
|
||||||
else:
|
else:
|
||||||
# get _link info from server, who knows about the local state ...
|
# get _link info from server, who knows about the local state ...
|
||||||
u = makeurl(apiurl, ['source', project.name, p])
|
u = makeurl(apiurl, ['source', project, p])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
root = ET.parse(f).getroot()
|
root = ET.parse(f).getroot()
|
||||||
linkinfo = root.find('linkinfo')
|
linkinfo = root.find('linkinfo')
|
||||||
@ -770,7 +770,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
|
|
||||||
# loop via all packages to do the action
|
# loop via all packages to do the action
|
||||||
for p in pac:
|
for p in pac:
|
||||||
result = create_submit_request(apiurl, project.name, p)
|
result = create_submit_request(apiurl, project, p)
|
||||||
if not result:
|
if not result:
|
||||||
# sys.exit(result)
|
# sys.exit(result)
|
||||||
sys.exit("submit request creation failed")
|
sys.exit("submit request creation failed")
|
||||||
@ -785,7 +785,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
for p in pi:
|
for p in pi:
|
||||||
for t in targetprojects:
|
for t in targetprojects:
|
||||||
s = """<action type="submit"> <source project="%s" package="%s" /> <target project="%s" package="%s" /> %s </action>""" % \
|
s = """<action type="submit"> <source project="%s" package="%s" /> <target project="%s" package="%s" /> %s </action>""" % \
|
||||||
(project.name, p, t, p, options_block)
|
(project, p, t, p, options_block)
|
||||||
actionxml += s
|
actionxml += s
|
||||||
|
|
||||||
if actionxml != "":
|
if actionxml != "":
|
||||||
@ -1965,10 +1965,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if args and len(args) == 1:
|
if args and len(args) == 1:
|
||||||
localdir = os.getcwd()
|
localdir = os.getcwd()
|
||||||
if is_project_dir(localdir):
|
if is_project_dir(localdir):
|
||||||
project = Project(localdir).name
|
project = store_read_project(localdir)
|
||||||
project_dir = localdir
|
project_dir = localdir
|
||||||
package = args[0]
|
package = args[0]
|
||||||
apiurl = Project(localdir).apiurl
|
apiurl = store_read_apiurl(localdir)
|
||||||
|
|
||||||
rev, dummy = parseRevisionOption(opts.revision)
|
rev, dummy = parseRevisionOption(opts.revision)
|
||||||
if rev==None:
|
if rev==None:
|
||||||
@ -3525,10 +3525,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
architecture = args[3]
|
architecture = args[3]
|
||||||
elif len(args) == 2:
|
elif len(args) == 2:
|
||||||
if is_package_dir(os.getcwd()):
|
if is_package_dir(os.getcwd()):
|
||||||
project = Project(os.getcwd()).name
|
project = store_read_project(os.curdir)
|
||||||
p = Package(os.getcwd())
|
package = store_read_package(os.curdir)
|
||||||
package = p.name
|
apiurl = store_read_apiurl(os.curdir)
|
||||||
apiurl = p.apiurl
|
|
||||||
repository = args[0]
|
repository = args[0]
|
||||||
architecture = args[1]
|
architecture = args[1]
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user