mirror of
https://github.com/openSUSE/osc.git
synced 2025-10-05 17:09:19 +02:00
- support updating of existing _patchinfo files
This commit is contained in:
1
NEWS
1
NEWS
@@ -9,6 +9,7 @@
|
|||||||
# Features which requires OBS 2.3
|
# Features which requires OBS 2.3
|
||||||
#
|
#
|
||||||
- support source services using OBS project or package name
|
- support source services using OBS project or package name
|
||||||
|
- support updateing _patchinfo file with new issues just by calling "osc patchinfo" again
|
||||||
- branch --add-repositories can be used to add repos from source project to target project
|
- branch --add-repositories can be used to add repos from source project to target project
|
||||||
|
|
||||||
0.132
|
0.132
|
||||||
|
@@ -426,15 +426,15 @@ class Osc(cmdln.Cmdln):
|
|||||||
|
|
||||||
|
|
||||||
@cmdln.option('-f', '--force', action='store_true',
|
@cmdln.option('-f', '--force', action='store_true',
|
||||||
help='force generation of new patchinfo file')
|
help='force generation of new patchinfo file, do not update existing one.')
|
||||||
@cmdln.option('--force-update', action='store_true',
|
|
||||||
help='drops away collected packages from an already built patch and let it collect again')
|
|
||||||
def do_patchinfo(self, subcmd, opts, *args):
|
def do_patchinfo(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Generate and edit a patchinfo file.
|
"""${cmd_name}: Generate and edit a patchinfo file.
|
||||||
|
|
||||||
A patchinfo file describes the packages for an update and the kind of
|
A patchinfo file describes the packages for an update and the kind of
|
||||||
problem it solves.
|
problem it solves.
|
||||||
|
|
||||||
|
This command either creates a new _patchinfo or updates an existing one.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
osc patchinfo
|
osc patchinfo
|
||||||
osc patchinfo PATCH_NAME
|
osc patchinfo PATCH_NAME
|
||||||
@@ -442,15 +442,20 @@ class Osc(cmdln.Cmdln):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
project_dir = localdir = os.getcwd()
|
project_dir = localdir = os.getcwd()
|
||||||
|
patchinfo = None
|
||||||
if is_project_dir(localdir):
|
if is_project_dir(localdir):
|
||||||
project = store_read_project(localdir)
|
project = store_read_project(localdir)
|
||||||
apiurl = self.get_api_url()
|
apiurl = self.get_api_url()
|
||||||
|
for p in meta_get_packagelist(apiurl, project):
|
||||||
|
if p.startswith("_patchinfo") or p.startswith("patchinfo"):
|
||||||
|
patchinfo = p
|
||||||
else:
|
else:
|
||||||
sys.exit('This command must be called in a checked out project.')
|
if is_package_dir(localdir):
|
||||||
patchinfo = None
|
project = store_read_project(localdir)
|
||||||
for p in meta_get_packagelist(apiurl, project):
|
patchinfo = store_read_package(localdir)
|
||||||
if p.startswith("_patchinfo") or p.startswith("patchinfo"):
|
apiurl = self.get_api_url()
|
||||||
patchinfo = p
|
else:
|
||||||
|
sys.exit('This command must be called in a checked out project or patchinfo package.')
|
||||||
|
|
||||||
if opts.force or not patchinfo:
|
if opts.force or not patchinfo:
|
||||||
print "Creating initial patchinfo..."
|
print "Creating initial patchinfo..."
|
||||||
@@ -462,14 +467,23 @@ class Osc(cmdln.Cmdln):
|
|||||||
for p in meta_get_packagelist(apiurl, project):
|
for p in meta_get_packagelist(apiurl, project):
|
||||||
if p.startswith("_patchinfo") or p.startswith("patchinfo"):
|
if p.startswith("_patchinfo") or p.startswith("patchinfo"):
|
||||||
patchinfo = p
|
patchinfo = p
|
||||||
|
else:
|
||||||
|
print "Update _patchinfo file..."
|
||||||
|
query='cmd=updatepatchinfo'
|
||||||
|
url = makeurl(apiurl, ['source', project, patchinfo], query=query)
|
||||||
|
f = http_POST(url)
|
||||||
|
|
||||||
# CAUTION:
|
# CAUTION:
|
||||||
# Both conf.config['checkout_no_colon'] and conf.config['checkout_rooted']
|
# Both conf.config['checkout_no_colon'] and conf.config['checkout_rooted']
|
||||||
# fool this test:
|
# fool this test:
|
||||||
if not os.path.exists(project_dir + "/" + patchinfo):
|
if is_package_dir(localdir):
|
||||||
|
pac = Package(localdir)
|
||||||
|
pac.update()
|
||||||
|
filename = "_patchinfo"
|
||||||
|
else:
|
||||||
checkout_package(apiurl, project, patchinfo, prj_dir=project_dir)
|
checkout_package(apiurl, project, patchinfo, prj_dir=project_dir)
|
||||||
|
filename = project_dir + "/" + patchinfo + "/_patchinfo"
|
||||||
|
|
||||||
filename = project_dir + "/" + patchinfo + "/_patchinfo"
|
|
||||||
run_editor(filename)
|
run_editor(filename)
|
||||||
|
|
||||||
@cmdln.alias('bsdevelproject')
|
@cmdln.alias('bsdevelproject')
|
||||||
|
Reference in New Issue
Block a user