[pacman-dev] IgnorePkg handling
I just found another thing I overlooked in a patch I submitted a while ago : "Let IgnorePkg superceed the FORCE package flag" , commit 5de03497c3f. I didn't see a change Dan made one month before : "* --ignore was being ignored (haha) on sysupgrade when a package was listed as being a force upgrade. This adds a prompt to the user in this case asking what to do." , commit 4a0aac3862 . So the change I made in alpm_pkg_compare_versions made this fix from Dan in _alpm_sync_sysupgrade obsolete. This code can't be run anymore. So I don't know, maybe this commit could be reverted now?
On Nov 15, 2007 4:27 PM, Xavier
I just found another thing I overlooked in a patch I submitted a while ago : "Let IgnorePkg superceed the FORCE package flag" , commit 5de03497c3f.
I didn't see a change Dan made one month before : "* --ignore was being ignored (haha) on sysupgrade when a package was listed as being a force upgrade. This adds a prompt to the user in this case asking what to do." , commit 4a0aac3862 .
So the change I made in alpm_pkg_compare_versions made this fix from Dan in _alpm_sync_sysupgrade obsolete. This code can't be run anymore. So I don't know, maybe this commit could be reverted now?
Something like this? lib/libalpm/sync.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-) diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index e5748e6..16ea5c2 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -213,15 +213,6 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s alpm_pkg_get_name(local), alpm_pkg_get_version(local), alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); if(!_alpm_sync_find(trans->packages, alpm_pkg_get_name(spkg))) { - /* If package is in the ignorepkg list, ask before we add it to - * the transaction */ - if(_alpm_pkg_should_ignore(local)) { - int resp = 0; - QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, local, NULL, NULL, &resp); - if(!resp) { - continue; - } - } pmpkg_t *tmp = _alpm_pkg_dup(local); if(tmp == NULL) { goto error;
On Thu, Nov 15, 2007 at 04:41:59PM -0600, Dan McGee wrote:
On Nov 15, 2007 4:27 PM, Xavier
wrote: I just found another thing I overlooked in a patch I submitted a while ago : "Let IgnorePkg superceed the FORCE package flag" , commit 5de03497c3f.
I didn't see a change Dan made one month before : "* --ignore was being ignored (haha) on sysupgrade when a package was listed as being a force upgrade. This adds a prompt to the user in this case asking what to do." , commit 4a0aac3862 .
So the change I made in alpm_pkg_compare_versions made this fix from Dan in _alpm_sync_sysupgrade obsolete. This code can't be run anymore. So I don't know, maybe this commit could be reverted now?
Something like this?
lib/libalpm/sync.c | 9 --------- 1 files changed, 0 insertions(+), 9 deletions(-)
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index e5748e6..16ea5c2 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -213,15 +213,6 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
alpm_pkg_get_name(local), alpm_pkg_get_version(local),
alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg)); if(!_alpm_sync_find(trans->packages, alpm_pkg_get_name(spkg))) { - /* If package is in the ignorepkg list, ask before we add it to - * the transaction */ - if(_alpm_pkg_should_ignore(local)) { - int resp = 0; - QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, local, NULL, NULL, &resp); - if(!resp) { - continue; - } - } pmpkg_t *tmp = _alpm_pkg_dup(local); if(tmp == NULL) { goto error;
Yes, that looks fine. I should probably check the other places where should_ignore is used though.
On Fri, Nov 16, 2007 at 12:39:47PM +0100, Xavier wrote:
Yes, that looks fine. I should probably check the other places where should_ignore is used though.
I rather looked at where compare_versions was used. Only three times, two in sync.c (sysupgrade and addtarget) and one in db.c (get_upgrades duplicated from sysupgrade). In sysupgrade, there was, as I mentioned, an additional ignore check that was no longer used. In get_upgrades, there wasn't anything. And finally, in addtarget, there was a special ignore handling. So based on that, I thought the ignorepkg handling could be as well removed from compare_versions, and handled manually by the callers. By the way, isn't it rather strange that the ignorepkg handling in addtarget is made only when the package is locally installed? For example :
sudo pacman -S bash --ignore bash :: bash is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n sudo pacman -S arts --ignore arts resolving dependencies... done. looking for inter-conflicts... done.
Targets: xdg-utils-1.0.2-1 archlinux-menus-1.2-1 kde-common-3.5.8-1 audiofile-0.2.6-3 esd-0.2.38-3 arts-1.5.8-2 Total Download Size: 1.74 MB Proceed with installation? [Y/n]
On Fri, Nov 16, 2007 at 03:54:51PM +0100, Xavier wrote:
By the way, isn't it rather strange that the ignorepkg handling in addtarget is made only when the package is locally installed?
For example :
sudo pacman -S bash --ignore bash :: bash is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n sudo pacman -S arts --ignore arts resolving dependencies... done. looking for inter-conflicts... done.
Targets: xdg-utils-1.0.2-1 archlinux-menus-1.2-1 kde-common-3.5.8-1 audiofile-0.2.6-3 esd-0.2.38-3 arts-1.5.8-2
Total Download Size: 1.74 MB
Proceed with installation? [Y/n]
Thinking about it again, it seems alright to ignore IgnorePkg on -S operations. If someone has IgnorePkg = arts in pacman.conf, but explictly does a pacman -S arts, he probably wants to install it. And no one would ever do pacman -S arts --ignore arts, because that doesn't make any sense :)
And check the IgnorePkg handling is done correctly in the other places.
For example, -Qu and -Su will automatically skip the ignored packages (-Su will print a warning),
but -S will install ignored packages anyway, because it was asked explicitly.
Signed-off-by: Chantry Xavier
participants (3)
-
Chantry Xavier
-
Dan McGee
-
Xavier