cassava / repoctl

Make it easy to manage your local Arch Linux repository.
MIT License
128 stars 13 forks source link

Support multiple repositories #4

Closed cassava closed 4 years ago

cassava commented 10 years ago

It should be possible to support multiple repositories via the config file.

Something like

[atlas]
repo = "/srv/abs/atlas.db.tar.gz"

[mercury]
repo = "/nfs/archlinux/mercury.db.tar.gz"

However, I do not want to introduce extra complexity unless it is necessary. If you want this therefore, please comment!

AladW commented 8 years ago

I think this would be useful if for example you want one repository for release packages, and a second for development versions (-git, -svn, etc).

AladW commented 8 years ago

Alternatively, if this is simpler you could instead add a switch which allows pointing to a configuration file, e.g.:

repoctl --config=custom.toml
repoctl --config=custom-vcs.toml
cassava commented 8 years ago

I agree that it's probably a better idea to use multiple configuration files for different profiles, as it allows you to just drop a config in the repoctl directory. A symbolic link default.toml would always point to the default configuration, which would be config.toml if not specified. This would then allow the setting of the default profile:

repoctl --set-profile custom
repoctl -P custom-vcs

and for temporarily using a certain profile with

repoctl --profile custom status
repoctl -p custom-vcs status

I'm just wondering if setting the profile and listing all the profiles should be a command and not a flag.

AladW commented 7 years ago

How about having a command for the default profile settings and also moving the functionality from "new" there? e.g. repoctl config set-profile, repoctl config new, repoctl config repo. Having besides that a flag to temporarily set the profile as you mentioned is also good to have.

cassava commented 7 years ago

That does sound like a good idea, thanks! Would you use multiple profiles? (I'd rather not put work in a feature no one will use.)

AladW commented 7 years ago

Well, I would definitely use the ability to use multiple repositories. Whether that's best done via multiple profiles, the ability to specify multiple entries in a single profile, or even some Include = foo ability, you're the best judge of that. :+1:

je-vv commented 5 years ago

The multiple repos specified on the same config, like the "atlas" and "mercury" ones in the example at the top, seem appealing.

cassava commented 4 years ago

Profiles will be supported in the 0.21 version release, and in fact already work in the devel branch.

See repoctl conf and it's subcommands repoctl conf show and repoctl conf migrate for more information on how to adjust the configuration file for multiple profiles.

Here's a preview:

    columnate = false
    color = "auto"
    quiet = false

    default_profile = "testing"

    [profiles.testing]
        repo = "/var/repos/testing/sirius.db.tar.zst"
        require_signature = false

    [profiles.release]
        repo = "/var/repos/release/sirius.db.tar.zst"
        require_signature = true
        backup = true
        backup_dir = "backup/"
        pre_action = ""
        post_action = "/var/repos/sync-release.sh"