From 30fdd56560e4a2d2c6b03ef635aaa5949800a4f7 Mon Sep 17 00:00:00 2001 From: Ingo Gottwald Date: Tue, 28 Aug 2012 11:28:50 +0200 Subject: [PATCH] Added cwd to tempdir in git clone method. Fixes usage with sudo. --- library/git | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/git b/library/git index 1bb5c94b0d..974a2e42f3 100755 --- a/library/git +++ b/library/git @@ -24,6 +24,7 @@ # that. Contribs welcome! -- MPD import re +import tempfile def get_version(dest): ''' samples the version of the git repo ''' @@ -40,7 +41,7 @@ def clone(repo, dest): except: pass cmd = "git clone %s %s" % (repo, dest) - cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=tempfile.gettempdir()) (out, err) = cmd.communicate() rc = cmd.returncode return (rc, out, err)