diff --git a/pisi/operations/build.py b/pisi/operations/build.py index adf9bedb..d3c63273 100644 --- a/pisi/operations/build.py +++ b/pisi/operations/build.py @@ -488,7 +488,10 @@ class Builder: # we'll need our working directory after actionscript # finished its work in the archive source directory. curDir = os.getcwd() - os.chdir(self.srcDir) + if os.path.exists(self.srcDir): + os.chdir(self.srcDir) + else: + raise Error(_("ERROR: WorkDir (%s) does not exist\n") % (self.srcDir)) if func in self.actionLocals: if ctx.get_option('ignore_sandbox') or not ctx.config.values.build.enablesandbox: diff --git a/pisi/util.py b/pisi/util.py index 2809a4ff..bb39d7a2 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -446,7 +446,10 @@ def uncompress(patchFile, compressType="gz", targetDir=None): def do_patch(sourceDir, patchFile, level=0, name=None): """Apply given patch to the sourceDir.""" cwd = os.getcwd() - os.chdir(sourceDir) + if os.path.exists(sourceDir): + os.chdir(sourceDir) + else: + raise Error(_("ERROR: WorkDir (%s) does not exist\n") % (sourceDir)) if level == None: level = 0