1
0
mirror of https://github.com/kepler155c/opus synced 2025-12-21 07:38:06 +00:00

packages stored in compressed state - experimental (with config option)

This commit is contained in:
kepler155c@gmail.com
2020-06-03 20:40:48 -06:00
parent 6009f22d8e
commit 6a3b38922b
5 changed files with 449 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ local function loadDirectory(dir)
return plugins
end
local programDir = fs.getDir(shell.getRunningProgram())
local programDir = fs.getDir(_ENV.arg[0])
local plugins = loadDirectory(fs.combine(programDir, 'system'), { })
local page = UI.Page {

View File

@@ -1,6 +1,9 @@
local BulkGet = require('opus.bulkget')
local Config = require('opus.config')
local Git = require('opus.git')
local LZW = require('opus.compress.lzw')
local Packages = require('opus.packages')
local Tar = require('opus.compress.tar')
local Util = require('opus.util')
local fs = _G.fs
@@ -100,6 +103,12 @@ local function install(name, isUpdate, ignoreDeps)
if not isUpdate then
runScript(manifest.install)
end
if Config.load('package').compression then
local c = Tar.tar_string(packageDir)
Util.writeFile(name .. '.tar.lzw', LZW.compress(c), 'wb')
fs.delete(packageDir)
end
end
if action == 'list' then