FS#15581 - Needed: -Su foo and -Syu foo

Attached to Project: Pacman
Opened by Scott H (stonecrest) - Sunday, 19 July 2009, 17:37 GMT
Last edited by Xavier (shining) - Saturday, 12 September 2009, 10:55 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To Xavier (shining)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.2.2
Due in Version 3.4.0
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

The only way to currently install a new package is to use pacman -Sy foo. Pretty much every documentation source states this as the way to install a package without explaining that, in fact, one really should issue a -Syu afterwards. Otherwise, problems like  FS#15566  can happen. However, this is rarely documented and one can hardly blame users for not knowing the dangers of a standalone -Sy foo.

It seems to me that a standalone -Sy foo should be strongly discouraged then, but IMO, this can only happen if we actually have a command that installs a package that way it is intended to be done! That is, there should be -Su foo and -Syu foo commands that issue a (-S foo; -Su) or a (-Sy foo; -Su) respectively. Then we can update the documentation to officially sanction these operations and start to ween users off of issuing standalone -Sy foo's. The -Sy foo command would instead become more of an expert operation where one can update a package if they know what you're doing. Perhaps the command should even give a warning to this effect.
This task depends upon

Closed by  Xavier (shining)
Saturday, 12 September 2009, 10:55 GMT
Reason for closing:  Implemented
Additional comments about closing:  f53d9bab0ef2
Comment by Xavier (shining) - Monday, 20 July 2009, 09:11 GMT
Then you want to replace the 500 occurrences of pacman -Sy foo on the wiki by -Syu foo?
http://wiki.archlinux.org/index.php?title=Special:Search&ns0=1&redirs=0&search=pacman+Sy&limit=500&offset=0

I would be more in favor of something like the options Allan proposed :
http://bugs.archlinux.org/task/15566#comment47190

Anyway, supporting -Su foo and -Syu foo doesn't hurt, so I am not against this.
I am just not convinced it will solve the problem.
On the other hand, having right dependencies would solve the problem.

I would also like to know how other distribs / package managers handle this.
Comment by Allan McRae (Allan) - Monday, 20 July 2009, 10:31 GMT
> I would also like to know how other distribs / package managers handle this.

It is a lot easier without rolling release. Debian names its libraries (e.g.) libfoo5 and libfoo6 so the soname is in the name of the package as so dependencies on libraries versions are obviously stated directly.
Comment by Xavier (shining) - Monday, 20 July 2009, 12:10 GMT
Ah yeah, that's right. But it makes more sense to do that, doesn't it?
At least it has the big advantage that it would avoid any breakage.
Comment by Allan McRae (Allan) - Tuesday, 21 July 2009, 09:56 GMT
Back to discussing the feature request... I'm not sure we should implement this. There are legitimate cases where the use of "pacman -Sy <pkg>" is not a bad thing (e.g. on a non-rolling release system when you just added a repo). So a warning is really not an option here. We do not give a warning with other potentially dangerous operations (-Rd, -Rsc).

Pacman alreay gives us the tools to stop -Sy being an issue; versioned dependencies and provides. Although, they are difficult to get perfect on a rolling release system.
Comment by Gavin Bisesi (Daenyth) - Monday, 07 September 2009, 14:54 GMT
Personally I haven't been bitten by this... I wouldn't mind support for -Su foo, but a warning on -Sy foo would just be obnoxious
Comment by Dan McGee (toofishes) - Monday, 07 September 2009, 14:58 GMT
So the long and short of this: "-Syu pkgname" would generate a sysupgrade transaction that also has one (or more) additional packages in the target list? This seems pretty sane, and no reason not to support it, right?
Comment by Xavier (shining) - Monday, 07 September 2009, 15:04 GMT
Fine then, it took me less than 5 min to write a patch, which I think I even dropped.
I will just do it again, updating help/doc and stuff.

Loading...