Skip to content
Snippets Groups Projects
Commit d9abe9a0 authored by Erik Alexandre Pucci's avatar Erik Alexandre Pucci
Browse files

build-{install,update}-package: Corrected error messages and exit(1)

parent eeab9ac7
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ test "$5" = '""' || PPASSWD=$5
# Check if $INEP is empty
if test -z "${INEP}"; then
printf "ERROR: Empty INEP.\n"
printf "ERROR (1): Empty INEP.\n"
exit 1
fi
# -----------------------------------------------------------------------------
......@@ -59,9 +59,9 @@ printf "Checking SEED2-run files integrity... "
for FILE in $(find "${MD5DIR}" -type f); do
if ! check_file_integrity "${FILE}"; then
printf "ERROR: File(s) corrupted. Please, re-create integrity or %b"
printf "ERROR (2): File(s) corrupted. Please, re-create integrity or %b"
"rebuild the agent files.\n"
exit 1
exit 2
fi
done
......@@ -78,8 +78,8 @@ mkdir -p "/tmp/${INEP}"
# Copy the agent files to the temporary directory where the installation package
# will be generated
if ! cp -r "${AGENT_FILES}/SEED2-run" "/tmp/${INEP}/SEED2"; then
printf "ERROR: Failed to copy agent files.\n"
exit 2
printf "ERROR (3): Failed to copy agent files.\n"
exit 3
fi
# Create client conf directory and the inep file with the school INEP
......@@ -112,9 +112,9 @@ md5sum "${FILE}" |cut -d' ' -f1 > \
# Copy the bootstrap-install to the temporary directory
if ! cp -r "${AGENT_FILES}/${BOOTSTRAP}" "/tmp/${INEP}"; then
printf "ERROR: Failed to copy ${BOOTSTRAP} to the %b" \
printf "ERROR (4): Failed to copy ${BOOTSTRAP} to the %b" \
"temporary directory.\n"
exit 3
exit 4
fi
printf "done.\n"
......@@ -126,8 +126,8 @@ printf "Packaging... "
cd "/tmp/${INEP}"
if ! tar -czf SEED2.tgz SEED2; then
printf "ERROR: Failed to compress the agent package.\n"
exit 4
printf "ERROR (5): Failed to compress the agent package.\n"
exit 5
fi
# Create the tar md5 and compute the bootstrap lines
......
......@@ -35,7 +35,7 @@ MD5DIRESC="$(echo ${MD5DIR} | sed "s/\./\\\./g")"
# Get the configuration
if ! source "${PREFIX}/buildpackage.conf" 2> /dev/null; then
printf "ERROR: Failed to load buildpackage.conf.\n"
printf "ERROR (1): Failed to load buildpackage.conf.\n"
exit 1
fi
......@@ -56,8 +56,8 @@ printf "====================\n\nStarting to build the package...\n\n"
# Check the readability of version file and get the version
if ! test -r "${VERSIONFILE}"; then
printf "ERROR: The version file is not readable. Aborting...\n"
exit 1
printf "ERROR (2): The version file is not readable. Aborting...\n"
exit 2
fi
VERSION=$(cat ${VERSIONFILE})
......@@ -73,9 +73,9 @@ printf "Checking SEED2-run files integrity... "
for FILE in $(find "${MD5DIR}" -type f); do
if ! check_file_integrity "${FILE}"; then
printf "ERROR: File(s) corrupted. Please, re-create integrity or %b"
printf "ERROR (3): File(s) corrupted. Please, re-create integrity or %b"
"rebuild the agent files.\n"
exit 1
exit 3
fi
done
......@@ -87,8 +87,8 @@ printf "Compressing SEED2-run files... "
TARFILE=$(tempfile --prefix=SEED2-tar)
if ! tar -czf "${TARFILE}" SEED2-run; then
printf "ERROR: Failed to compress the agent files.\n"
exit 2
printf "ERROR (4): Failed to compress the agent files.\n"
exit 4
fi
cd - &> /dev/null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment