Used guess_spec in changelog mode
authorEd Bartosh <eduard.bartosh@intel.com>
Tue, 9 Oct 2012 14:24:40 +0000 (17:24 +0300)
committerEd Bartosh <eduard.bartosh@intel.com>
Tue, 9 Oct 2012 14:42:58 +0000 (17:42 +0300)
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 <eduard.bartosh@intel.com>
gitbuildsys/cmd_changelog.py
tools/gbs

index d477b694cb5f92e89f304c9c6f3c6fa470a5d531..9fdec40626a5b7f090e98b4f0bd8ab1520cbe739 100644 (file)
@@ -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:
index 202a18c294a739bf10c2917ca965af8fc941003a..9a0bea7f04c61bd37874f882d3539e309c31a080 100755 (executable)
--- 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',