[pacman-dev] [PATCH 0/3] Add "Usage" option for repos
I've been using these patches for a while now (see the author date on the actual patches) and would like to present them again for feedback. I've found it tremendously useful (particularly as an Arch packager) to be able to keep an eye on other repos like [staging] without actually having them enabled. Dave Reisner (3): libalpm: introduce a usage level for repos pacman: add front end support for repo usage level pactree: set full usage on DBs when registering doc/pacman.conf.5.txt | 18 +++++++++++++++ lib/libalpm/alpm.h | 22 ++++++++++++++++++ lib/libalpm/be_local.c | 1 + lib/libalpm/be_sync.c | 4 ++++ lib/libalpm/db.c | 22 ++++++++++++++++++ lib/libalpm/db.h | 1 + lib/libalpm/deps.c | 15 +++++++++++-- lib/libalpm/sync.c | 15 +++++++++++-- src/pacman/conf.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ src/pacman/sync.c | 11 +++++++++ src/util/pactree.c | 3 ++- test/pacman/tests/sync051.py | 17 ++++++++++++++ test/pacman/tests/sync052.py | 14 ++++++++++++ 13 files changed, 191 insertions(+), 5 deletions(-) create mode 100644 test/pacman/tests/sync051.py create mode 100644 test/pacman/tests/sync052.py -- 1.8.3.4
This defines a level of interest a user has in a repository. These are
described by the bitmask flags in the alpm_db_usage_t enum:
ALPM_DB_USAGE_SEARCH: repo is valid for searching
ALPM_DB_USAGE_INSTALL: repo is valid for installs (e.g. -S pkg)
ALPM_DB_USAGE_UPGRADE: repo is valid for sysupgrades
ALPM_DB_USAGE_ALL: all of the above are valid
Explicitly listing the contents of a repo will always be valid, and the
repo will always be refreshed appropriately on sync operations.
Signed-off-by: Dave Reisner
Add a "Usage" key to the repo section of the config which allows for the
tokens "Search", "Install", "Upgrade", "All", which correspond to values
in the alpm_db_usage_t enum. Users can specify "Usage" multiple times
for a given repo, or multiple flags per "Usage" line and they will be
OR'd together. If unspecified, the default is full usage of the repo.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
On 05/08/13 03:25, Dave Reisner wrote:
I've been using these patches for a while now (see the author date on the actual patches) and would like to present them again for feedback. I've found it tremendously useful (particularly as an Arch packager) to be able to keep an eye on other repos like [staging] without actually having them enabled.
+*Usage =* ...:: + Set the usage level for this repository. This option takes a list of tokens + which must be at least one of the following: + *Sync*;; + Enables refreshes for this repository. + *Search*;; + Enables searching for this repository. + *Install*;; + Enables installation of packages from this repository during a '\--sync' + operation. + *Upgrade*;; + Allows this repository to be a valid source of packages when
I like these patches, and I believe I had the last version of them on my working branch for a while. I have just one comment for some discussion: performing
+ a '\--sysupgrade'. + *All*;; + Enables all of the above features for the repository. This is the default + if not specified.
I think the description here needs to be clearer. Sync allows use to list the contents of the repo with -Sl? Search, Install and Upgrade obviously imply Sync. Does Install only allow explicit installation - i.e. "-S repo/foo", or is "-S foo" enough? Is Upgrade different from All? I would assume it implies Install (just by description). So here is my suggestion. Can we put these in an order where the higher up ones imply everything below? Sync < Search < Install < Upgrade == All Allan
On Mon, Aug 05, 2013 at 11:17:13AM +1000, Allan McRae wrote:
On 05/08/13 03:25, Dave Reisner wrote:
I've been using these patches for a while now (see the author date on the actual patches) and would like to present them again for feedback. I've found it tremendously useful (particularly as an Arch packager) to be able to keep an eye on other repos like [staging] without actually having them enabled.
I like these patches, and I believe I had the last version of them on my working branch for a while. I have just one comment for some discussion:
+*Usage =* ...:: + Set the usage level for this repository. This option takes a list of tokens + which must be at least one of the following: + *Sync*;; + Enables refreshes for this repository. + *Search*;; + Enables searching for this repository. + *Install*;; + Enables installation of packages from this repository during a '\--sync' + operation. + *Upgrade*;; + Allows this repository to be a valid source of packages when performing + a '\--sysupgrade'. + *All*;; + Enables all of the above features for the repository. This is the default + if not specified.
I think the description here needs to be clearer. Sync allows use to list the contents of the repo with -Sl?
Acting on a repo explicitly should ignore usage. I suppose I could make that clear.
Search, Install and Upgrade obviously imply Sync. Does Install only allow explicit installation - i.e. "-S repo/foo", or is "-S foo" enough?
If you set 'Install' for Usage, '-S foo' is sufficient.
Is Upgrade different from All? I would assume it implies Install (just by description).
-U has no concept of repos. Usage isn't relevant here.
So here is my suggestion. Can we put these in an order where the higher up ones imply everything below?
Sync < Search < Install < Upgrade == All
Allan
Hrmm. So, I suspect that 'Sync Search' will be the common alternative as 'Sync' or 'Search' on their own are not very useful, though 'Sync' alone will still allow for -S $repo/$pkg. 'Install' without 'Sync' *and* 'Search' isn't very useful either, but if you want the effects of all 3 of these, you simply don't specify usage. I'm +0 on the idea of adding a hierarchy. Anyone else have an opinion?
On 21/08/13 11:57, Dave Reisner wrote:
On Mon, Aug 05, 2013 at 11:17:13AM +1000, Allan McRae wrote:
On 05/08/13 03:25, Dave Reisner wrote:
I've been using these patches for a while now (see the author date on the actual patches) and would like to present them again for feedback. I've found it tremendously useful (particularly as an Arch packager) to be able to keep an eye on other repos like [staging] without actually having them enabled.
I like these patches, and I believe I had the last version of them on my working branch for a while. I have just one comment for some discussion:
+*Usage =* ...:: + Set the usage level for this repository. This option takes a list of tokens + which must be at least one of the following: + *Sync*;; + Enables refreshes for this repository. + *Search*;; + Enables searching for this repository. + *Install*;; + Enables installation of packages from this repository during a '\--sync' + operation. + *Upgrade*;; + Allows this repository to be a valid source of packages when performing + a '\--sysupgrade'. + *All*;; + Enables all of the above features for the repository. This is the default + if not specified.
I think the description here needs to be clearer. Sync allows use to list the contents of the repo with -Sl?
Acting on a repo explicitly should ignore usage. I suppose I could make that clear.
Search, Install and Upgrade obviously imply Sync. Does Install only allow explicit installation - i.e. "-S repo/foo", or is "-S foo" enough?
If you set 'Install' for Usage, '-S foo' is sufficient.
Is Upgrade different from All? I would assume it implies Install (just by description).
-U has no concept of repos. Usage isn't relevant here.
So here is my suggestion. Can we put these in an order where the higher up ones imply everything below?
Sync < Search < Install < Upgrade == All
Allan
Hrmm. So, I suspect that 'Sync Search' will be the common alternative as 'Sync' or 'Search' on their own are not very useful, though 'Sync' alone will still allow for -S $repo/$pkg. 'Install' without 'Sync' *and* 'Search' isn't very useful either, but if you want the effects of all 3 of these, you simply don't specify usage.
I'm +0 on the idea of adding a hierarchy. Anyone else have an opinion?
On IRC we discussed not adding the hierarchy and adding some more documentation. @Dave: are the patches on your branch good to go now? Allan
On Tue, Sep 03, 2013 at 04:02:07PM +1000, Allan McRae wrote:
On 21/08/13 11:57, Dave Reisner wrote:
On Mon, Aug 05, 2013 at 11:17:13AM +1000, Allan McRae wrote:
On 05/08/13 03:25, Dave Reisner wrote:
I've been using these patches for a while now (see the author date on the actual patches) and would like to present them again for feedback. I've found it tremendously useful (particularly as an Arch packager) to be able to keep an eye on other repos like [staging] without actually having them enabled.
I like these patches, and I believe I had the last version of them on my working branch for a while. I have just one comment for some discussion:
+*Usage =* ...:: + Set the usage level for this repository. This option takes a list of tokens + which must be at least one of the following: + *Sync*;; + Enables refreshes for this repository. + *Search*;; + Enables searching for this repository. + *Install*;; + Enables installation of packages from this repository during a '\--sync' + operation. + *Upgrade*;; + Allows this repository to be a valid source of packages when performing + a '\--sysupgrade'. + *All*;; + Enables all of the above features for the repository. This is the default + if not specified.
I think the description here needs to be clearer. Sync allows use to list the contents of the repo with -Sl?
Acting on a repo explicitly should ignore usage. I suppose I could make that clear.
Search, Install and Upgrade obviously imply Sync. Does Install only allow explicit installation - i.e. "-S repo/foo", or is "-S foo" enough?
If you set 'Install' for Usage, '-S foo' is sufficient.
Is Upgrade different from All? I would assume it implies Install (just by description).
-U has no concept of repos. Usage isn't relevant here.
So here is my suggestion. Can we put these in an order where the higher up ones imply everything below?
Sync < Search < Install < Upgrade == All
Allan
Hrmm. So, I suspect that 'Sync Search' will be the common alternative as 'Sync' or 'Search' on their own are not very useful, though 'Sync' alone will still allow for -S $repo/$pkg. 'Install' without 'Sync' *and* 'Search' isn't very useful either, but if you want the effects of all 3 of these, you simply don't specify usage.
I'm +0 on the idea of adding a hierarchy. Anyone else have an opinion?
On IRC we discussed not adding the hierarchy and adding some more documentation.
@Dave: are the patches on your branch good to go now?
Allan
Yeah, I rehashed some of the documentation to make it a bit clearler. What's on my branch should be good to go.
participants (3)
-
Allan McRae
-
Dave Reisner
-
Dave Reisner