File 0002-handle-.changes-file-correctly.patch of Package tito

From 71c1d7a0c5368b35eb140f648e65a6fd2e946d06 Mon Sep 17 00:00:00 2001
From: Michael Calmer <mc@suse.de>
Date: Sat, 5 Mar 2016 17:34:19 +0100
Subject: [PATCH 2/9] handle .changes file correctly

---
 src/tito/builder/main.py | 8 ++++++++
 1 file changed, 8 insertions(+)

Index: tito-tito-0.6.11-1/src/tito/builder/main.py
===================================================================
--- tito-tito-0.6.11-1.orig/src/tito/builder/main.py
+++ tito-tito-0.6.11-1/src/tito/builder/main.py
@@ -230,6 +230,14 @@ class BuilderBase(object):
         self.srpm_location = find_wrote_in_rpmbuild_output(output)[0]
         self.artifacts.append(self.srpm_location)
 
+        # handle an existing .changes file.
+        # TODO: may or may not end up in a OBSBuilder as this is OBS-specific.
+        changes_file = "%s.changes" % self.spec_file[0:-5]
+        if os.path.exists(changes_file):
+            run_command("mv %s %s" % (changes_file, self.rpmbuild_basedir))
+            print("Wrote: %s" % os.path.join(self.rpmbuild_basedir, os.path.basename(changes_file)))
+            self.artifacts.append(os.path.join(self.rpmbuild_basedir, os.path.basename(changes_file)))
+
     # Assume that if tito's --no-cleanup option is set, also disable %clean in rpmbuild:
     def _get_clean_option(self):
         if self.no_cleanup:
openSUSE Build Service is sponsored by