From 9c988421321795c334876f7ddbc1dfb2993da4dd Mon Sep 17 00:00:00 2001 From: Stefano Mazzocchi Date: Fri, 24 Dec 2010 20:05:57 +0000 Subject: [PATCH] ISSUE-295 use "mktemp" instead of creating files locally which makes it possible to install Refine under a different user than the one executing it on *nix systems git-svn-id: http://google-refine.googlecode.com/svn/trunk@1956 7d457c2a-affb-35e4-300a-418c747d4874 --- refine | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/refine b/refine index 176e25d4a..c19ae4822 100755 --- a/refine +++ b/refine @@ -91,11 +91,15 @@ add_option() { } load_configs() { - cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > .$1 - . ./.$1 - rm ./.$1 + TEMP_CONFIG=$(mktemp -t refine.XXXXXXX) + if [ "${TEMP_CONFIG}" == "" ]; then + error "Could not create temporary file to load configurations" + fi + cat $1 | egrep "^[A-Z]" | sed 's/^\(.*\)$/export \1/' > ${TEMP_CONFIG} + . ${TEMP_CONFIG} + rm ${TEMP_CONFIG} } - + check_macosx() { if [ "$OS" != "macosx" ] ; then error "This action can only run on MacOSX" @@ -937,3 +941,5 @@ case "$ACTION" in dist) dist $1;; *) usage; ;; esac + +# ----------- end of file --------------------