From: Markus Lehtonen Date: Thu, 8 Nov 2012 10:27:43 +0000 (+0200) Subject: buildpackage-rpm: fail patch-export if local patches found X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5860e089c264fb2af9a53c8db56fda5996d2012b;p=tools%2Fgit-buildpackage.git buildpackage-rpm: fail patch-export if local patches found Make patch export fail if local patch files (not marked for manual maintenance) exist. Signed-off-by: Markus Lehtonen --- diff --git a/gbp/scripts/buildpackage_rpm.py b/gbp/scripts/buildpackage_rpm.py index 13e4d1a9..8c01fc93 100755 --- a/gbp/scripts/buildpackage_rpm.py +++ b/gbp/scripts/buildpackage_rpm.py @@ -227,6 +227,15 @@ def export_patches(repo, spec, export_treeish, options): """ Generate patches and update spec file """ + # Fail if we have local patch files not marked for manual maintenance. + # Ignore patches listed in spec but not found in packaging dir + for patch in spec.patchseries(): + if os.path.exists(patch.path): + raise GbpAutoGenerateError( + 'Patches not marked for manual maintenance found, ' + 'refusing to overwrite! Fix by applying them to packaging ' + 'branch and removing the files.') + try: upstream_tree = get_upstream_tree(repo, spec, options) update_patch_series(repo, spec, upstream_tree, export_treeish, options)