From 48e10966a05dfd7e64abca7c4ae3aab960135cfc Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 9 Oct 2012 17:24:40 +0300 Subject: [PATCH] Used guess_spec in changelog mode This change fixes confusing behaviour of changelog mode. When there are more than one .spec file in packaging/ directory first one is picked up for processing. Users were confused, because there was not way to understand which spec will be used and there was not way to specify spec to proceed with. Fixes: #399 Change-Id: I65d546b1c0d2fee93bdad8ed03c39d1588edf7d8 Signed-off-by: Ed Bartosh --- gitbuildsys/cmd_changelog.py | 7 ++----- tools/gbs | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gitbuildsys/cmd_changelog.py b/gitbuildsys/cmd_changelog.py index d477b69..9fdec40 100644 --- a/gitbuildsys/cmd_changelog.py +++ b/gitbuildsys/cmd_changelog.py @@ -98,11 +98,8 @@ def main(args): % (changes_file_list[0])) else: # Create .changes file with the same name as a spec - spec_file_list = glob.glob("%s/packaging/*.spec" % project_root_dir) - if spec_file_list: - fn_changes = os.path.splitext(spec_file_list[0])[0] + ".changes" - else: - msger.error("Found no changes nor spec files under packaging dir") + specfile = utils.guess_spec(project_root_dir, args.spec) + fn_changes = os.path.splitext(specfile)[0] + ".changes" # get the commit start from the args.since if args.since: diff --git a/tools/gbs b/tools/gbs index 202a18c..9a0bea7 100755 --- a/tools/gbs +++ b/tools/gbs @@ -263,6 +263,7 @@ def changelog_parser(parser): default=os.getcwd(), help='path to git repository') + parser.add_argument('--spec', help='specify a spec file to use') parser.add_argument('-s', '--since', help='commit to start from') parser.add_argument('-m', '--message', -- 2.7.4