severity 312110 wishlist clone 312110 -1 retitle -1 Add a command to modify the state database without acting thanks
[we resolved this on IRC, so this is mostly for the peanut gallery] On Sunday 05 June 2005 10:40 am, Marc Haber wrote: > Hi, > > On Sun, Jun 05, 2005 at 10:29:51AM -0700, Daniel Burrows wrote: > > On Sunday 05 June 2005 08:52 am, Marc Haber wrote: > > > $ sudo aptitude markauto '.' > > > Couldn't find package ".", and more than 40 > > > packages contain "." in their name. > > > (no action results) > > > > > > A quick look into the source code shows that the 40 is hard-coded. It > > > should be at least configurable. > > > > Do you really want aptitude to spew out a list of 2846 suggestions (the > > count on my system of packages whose name contains '.') > > Actually, it should spit out a list of all packages on the system (or > act on all installed packages), since '.' is a regexp which hopefully > matches all package names. Yes, I would have realized what you were trying to do if I had thought for a few more seconds. The issue here is that unless you explicitly escape into the pattern language, aptitude assumes that each argument to "install" is a literal package name. The alternative would be horribly confusing to just about everyone when regexp metacharacters are part of package names. To use pattern language, include a tilde-escape somewhere in the argument; for instance, what you want above is 'aptitude install "~n."' . The error message that gets displayed is for human consumption, a sort of step below autocorrection (i.e., "you typed something that didn't make sense, here's my best guess at what you want"), and so it refuses to print more than 40 package names. Even 40 is arguably too many, but I wanted to leave a little headroom. My comment about "search" is because I thought you were somehow abusing this error message to try to search for packages; obviously wrong. > > etc. I can make this value configurable, it won't hurt, but the fact > > that you want to increase it suggests to me that you're trying to abuse > > the command to do something that would be better done using "search". > > The message you get from the "install" command is just a suggestion about > > ways you could correct the command you typed. > > Please notice that I didn't use the "install" command, but rather the > "markauto" command. Oops, that's true. I wasn't paying close attention because the code that parses command line parameters is shared between those two commands, so I tend to just use "install"'s behavior as a generic example. > Oh, btw, is there a way to have aptitude refrain from acting > immediately on a command from the command line? For example, I'd like > to be able to do > > aptitude upgrade > aptitude --visual-preview markauto '.' > > which will have me end up in an interactive aptitude session with all > upgradeable packages maked as "upgrade", and all packages being marked > as "automatically installed", so that I can manually select the > packages that should stay on the system. > > Currently, I am forced to upgrade packages which will be uninstalled > in the next step. Yes, this is a good idea. The possibility of a --no-act option or somesuch came up in the discussion of bug #253335, but it looks like I resolved that bug by adding --visual-preview and then promptly forgot about the other proposal. I'll clone this bug as a feature request for that. Is there a bug left here, or should I close #312110? I suppose it could be a documentation bug if the documentation doesn't make it clear enough that you have to add a tilde-escape to enter a regexp as an argument to "install" (or whatever). Daniel -- /------------------- Daniel Burrows <[EMAIL PROTECTED]> ------------------\ | The only thing worse than infinite recursion | | is infinite recursion. | \--- Be like the kid in the movie! Play chess! -- http://www.uschess.org --/
pgprYsgtpHxFx.pgp
Description: PGP signature