Skip to content

Commit 403da08

Browse files
xumiayxieca
authored andcommitted
[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.
1 parent c71c63b commit 403da08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sonic-build-hooks/hooks/apt-get

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

0 commit comments

Comments
 (0)