FS#9228 - pacman asks about replacing packages before checking for a new pacman version

Attached to Project: Pacman
Opened by Roman Kyrylych (Romashka) - Wednesday, 16 January 2008, 12:19 GMT
Last edited by Dan McGee (toofishes) - Friday, 06 June 2008, 04:30 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Xavier (shining)
Architecture All
Severity Low
Priority Normal
Reported Version 3.1.0
Due in Version 3.2.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I've just installed 2007.08-2 (in a VirtualBox) and run -Syu.
Pacman asked if I want to replace slocate with mlocate first,
and only then reported about the new version available.

I think it should be more logical to check for a new version first.
However, I don't know if this is technically easy to fix, so feel free to close this as "Won't fix" if this is the case.
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 06 June 2008, 04:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 3.2 with SyncFirst option (commit d5278ebb3ba94efdc9fffb7924ac66b6747d9011 )
Comment by Dan McGee (toofishes) - Wednesday, 16 January 2008, 23:26 GMT
pacman -S <pkgname> in this case would do the job, right?

-Syu is meant to honor replaces, depends, provides, and conflicts and update your system to all the latest packages. Note that this is slightly different than the goal you imply above- "upgrade all packages currently on the system". Does the difference make sense? It is slight, but they are two goals that cannot always both be satisfied.
Comment by Aaron Griffin (phrakture) - Wednesday, 16 January 2008, 23:40 GMT
I think Roman is saying that it seems a little silly to see:

replace 'foo' with 'bar'? [Y/n] y
OMG New pacman. Upgrade to this? [Y/n]

The "OMG New pacman" should come first. I agree, but it's a fairly minor bug overall.
Comment by Roman Kyrylych (Romashka) - Wednesday, 16 January 2008, 23:52 GMT
Yes, exactly, Aaron.
Comment by Dan McGee (toofishes) - Thursday, 17 January 2008, 00:07 GMT
Wow, misread.

Sorry! Maybe for 3.1.2? It shouldn't be hard but someone will have to come up with a patch.
Comment by Xavier (shining) - Thursday, 17 January 2008, 17:04 GMT
I tried to look at this, but I am not sure how easy it is with the current libalpm. The interface seems a bit limited for this kind of stuff.
Comment by Aaron Griffin (phrakture) - Thursday, 17 January 2008, 20:37 GMT
Right. In an ideal world all "questions" would be in the front end, so this would be a simple fix. But because the questions are asked by the backend, we have some confusion here.
Comment by Xavier (shining) - Thursday, 17 January 2008, 20:58 GMT
Ah, good point.

However, that's not what I was thinking about, but I forgot to explain what I had in mind :
in the frontend, before calling sysupgrade, check if a newer version of pacman is available.
Then we could simply init a transaction with pacman as the only target (just like pacman -S pacman).

But the problem here is to check if a newer version of a package is available from the frontend.
Comment by Nagy Gabor (combo) - Saturday, 26 January 2008, 23:42 GMT
Well, maybe a bit off here, this check-for-new-version could be more general, with simple "-S foo" can be useful imho (can be enabled/disabled in pacman.conf).

So we could implement a check_for_new_version() function to the back-end [with parameters repo (or NULL for all), and pkgname]; and this could be called by the front-end before transaction start.
Comment by Xavier (shining) - Friday, 08 February 2008, 11:53 GMT
Attaching a patch which should fix this problem. It's a mix of my ideas and Nagy's ones (and we both did a part of the patch).
Comment by Xavier (shining) - Thursday, 15 May 2008, 20:41 GMT
A reworked patch has been applied :
http://projects.archlinux.org/?p=pacman.git;a=commitdiff;h=d5278ebb3ba94efdc9fffb7924ac66b6747d9011
So this is fixed in git now, for pacman 3.2 release.
Probably the following line should be added to the pacman.conf of the pacman-git and then pacman 3.2 packages :
SyncFirst = pacman

Loading...