Skip to content

ENT-12600: compile: Documented script #1775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions build-scripts/compile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh -x
#!/bin/sh

. "$(dirname "$0")"/functions
. detect-environment
Expand All @@ -12,21 +12,29 @@ case "$PROJECT" in
NOVA=yes
;;
*)
echo "Unknown project: $PROJECT"
echo "$(basename "$0"): Error: Unknown project: $PROJECT"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd do Unknown project '$PROJECT', but YMMV.

exit 42;;
esac

$MAKE -C "$BASEDIR"/core -k
$MAKE -C "$BASEDIR"/core install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make in core repo..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like functions deserves some new functions like log_error(), log_debug(),...

run_and_print_on_failure $MAKE -C "$BASEDIR"/core -k
echo "$(basename "$0"): Debug: Running make install in core repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/core install DESTDIR="$BASEDIR"/cfengine/dist

if [ "$NOVA" = yes ]; then
$MAKE -C "$BASEDIR"/enterprise -k
$MAKE -C "$BASEDIR"/enterprise install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make in enterprise repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/enterprise -k
echo "$(basename "$0"): Debug: Running make install in enterprise repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/enterprise install DESTDIR="$BASEDIR"/cfengine/dist
Comment on lines +40 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting to break it up separate for nova and the -k for keep going. I suppose these are reasonable but I wonder if just make install wouldn't make more sense. We should get about the same output. The advantage of -k is we get more of the problems with each run. I never use that option as I guess I would prefer to see the first error, fix it, repeat. Also if -j is anything but 1 I'm not sure if -k really buys us much in terms of readability.

if [ "$ROLE" = hub ]; then
$MAKE -C "$BASEDIR"/nova -k
$MAKE -C "$BASEDIR"/nova install DESTDIR="$BASEDIR"/cfengine/dist
$MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make in nova repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/nova -k
echo "$(basename "$0"): Debug: Running make install in nova repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/nova install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make install in masterfiles repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
fi
else
$MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
echo "$(basename "$0"): Debug: Running make install in masterfiles repo..."
run_and_print_on_failure $MAKE -C "$BASEDIR"/masterfiles install DESTDIR="$BASEDIR"/cfengine/dist
fi