From cadcf4fa5b78a30507f1cb92e329189512157d15 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: Sep 14 2015 15:42:25 +0000 Subject: apply -f/--file patch from Jason Tibbitts, rhbz#1246273 --- diff --git a/rpmdev-bumpspec b/rpmdev-bumpspec index fc2a6de..8cc9a0b 100755 --- a/rpmdev-bumpspec +++ b/rpmdev-bumpspec @@ -270,6 +270,8 @@ the Free Software Foundation; either version 2 of the License, or parser = OptionParser(usage=usage) parser.add_option("-c", "--comment", help="changelog comment (default: \"- rebuilt\")") + parser.add_option("-f", "--file", + help="take changelog comment from the given file") parser.add_option("-u", "--userstring", default=userstring, help="user name+email string (default: output from " "rpmdev-packager(1))") @@ -298,6 +300,10 @@ the Free Software Foundation; either version 2 of the License, or if not opts.userstring: parser.error('Userstring required, see option -u') + if opts.file: + with open(opts.file, 'r') as f: + opts.comment = f.read().rstrip() + if not opts.comment: opts.comment = '- new version' if opts.new else '- rebuilt'