made pkgman cleanly remove packages before updating them

This commit is contained in:
Izaya 2020-06-06 19:48:21 +10:00
parent f86f7d54ad
commit 89ab49faf6

View File

@ -128,6 +128,7 @@ function pkg.upgrade(force) -- boolean -- boolean -- Upgrades all packages on th
for repo,info in pairs(getSources()) do
for pkgname,pkg in pairs(getRepoMeta(repo)) do
if pkg.version ~= installed[pkgname].version or force then
pkg.remove(pkgname)
dl(info.path.."/"..pkg.filename,"/boot/pkg/"..pkg.filename)
installed[pkgname] = pkg
pcall(activatePackage,"/boot/pkg/"..pkg.filename,pkg.compressed)