ports/80528: PORTDOCS: shell glob "*" causes test command error

Matthias Andree matthias.andree at gmx.de
Mon May 2 08:10:06 UTC 2005


>Number:         80528
>Category:       ports
>Synopsis:       PORTDOCS: shell glob "*" causes test command error
>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 May 02 08:10:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 5.4-STABLE i386
>Organization:
>Environment:
System: FreeBSD merlin.emma.line.org 5.4-STABLE FreeBSD 5.4-STABLE #28: Sun Apr 24 10:56:21 CEST 2005 toor at merlin.emma.line.org:/usr/src/sys/i386/compile/MA5 i386


	
>Description:
Using a shell glob in PORTDOCS in a port's Makefile (for instance
PORTDOCS=*) causes an error, example:

[: /usr/local/share/doc/leafnode/ADD-ONS: unexpected operator

The context is, for news/leafnode, using "make -dl install":

if /usr/bin/egrep -qe '^@cw?d' /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp &&  [ "`/usr/bin/sed -En -e '/^@cw?d[     ]*/s,,,p' /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp | /usr/bin/tail -n 1`" != "/usr/local" ]; then
 echo "@cwd /usr/local" >> /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp;  fi
if [ ! -e /usr/local/share/doc/leafnode/* ]; then  @echo /usr/local/share/doc/leafnode/* |  /usr/bin/sed -e 's,^/usr/local/,,' >> /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp;  fi
[: /usr/local/share/doc/leafnode/ADD-ONS: unexpected operator
/usr/bin/find -P /usr/local/share/doc/leafnode/* ! -type d 2>/dev/null |  /usr/bin/sed -ne 's,^/usr/local/,,p' >> /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp
/usr/bin/find -P -d /usr/local/share/doc/leafnode/* -type d 2>/dev/null |  /usr/bin/sed -ne 's,^/usr/local/, at dirrm ,p' >> /var/tmp/usr/ports/news/leafnode/work/.PLIST.mktmp

Replacing the wildcard by an explicit file lists makes this error disappear,
but /usr/ports/Mk/bsd.ports.mk is documented as

"# PORTDOCS      - A list of files and directories relative to DOCSDIR.
 #                 Shell glob patterns can be used, directories include
 #                 the entire subtree of contained files and directories. ..."

allowing globs.

	
>How-To-Repeat:
cd /usr/ports/news/leafnode
make install

Note: leafnode uses PORTDOCS= *
	
>Fix:
change /usr/ports/Mk/bsd.port.mk so it Does The Right Thing[tm] :-)
	


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



More information about the freebsd-ports-bugs mailing list