Copilot commented on code in PR #13602: URL: https://github.com/apache/cloudstack/pull/13602#discussion_r3576864615
########## debian/cloudstack-common.postinst: ########## @@ -22,11 +22,11 @@ CLOUDUTILS_DIR="/usr/share/pyshared/" DIST_DIR=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") if which pycompile >/dev/null 2>&1; then Review Comment: Using `which` in a `/bin/sh` maintainer script is not POSIX and can fail if `which` isn’t installed, causing the postinst to abort under `set -e`. Prefer `command -v` for a reliable check. ########## debian/cloudstack-common.postinst: ########## @@ -22,11 +22,11 @@ CLOUDUTILS_DIR="/usr/share/pyshared/" DIST_DIR=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") if which pycompile >/dev/null 2>&1; then - pycompile -p cloudstack-common + pycompile -p cloudstack-common || echo "Warning: pycompile failed for cloudstack-common" >&2 fi if which pycompile >/dev/null 2>&1; then - pycompile -p cloudstack-common /usr/share/cloudstack-common + pycompile -p cloudstack-common /usr/share/cloudstack-common || true fi Review Comment: This `pycompile` invocation ignores failures silently (`|| true`). Since the intent is to proceed on failure, it should still emit a warning to stderr (like the previous block) to aid diagnosing packaging issues while keeping the install non-fatal. Also prefer `command -v` over `which` here for POSIX compatibility. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
