diff options
author | Olav Vitters <olav@vitters.nl> | 2014-07-06 17:33:33 +0200 |
---|---|---|
committer | Olav Vitters <olav@vitters.nl> | 2014-07-06 17:33:33 +0200 |
commit | 600f03f37a4b299bfd8f366edbbdcbe8fbcb9255 (patch) | |
tree | 57a5237387af8b0ce91ea4f8b3a76763254e7585 | |
parent | b8f9d03937492a97d84f31ce183c4f76b56ca504 (diff) | |
download | mgagnome-600f03f37a4b299bfd8f366edbbdcbe8fbcb9255.tar mgagnome-600f03f37a4b299bfd8f366edbbdcbe8fbcb9255.tar.gz mgagnome-600f03f37a4b299bfd8f366edbbdcbe8fbcb9255.tar.bz2 mgagnome-600f03f37a4b299bfd8f366edbbdcbe8fbcb9255.tar.xz mgagnome-600f03f37a4b299bfd8f366edbbdcbe8fbcb9255.zip |
allow forcing changes and ensure spec file exists
-rwxr-xr-x | mgagnome | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -410,7 +410,6 @@ class SpecFile(object): # - first figure out how a buildrequire is usually defined mo = self.re_update_br.search(data) br_pre = mo.group('pre') if mo and mo.group('pre') else "BuildRequires:\t" - print br_pre for reason, new_brs, regexp in re_convert_br: mo = regexp.search(data) @@ -1238,10 +1237,15 @@ def cmd_clean_spec_multi(args): print package cwd = os.path.join(root, package) - s = SpecFile(os.path.join(cwd, "SPECS", "%s.spec" % package), module=package) + path = os.path.join(cwd, "SPECS", "%s.spec" % package) + if not os.path.exists(path): + print >>sys.stderr, 'ERROR: Cannot find spec file for package %s' % package + return False + + s = SpecFile(path, module=package) try: - if not s.ensure_no_local_changes(): + if not s.ensure_no_local_changes(options.force): return False except subprocess.CalledProcessError: # Package was probably not checked out or something @@ -1507,11 +1511,12 @@ def main(): subparser = subparsers.add_parser('clean-spec', help='clean specfile') subparser.add_argument("package", help="Package name", nargs='*') subparser.add_argument("-d", action="store_true", dest="doit") + subparser.add_argument("-f", "--force", action="store_true") subparser.add_argument("-a", "--all", action="store_true", dest="all", help="checkout all Downstream packages") subparser.add_argument("--no-convert-devel", action="store_false", dest="pkgconfig") subparser.set_defaults( - func=cmd_clean_spec, doit=False, pkgconfig=True, all=False + func=cmd_clean_spec, doit=False, pkgconfig=True, all=False, force=False ) subparser = subparsers.add_parser('check-version', help='check if spec version and downstream version match') |