[Build][Bug] Fix apt-get remove version not lock issue (#12193)

Why I did it
Fix apt-get remove/purge version not locked issue when the apt-get options not specified.

How I did it
Add a space character before and after the command line parameters.
This commit is contained in:
xumia 2022-10-11 07:59:14 +08:00 committed by GitHub
parent 9b2b8e3e86
commit df93a1be54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ if [ "$INSTALL" == y ]; then
[ "$lock_result" == y ] && release_apt_installation_lock
exit $command_result
else
if [[ "$1" == "purge" || "$@" == *" purge "* || "$@" == *" remove "* ]]; then
if [[ " $@ " == *" purge "* || " $@ " == *" remove "* ]]; then
# When running the purge command, collect the debian versions
dpkg-query -W -f '${Package}==${Version}\n' >> $POST_VERSION_PATH/purge-versions-deb
chmod a+wr $POST_VERSION_PATH/purge-versions-deb