Skip to content

Commit

Permalink
Bug 1328205 - Unbreak building and testing with 'build.sh -c' r=me
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Taubert committed Jan 10, 2017
1 parent 328c0ce commit 11fd576
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions build.sh
Expand Up @@ -158,9 +158,6 @@ dist_dir="$cwd"/../dist
dist_dir=$(mkdir -p "$dist_dir"; cd "$dist_dir"; pwd -P)
gyp_params+=(-Dnss_dist_dir="$dist_dir")

# save the chosen target
echo $target > "$dist_dir"/latest

# pass on CC and CCC to scanbuild
if [ "${#scanbuild[@]}" -gt 0 ]; then
if [ -n "$CC" ]; then
Expand All @@ -185,12 +182,26 @@ normalize_config()

gyp_config="$cwd"/out/gyp_config
nspr_config="$cwd"/out/$target/nspr_config

# If we don't have a build directory make sure that we rebuild.
if [ ! -d "$target_dir" ]; then
rebuild_nspr=1
rebuild_gyp=1
fi

# -c = clean first
if [ "$clean" = 1 ]; then
rebuild_gyp=1
rebuild_nspr=1
nspr_clean
rm -rf "$cwd"/out
rm -rf "$dist_dir"
mkdir -p "$dist_dir"
fi

# save the chosen target
echo $target > "$dist_dir"/latest

normalize_config "$gyp_config".new "${gyp_params[@]}"
if ! diff -q "$gyp_config".new "$gyp_config" >/dev/null 2>&1; then
rebuild_gyp=1
Expand All @@ -204,15 +215,6 @@ if [ ! -d "$dist_dir"/$target ] || \
rebuild_nspr=1
fi

# -c = clean first
if [ "$clean" = 1 ]; then
rebuild_gyp=1
rebuild_nspr=1
nspr_clean
rm -rf "$cwd"/out
rm -rf "$dist_dir"
fi

if [ "$rebuild_nspr" = 1 ]; then
nspr_build "${nspr_params[@]}"
mv -f "$nspr_config".new "$nspr_config"
Expand Down

0 comments on commit 11fd576

Please sign in to comment.