From owner-freebsd-ports Sun Oct 21 15:14: 1 2001 Delivered-To: freebsd-ports@freebsd.org Received: from mail.musha.org (daemon.musha.org [61.122.44.178]) by hub.freebsd.org (Postfix) with ESMTP id AD3D337B401; Sun, 21 Oct 2001 15:13:48 -0700 (PDT) Received: from archon.local.idaemons.org (archon.local.idaemons.org [192.168.1.32]) by mail.musha.org (Postfix) with ESMTP id 297F94DB54; Mon, 22 Oct 2001 07:13:47 +0900 (JST) Date: Mon, 22 Oct 2001 07:13:47 +0900 Message-ID: <86ofn0od44.wl@archon.local.idaemons.org> From: "Akinori MUSHA" To: portmgr@FreeBSD.org, ports@FreeBSD.org Subject: A patch to fix "make describe" User-Agent: Wanderlust/2.7.4 (Too Funky) SEMI/1.14.3 (Ushinoya) LIMIT/1.14.7 (Fujiidera) APEL/10.3 MULE XEmacs/21.1 (patch 14) (Cuyahoga Valley) (i386--freebsd) Organization: Associated I. Daemons X-PGP-Public-Key: finger knu@FreeBSD.org X-PGP-Fingerprint: 081D 099C 1705 861D 4B70 B04A 920B EFC7 9FD9 E1EE MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I happened to find a bug in bsd.port.mk's "make describe" routine. Because it is not quoted properly, shell wildcards are unexpectedly expanded. To confirm this, try doing "make describe" in /usr/ports/games/tkmoo. You can see the short description: "Tk-based M** client with scripting support" get turned into: "Tk-based Makefile client with scripting support" Also, series of spaces are suppressed for the same reason. Attached is the patch which fixes the problem and makes the code more short and efficient in the Perl way. I've confirmed that the INDEX file made with the patched bsd.port.mk is identical to the one made with the current bsd.port.mk except for what is described above. Please evaluate it, and I'll commit it if it's okay. Regards, -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "Freeze this moment a little bit longer, make each impression a little bit stronger.. Experience slips away -- Time stand still" Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.383 diff -u -r1.383 bsd.port.mk --- bsd.port.mk 9 Oct 2001 07:37:34 -0000 1.383 +++ bsd.port.mk 21 Oct 2001 20:44:38 -0000 @@ -2747,77 +2747,55 @@ .if !target(describe) describe: - @${ECHO} `perl -e ' \ - print "${PKGNAME}|${.CURDIR}|${PREFIX}|"; \ - if (open (COMMENT, "${COMMENT}")) { \ + @${ECHO} "`perl -e ' \ + print q{${PKGNAME}|${.CURDIR}|${PREFIX}|}; \ + if (open(COMMENT, q{${COMMENT}})) { \ $$_ = ; \ chomp; \ print; \ } else { \ - print "** No Description"; \ + print q{** No Description}; \ } \ - if ( -f "${DESCR}" ) { \ - print "|${DESCR}"; \ + if ( -f q{${DESCR}} ) { \ + print q{|${DESCR}}; \ } else { \ - print "|/dev/null"; \ + print q{|/dev/null}; \ } \ - print q#|${MAINTAINER}|${CATEGORIES}|#; \ - for (split /\s+/, "${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS}") { \ - next if /^$$/; \ - s/^[^:]*\://; \ - s/\:.*//; \ - if ( ! -d $$_ ) { \ - print STDERR "${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete"; \ - } else { \ - push @bdirs, $$_; \ + print q{|${MAINTAINER}|${CATEGORIES}|}; \ + @bdirs = map((split /:/)[1], split(q{ }, q{${FETCH_DEPENDS} ${BUILD_DEPENDS}})); \ + @rdirs = map((split /:/)[1], split(q{ }, q{${RUN_DEPENDS}})); \ + @mdirs = ( \ + map((split /:/)[0], split(q{ }, q{${DEPENDS}})), \ + map((split /:/)[1], split(q{ }, q{${LIB_DEPENDS}})) \ + ); \ + for my $$i (\@bdirs, \@rdirs, \@mdirs) { \ + my @dirs = @$$i; \ + @$$i = (); \ + for (@dirs) { \ + if (-d $$_) { \ + push @$$i, $$_; \ + } else { \ + print STDERR qq{${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete\n}; \ + } \ + } \ + } \ + for (@bdirs, @mdirs) { \ + $$x{$$_} = 1; \ + } \ + print join(q{ }, sort keys %x), q{|}; \ + for (@rdirs, @mdirs) { \ + $$y{$$_} = 1; \ + } \ + print join(q{ }, sort keys %y), q{|}; \ + if (open(DESCR, q{${DESCR}})) { \ + while () { \ + if (/^WWW:\s+(\S+)/) { \ + print $$1; \ + last; \ + } \ } \ } \ - for (split /\s+/, "${LIB_DEPENDS} ${RUN_DEPENDS}") { \ - next if /^$$/; \ - s/^[^:]*\://; \ - s/\:.*//; \ - if ( ! -d $$_ ) { \ - print STDERR "${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete"; \ - } else { \ - push @rdirs, $$_; \ - } \ - } \ - for (split /\s+/, "${DEPENDS}") { \ - next if /^$$/; \ - s/\:.*//; \ - if ( ! -d $$_ ) { \ - print STDERR "${PKGNAME}: \"$$_\" non-existent -- dependency list incomplete"; \ - } else { \ - push @mdirs, $$_; \ - } \ - } \ - for (sort (@bdirs, @mdirs)) { \ - if ($$_ ne $$l) { \ - $$a .= $$_ . " "; \ - $$l = $$_; \ - } \ - } \ - chop $$a; \ - print "$$a|"; \ - for (sort (@rdirs, @mdirs)) { \ - if ($$_ ne $$m) { \ - $$b .= $$_ . " "; \ - $$m = $$_; \ - } \ - } \ - chop $$b; \ - print "$$b|"; \ - if (open (DESCR, "${DESCR}")) { \ - until (/^WWW\:\s/ or eof DESCR) { \ - $$_ = ; \ - } \ - if (/^WWW\:\s/) { \ - chomp; \ - split /\s+/; \ - print $$_[1]; \ - } \ - } \ - print "\n";'` + print qq{\n};'`" .endif www-site: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message