-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[features]: A attempt of env and package manager #46
Comments
Is it means (every)developer need to implement self-manager when write a package file (save status? |
For example, package may need to interact with package manager, but package manager obviously don't know how to install the package unless { -- part of configs.
windows: {
winget: {}
scoop: {}
raw: {}
}
ubuntu:{
apt:{}
raw: {}
}
} -- implement all for various versions and vendors(you can't avoid by pack into all-in-one, because every versions, vendors is siblings.) Another thing is many langs has its own version manager, you need to ponder wether to integrate that.(I personally don't recommend) |
example: -- 1.0.0 version package = {
name = "jdk-tools",
version = "1.0.0",
maintainer = "m-a",
deps = {
windows = {"w1", "w2"}
},
pm = {
windows = {"winget", "jdk.x.x"}
}
} -- 2.0.0 version ( fork ... package = {
name = "jdk-tools",
version = "2.0.0",
maintainer = "m-a",
deps = {
windows = {"w1", "w2"}
},
pm = {
windows = {"winget", "jdk.x.x"}
}
} package = {
name = "jdk-tools",
version = "2.0.0",
maintainer = "m-google",
deps = {
windows = {"w1", "w2", "w3"},
ubuntu = {"u1"},
arch_linux = {"a1", "a2"}
},
pm = {
windows = {"winget", "jdk.x.x"},
ubuntu = {"apt", "jdk-tools"},
arch_linux = {"pacman", "jdk-tools-2-g"}
}
} package = {
name = "jdk-tools",
version = "2.0.0",
maintainer = "m-microsoft",
deps = {
ubuntu = {"w2", "w3", "w4"}
},
pm = {
windows = {"winget", "jdk.x.x"},
arch_linux = {"pacman", "jdk-tools-microsoft"}
}
} if 'deps/attr/maintainer' have diff between old version and new version. it may be hard to all-in-one. |
I agree with this, we just need to abstract function as could as possble to reduce repetition.(
my suggestion is actually you can't pack it all in one, if there's variations, and you need to keep it consistent, you can't avoid by packing it all in one. I guess you misunderstand my suggestion. My real implementation is |
Here is an example, previously, I identify version as a factor without discrepancy. Now I take it as a special factor: local initKey(name, factors) -- factors to identify a independent sibling
return package_name .. ":" .. table.concat(factors, ":")
end
local packages = {}
local function add(name, factors, version, configs)
local key = initKey(name,factors)
package[key][version] = { configs, parent = "..." } -- maintain a relation of versions
end |
Features Describe | 功能描述
As the title. It's an attempt, so still vague for most of the parts.
Usage Scenario | 需求背景/使用场景
As I suggest, Package need to be a self-manager. In order to control env, the package need to store the variations of vendors, versions, even OS. why we don't separate to different packages? Because those packages have the same functionality and collide to each other. Package should be considered as a vertex contains all siblings.(every vertex should be depended on its parents and not its siblings.). To follow this design pattern, every feature should take its parents as an input to initialize itself.(For example, env manager should take OS manager as its input.)
Maybe Solutions | 可能的实现方案 - (if you are developer)
Additional context | 额外补充
The text was updated successfully, but these errors were encountered: