fix logic error when computing packages to install during update