1
0
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:
2023-06-12 19:13:44 +02:00
parent e7b30c72d2
commit 7aaa9898d4
4 changed files with 18 additions and 2 deletions

View File

@@ -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.

View File

@@ -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()

View File

@@ -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",