Skip to content

ENT-12600: clean-buildmachine: Documented script #1766

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 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
26 changes: 19 additions & 7 deletions build-scripts/clean-buildmachine
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
#!/bin/sh

. `dirname "$0"`/functions
# This script cleans a build machine by uninstalling cfbuild and removing the
# contents of the PREFIX directory.
Comment on lines +3 to +4
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# This script cleans a build machine by uninstalling cfbuild and removing the
# contents of the PREFIX directory.
# This script cleans a build machine by uninstalling cfbuild and removing the contents of the PREFIX directory.

What is 'cfbuild'? ;) do you mean all the cfbuild- prefixed packages which are made by install-dependencies?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or maybe cfbuild to you means the built items in $PREFIX, typically /var/cfengine.

#
# Don't run this script on your dev machine! You may accidentally delete
# something very important.
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Don't run this script on your dev machine! You may accidentally delete
# something very important.
# Don't run this script on your dev machine! You may accidentally delete something very important.


. "$(dirname "$0")"/functions
. detect-environment

uninstall_cfbuild

if [ -z "$PREFIX" ] || [ "$PREFIX" = "/" ]; then
echo "$(basename "$0"): Error: \$PREFIX is not defined, is empty, or is set to the root directory. Aborting to prevent accidental deletion."
exit 1
fi

echo "$(basename "$0"): Debug: Cleaning build host by deleting $PREFIX"
case $OS in
aix)
sudo rm -rf "$PREFIX"/*
;;
*)
sudo rm -rf "$PREFIX"
;;
aix)
sudo rm -rf "$PREFIX"/*
;;
*)
sudo rm -rf "$PREFIX"
;;
esac
Loading