mirror of
https://github.com/AR2000AR/openComputers_codes.git
synced 2025-09-08 14:41:14 +02:00
[pm_get] update show the number of packages that can be upgraded
This commit is contained in:
@@ -337,7 +337,7 @@
|
||||
["pm_get"] = {
|
||||
["manifestVersion"] = "1.0",
|
||||
["package"] = "pm_get",
|
||||
["version"] = "1.3.3",
|
||||
["version"] = "1.3.4",
|
||||
["name"] = "pm get",
|
||||
["repo"] = "tree/master/pm",
|
||||
["description"] = "Download and install package for pm",
|
||||
|
Binary file not shown.
@@ -303,6 +303,22 @@ local function update()
|
||||
end
|
||||
end
|
||||
io.open(REPO_MANIFEST_CACHE, "w"):write(serialization.serialize(manifests)):close()
|
||||
|
||||
--check if packages need updating
|
||||
local canBeUpgraded = 0
|
||||
local remotePackages = getCachedPackageList()
|
||||
local installedPackages = pm.getInstalled()
|
||||
for pkgName, pkgManifest in pairs(installedPackages) do
|
||||
for src, srcManifests in pairs(remotePackages) do
|
||||
if (srcManifests[pkgName]) then
|
||||
if (compareVersion(srcManifests[pkgName].version, pkgManifest.version)) then
|
||||
canBeUpgraded = canBeUpgraded + 1
|
||||
break --next package
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
printf("%s package(s) can be upgraded", canBeUpgraded)
|
||||
end
|
||||
|
||||
local function printHelp()
|
||||
|
@@ -352,7 +352,7 @@
|
||||
dependencies = {
|
||||
["pm"] = "/"
|
||||
},
|
||||
version = "1.3.3"
|
||||
version = "1.3.4"
|
||||
name = "pm get",
|
||||
description = "Download and install package for pm",
|
||||
authors = "AR2000AR",
|
||||
|
Reference in New Issue
Block a user