1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-11 16:36:14 +01:00

maintenancerequest: simplify sytnax to create request for single package

The syntax to create a maintnancerequest for a single currently package
is:
  osc mr SOURCEPROJECT SOURCEPACKAGES RELEASEPROJECT
which means that the source project, the package name and the release
project have to be specified on the command line.
Often times the workflow is such that the user will already be inside
of the subdirectory containing the checked out package.
To simplify the submission when the user is in a package subdirectory
this patch adds the syntax:
  osc mr .
to indicate that the source project and source target is to be taken
from the meta information in this package directory.

Signed-off-by: Egbert Eich <eich@freedesktop.org>
This commit is contained in:
Egbert Eich 2015-08-25 12:34:13 +02:00 committed by Adrian Schröter
parent df9c3000b0
commit 43ffb9f3ac

View File

@ -3046,6 +3046,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
usage:
osc maintenancerequest [ SOURCEPROJECT [ SOURCEPACKAGES RELEASEPROJECT ] ]
osc maintenancerequest .
The 2nd line when issued within a package directory provides a short cut to submit a single
package (the one in the current directory) from the project of this package to be submitted
to the release project this package links to. This syntax is only valid when specified from
a package subdirectory.
${cmd_option_list}
"""
#FIXME: the follow syntax would make more sense and would obsolete the --release-project parameter
@ -3066,7 +3072,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
elif len(args) == 0:
raise oscerr.WrongArgs('Too few arguments.')
if len(args) > 0:
source_project = args[0]
if len(args) == 1 and args[0] == '.':
if is_package_dir(os.curdir):
source_project = store_read_project(os.curdir)
source_packages = [store_read_package(os.curdir)]
p = Package(os.curdir)
release_project = p.linkinfo.project
else:
raise oscerr.WrongArgs('No package directory')
else:
source_project = args[0]
if len(args) > 1:
if len(args) == 2:
sys.exit('Source package defined, but no release project.')