From 58f74f316678e62d47841f3c19cdf8ad0251b01b Mon Sep 17 00:00:00 2001 From: Joseph Wayne Norton Date: Sat, 8 Dec 2012 14:47:48 +0900 Subject: 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. --- kerl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kerl') 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" -- cgit v1.2.3