FS#24036 - Pacman should not lock the database when doing downloads
Attached to Project:
Pacman
Opened by Ng Oon-Ee (ngoonee) - Sunday, 01 May 2011, 23:26 GMT
Last edited by Dan McGee (toofishes) - Monday, 02 May 2011, 12:55 GMT
Opened by Ng Oon-Ee (ngoonee) - Sunday, 01 May 2011, 23:26 GMT
Last edited by Dan McGee (toofishes) - Monday, 02 May 2011, 12:55 GMT
|
Details
Summary and Info:
Currently, during a pacman -Syu, there are three 'steps':- 1. Updating of each repo database. (pacman -Sy) 2. Downloading of the packages to be updated. (pacman -Suw) 3. Performing the install. (pacman -Su) Based on my understanding (may be flawed), /var/lib/pacman/db.lck only NEEDS TO be locked during 1. and 3. I'd like to suggest that the lock be released during 2. Here's my own use-case when doing system maintainance:- A. Run pacman -Syu B. While waiting for the downloads (quite a while since I'm on a slow connection) I may check for AUR updates. C. If the updates are small, makepkg normally finishes before the download of step A completes. I'd like to simply be able to do the install at that point. Since (presumably) step 3 above is the equivalent of pacman -Su, the database is re-checked before the final update is applied anyway, so this should not break anything. |
This task depends upon
Closed by Dan McGee (toofishes)
Monday, 02 May 2011, 12:55 GMT
Reason for closing: Duplicate
Additional comments about closing: FS#23501
Monday, 02 May 2011, 12:55 GMT
Reason for closing: Duplicate
Additional comments about closing: FS#23501
The latter does all the target computation twice from scratch. If the database changed in the mean time, the targets of the second -Su can be completely different than the ones from the first -Suw.
And doing the target computation twice also means you need to answer all the conclicts/replaces/ignore/... questions twice.
Not doing it (as -Su does) means you can break some dependencies with the package install/upgrade you do in the meantime.
However, -Suw does not need to lock the repo, just the download cache/directory.
My opinion is that if a user is explicitly doing something while a download is being done he should know what to expect. In any case, if the check is done again prior to actual updating, it will just raise an error message, not break anything.
The biggest issue then is that all the questions need to be answered twice. I can't remember how (or whether) Xyne handled this with bauerbill, since it did downloads on its own I believe he may have parsed to dependency list himself, then allowed -Su to parse it again prior to actual installation.
So my follow-up suggestions:-
1. Simply implement as suggested here. Disadvantage is double-asking of questions, for all use-cases.
2. Implement this as a configurable (from a switch or pacman.conf) option. Much more work, I believe, for not very much gain.
3. -Suw not to ask questions, this may mean wastage of bandwidth if a person later decides not to update.
4. 'Save' the answers from the first round. This is also more work, and most probably brittle.
5. As a compromise, if -Suw is implemented so as not to lock the repo (with no other change to current pacman) the behaviour I'm looking for is easily scriptable.