termux / termux-tools

Scripts and small programs that are packaged into termux's termux-tools package
GNU General Public License v3.0
284 stars 62 forks source link

[Idea]: more flexible repos management #34

Open Maxython opened 1 year ago

Maxython commented 1 year ago

I suggest creating a termux-set-repo command which allows you to disable or enable repos for apt or for pacman. How to implement it correctly, I can’t figure out how to do it in my head, so I’m waiting for your implementation proposal (if you’re interested, of course).

Maxython commented 1 year ago

Well, I have one idea how this can be implemented, but then will need to completely change the structure of the repos management of the service and mirrors.

So here's the idea: start storing all references to services and mirrors in files (let's call db) that will be located in $PREFIX/share/repos-db, thanks to which you can flexibly generate files in etc for package managers.

For example, the "db file" of the official termux apt service (packages.termux.dev) will look like this:

{
    "link": "https://packages.termux.dev/",
    "pm": "apt",
    "repo": {
        "main": {"arch": "all", "av": "new"},
        "root": {"arch": "all", "av": "new"},
        "x11": {"arch": "all", "av": "new"},
        "termux-main-21": {"arch": "all", "av": "old"}
    }
}

Explanation:

Yes, it all looks complicated (in addition to this, these are just my ideas), but I think that the result will be worth it :)

@Grimler91 and @agnostic-apollo