aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph Wayne Norton <[email protected]>2012-12-08 14:47:48 +0900
committerJoseph Wayne Norton <[email protected]>2012-12-08 14:47:48 +0900
commit58f74f316678e62d47841f3c19cdf8ad0251b01b (patch)
tree9b263e12bc24dca7d265448ab729a31d20d6baa4
parent83ca3eb4f121606c145e5b71af89eb46282e1e8b (diff)
downloadkerl-58f74f316678e62d47841f3c19cdf8ad0251b01b.tar.gz
kerl-58f74f316678e62d47841f3c19cdf8ad0251b01b.tar.bz2
kerl-58f74f316678e62d47841f3c19cdf8ad0251b01b.zip
Force the name of the otp_src_.* directory to match expectations
The name of the otp_src_.* directory (e.g. otp_src_R15B03) may not always match with the name (e.g. otp_src_R15B03-1.tar.gz) of it's tarball file. The tar --strip-components option was purposely not used since this option might not be available all of the time.
-rwxr-xr-xkerl6
1 files changed, 5 insertions, 1 deletions
diff --git a/kerl b/kerl
index d50f7c5..fa7f881 100755
--- a/kerl
+++ b/kerl
@@ -326,7 +326,11 @@ do_build()
mkdir -p "$KERL_BUILD_DIR/$2"
if [ ! -d "$KERL_BUILD_DIR/$2/otp_src_$1" ]; then
echo "Extracting source code"
- cd "$KERL_BUILD_DIR/$2" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME"
+ UNTARDIRNAME="$KERL_BUILD_DIR/$2/otp_src_$1-kerluntar-$$"
+ rm -rf "$UNTARDIRNAME"
+ mkdir -p "$UNTARDIRNAME"
+ (cd "$UNTARDIRNAME" && tar xfz "$KERL_DOWNLOAD_DIR/$FILENAME" && mv * "$KERL_BUILD_DIR/$2/otp_src_$1")
+ rm -rf "$UNTARDIRNAME"
fi
echo "Building Erlang/OTP $1 ($2), please wait..."
ERL_TOP="$KERL_BUILD_DIR/$2/otp_src_$1"