From bharat@menalto.com  Sat Jul 12 21:52:08 2003
Return-Path: <bharat@menalto.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id ACFA637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Jul 2003 21:52:08 -0700 (PDT)
Received: from menalto.com (home.menalto.com [198.144.206.35])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4E93343F3F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Jul 2003 21:52:06 -0700 (PDT)
	(envelope-from bharat@menalto.com)
Received: from harmony.menalto.com (6xpajiokqfxzci2f@localhost [127.0.0.1])
	by menalto.com (8.12.9/8.12.9) with ESMTP id h6D4q2rv063536
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 12 Jul 2003 21:52:02 -0700 (PDT)
	(envelope-from bharat@harmony.menalto.com)
Received: (from bharat@localhost)
	by harmony.menalto.com (8.12.9/8.12.1/Submit) id h6D4q2PB063535;
	Sat, 12 Jul 2003 21:52:02 -0700 (PDT)
Message-Id: <200307130452.h6D4q2PB063535@harmony.menalto.com>
Date: Sat, 12 Jul 2003 21:52:02 -0700 (PDT)
From: Bharat Mediratta <bharat@menalto.com>
Reply-To: Bharat Mediratta <bharat@menalto.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: koma2@lovepeers.org
Subject: portupgrade ignores ALT_PKGDEP
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         54424
>Category:       ports
>Synopsis:       portupgrade ignores ALT_PKGDEP
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    daichi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 12 22:00:29 PDT 2003
>Closed-Date:    Wed Oct 19 07:49:04 GMT 2005
>Last-Modified:  Wed Oct 19 07:49:04 GMT 2005
>Originator:     Bharat Mediratta
>Release:        FreeBSD 4.8-RELEASE i386
>Organization:
menalto.com
>Environment:
System: FreeBSD harmony.menalto.com 4.8-RELEASE FreeBSD 4.8-RELEASE #3: Wed Apr 16 00:50:18 PDT 2003 bharat@harmony.menalto.com:/usr/obj/usr/src/sys/HARMONY i386


	

	portupgrade-20030427

>Description:
	
	pkgtools.conf contains a section called ALT_PKGDEP that allows you to 
	substitute one package dependency for another.  In my particular case,
	I want to install the "security/acid" port without having it install
	"databases/adodb", which is listed in the RUN_DEPENDS for the acid
	Makefile.

	In the ALT_PKGDEP section of pkgtools.conf I've tried the following
	settings:
	1.	'databases/adodb' => :delete,
	2.	'databases/adodb' => :skip,
	3.	'adodb' => :delete,
	4.	'adodb' => :skip,

	but none of them work.  A quick grep through the /usr/local/lib/ruby/site_ruby
	code shows that most of the other hashes defined in pkgtools.conf are
	referenced in the code, but ALT_PKGDEP isn't.  It looks like this feature
	was never implemented.  


>How-To-Repeat:
	
	Edit pkgtools.conf and modify ALT_PKGDEP to be:
		  ALT_PKGDEP = { 
		    'databases/adodb' => :delete, 
		  } 

	then do "portinstall acid" and see that it still tries to install adodb.

>Fix:
	Implement this function, or document the fact that it doesn't work in pkgtools.conf
	so that folks don't waste their time trying to get it working!
	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->knu 
Responsible-Changed-By: osa 
Responsible-Changed-When: Wed Jul 16 02:25:31 PDT 2003 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54424 

From: "Akinori MUSHA" <knu@iDaemons.org>
To: Bharat Mediratta <bharat@menalto.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: ports/54424: portupgrade ignores ALT_PKGDEP
Date: Sun, 20 Jul 2003 07:14:04 +0900

 At Sat, 12 Jul 2003 21:52:02 -0700 (PDT),
 Bharat Mediratta wrote:
 > >Description:
 > 	
 > 	pkgtools.conf contains a section called ALT_PKGDEP that allows you to 
 > 	substitute one package dependency for another.  In my particular case,
 > 	I want to install the "security/acid" port without having it install
 > 	"databases/adodb", which is listed in the RUN_DEPENDS for the acid
 > 	Makefile.
 
 ALT_PKGDEP does not work for that purpose.  It is, as described in the
 comment section, for updating already installed packages'
 depencencies.  If you thought it works when installing a new port, it
 might be my English problem.  It was regrettable that I made you think
 so without using the word "port(s)" in the section at all.
 
 Actually, it is impossible to implement the function you possibly
 want.  You can't make a port skip its dependencies and I wouldn't want
 to do that even if it were possible.  You should instead ask the
 maintainer to make the dependency optional, or propose and implement a
 selective dependency feature in the ports system.
 
 > 	In the ALT_PKGDEP section of pkgtools.conf I've tried the following
 > 	settings:
 > 	1.	'databases/adodb' => :delete,
 > 	2.	'databases/adodb' => :skip,
 > 	3.	'adodb' => :delete,
 > 	4.	'adodb' => :skip,
 > 
 > 	but none of them work.  A quick grep through the /usr/local/lib/ruby/site_ruby
 > 	code shows that most of the other hashes defined in pkgtools.conf are
 > 	referenced in the code, but ALT_PKGDEP isn't.  It looks like this feature
 > 	was never implemented.  
 
 It is pkgdb(1) that refers to the variable and automatically replace
 specified dependencies during a pkgdb -F session.
 
 > >How-To-Repeat:
 > 	
 > 	Edit pkgtools.conf and modify ALT_PKGDEP to be:
 > 		  ALT_PKGDEP = { 
 > 		    'databases/adodb' => :delete, 
 > 		  } 
 > 
 > 	then do "portinstall acid" and see that it still tries to install adodb.
 > 
 > >Fix:
 > 	Implement this function, or document the fact that it doesn't work in pkgtools.conf
 > 	so that folks don't waste their time trying to get it working!
 
 Things are not always made as you want them to be.  I should have
 documented that there are kinds of people who should not use
 portupgrade only to blame and demotivate the author.
 
 -- 
                      /
                     /__  __            Akinori.org / MUSHA.org
                    / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
 Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp
 
 "It seems to me as we make our own few circles 'round the sun
           We get it backwards and our seven years go by like one"

From: "Bharat Mediratta" <bharat@vasoftware.com>
To: "Akinori MUSHA" <knu@iDaemons.org>
Cc: <FreeBSD-gnats-submit@FreeBSD.org>
Subject: Re: ports/54424: portupgrade ignores ALT_PKGDEP
Date: Wed, 23 Jul 2003 13:41:27 -0700

 From: "Akinori MUSHA" <knu@iDaemons.org>
 > ALT_PKGDEP does not work for that purpose.  It is, as described in the
 > comment section, for updating already installed packages'
 > depencencies.  If you thought it works when installing a new port, it
 > might be my English problem.  It was regrettable that I made you think
 > so without using the word "port(s)" in the section at all.
 
 Obviously (from reading your entire email) by filing this bug I have
 offended and demotivated you and for that I apologize.  The port 
 tools that you have written are excellent and I appreciate them 
 every time I use them.  Furthermore, your comments demonstrate
 a mastery of the English language.
 
 However, in the spirit of providing constructive criticism that
 will hopefully lead to improving the experience for others, I
 must point out that it was totally unclear to me (and to at least 
 the one other person who I found via google who had this problem) 
 from the documentation that this particular feature applies only 
 to installed packages.  Even though you did not mention the 
 word "port" in the description, I only found this particular 
 configuration file from the portinstall/portupgrade(1) man page 
 so it was a natural conclusion for me to assume that it applied to 
 portinstall.
 
 Furthermore, your example snippet:
 
   #     # If you install Apache from source (not from ports/packages)
   #     'apache' => :delete,
 
 Appeared to have direct bearing upon my problem, where I have
 Apache installed from my own source and not from a package, but
 I cannot install other ports because they depend on apache.
 
 > Actually, it is impossible to implement the function you possibly
 > want.  You can't make a port skip its dependencies and I wouldn't want
 > to do that even if it were possible.  You should instead ask the
 > maintainer to make the dependency optional, or propose and implement a
 > selective dependency feature in the ports system.
 
 I am not by any means making the mistake of petulantly demanding
 that you implement a feature just because I want it.  However, I
 have certainly found that it is not only possible but beneficial
 for me to ignore certain dependencies for certain packages.  I
 use this capability judiciously and find it tremendously valuable.
 Unfortunately, at the moment I have to do this by modifying the
 RUN_DEPENDS defines in the Makefile.  I do agree though that the
 portupgrade system is perhaps not capabable of intercepting and
 making this change as appropriate and I should direct my energies
 elsewhere to resolve this.  That's unfortunate, because pkgtools.conf 
 would be a very nice place to capture this dependency modification.
 
 > > >Fix:
 > > Implement this function, or document the fact that it doesn't work 
 > > in pkgtools.conf so that folks don't waste their time trying to get 
 > > it working!
 > 
 > Things are not always made as you want them to be.  I should have
 > documented that there are kinds of people who should not use
 > portupgrade only to blame and demotivate the author.
 
 Again I apologize for offending you.  But I humbly suggest that you
 modify the comment to say something like this:
 
 "This is a hash to define alternative package dependencies for
  installed packages.  It is not applicable when installing new
  ports"
 
 That would have saved me an hour of my time, and perhaps it will
 forestall bug reports like this in the future.
 
 regards,
 -Bharat
 
 
State-Changed-From-To: open->feedback 
State-Changed-By: daichi 
State-Changed-When: Wed Jun 22 05:33:02 GMT 2005 
State-Changed-Why:  
Grab and over to new maintainer. 


Responsible-Changed-From-To: knu->daichi 
Responsible-Changed-By: daichi 
Responsible-Changed-When: Wed Jun 22 05:33:02 GMT 2005 
Responsible-Changed-Why:  
Grab and over to new maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54424 

From: KOMATSU Shinichiro <koma2@lovepeers.org>
To: Bharat Mediratta <bharat@vasoftware.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, Akinori MUSHA <knu@iDaemons.org>,
	daichi@FreeBSD.org
Subject: Re: ports/54424: portupgrade ignores ALT_PKGDEP
Date: Tue, 18 Oct 2005 15:40:09 +0900

 Hello. I am a new maintainer of portupgrade.
 
 I read ports/54424 and found that:
 
 (1) PKG_ALTDEP does not work as expected, so apply the patch to fix it.
 (2) It is unclear that PKG_ALTDEP is treated when "pkgdb -F" is executed,
     so clarify it in the document. 
 
 If you do not find any problem, I will ask some committer to commit
 this, and close this PR.
 
 
 diff --exclude=CVS --exclude=*.log* -urN sysutils/portupgrade.old/Makefile sysutils/portupgrade/Makefile
 --- sysutils/portupgrade.old/Makefile	Tue Aug  2 18:06:37 2005
 +++ sysutils/portupgrade/Makefile	Tue Oct 18 12:48:02 2005
 @@ -7,7 +7,7 @@
  
  PORTNAME=	portupgrade
  PORTVERSION=	20041226
 -PORTREVISION=	7
 +PORTREVISION=	8
  CATEGORIES=	sysutils
  MASTER_SITES=	ftp://ftp.iDaemons.org/pub/distfiles/ \
  		${MASTER_SITE_LOCAL}
 diff --exclude=CVS --exclude=*.log* -urN sysutils/portupgrade.old/files/patch-bin-pkgdb sysutils/portupgrade/files/patch-bin-pkgdb
 --- sysutils/portupgrade.old/files/patch-bin-pkgdb	Thu Jan  1 09:00:00 1970
 +++ sysutils/portupgrade/files/patch-bin-pkgdb	Tue Oct 18 11:58:13 2005
 @@ -0,0 +1,13 @@
 +Index: bin/pkgdb
 +===================================================================
 +--- bin/pkgdb	(revision 38)
 ++++ bin/pkgdb	(working copy)
 +@@ -615,7 +615,7 @@
 +       next
 +     end
 + 
 +-    if $pkgdb.match?(pat, dep)
 ++    if File.fnmatch?(pat, dep)
 +       case alt
 +       when :delete, :skip
 + 	return [alt]
 diff --exclude=CVS --exclude=*.log* -urN sysutils/portupgrade.old/files/patch-etc-pkgtools.conf sysutils/portupgrade/files/patch-etc-pkgtools.conf
 --- sysutils/portupgrade.old/files/patch-etc-pkgtools.conf	Thu Jan  1 09:00:00 1970
 +++ sysutils/portupgrade/files/patch-etc-pkgtools.conf	Tue Oct 18 12:47:34 2005
 @@ -0,0 +1,16 @@
 +Index: etc/pkgtools.conf
 +===================================================================
 +--- etc/pkgtools.conf	(revision 39)
 ++++ etc/pkgtools.conf	(revision 40)
 +@@ -252,8 +252,10 @@
 +   # be used as B values, instead of pkgname glob patterns.  <:delete>
 +   # means to delete the dependency and <:skip> to skip it.
 +   #
 +-  # cf. pkg_glob(1)
 ++  # This replacement is done when "pkgdb -F" is executed.
 +   #
 ++  # cf. pkg_glob(1), pkgdb(1)
 ++  #
 +   # e.g.:
 +   #   ALT_PKGDEP = {
 +   #     # If you use apache13-modssl instead of apache13
State-Changed-From-To: feedback->closed 
State-Changed-By: daichi 
State-Changed-When: Wed Oct 19 07:48:31 GMT 2005 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=54424 
>Unformatted:
