aboutsummaryrefslogtreecommitdiff
path: root/scripts/cbc_monolith
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunk@stsci.edu>2015-12-10 20:03:18 -0500
committerJoseph Hunkeler <jhunk@stsci.edu>2015-12-10 20:03:18 -0500
commite2d622813533fe1291da547688c0442a61a4ba21 (patch)
treef1d08ecef00e6a5326e88a1772c14a188397264d /scripts/cbc_monolith
parent1161b681e794ed034f6d43f5995dda71f7fbb5d0 (diff)
parentb004deb0eca736cb844cc927462b9e03e35a8287 (diff)
downloadcbc-e2d622813533fe1291da547688c0442a61a4ba21.tar.gz
Merge branch 'master' of bitbucket.org:jhunkeler/cbc1.3.2
Diffstat (limited to 'scripts/cbc_monolith')
-rwxr-xr-xscripts/cbc_monolith33
1 files changed, 27 insertions, 6 deletions
diff --git a/scripts/cbc_monolith b/scripts/cbc_monolith
index c8078dc..a55798c 100755
--- a/scripts/cbc_monolith
+++ b/scripts/cbc_monolith
@@ -1,6 +1,9 @@
#!/bin/bash
EXEC_PATH=$(dirname "${BASH_SOURCE[0]}")
source "$EXEC_PATH/cbc_functions.inc"
+# declare $OS and $ARCH (don't touch)
+get_os_info
+
LOGFILE="monolith.log"
LOGFILE_PREV="$LOGFILE.prev"
TMPDIR=/tmp
@@ -50,10 +53,22 @@ function build_prepare {
function build_prepare_branch()
{
- # This works, mostly. I need to implement a whitelist for git_url entries.
echo Building from branch: $BRANCH
CBC_HOME_ORIG="$CBC_HOME"
- export CBC_HOME="$(mktemp -u -d)"
+
+ mktemp_args=
+ case "$OS" in
+ osx)
+ export mktemp_args="-d -u -t $(basename $0)"
+ ;;
+ linux)
+ export mktemp_args="-u -d"
+ ;;
+ *)
+ ;;
+ esac
+
+ export CBC_HOME="$(mktemp $mktemp_args)"
mkdir -pv "$CBC_HOME"
echo "CBC_HOME=$CBC_HOME"
@@ -69,6 +84,11 @@ function build_prepare_branch()
# Redundant code alert... ugh (WILL FIX)
+ is_osx=
+ if [[ $OS == "osx" ]]; then
+ export is_osx=".orig"
+ fi
+
if [ -n "$BRANCH_MANIFEST" ]; then
while read pattern
do
@@ -78,8 +98,8 @@ function build_prepare_branch()
_OK=`success`
if [ $_OK -eq 0 ]; then
echo "Applying branch: $BRANCH -> $(dirname $f)"
- sed -i 's|git_tag|#git_tag|g' "$f" >/dev/null
- sed -i "/git_url/ a \ \ \ \ git_tag: '$BRANCH'" "$f" >/dev/null
+ sed -i$is_osx 's|git_tag|#git_tag|g' "$f" >/dev/null
+ sed -i$is_osx "/git_url/ a \ \ \ \ git_tag: '$BRANCH'" "$f" >/dev/null
fi
done
done < "$BRANCH_MANIFEST"
@@ -90,8 +110,8 @@ function build_prepare_branch()
_OK=`success`
if [ $_OK -eq 0 ]; then
echo "Applying branch $BRANCH -> $(dirname $f)"
- sed -i 's|git_tag|#git_tag|g' "$f" >/dev/null
- sed -i "/git_url/ a \ \ \ \ git_tag: '$BRANCH'" "$f" >/dev/null
+ sed -i$is_osx 's|git_tag|#git_tag|g' "$f" >/dev/null
+ sed -i$is_osx "/git_url/ a \ \ \ \ git_tag: '$BRANCH'" "$f" >/dev/null
fi
done
fi
@@ -227,6 +247,7 @@ do
shift
done
+
# DO NOT LOG THIS...
build_prepare
build_restart