1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 17:16:23 +01:00

Add -F option to osc submitreq

Fixes #1001
This commit is contained in:
John Paul Adrian Glaubitz 2022-02-25 12:00:06 +01:00
parent fe6a50ffb7
commit 483e07042a

View File

@ -1177,6 +1177,8 @@ class Osc(cmdln.Cmdln):
@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
@cmdln.option('-F', '--file', metavar='FILE',
help='read log message from FILE, \'-\' denotes standard input.')
@cmdln.option('-r', '--revision', metavar='REV',
help='specify a certain source revision ID (the md5 sum) for the source package')
@cmdln.option('-s', '--supersede', metavar='REQUEST_ID',
@ -1257,6 +1259,14 @@ class Osc(cmdln.Cmdln):
if opts.message:
opts.message = str(opts.message.encode().decode('unicode_escape'))
elif opts.file:
if opts.file == '-':
opts.message = sys.stdin.read()
else:
try:
opts.message = open(opts.file).read()
except:
sys.exit('could not open file \'%s\'.' % opts.file)
myreqs = []
if opts.supersede: