summaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2001-11-09 15:48:40 +0000
committerknu <knu@FreeBSD.org>2001-11-09 15:48:40 +0000
commit61ad897ad8bb0fb14dfb0777701e6a639cad7b1f (patch)
treed50844d388c06b74d5e7384c0eff14bb89d82f11 /Mk
parenta481281c5e56253f24a57cbdc0ca7e2b0f406944 (diff)
downloadFreeBSD-ports-61ad897ad8bb0fb14dfb0777701e6a639cad7b1f.zip
FreeBSD-ports-61ad897ad8bb0fb14dfb0777701e6a639cad7b1f.tar.gz
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)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk94
1 files changed, 36 insertions, 58 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 606abd5..d2cfced 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:
OpenPOWER on IntegriCloud