Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Mar 2013 13:23:07 GMT
From:      Oleg Ginzburg <olevole@olevole.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/176849: empty variable optionsdir in bsd.port.mk
Message-ID:  <201303111323.r2BDN7VP034188@red.freebsd.org>
Resent-Message-ID: <201303111330.r2BDU1QP019941@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         176849
>Category:       ports
>Synopsis:       empty variable optionsdir in bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 11 13:30:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Ginzburg
>Release:        10-current
>Organization:
>Environment:
>Description:
in the follow code:
@(optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*};

optionsdir declate in subshell and not exported for using outside, for example in next follow code:

(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)

>How-To-Repeat:
Create conditions for mkdir fail, for example:

rm -rf /var/db/ports/redis
touch /var/db/ports/redis
make -C /usr/ports/databases/redis
===> Cannot create , check permissions
*** [do-config] Error code 1


Missing dir in "Cannot create" 
>Fix:


Patch attached with submission follows:

--- /usr/ports/Mk/bsd.port.mk.bak	2013-03-11 17:12:22.000000000 +0400
+++ /usr/ports/Mk/bsd.port.mk	2013-03-11 17:12:31.000000000 +0400
@@ -6142,8 +6142,8 @@
 		(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1); \
 	${ECHO_MSG} "===>  Returning to user credentials"
 .else
-	@(optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
-	${MKDIR} $${optionsdir} 2> /dev/null) || \
+	@optionsdir=${OPTIONSFILE}; optionsdir=$${optionsdir%/*}; \
+	${MKDIR} $${optionsdir} 2> /dev/null || \
 	(${ECHO_MSG} "===> Cannot create $${optionsdir}, check permissions"; exit 1)
 .endif
 	@TMPOPTIONSFILE=$$(mktemp -t portoptions); \


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303111323.r2BDN7VP034188>