[build]: check if package with given version is installed or not
in case conflicting packages have same name but different version, the install step needs to wait till package with the conflicting version is uninstalled Signed-off-by: Guohan Lu <lguohan@gmail.com>
This commit is contained in:
parent
83781b9459
commit
68086fc297
2
slave.mk
2
slave.mk
@ -530,7 +530,7 @@ $(SONIC_INSTALL_TARGETS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -inst
|
||||
while true; do
|
||||
# wait for conflicted packages to be uninstalled
|
||||
$(foreach deb, $($*_CONFLICT_DEBS), \
|
||||
{ while dpkg -s $(firstword $(subst _, ,$(basename $(deb)))) &> /dev/null; do echo "waiting for $(deb) to be uninstalled" $(LOG); sleep 1; done } )
|
||||
{ while dpkg -s $(firstword $(subst _, ,$(basename $(deb)))) | grep "^Version: $(word 2, $(subst _, ,$(basename $(deb))))" &> /dev/null; do echo "waiting for $(deb) to be uninstalled" $(LOG); sleep 1; done } )
|
||||
# put a lock here because dpkg does not allow installing packages in parallel
|
||||
if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then
|
||||
{ sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; }
|
||||
|
Reference in New Issue
Block a user