diff options
author | Akinori MUSHA <knu@FreeBSD.org> | 2001-11-09 15:48:40 +0000 |
---|---|---|
committer | Akinori MUSHA <knu@FreeBSD.org> | 2001-11-09 15:48:40 +0000 |
commit | 345bbe4bfd49a7abeeea68d19deb113d04e44b84 (patch) | |
tree | d438d1ee2e6d0abcf639c31c38030ff18ac14058 /Mk/bsd.port.mk | |
parent | Oops, this was supposed to be removed. (diff) |
Fix a quoting bug in `make describe'.
- Do not shrink series of spaces.
- Do not expand shell wildcards in pkg-comment.
I made the code cleaner and (3-4%) faster while I was at it.
Tested by: diff(1) and its option -b
(Maintainer timeout)
Notes
Notes:
svn path=/head/; revision=49878
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r-- | Mk/bsd.port.mk | 94 |
1 files changed, 36 insertions, 58 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 606abd56ccb0..d2cfced2a6b8 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -2747,77 +2747,55 @@ package-depends: .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}})) { \ $$_ = <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 (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 (@bdirs, @mdirs) { \ + $$x{$$_} = 1; \ } \ - for (sort (@bdirs, @mdirs)) { \ - if ($$_ ne $$l) { \ - $$a .= $$_ . " "; \ - $$l = $$_; \ - } \ + print join(q{ }, sort keys %x), q{|}; \ + for (@rdirs, @mdirs) { \ + $$y{$$_} = 1; \ } \ - 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) { \ - $$_ = <DESCR>; \ - } \ - if (/^WWW\:\s/) { \ - chomp; \ - split /\s+/; \ - print $$_[1]; \ + print join(q{ }, sort keys %y), q{|}; \ + if (open(DESCR, q{${DESCR}})) { \ + while (<DESCR>) { \ + if (/^WWW:\s+(\S+)/) { \ + print $$1; \ + last; \ + } \ } \ } \ - print "\n";'` + print qq{\n};'`" .endif www-site: |