[pacman-dev] [arch-general] Package group xorg-video-drivers: intel conflict

Nathan Jones nathanj at insightbb.com
Sat Dec 15 11:01:52 EST 2007


On Mon, Dec 10, 2007 at 07:13:57PM +0100, Xavier wrote:
> On Mon, Dec 10, 2007 at 10:47:00AM -0600, Aaron Griffin wrote:
> > Hmm, it almost makes sense to do something of the sort:
> > 
> > int alpm_add_target(pmtrans_t *trans, const char *pkgname)
> > {
> >    ...
> >    if(is_ignored(pkgname)) {
> >       return PM_ERR_PKG_IGNORED;
> >    }
> >    ...
> > }
> > 
> > 
> > if(alpm_add_target(trans, "xorg-video-something") == PM_ERR_PKG_IGNORED) {
> >    puts("omg the package was ignored, panic panic!");
> > }
> > 
> > At least, that is how I'd think it through.
> > 
> 
> sync_addtarget had some sort of Ignore support before, but I didn't find it
> consistent :
> http://www.archlinux.org/pipermail/pacman-dev/2007-November/010112.html
> So I removed it in 8f824e70b. But clearly, I didn't take the group case in
> consideration.
> I dislike that we can't make the distinction between a group and a simple
> target here, but well.. Probably just having sync_addtarget always ignore the
> packages would be easier, like in what you are suggesting.

How about this patch? Xavier, this is different from what you removed in
8f824e70b because it is now sees if 'spkg' is ignored, not 'local'. Some
examples:

$ sudo pacman -S gnome-extra --ignore evince
:: group gnome-extra (including ignored packages):
    bug-buddy  dasher  eog  evince  file-roller  gcalctool  gconf-editor  gdm
    gedit  gnome-audio  gnome-games  gnome-mag  gnome-netstatus  gnome-nettool
    gnome-power-manager  gnome-python-desktop  gnome-system-monitor
    gnome-terminal  gnome-utils  gnome-volume-manager  gok  gucharmap
    nautilus-cd-burner  orca  seahorse  sound-juicer  tomboy  totem  vino
    zenity
:: Install whole content? [Y/n]
:: evince is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] n
resolving dependencies...
looking for inter-conflicts...

Targets: (no evince or dependencies here)

Total Download Size:    77.89 MB

Proceed with installation? [Y/n] n


$ sudo pacman -S arts --ignore arts    # arts is not installed
:: arts is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 
resolving dependencies...
looking for inter-conflicts...

Targets: kde-common-3.5.8-1 [0.11 MB]  arts-1.5.8-1 [1.35 MB]  

Total Download Size:    1.47 MB

Proceed with installation? [Y/n] n


$ sudo pacman -S bash --ignore bash    # bash is installed
:: bash is in IgnorePkg/IgnoreGroup. Install anyway? [Y/n] 
warning: bash-3.2.025-4 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets: bash-3.2.025-4 [0.40 MB]  

Total Download Size:    0.40 MB

Proceed with installation? [Y/n] n



From: Nathan Jones <nathanj at insightbb.com>
Date: Sat, 15 Dec 2007 10:48:00 -0500
Subject: [PATCH] Check ignored packages in _alpm_sync_addtarget().

This will allow someone to install a group but ignore individual
packages inside the group.

Signed-off-by: Nathan Jones <nathanj at insightbb.com>
---
 lib/libalpm/sync.c |    8 ++++++++
 src/pacman/sync.c  |    2 +-
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 065340c..7128fea 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -346,6 +346,14 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
 		RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
 	}
 
+	if(_alpm_pkg_should_ignore(spkg)) {
+		int resp;
+		QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, spkg, NULL, NULL, &resp);
+		if (!resp) {
+			return(0);
+		}
+	}
+
 	local = _alpm_db_get_pkgfromcache(db_local, alpm_pkg_get_name(spkg));
 	if(local) {
 		if(alpm_pkg_compare_versions(local, spkg) == 0) {
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index df102af..f6f82be 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -584,7 +584,7 @@ static int sync_trans(alpm_list_t *targets, int sync_only)
 						alpm_list_t *k;
 
 						found++;
-						printf(_(":: group %s:\n"), targ);
+						printf(_(":: group %s (including ignored packages):\n"), targ);
 						/* remove dupe entries in case a package exists in multiple repos */
 						const alpm_list_t *grppkgs = alpm_grp_get_pkgs(grp);
 						alpm_list_t *pkgs = alpm_list_remove_dupes(grppkgs);
-- 
1.5.3.7




More information about the pacman-dev mailing list