From nobody@FreeBSD.org  Mon May 28 18:46:35 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AF86016A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 May 2007 18:46:35 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 93AF313C447
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 May 2007 18:46:35 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l4SIkZg8052687
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 28 May 2007 18:46:35 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id l4SIkZYZ052685;
	Mon, 28 May 2007 18:46:35 GMT
	(envelope-from nobody)
Message-Id: <200705281846.l4SIkZYZ052685@www.freebsd.org>
Date: Mon, 28 May 2007 18:46:35 GMT
From: Artem Naluzhny<tut@nhamon.com.ua>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [PATCH] sysutils/libchk may skip $X11BASE now
X-Send-Pr-Version: www-3.0

>Number:         113099
>Category:       ports
>Synopsis:       [PATCH] sysutils/libchk may skip $X11BASE now
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    knu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 28 18:50:02 GMT 2007
>Closed-Date:    Tue Nov 17 22:56:48 JST 2009
>Last-Modified:  Tue Nov 17 22:56:48 JST 2009
>Originator:     Artem Naluzhny
>Release:        7.0-CURRENT
>Organization:
>Environment:
FreeBSD tut.intra 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Mon May 21 19:32:01 EEST 2007     root@tut.intra:/usr/obj/usr/src/sys/TUT  i386
>Description:
Since $X11BASE is a symlink to $LOCALBASE now (xorg 7.2 update), sysutils/libchk can skip searches for executables and libraries in following directories to reduce overall scanning time: $X11BASE/bin, $X11BASE/libexec and $X11BASE/sbin.
>How-To-Repeat:

>Fix:
diff -ruN libchk.bak/Makefile libchk/Makefile
--- libchk.bak/Makefile	Thu May 25 23:30:08 2006
+++ libchk/Makefile	Mon May 28 21:22:49 2007
@@ -7,6 +7,7 @@
 
 PORTNAME=	libchk
 PORTVERSION=	1.9
+PORTREVISION=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	ftp://ftp.iDaemons.org/pub/distfiles/ \
 		${MASTER_SITE_LOCAL}
diff -ruN libchk.bak/files/patch-libchk.1 libchk/files/patch-libchk.1
--- libchk.bak/files/patch-libchk.1	Thu Jan  1 03:00:00 1970
+++ libchk/files/patch-libchk.1	Mon May 28 21:26:33 2007
@@ -0,0 +1,30 @@
+--- libchk.1.orig	Sun May  2 21:56:10 2004
++++ libchk.1	Mon May 28 21:25:24 2007
+@@ -1,6 +1,6 @@
+ .\" $Idaemons: /home/cvs/libchk/libchk.1,v 1.6 2004/05/02 18:56:10 knu Exp $
+ .\"
+-.Dd September 2, 2002
++.Dd May 28, 2007
+ .Dt LIBCHK 1
+ .Os FreeBSD
+ .Sh NAME
+@@ -37,9 +37,6 @@
+ .It Pa $LOCALBASE/bin
+ .It Pa $LOCALBASE/libexec
+ .It Pa $LOCALBASE/sbin
+-.It Pa $X11BASE/bin
+-.It Pa $X11BASE/libexec
+-.It Pa $X11BASE/sbin
+ .El
+ .Pp
+ And the directories listed in
+@@ -123,9 +120,6 @@
+ .It Ev LOCALBASE
+ The local base directory. (default:
+ .Pa /usr/local )
+-.It Ev X11BASE
+-The X11 base directory. (default:
+-.Pa /usr/X11R6 )
+ .El
+ .Sh SEE ALSO
+ .Xr ldconfig 8
diff -ruN libchk.bak/files/patch-libchk.rb libchk/files/patch-libchk.rb
--- libchk.bak/files/patch-libchk.rb	Thu Jan  1 03:00:00 1970
+++ libchk/files/patch-libchk.rb	Mon May 28 21:27:07 2007
@@ -0,0 +1,30 @@
+--- libchk.rb.orig	Fri May 14 20:11:09 2004
++++ libchk.rb	Mon May 28 21:22:24 2007
+@@ -43,7 +43,6 @@
+   $strict = false
+ 
+   $localbase = ENV['LOCALBASE'] || '/usr/local'
+-  $x11base = ENV['X11BASE'] || '/usr/X11R6'
+ 
+   $bindirs = [
+     "/bin",
+@@ -55,9 +54,6 @@
+     "#{$localbase}/bin",
+     "#{$localbase}/libexec",
+     "#{$localbase}/sbin",
+-    "#{$x11base}/bin",
+-    "#{$x11base}/libexec",
+-    "#{$x11base}/sbin",
+   ]
+ 
+   $exclude_dirs = []
+@@ -96,8 +92,7 @@
+     opts.def_tail_option '
+ Environment Variables [default]:
+     PATH             command search path
+-    LOCALBASE        local base directory [/usr/local]
+-    X11BASE          X11 base directory [/usr/X11R6]'
++    LOCALBASE        local base directory [/usr/local]'
+ 
+     begin
+       init_global
diff -ruN libchk.bak/pkg-descr libchk/pkg-descr
--- libchk.bak/pkg-descr	Mon Sep  2 15:41:59 2002
+++ libchk/pkg-descr	Mon May 28 21:20:55 2007
@@ -11,4 +11,4 @@
 libraries that look obsolete.
 
 Author: Akinori MUSHA <knu@FreeBSD.org>
-WWW:	http://www.iDaemons.org/cgi-bin/cvsweb.cgi/libchk/
+WWW:	http://www.idaemons.org/projects/libchk/


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Mon May 28 18:50:09 UTC 2007 
State-Changed-Why:  
Awaiting maintainers feedback 

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

From: Rene Ladan <r.c.ladan@gmail.com>
To: bug-followup@FreeBSD.org
Cc: x11@freebsd.org
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Mon, 28 May 2007 21:18:02 +0200

 Edwin Groothuis wrote:
 > Maintainer of sysutils/libchk,
 > 
 > Please note that PR ports/113099 has just been submitted.
 > 
 > If it contains a patch for an upgrade, an enhancement or a bug fix
 > you agree on, reply to this email stating that you approve the patch
 > and a committer will take care of it.
 > 
 > The full text of the PR can be found at:
 >     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/113099
 > 
 
 According to ${PORTSDIR}/Mk/bsd.port.mk, ${X11BASE} now _defaults_ to 
 ${LOCALBASE}, but users can still choose to set ${X11BASE} to another 
 directory than ${LOCALBASE} when USE_NONDEFAULT_X11BASE is set (on my 
 box they're the same}
 
 I'm cc'ing x11@ to get some general consensus.
 -- 
 GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6 
 (subkeys.pgp.net)
 
 "It won't fit on the line."
 		-- me, 2001
 

From: Dejan Lesjak <dejan.lesjak@ijs.si>
To: freebsd-x11@freebsd.org
Cc: Rene Ladan <r.c.ladan@gmail.com>, bug-followup@freebsd.org,
        x11@freebsd.org
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Tue, 29 May 2007 23:22:34 +0200

 USE_NONDEFAULT_X11BASE is only relevant on FreeBSD before 6.2 (as we cant set 
 the default X11BASE in ports infrastructure there). On newer versions one can 
 define different X11BASE even without also setting USE_NONDEFAULT_X11BASE. 
 The ability to do that is left intentionally.
 Anyhow, perhaps a more general solution for libchk might be to skip $X11BASE 
 if it is the same as $LOCALBASE?
 
 Dejan

From: Rene Ladan <r.c.ladan@gmail.com>
To: knu@freebsd.org
Cc: Dejan Lesjak <dejan.lesjak@ijs.si>,  freebsd-x11@freebsd.org, 
 bug-followup@freebsd.org
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Wed, 30 May 2007 21:26:58 +0200

 This is a multi-part message in MIME format.
 --------------080601010909080703060101
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Dejan Lesjak wrote:
 > USE_NONDEFAULT_X11BASE is only relevant on FreeBSD before 6.2 (as we cant set 
 > the default X11BASE in ports infrastructure there). On newer versions one can 
 > define different X11BASE even without also setting USE_NONDEFAULT_X11BASE. 
 > The ability to do that is left intentionally.
 > Anyhow, perhaps a more general solution for libchk might be to skip $X11BASE 
 > if it is the same as $LOCALBASE?
 > 
 This sounds reasonable.  Akinori, what do you think of the attached patch?
 
 -- 
 GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6 
 (subkeys.pgp.net)
 
 "It won't fit on the line."
 		-- me, 2001
 
 
 --------------080601010909080703060101
 Content-Type: text/plain;
  name="libchk.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="libchk.diff"
 
 --- /usr/local/sbin/libchk	Mon May 28 01:27:15 2007
 +++ libchk2	Wed May 30 21:25:48 2007
 @@ -27,6 +27,8 @@
  # SUCH DAMAGE.
  #
  
 +# (rene) 20070530 : skip $X11BASE if $X11BASE == $LOCALBASE
 +
  RCS_ID = %q$Idaemons: /home/cvs/libchk/libchk.rb,v 1.9 2004/05/14 17:11:09 knu Exp $
  RCS_REVISION = RCS_ID.split[2]
  MYNAME = File.basename($0)
 @@ -55,10 +57,15 @@
      "#{$localbase}/bin",
      "#{$localbase}/libexec",
      "#{$localbase}/sbin",
 -    "#{$x11base}/bin",
 -    "#{$x11base}/libexec",
 -    "#{$x11base}/sbin",
    ]
 +
 +  if $x11base != $localbase
 +    $bindirs += [
 +      "#{$x11base}/bin",
 +      "#{$x11base}/libexec",
 +      "#{$x11base}/sbin",
 +    ]
 +  end
  
    $exclude_dirs = []
  end
 
 --------------080601010909080703060101--

From: "Akinori MUSHA" <knu@iDaemons.org>
To: Rene Ladan <r.c.ladan@gmail.com>
Cc: Dejan Lesjak <dejan.lesjak@ijs.si>,
	freebsd-x11@freebsd.org,
	bug-followup@freebsd.org
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Fri, 01 Jun 2007 19:49:20 +0900

 --pgp-sign-Multipart_Fri_Jun__1_19:49:20_2007-1
 Content-Type: text/plain; charset=US-ASCII
 
 Hi,
 
 At Wed, 30 May 2007 21:26:58 +0200,
 Rene Ladan wrote:
 > Dejan Lesjak wrote:
 > > USE_NONDEFAULT_X11BASE is only relevant on FreeBSD before 6.2 (as we
 > > cant set the default X11BASE in ports infrastructure there). On
 > > newer versions one can define different X11BASE even without also
 > > setting USE_NONDEFAULT_X11BASE. The ability to do that is left
 > > intentionally.
 > > Anyhow, perhaps a more general solution for libchk might be to skip
 > > $X11BASE if it is the same as $LOCALBASE?
 > >
 > This sounds reasonable.  Akinori, what do you think of the attached patch?
 
 > +  if $x11base != $localbase
 > +    $bindirs += [
 > +      "#{$x11base}/bin",
 > +      "#{$x11base}/libexec",
 > +      "#{$x11base}/sbin",
 > +    ]
 > +  end
 
 I suppose this would not make any difference to the behavior, since
 duplicated or redundant directories (descendant of another entry,
 etc.) are removed in compact_dirs!().
 
 The real problem might be that in that process libchk does not use
 realpath(3) to follow symlinks but just performs static, literal
 string matching.
 
 So if you have /usr/X11R6 symlinked to /usr/local, libchk will dive
 into the directory twice.
 
 Regards,
 
 --
                      /
                     /__  __            Akinori.org / MUSHA.org
                    / )  )  ) )  /     FreeBSD.org / Ruby-lang.org
 Akinori MUSHA aka / (_ /  ( (__(  @ iDaemons.org / and.or.jp
 
 "Different eyes see different things,
     Different hearts beat on different strings --
        But there are times for you and me when all such things agree"
 
 --pgp-sign-Multipart_Fri_Jun__1_19:49:20_2007-1
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.7 (FreeBSD)
 
 iD8DBQBGX/mwkgvvx5/Z4e4RAiXPAJ0UkXVCFJ/X5NV4MruxkntJojbivQCdGYmF
 aL6f7fFTbovxqN2rChmq5+Q=
 =HhdN
 -----END PGP SIGNATURE-----
 
 --pgp-sign-Multipart_Fri_Jun__1_19:49:20_2007-1--
Responsible-Changed-From-To: freebsd-ports-bugs->tmclaugh 
Responsible-Changed-By: tmclaugh 
Responsible-Changed-When: Sat Jul 7 20:48:02 UTC 2007 
Responsible-Changed-Why:  
Grab. 

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

From: Tom McLaughlin <tmclaugh@sdf.lonestar.org>
To: bug-followup@FreeBSD.org, tut@nhamon.com.ua
Cc:  
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Tue, 19 Feb 2008 21:39:36 -0500

 Sent a followup email to the maintainer to see what to do with this PR.
 I've seen two threads on different lists and neither has come to a
 resolution for this issue.
 -- 
 | tmclaugh at sdf.lonestar.org                 tmclaugh at FreeBSD.org |
 | FreeBSD                                       http://www.FreeBSD.org |
 

From: Ulrich Spoerlein <uspoerlein@gmail.com>
To: bug-followup@FreeBSD.org, tut@nhamon.com.ua,
        Tom McLaughlin <tmclaugh@sdf.lonestar.org>,
        Akinori MUSHA <knu@iDaemons.org>, Rene Ladan <r.c.ladan@gmail.com>
Cc:  
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Mon, 14 Apr 2008 17:46:22 +0200

 --AhhlLboLdkugWU4S
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi,
 
 I sent a (crude) patch for this to the author and maintainer yesterday.
 Attached is an IMHO better aproach to the whole lib path thing. It
 simply calls realpath() on all provided dirs, that way symlinks will be
 detected and weeded out.
 
 This can slightly alter the printed output of libchk(1) when your
 /usr/local/lib symlinks to /usr/local/amd64/lib or some such.
 
 But it also detects additional symlinked directories given on the
 command line or in $PATH.
 
 Please test and commit this patch, thanks!
 
 Cheers,
 Ulrich Spoerlein
 
 --AhhlLboLdkugWU4S
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="libchk.diff"
 
 --- libchk.rb.orig	2004-05-14 19:11:09.000000000 +0200
 +++ libchk.rb	2008-04-14 17:40:37.068840933 +0200
 @@ -33,6 +33,7 @@
  
  require 'optparse'
  require 'find'
 +require 'pathname'
  
  LDCONFIG_CMD = '/sbin/ldconfig -elf'
  OBJDUMP_CMD = '/usr/bin/objdump'
 @@ -267,9 +268,11 @@
  end
  
  def normalize_dir!(dir)
 -  # handle sequences of /'s (tr_s is not multibyte-aware, hence gsub)
 -  dir.gsub!(%r"//+", '/')
 -  dir.replace(File.expand_path(dir))
 +  begin
 +    dir.replace(Pathname.new(dir).realpath)
 +  rescue
 +    # No such file errors
 +  end
  
    return dir if dir == '/'
  
 
 --AhhlLboLdkugWU4S--

From: Rene Ladan <r.c.ladan@gmail.com>
To: Ulrich Spoerlein <uspoerlein@gmail.com>
Cc: bug-followup@FreeBSD.org, tut@nhamon.com.ua, 
 Tom McLaughlin <tmclaugh@sdf.lonestar.org>,
 Akinori MUSHA <knu@iDaemons.org>
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Mon, 14 Apr 2008 22:48:15 +0200

 Ulrich Spoerlein schreef:
 > Hi,
 > 
 > I sent a (crude) patch for this to the author and maintainer yesterday.
 [ Uhm yes, I only saw it today because I looking over 'my' PRs, I had
  to teach the gmail filter to not consider your mails as spam... ]
 
 > Attached is an IMHO better aproach to the whole lib path thing. It
 > simply calls realpath() on all provided dirs, that way symlinks will be
 > detected and weeded out.
 > 
 > This can slightly alter the printed output of libchk(1) when your
 > /usr/local/lib symlinks to /usr/local/amd64/lib or some such.
 > 
 > But it also detects additional symlinked directories given on the
 > command line or in $PATH.
 > 
 > Please test and commit this patch, thanks!
 > 
 I've just tested your patch from today, it seems to work fine on my box
 (with symlink /usr/X11R6 -> /var/empty).  libchk now looks into:
         /bin
         /lib
         /sbin
         /usr/bin
         /usr/games
         /usr/lib
         /usr/libexec
         /usr/local/bin
         /usr/local/lib
         /usr/local/libexec
         /usr/local/sbin
         /usr/sbin
 
 (no double entries, no /usr/X11R6).  The output seems to be correct too.
 
 Regards,
 Rene
 -- 
 http://www.rene-ladan.nl/
 
 GPG fingerprint = E738 5471 D185 7013 0EE0  4FC8 3C1D 6F83 12E1 84F6 (subkeys.pgp.net)

From: "Akinori MUSHA" <knu@iDaemons.org>
To: Ulrich Spoerlein <uspoerlein@gmail.com>
Cc: bug-followup@FreeBSD.org,
	tut@nhamon.com.ua,
	Tom McLaughlin <tmclaugh@sdf.lonestar.org>,
	Rene Ladan <r.c.ladan@gmail.com>
Subject: Re: ports/113099: [PATCH] sysutils/libchk may skip $X11BASE now
Date: Tue, 15 Apr 2008 14:35:53 +0900

 --pgp-sign-Multipart_Tue_Apr_15_14:35:53_2008-1
 Content-Type: text/plain; charset=US-ASCII
 
 Hi,
 
 I will look into your patches this weekend.  I think I had some
 problems when all symlinks are resolved, but I'll test them anyway.
 
 Regards,
 
 At Mon, 14 Apr 2008 17:46:22 +0200,
 Ulrich Spoerlein wrote:
 > I sent a (crude) patch for this to the author and maintainer yesterday.
 > Attached is an IMHO better aproach to the whole lib path thing. It
 > simply calls realpath() on all provided dirs, that way symlinks will be
 > detected and weeded out.
 >
 > This can slightly alter the printed output of libchk(1) when your
 > /usr/local/lib symlinks to /usr/local/amd64/lib or some such.
 >
 > But it also detects additional symlinked directories given on the
 > command line or in $PATH.
 >
 > Please test and commit this patch, thanks!
 
 --
 Akinori MUSHA / http://akinori.org/
 
 --pgp-sign-Multipart_Tue_Apr_15_14:35:53_2008-1
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.8 (FreeBSD)
 
 iEYEABECAAYFAkgEPrkACgkQkgvvx5/Z4e5VZQCfUjhGLCioJ1Apq6XLgDqYq2hi
 qQIAoJlxr1yC1ucE9Qo797pakT1MUvy4
 =Tfp0
 -----END PGP SIGNATURE-----
 
 --pgp-sign-Multipart_Tue_Apr_15_14:35:53_2008-1--
State-Changed-From-To: feedback->open 
State-Changed-By: miwi 
State-Changed-When: Sat May 30 21:14:10 UTC 2009 
State-Changed-Why:  
. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113099 
State-Changed-From-To: open->feedback 
State-Changed-By: miwi 
State-Changed-When: Sat May 30 21:14:22 UTC 2009 
State-Changed-Why:  
any action here or can we close this one? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113099 
Responsible-Changed-From-To: tmclaugh->knu 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Oct 16 10:26:56 UTC 2009 
Responsible-Changed-Why:  
Over to new maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113099 
State-Changed-From-To: feedback->open 
State-Changed-By: knu 
State-Changed-When: Mon Nov 9 22:46:55 JST 2009 
State-Changed-Why:  
The problem should be fixed in the latest version. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=113099 
State-Changed-From-To: open->closed 
State-Changed-By: knu 
State-Changed-When: Tue Nov 17 22:55:49 JST 2009 
State-Changed-Why:  
My intention was to close this PR, not to reopen. 

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