Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#9173 - HoldPkg rework is needed

Attached to Project: Pacman
Opened by Nagy Gabor (combo) - Saturday, 12 January 2008, 11:59 GMT
Last edited by Xavier (shining) - Wednesday, 14 January 2009, 13:45 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To Xavier (shining)
Architecture All
Severity Medium
Priority Normal
Reported Version git
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

As I see HoldPkg is not very useful now.

1. It can be defined in pacman.conf only
2. It is used to filter explicit targets only (imho if user does a "pacman -R holdpkg" then he _really_ wants to remove it)
3. So holdpkg has no effect on implicit targets: see -Rc, -Rs and -S replaces(?) <- I think this is the place where holpkg would be useful.

Ref.: http://www.archlinux.org/pipermail/pacman-dev/2007-November/010297.html
This task depends upon

Closed by  Xavier (shining)
Wednesday, 14 January 2009, 13:45 GMT
Reason for closing:  Implemented
Additional comments about closing:  Implemented in git by commit a888f377a5c805f1da24b556e6a4a9e3678d8eb3
Comment by Xavier (shining) - Sunday, 24 August 2008, 17:29 GMT
Nagy, would that patch work for you?
Comment by Nagy Gabor (combo) - Sunday, 24 August 2008, 19:29 GMT
Wow, you are very active nowadays ;-)

Well, the patch is much simpler than expected. With -R it seems perfect.

1. If I understand correctly, this won't work with -S replaces, right? Because sync_commit doesn't pass callback functions to the created remove transaction. But this can be changed easily.
2. And maybe do a trans != REMOVEUPGRADE check for safety (now we skip the prepare part of REMOVEUPGRADE, so this is not a real problem).
3. My first thought was after reading your simple (=> nice) patch: Couldn't we implement this in front-end? (Do this check just before remove_commit in front-end). Of course after moving the whole holdpkg stuff there?
Pro:
+ simpler, cleaner back-end
Contras:
- in backend, we can do more sophisticated stuffs with holdpkg than in front-end, if needed (for example: ask confirmation before pulling -Rs selected holdpkg _dependency_)
- in front-end we should implement this twice: for -R and for -S %REPLACES% (if we want that)
Comment by Xavier (shining) - Sunday, 24 August 2008, 20:28 GMT
1. Well, in my opinion, replacing is similar to upgrading in the sense that the functionality is preserved. So HoldPkg is not so important here.
2. Indeed, I saw it was skipped so I didn't add this check, but I agree it would be safer.
3. As you said, the current patch is very simple. Moving this to frontend would be a bit more work, and as you said, there are both advantages and inconvenient, so it is not clearly better. So I will propose this patch to Dan as it is. You are welcome to write a patch to move it to frontend if you like it better :)

To sum up, the only thing I am going to change to the patch is 2. (adding REMOVEUPGRADE check).
Thanks for the comments.
Comment by Xavier (shining) - Sunday, 24 August 2008, 20:33 GMT
Well, I changed my mind, I think the code is clear enough as it is :

/* skip all checks if we are doing this removal as part of an upgrade */
if(trans->type == PM_TRANS_TYPE_REMOVEUPGRADE) {
return(0);
}

So checking this again as the end of the remove_prepare function looks weird, and it adds another level to the code, which I dislike :)
Comment by Nagy Gabor (combo) - Sunday, 24 August 2008, 20:41 GMT
1. Well, this is the harder to implement;-) Without modification your patch will automatically refuse to replace a holdpkg package. Btw, I agree that replacement is similar to upgrade, so holdpkg handling is not important here, indeed.
3. But this just gave me one more reason for implement HoldPkg in front-end, it eliminated my second contra. Probably I will write my front-end version based on your patch. I am pretty sure now, that holdpkg shouldn't belong to libalpm.

And if we prefer simplicity (ie. we don't implement sophisticated holdpkg stuffs, like in my first contra), the --holdpkg option (the 1. point in my request) is useless.
Comment by Nagy Gabor (combo) - Sunday, 24 August 2008, 20:42 GMT
"Well, I changed my mind, I think the code is clear enough as it is :"
Indeed, I've missed that. Thx.
Comment by Xavier (shining) - Sunday, 24 August 2008, 20:56 GMT
Hmm ok then, I will wait for your frontend version :)
Comment by Nagy Gabor (combo) - Sunday, 24 August 2008, 22:08 GMT
Hm. I've just realised, that -S removes can happen due to conflict resolving. This is an edge case (conflict resolving + holdpkg), but I should have thought about that earlier :-/
Comment by Xavier (shining) - Sunday, 24 August 2008, 22:26 GMT
Don't worry about this case either. Usually when a package conflicts with another, it is because it provides the same thing (even the same files!).
So no problem.
Comment by Nagy Gabor (combo) - Sunday, 24 August 2008, 23:25 GMT
That's true, but I don't like these assumptions. Theoretically that case should be handled too.

1. Well, during this discussion I convinced myself about the fact that _atm_ HoldPkg is just a spam in alpm. If the simple "just before trans_commit check" is enough, I vote for keeping my ML patch, and implement -S removes check later. (I suspect that with universal transaction we can share this holdpkg check codepart easily between -S and -R.)

2. On the other side, I always kept holdpkg analogous to ignorepkg, that's why I was suprised when you showed me your cool small patch. To be more concrete, I like ignorepkg because I can _affect_ some libalpm mechanisms, see resolvedeps for example. With (an "advanced") holdpkg user could affect -Rs, which would mean: select all unused dependencies except holdpkg (that's why I first thought about --holdpkg option). In this case holdpkg-stuff asks confirmation for "adding holdpkg to transaction" not confirmation for "continue" (so HoldPkg acts like a filter similar to ignorepkg). Ignorepkg and holdpkg represent some kind of "hidden" packages in this interpretation.

So the question is, whether it is worth thinking about 2 or no? (In future?) If no, ie. we choose the simple holdpkg (pre-commit check), I can confirm my ML-patch.
Comment by Xavier (shining) - Monday, 25 August 2008, 06:21 GMT
1. Ok

2. I see your point and it is interesting, but in my opinion it is not that useful. I never felt the need for that, and never saw any user requesting it.
Comment by Nagy Gabor (combo) - Tuesday, 14 October 2008, 17:31 GMT
Status of this?
The patch is applied in my git repo.

Loading...