File 0004-read-alternative-build-directory-from-environment.patch of Package tito

From bdf7ceabc3756a7c81ec22e1925fb66ac0bcf49f Mon Sep 17 00:00:00 2001
From: Michael Calmer <mc@suse.de>
Date: Sat, 5 Mar 2016 17:35:18 +0100
Subject: [PATCH 4/9] read alternative build directory from environment

---
 src/tito/cli.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: tito-tito-0.6.11-1/src/tito/cli.py
===================================================================
--- tito-tito-0.6.11-1.orig/src/tito/cli.py
+++ tito-tito-0.6.11-1/src/tito/cli.py
@@ -174,9 +174,12 @@ class ConfigLoader(object):
 
 def lookup_build_dir(user_config):
     """
-    Read build_dir user config if it exists, otherwise
-    return the current working directory.
+    Read build_dir from environment($RPMBUILD_BASEDIR) or from user config if
+    it exists, otherwise return the DEFAULT_BUILD_DIR.
     """
+    build_dir = os.getenv('RPMBUILD_BASEDIR')
+    if build_dir:
+      return build_dir
     build_dir = DEFAULT_BUILD_DIR
 
     if 'RPMBUILD_BASEDIR' in user_config:
openSUSE Build Service is sponsored by