1
0
mirror of https://github.com/AR2000AR/openComputers_codes.git synced 2025-09-07 22:21:14 +02:00

[pm-get] added default repo

This commit is contained in:
2023-04-08 15:40:34 +02:00
parent b1b53d6ab3
commit f181c7ec8d
32 changed files with 395 additions and 26 deletions

3
.gitignore vendored
View File

@@ -3,4 +3,5 @@ updateFiles.bat
.vscode/
libGUI/libGUI/widget/Keypad.lua
/misc/
/pm/testpackages
/pm/testpackages
/packages/.prop

BIN
packages/autocrafter.tar Normal file

Binary file not shown.

Binary file not shown.

BIN
packages/bank_api.tar Normal file

Binary file not shown.

BIN
packages/bank_atm.tar Normal file

Binary file not shown.

BIN
packages/bank_client.tar Normal file

Binary file not shown.

BIN
packages/bank_dev_tools.tar Normal file

Binary file not shown.

BIN
packages/bank_server.tar Normal file

Binary file not shown.

BIN
packages/crypttool.tar Normal file

Binary file not shown.

BIN
packages/dns_common.tar Normal file

Binary file not shown.

BIN
packages/dns_server.tar Normal file

Binary file not shown.

BIN
packages/door_ctrl.tar Normal file

Binary file not shown.

BIN
packages/instgen.tar Normal file

Binary file not shown.

Binary file not shown.

BIN
packages/libcb.tar Normal file

Binary file not shown.

BIN
packages/libclass.tar Normal file

Binary file not shown.

BIN
packages/libcoin.tar Normal file

Binary file not shown.

BIN
packages/libgui.tar Normal file

Binary file not shown.

BIN
packages/libgui_extra.tar Normal file

Binary file not shown.

BIN
packages/libtar.tar Normal file

Binary file not shown.

BIN
packages/lnfsc.tar Normal file

Binary file not shown.

BIN
packages/lnfss.tar Normal file

Binary file not shown.

340
packages/manifest Normal file
View File

@@ -0,0 +1,340 @@
{
["bank_api"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_api",
["version"] = "oppm",
["name"] = "Bank API",
["repo"] = "tree/master/bank_api",
["description"] = "API used to send request to the bank server",
["note"] = "You will need to set the server address",
["authors"] = "AR2000AR",
["archiveName"] = "bank_api.tar"
},
["libcb"] = {
["manifestVersion"] = "1.0",
["package"] = "libcb",
["version"] = "oppm",
["name"] = "libCB",
["repo"] = "tree/master/libCB",
["description"] = "library used to read and write CB",
["note"] = "CB are unmanaged floppies",
["authors"] = "AR2000AR",
["archiveName"] = "libcb.tar"
},
["bank_dev_tools"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_dev_tools",
["version"] = "oppm",
["name"] = "bank_dev_tools",
["repo"] = "tree/master/bank_dev_tools",
["description"] = "collection of tools used to help in the bank software development",
["note"] = "DEV ONLY",
["authors"] = "AR2000AR",
["archiveName"] = "bank_dev_tools.tar"
},
["bank_server"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_server",
["version"] = "oppm",
["name"] = "Bank server",
["repo"] = "tree/master/bank_server",
["description"] = "The bank server service",
["note"] = "enable it with the rc command",
["authors"] = "AR2000AR",
["dependencies"] = {
["libcb"] = "oppm"
},
["archiveName"] = "bank_server.tar"
},
["libgui"] = {
["manifestVersion"] = "1.0",
["package"] = "libgui",
["version"] = "oppm",
["name"] = "libGUI",
["repo"] = "tree/master/libGUI",
["description"] = "library used to create gui \n The library can load \"pam\" images",
["note"] = "transparency in pam image isn't fully supported. Only fully transparent pixel are recognized as such",
["authors"] = "AR2000AR",
["dependencies"] = {
["libclass"] = "oppm"
},
["archiveName"] = "libgui.tar"
},
["libgui_extra"] = {
["manifestVersion"] = "1.0",
["package"] = "libgui_extra",
["version"] = "oppm",
["name"] = "libGUI-extra",
["repo"] = "tree/master/libGUI-extra",
["description"] = "more widgets for the libGUI",
["authors"] = "AR2000AR, thofi",
["dependencies"] = {
["libgui"] = "oppm"
},
["archiveName"] = "libgui_extra.tar"
},
["bank_client"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_client",
["version"] = "oppm",
["name"] = "bank client app",
["repo"] = "tree/master/bank_client",
["description"] = "The client app for the banker",
["note"] = "WIP",
["authors"] = "AR2000AR, thofi",
["dependencies"] = {
["libgui"] = "oppm",
["libgui_extra"] = "oppm",
["bank_api"] = "oppm",
["libcb"] = "oppm"
},
["archiveName"] = "bank_client.tar"
},
["item_id_catcher"] = {
["manifestVersion"] = "1.0",
["package"] = "item_id_catcher",
["version"] = "oppm",
["name"] = "itemIdCatcher",
["repo"] = "tree/master/itemIdCatcher",
["description"] = "Write id of item in the chest on the top to a file",
["note"] = "item are moved to a other chest",
["authors"] = "AR2000AR",
["archiveName"] = "item_id_catcher.tar"
},
["libclass"] = {
["manifestVersion"] = "1.0",
["package"] = "libclass",
["version"] = "oppm",
["name"] = "libClass",
["repo"] = "tree/master/libClass",
["description"] = "Class library for lua",
["authors"] = "AR2000AR",
["archiveName"] = "libclass.tar"
},
["libcoin"] = {
["manifestVersion"] = "1.0",
["package"] = "libcoin",
["version"] = "oppm",
["name"] = "libCoin",
["repo"] = "tree/master/libCoin",
["description"] = "small library used to moved coins from ordinarycoins from one chest to a other",
["authors"] = "AR2000AR",
["archiveName"] = "libcoin.tar"
},
["bank_atm"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_atm",
["version"] = "oppm",
["name"] = "bank atm",
["repo"] = "tree/master/bank_atm",
["description"] = "atm that work with my bank server",
["authors"] = "AR200AR",
["dependencies"] = {
["libgui"] = "oppm",
["bank_api"] = "oppm",
["libcb"] = "oppm",
["libcoin"] = "oppm",
["libgui_extra"] = "oppm"
},
["archiveName"] = "bank_atm.tar"
},
["door_ctrl"] = {
["manifestVersion"] = "1.0",
["package"] = "door_ctrl",
["version"] = "oppm",
["name"] = "Door controller",
["repo"] = "tree/master/doorCtrl",
["description"] = "Controll your doors with multiple redstone io block",
["authors"] = "AR2000AR",
["dependencies"] = {
["libgui"] = "oppm",
["libclass"] = "oppm"
},
["configFiles"] = {
"/etc/doorCtrl.conf"
},
["archiveName"] = "door_ctrl.tar"
},
["autocrafter"] = {
["manifestVersion"] = "1.0",
["package"] = "autocrafter",
["version"] = "oppm",
["name"] = "AutoCrafter",
["repo"] = "tree/master/autocrafter",
["description"] = "User a robot linked via a linked card to craft item from a inventory",
["authors"] = "AR200AR",
["archiveName"] = "autocrafter.tar"
},
["stargate"] = {
["manifestVersion"] = "1.0",
["package"] = "stargate",
["version"] = "oppm",
["name"] = "Stargate Ctl",
["repo"] = "tree/master/stargate_crl",
["description"] = "GUI to controll stargates from SGCraft",
["authors"] = "AR2000AR",
["archiveName"] = "stargate.tar"
},
["vending"] = {
["manifestVersion"] = "1.0",
["package"] = "vending",
["version"] = "oppm",
["name"] = "Vending",
["repo"] = "tree/master/vending",
["description"] = "Vending machine program compatible with libCoin and bank_api",
["authors"] = "AR2000AR",
["dependencies"] = {
["libCoin"] = "oppm",
["bank_api"] = "oppm"
},
["archiveName"] = "vending.tar"
},
["bank_account_maker"] = {
["manifestVersion"] = "1.0",
["package"] = "bank_account_maker",
["version"] = "oppm",
["name"] = "Account maker",
["repo"] = "tree/master/account_maker",
["description"] = "Machine to create one account per player and dispense a credit card",
["authors"] = "AR2000AR",
["dependencies"] = {
["bank_api"] = "oppm"
},
["archiveName"] = "bank_account_maker.tar"
},
["lnfsc"] = {
["manifestVersion"] = "1.0",
["package"] = "lnfsc",
["version"] = "oppm",
["name"] = "Lua Network File System Client",
["repo"] = "tree/master/lnfs",
["description"] = "Let you mount a files ystem hosted by a other computer using lnfss and use it as if it was a local file system",
["authors"] = "AR2000AR",
["archiveName"] = "lnfsc.tar"
},
["lnfss"] = {
["manifestVersion"] = "1.0",
["package"] = "lnfss",
["version"] = "oppm",
["name"] = "Lua Network File System Server",
["repo"] = "tree/master/lnfs",
["description"] = "Share your local file system with other computers. Root folder is configurable in rc.cfg",
["authors"] = "AR2000AR",
["archiveName"] = "lnfss.tar"
},
["instgen"] = {
["manifestVersion"] = "1.0",
["package"] = "instgen",
["version"] = "oppm",
["name"] = "Repo installer",
["repo"] = "tree/master/repo-installer",
["description"] = "A set of tools for making installable floppies for OpenComputers from OPPM repositories.",
["authors"] = "Izaya, AR2000AR",
["archiveName"] = "instgen.tar"
},
["crypttool"] = {
["manifestVersion"] = "1.0",
["package"] = "crypttool",
["version"] = "oppm",
["name"] = "CryptTool",
["repo"] = "tree/master/crypttol",
["description"] = "Remount a filesystem and store everything as encrypted data. Use managed (default) floppy or HDD",
["authors"] = "AR2000AR",
["archiveName"] = "crypttool.tar"
},
["osinetwork"] = {
["manifestVersion"] = "1.0",
["package"] = "osinetwork",
["version"] = "oppm",
["name"] = "OSI Network stack",
["repo"] = "tree/master/network",
["description"] = "A close to official rfc emulation of the OSI layers for OpenOS. Include Ethernet, ARP, ICMP, UDP. Also provide a luasocket libe librairy",
["note"] = "Are provided : ping, ifup, ifdown, arp, nc, netstat. Any one of theses tools may be moved to a separate package at any time",
["authors"] = "AR2000AR",
["configFiles"] = {
"/etc/network/interfaces"
},
["archiveName"] = "osinetwork.tar"
},
["dns_common"] = {
["manifestVersion"] = "1.0",
["package"] = "dns_common",
["version"] = "oppm",
["name"] = "DNS common files",
["repo"] = "tree/master/dns_common",
["description"] = "basic files used by the dns server as well as the resolver library",
["authors"] = "AR2000AR",
["dependencies"] = {
["osinetwork"] = "oppm"
},
["configFiles"] = {
"/etc/resolv.conf"
},
["archiveName"] = "dns_common.tar"
},
["dns_server"] = {
["manifestVersion"] = "1.0",
["package"] = "dns_server",
["version"] = "oppm",
["name"] = "DNS server daemon",
["repo"] = "tree/master/dns_server",
["description"] = "this package provide the dns server",
["authors"] = "AR2000AR",
["dependencies"] = {
["dns_common"] = "oppm"
},
["archiveName"] = "dns_server.tar"
},
["nslookup"] = {
["manifestVersion"] = "1.0",
["package"] = "nslookup",
["version"] = "oppm",
["name"] = "nslookup",
["repo"] = "tree/master/nslookup",
["description"] = "cmd line tool to querry a name server",
["authors"] = "AR2000AR",
["dependencies"] = {
["dns_common"] = "oppm"
},
["archiveName"] = "nslookup.tar"
},
["libtar"] = {
["manifestVersion"] = "1.0",
["package"] = "libtar",
["version"] = "1.1.0",
["name"] = "libtar",
["repo"] = "tree/master/tar",
["description"] = "Librairy to extract and list the content of tar archive",
["authors"] = "AR2000AR, luarock",
["archiveName"] = "libtar.tar"
},
["pm"] = {
["manifestVersion"] = "1.0",
["package"] = "pm",
["version"] = "1.2.2",
["name"] = "pm Package Manager",
["repo"] = "tree/master/pm",
["description"] = "Package manager for OpenOS",
["authors"] = "AR2000AR",
["dependencies"] = {
["libtar"] = "oppm"
},
["archiveName"] = "pm.tar"
},
["pm_get"] = {
["manifestVersion"] = "1.0",
["package"] = "pm_get",
["version"] = "1.2.0",
["name"] = "pm get",
["repo"] = "tree/master/pm",
["description"] = "Download and install package for pm",
["authors"] = "AR2000AR",
["dependencies"] = {
["pm"] = "oppm"
},
["configFiles"] = {
"/etc/pm/sources.list"
},
["archiveName"] = "pm_get.tar"
}
}

BIN
packages/nslookup.tar Normal file

Binary file not shown.

BIN
packages/osinetwork.tar Normal file

Binary file not shown.

BIN
packages/pm.tar Normal file

Binary file not shown.

BIN
packages/pm_get.tar Normal file

Binary file not shown.

BIN
packages/stargate.tar Normal file

Binary file not shown.

BIN
packages/vending.tar Normal file

Binary file not shown.

View File

@@ -12,7 +12,7 @@ local internet
local DOWNLOAD_DIR = "/home/.pm-get/" --can't use /tmp as some archive can be bigger than the tmpfs
local CONFIG_DIR = "/etc/pm/" --share the config directory with the rest of the package manager
local SOURCE_FILE = CONFIG_DIR .. "sources.list"
local SOURCE_DIR = CONFIG_DIR .. SOURCE_FILE .. ".d/"
local SOURCE_DIR = SOURCE_FILE .. ".d/"
local REPO_MANIFEST_CACHE = CONFIG_DIR .. "manifests.cache"
local AUTO_INSTALLED = CONFIG_DIR .. "automaticlyInstalled"
@@ -40,23 +40,35 @@ local function getSources()
if (filesystem.exists(SOURCE_FILE) and not filesystem.isDirectory(SOURCE_FILE)) then
file = assert(io.open(SOURCE_FILE))
for url in file:lines() do
table.insert(sources, url)
if (not url:sub(1, 1) ~= "#") then
table.insert(sources, url)
end
end
file:close()
end
if (not filesystem.isDirectory(SOURCE_DIR)) then return sources end
for fileName in filesystem.list(SOURCE_DIR) do
file = assert(io.open(SOURCE_DIR .. fileName))
for url in file:lines() do
table.insert(sources, url)
if (filesystem.isDirectory(SOURCE_DIR)) then
for fileName in filesystem.list(SOURCE_DIR) do
if (fileName:match("%.list")) then
file = assert(io.open(SOURCE_DIR .. fileName))
for url in file:lines() do
if (not url:sub(1, 1) ~= "#") then
table.insert(sources, 1, url)
end
end
file:close()
end
end
end
for i, url in pairs(sources) do
if (url:match("^https://github.com/")) then
sources[i] = url:gsub("https://github.com/", "https://raw.githubusercontent.com/"):gsub("/tree/", "/"):gsub("/blob/", "/")
end
file:close()
end
return sources
end
---@return table<string,table<string,manifest>>
local function getRepoList()
local function getPackageList()
if (not reposRuntimeCache) then
if (not filesystem.exists(REPO_MANIFEST_CACHE)) then
printferr("No data. Run `pm-get upddate` or add repositorys")
@@ -74,7 +86,7 @@ end
---@param targetRepo? string
---@return manifest? manifest, string? originRepo
local function getPacket(name, targetRepo)
for repoName, repo in pairs(getRepoList()) do
for repoName, repo in pairs(getPackageList()) do
if (not targetRepo or repoName == targetRepo) then
if (repo[name]) then
return repo[name], repoName
@@ -223,7 +235,6 @@ local function update()
local repos = getSources()
local manifests = {}
for _, repoURL in pairs(repos) do
printf("Found repository : %s", repoURL)
local request = internet.request(repoURL .. "/manifest")
local ready, reason
repeat
@@ -231,19 +242,22 @@ local function update()
until ready or reason
if (not ready) then
printferr("Could not get manifest from %s\ns", repoURL, reason)
end
local data = ""
repeat
local read = request.read()
if (read) then data = data .. read end
until not read
request.close()
local pcalled
pcalled, data = pcall(serialization.unserialize, data)
if (pcalled == false) then
printferr("Invalid manifest for %s", repoURL)
request.close()
else
manifests[repoURL] = data
printf("Found repository : %s", repoURL)
local data = ""
repeat
local read = request.read()
if (read) then data = data .. read end
until not read
request.close()
local pcalled
pcalled, data = pcall(serialization.unserialize, data)
if (pcalled == false) then
printferr("Invalid manifest for %s", repoURL)
else
manifests[repoURL] = data
end
end
end
io.open(REPO_MANIFEST_CACHE, "w"):write(serialization.serialize(manifests)):close()
@@ -287,7 +301,7 @@ if (mode == "update") then
update()
elseif (mode == "list") then
args[1] = args[1] or ".*"
for repoName, repo in pairs(getRepoList()) do
for repoName, repo in pairs(getPackageList()) do
for package, manifest in pairs(repo) do
if (package:match("^" .. args[1])) then
printf("%s (%s)", package, manifest.version)
@@ -374,6 +388,19 @@ elseif (mode == "upgrade") then
for _, pkg in pairs(toUpgrade) do
install(pkg, false)
end
elseif (mode == "sources") then
if (args[1] == "list") then
local sources = getSources()
for _, s in pairs(sources) do
print(s)
end
elseif (args[1] == "add" and args[2]) then
--TODO check if exists
filesystem.makeDirectory(SOURCE_DIR)
assert(io.open(SOURCE_DIR .. "/custom.list", "a")):write(args[2] .. "\n"):close()
else
print("pm-get sources add|list")
end
else
printHelp()
os.exit(0)

View File

@@ -0,0 +1 @@
https://github.com/AR2000AR/openComputers_codes/tree/master/packages

View File

@@ -317,7 +317,7 @@
dependencies = {
["pm"] = "/"
},
version = "1.1.1"
version = "1.2.0"
name = "pm get",
description = "Download and install package for pm",
authors = "AR2000AR",