From cdc0c79c90dfaf1cda3fa37ad9ac4fe43b44a779 Mon Sep 17 00:00:00 2001 From: Chenxiong Qi Date: Nov 28 2016 12:00:35 +0000 Subject: Give hint to scratch-build when build from local changes Resolves: BZ#841516 Signed-off-by: Chenxiong Qi --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index e9c06fc..2f817cf 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1865,7 +1865,13 @@ class Commands(object): # We don't have a url, so build from the latest commit # Check to see if the tree is dirty and if all local commits # are pushed - self.check_repo() + try: + self.check_repo() + except rpkgError as e: + msg = '{0}\n{1}'.format( + str(e), + 'Try option --srpm to make scratch build from local changes.') + raise rpkgError(msg) url = self._get_namespace_anongiturl(self.ns_module_name) + \ '?#%s' % self.commithash # Check to see if the target is valid