Skip to content

Commit 71fd343

Browse files
author
Eric Chanudet
committed
part1: detailed error for control package
Provide more information on failure to extract the control package. Also simplify the tar command usage. Signed-off-by: Eric Chanudet <[email protected]>
1 parent 7437196 commit 71fd343

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

part1/stages/Functions/install-main

+8-3
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,19 @@ extract_control_package()
113113

114114
echo -e >&2 "Extracting control package" \
115115
"\nType: ${PACKAGE_TYPE}" \
116-
"\nFrom: ${PACKAGE_FILE}"
116+
"\nFrom: ${PACKAGE_FILE}" \
117+
"\nTo: ${CONTROL_DIR}"
117118

118119
case "${PACKAGE_TYPE}" in
119120
tarbz2)
120-
bunzip2 -q -c "${PACKAGE_FILE}" | tar -x -f - -C "${CONTROL_DIR}"
121+
if ! tar xjf "${PACKAGE_FILE}" -C "${CONTROL_DIR}"; then
122+
echo "ERROR: Failure to extract ${PACKAGE_FILE}" >&2
123+
return 1
124+
fi
121125

122126
if [ ! -x "${CONTROL_DIR}/${SUBGRAPH_SCRIPT}" ] ; then
123-
echo "ERROR: Failure to extract ${PACKAGE_FILE}">&2
127+
echo "ERROR: Invalid ${PACKAGE_FILE}, cannot find " \
128+
"${CONTROL_DIR}/${SUBGRAPH_SCRIPT}">&2
124129
return 1
125130
fi
126131
;;

0 commit comments

Comments
 (0)