[Aptitude-devel] Bug#204614: mutt-like tag-foo would be VERY nice

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Sat Sep 5 11:57:59 UTC 2015


Control: tags -1 + moreinfo


Hello, submitters from the distant and not-so-distant past,

2003-08-08 19:42 Marcin Owsiany:
>Package: aptitude
>Version: 0.2.13-1
>Severity: wishlist
>
>You probably know the mutt feature called "tagging":
> - press capital "T",
> - enter a search expression,
> - use semicolon-foo, where foo is almost any command.
>
>That causes the command to be performed on all messages which matched
>the search expression.
>
>I would LOVE to see that in aptitude.

... and ...

2013-08-25 18:09 martin f krafft:
>Package: aptitude
>Followup-For: Bug #204614
>
>I was just about to file this issue again, when I had the hunch to
>search for "mutt" — and yes, someone before me has had this idea!
>
>Especially on slow machines, it's a real pain to have to wait after
>every action before I can navigate to the next package and apply the
>next action.
>
>Either tagging, or queuing of actions and multi-threaded navigation
>while actions are being computed would be great.


Replying from mutt, I can see what you mean and the usefulness of the
feature, and I just used it to reply to both.

Even if not exactly the same, I think that there are several ways to
accomplish what you want (specially the original request), with search
patterns [1] [2].  This works from the command line and from the curses
interface, e.g. limiting the view with 'l'.

  [1] http://aptitude.alioth.debian.org/doc/en/ch02s04.html

  [2] http://aptitude.alioth.debian.org/doc/en/ch02s04s05.html


For example, if one wants to purge all packages that were just removed
but still have config and data files around, one can:

  # aptitude purge ~c

To reinstall some sets of packages (multiarch system here, with amd64
and i386):

  # aptitude search '~n ^base-.*'
  i A base-files                   - Debian base system miscellaneous files
  p   base-files:i386              - Debian base system miscellaneous files
  i   base-passwd                  - Debian base system master password and group files
  p   base-passwd:i386             - Debian base system master password and group files

  # aptitude search '~n ^base-files ~ramd64'
  i A base-files                   - Debian base system miscellaneous files

  # aptitude reinstall '~n ^base-files ~ramd64'
  The following packages will be REINSTALLED:
    base-files
  0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 468 not upgraded.
  Need to get 0 B/78.5 kB of archives. After unpacking 0 B will be used.
  (Reading database ... 187579 files and directories currently installed.)
  Preparing to unpack .../base-files_9.4_amd64.deb ...
  Unpacking base-files (9.4) over (9.4) ...
  Processing triggers for install-info (6.0.0.dfsg.1-3) ...
  Processing triggers for man-db (2.7.2-1) ...
  Processing triggers for cracklib-runtime (2.9.2-1) ...
  Setting up base-files (9.4) ...


In the graphical interface, the patterns work in the same way if one
uses them with 'l' (again, like in mutt) -- it filters the list of
packages in the view, and only shows the packages matching the pattern.
It still groups the package list according to different criteria, but
users can change this, and use a "flat" view (Menu Views->New Flat
Package List) to not nest in Upgradable/libdevel/main (example below),
or one can change temporarily the grouping of the current view ('G' and
clearing the text, then OK; or selecting another prefered grouping;
saving it as default, whatever).

As an example, one can 'l'imit on '~s libdevel ~i ~U' (for "packages
matching section libdevel AND already installed AND new version
available a.k.a. upgradeable"), only this tree below will show:

  --\ Upgradable Packages (45)
    --\ libdevel - Development files for libraries (45)
      --\ main - The main Debian archive (45)
      i A   icu-devtools          52.1-10        55.1-4
      i A   libapt-pkg-dev        1.0.9.10       1.0.10.2
      i     libaqsis-dev          1.8.2-1        1.8.2-2
      i     libasprintf-dev       0.19.4-1       0.19.5.1-1
      i A   libbaloocore4         4:4.14.2-1.1   4:4.14.2-2
      i A   libbaloofiles4        4:4.14.2-1.1   4:4.14.2-2
      i A   libbaloopim4          4:4.14.2-1.1   4:4.14.2-2
      ...

Or all installed fonts-*, '~i ~n ^fonts*':

  --\ Installed Packages (12)
    --\ fonts - Fonts and font utilities (12)
      --\ main - The main Debian archive (12)
      i     fonts-dejavu          2.35-1         2.35-1
      i A   fonts-dejavu-core     2.35-1         2.35-1
      i     fonts-dejavu-extra    2.35-1         2.35-1
      i A   fonts-droid           1:4.4.4r2-7    1:4.4.4r2-7
      i A   fonts-freefont-ttf    20120503-4     20120503-4
      i A   fonts-gargi           2.0-4          2.0-4
      i A   fonts-liberation      1.07.4-1       1.07.4-1
      i     fonts-linuxlibertine  5.3.0-2        5.3.0-2
      i A   fonts-opensymbol      2:102.6+LibO5. 2:102.6+LibO5.
      i     fonts-oxygen          4:5.3.2-2      4:5.3.2-2
      i A   fonts-tlwg-waree      1:0.6.1-2      1:0.6.1-2
      i A   fonts-wqy-microhei    0.2.0-beta-2   0.2.0-beta-2

If one then clicks '+' or '_' on the first lines (or whatever other
allowed action), it will apply Install/Upgrade or Purge to all children
nodes rather than the individual packages.


I realise that this is a bit different than how one will sometimes tag
and apply actions to messages in mutt, because for example another use
of the tag feature like in mutt would also allow one to just go down the
list of all upgradable packages without a pre-determined set of packages
in mind to act upon, tag some that one deems safe/interesting to
upgrade, then apply 'Install' at the end, and no delay would happen at
every package, only at the end.

But I think that the way that I explained addresses quite well the
use-case of the original request at least, maybe less so for the second
request, but perhaps this workaround is enough.

If it is a good substitute, this would save from implementing another
command(and documenting, and fixing the implementation bugs of, and...).

What do you think?

--
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>



More information about the Aptitude-devel mailing list