aptitude should support attaching arbitrary collections of tags to packages. This is not debtags; instead, I want users to be able to create tags that have a functional meaning on their system.
Use cases
DONE User installs packages with the (not-existant) build-dep command and they all get tagged with "build-dep". They can be removed later with "aptitude remove ?tag(build-dep)". To keep the conceptual model simple, the user has to explicitly request a tag; if packages are removed they'll get the same tag, but the user can restrict tags using search terms.
User selects a bunch of packages in the user interface and attaches a "look at these later" tag.
Implementation
DONE Tags will be stored in pkgstates or maybe in the apt state file if that's extensible enough. (need to investigate) currently in pkgstates
A command in the visual interface to add a tag to a package should be created.
The visual interface should support editing the list of tags of a package. This is a bit awkward due to the stupid tree interface we're saddled with, but there's probably a way to fix it (even if it involves writing a non-stupid tree widget).
Command-line actions should get an extra
--tagfield containing a tag that should be applied to any packages altered by the command. e.g.,aptitude safe-upgrade --tag upgrade-2007-12-07. DONE, under the name--add-user-tag.Command-line actions should also get fields:
--install-tag--upgrade-tag--remove-tag--add-tag TAG PATTERN
where the first three tag only packages being installed, upgraded, or removed, and the last tags packages that match the pattern.
DONE, but only one option was added:
--add-user-tag-to TAG PATTERNA new command-line action
add-tagshould be added to apply a tag to any package matching a pattern:aptitude add-tag TAG PATTERN ...DONE, the command is
add-user-tagA counterpart
remove-tagtoadd-tagshould be added to remove a tag.aptitude remove-tag TAG PATTERN ...DONE, the command is
remove-user-tagTag names should be able to use substitution variables: e.g.,
aptitude full-upgrade --tag 'full-upgrade-${DATE}'.--tagand/or--add-tagshould have config-file equivalents. e.g.,Aptitude::Add-Tag { ArbitraryName { Tag "full-upgrade-${DATE}"; Pattern "~ainstall|~aupgrade"; }
Open questions
Can the tags have values? e.g., should we set "installed-on-2007-12-07" or "installed-on: 2007-12-07"? Obviously valued tags are more general, esp. if values are optional.
Tags do not have values, for simplicity.