termux-tools icon indicating copy to clipboard operation
termux-tools copied to clipboard

[Idea]: more flexible repos management

Open Maxython opened this issue 3 years ago • 1 comments

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 avatar Feb 06 '23 10:02 Maxython

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:

  • pm - for which package manager it belongs
  • av - which version of android repo is supported for ("new" for 7+ and "old" for 5/6)

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

Maxython avatar Feb 10 '23 12:02 Maxython