From rea-fbsd@codelabs.ru  Wed Apr 22 19:57:56 2009
Return-Path: <rea-fbsd@codelabs.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11322106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Apr 2009 19:57:56 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45])
	by mx1.freebsd.org (Postfix) with ESMTP id A379C8FC15
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Apr 2009 19:57:55 +0000 (UTC)
	(envelope-from rea-fbsd@codelabs.ru)
Received: from amnesiac.at.no.dns (ppp91-77-11-103.pppoe.mtu-net.ru [91.77.11.103])
	by 0.mx.codelabs.ru with esmtps (TLSv1:CAMELLIA256-SHA:256)
	id 1LwiZt-000M9S-Vv for FreeBSD-gnats-submit@freebsd.org; Wed, 22 Apr 2009 23:57:54 +0400
Message-Id: <20090422195753.4D1621712A@amnesiac.at.no.dns>
Date: Wed, 22 Apr 2009 23:57:53 +0400 (MSD)
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Reply-To: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] bsd.openssl.mk: silence warnings when OPENSSL_INSTALLED is empty
X-Send-Pr-Version: 3.113
X-GNATS-Notify: dinoex@freebsd.org

>Number:         133927
>Category:       ports
>Synopsis:       [patch] bsd.openssl.mk: silence warnings when OPENSSL_INSTALLED is empty
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dinoex
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 22 20:00:01 UTC 2009
>Closed-Date:    Thu May 07 10:24:23 CEST 2009
>Last-Modified:  Thu May 07 10:24:23 CEST 2009
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 7.2-PRERELEASE amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD 7.2-PRERELEASE amd64

>Description:

While doing 'port test' for 'devel/git' I had seen the following
warning messages:
-----
grep: : No such file or directory
grep: : No such file or directory
"/usr/ports/Mk/bsd.openssl.mk", line 111: warning: "grep "^lib/libssl.so." """ returned non-zero status
-----

The appear because porttools use /tmp/<something> as the package
database and build the port without dependencies.  This should not
happen for real port building, because OpenSSL dependency should
be satisfied first.

>How-To-Repeat:

Do 'port test' for 'devel/git' or some other port that requires
OpenSSL from ports.

>Fix:

The following patch shuts the warning messages:

--- bsd.openssl.mk-fix-empty-grep-args.diff begins here ---
From f11455108e7f02fd16661a6fe5d12fa09b0a8a48 Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
Date: Wed, 22 Apr 2009 22:59:18 +0400

When no OpenSSL library installed via port is found, OPENSSL_INSTALLED
will be empty and grep for OPENSSL_PORT and OPENSSL_SHLIBFILE will be
called with empty filename.  This will produce verbose warnings that
look rather ugly.

I had encountered these while was running 'port test' for the
'git/devel': PKG_DBDIR is set to /tmp/<something>, so no OpenSSL
is present there.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
---
 Mk/bsd.openssl.mk |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Mk/bsd.openssl.mk b/Mk/bsd.openssl.mk
index 194fb86..845416c 100644
--- a/Mk/bsd.openssl.mk
+++ b/Mk/bsd.openssl.mk
@@ -107,8 +107,10 @@ OPENSSL_INSTALLED!=	find "${PKG_DBDIR}/" -type f -name "+CONTENTS" -print0 | \
 				if test "$${sslprefix}" = "@cwd ${LOCALBASE}" ; then \
 					echo "$${contents}"; break; fi; done
 .endif
+.if defined(OPENSSL_INSTALLED) && ${OPENSSL_INSTALLED} != ""
 OPENSSL_PORT!=		grep "^@comment ORIGIN:" "${OPENSSL_INSTALLED}" | ${CUT} -d : -f 2
 OPENSSL_SHLIBFILE!=	grep "^lib/libssl.so." "${OPENSSL_INSTALLED}"
+.endif
 OPENSSL_SHLIBVER?=	${OPENSSL_SHLIBFILE:E}
 .endif
 OPENSSL_PORT?=		security/openssl
-- 
1.6.2.4
--- bsd.openssl.mk-fix-empty-grep-args.diff ends here ---
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->dinoex 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Apr 22 20:00:24 UTC 2009 
Responsible-Changed-Why:  
bsd.openssl.mk is dinoex territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133927 
State-Changed-From-To: open->feedback 
State-Changed-By: dinoex 
State-Changed-When: Wed Apr 29 10:02:03 CEST 2009 
State-Changed-Why:  

Please check. 
The grep should never returnan empty string. 
unless your /var/db/pkg is messed up badly. 

please tell the output off: 
$ ls -l /usr/local/lib/libcrypto.* 

$ cd /usr/ports/devel/git && make -V PKG_DBDIR 

I don't know the "port" command, where dioes it com from? 
$ pkg:_info -w port 


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

From: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To: dinoex@FreeBSD.org, bug-followup@freebsd.org
Cc:  
Subject: Re: ports/133927: [patch] bsd.openssl.mk: silence warnings when
	OPENSSL_INSTALLED is empty
Date: Wed, 29 Apr 2009 16:18:59 +0400

 Dirk, good day.
 
 Wed, Apr 29, 2009 at 10:09:56AM +0200, dinoex@FreeBSD.org wrote:
 > Synopsis: [patch] bsd.openssl.mk: silence warnings when OPENSSL_INSTALLED is empty
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: dinoex
 > State-Changed-When: Wed Apr 29 10:02:03 CEST 2009
 > State-Changed-Why: 
 > 
 > Please check.
 > The grep should never returnan empty string.
 > unless your /var/db/pkg is messed up badly.
 
 It's not /var/db/pkg, it is /tmp/<something> as set by the porttools.
 Normal package builds have it set to /var/db/pkg and everything is fine.
 Please, see below for explanations.
 
 > please tell the output off:
 > $ ls -l /usr/local/lib/libcrypto.*
 
 Libraries are here.
 
 > $ cd /usr/ports/devel/git && make -V PKG_DBDIR
 
 Of course, /var/db/pkg.
 
 > I don't know the "port" command, where dioes it com from?
 > $ pkg:_info -w port
 
 Here lies the badness: 'port' is from the port-mgmt/porttools suite that
 I use for port testing and validation.  The utility sets PKG_DBDIR to
 the freshly created directory in /tmp and sets NO_DEPENDS, so this is
 the reason why OpenSSL stuff isn't detected -- it isn't recorded in the
 'fake' PKG_DBDIR and isn't built because NO_DEPENDS is here.
 -- 
 Eygene
  _                ___       _.--.   #
  \`.|\..----...-'`   `-._.-'_.-'`   #  Remember that it is hard
  /  ' `         ,       __.--'      #  to read the on-line manual
  )/' _/     \   `-_,   /            #  while single-stepping the kernel.
  `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
      _.-'_./   {_.'   ; /           #    -- FreeBSD Developers handbook
     {_.-``-'         {_/            #

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/133927: commit references a PR
Date: Thu,  7 May 2009 08:19:17 +0000 (UTC)

 dinoex      2009-05-07 08:19:02 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.openssl.mk 
   Log:
   - Fix autodetec with invalid PKG_DBDIR
   PR:             133927
   Submitted by:   Eygene Ryabinkin
   
   Revision  Changes    Path
   1.43      +7 -1      ports/Mk/bsd.openssl.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: feedback->closed 
State-Changed-By: dinoex 
State-Changed-When: Thu May 7 10:23:59 CEST 2009 
State-Changed-Why:  
committed, thanks. 

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