From 8b0e40b3d40de5e62043ba9f2731dfcb6b480015 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 11 Jul 2004 20:02:57 +0000 Subject: [PATCH] * Always make source writable. svn path=/nixpkgs/trunk/; revision=1153 --- pkgs/stdenv/generic-branch/setup.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkgs/stdenv/generic-branch/setup.sh b/pkgs/stdenv/generic-branch/setup.sh index 44d6ec58c54..237ae21fa96 100644 --- a/pkgs/stdenv/generic-branch/setup.sh +++ b/pkgs/stdenv/generic-branch/setup.sh @@ -185,6 +185,8 @@ startLog() { ensureDir $logDir exec 3>&1 if test "$dontLogThroughTee" != 1; then + # Put this in an `eval' so that non-bash shells (or bash + # invoked as `sh') won't choke on parsing this file. eval "exec > >(tee $logDir/$logFile) 2>&1" else exec > $logDir/$logFile 2>&1 @@ -227,11 +229,8 @@ unpackFile() { *.zip) cmd="unzip $file";; *) if test -d "$file"; then - # Copy directories and add write permission (this is - # because such directories are usually in the store - # and are this read-only). stripHash $file - cmd="cp -prvd $file $strippedName && chmod -R +w $strippedName" + cmd="cp -prvd $file $strippedName" else if test -n "$findUnpacker"; then $findUnpacker $1; @@ -310,6 +309,13 @@ unpackW() { echo "source root is $sourceRoot" + # By default, add write permission to the sources. This is often + # necessary when sources have been copied from other store + # locations. + if test "dontMakeSourcesWritable" != 1; then + chmod -R +w $sourceRoot + fi + if test -n "$postUnpack"; then $postUnpack fi