pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/58961: 'make print-PLIST' emits 'No such file or directory' when directories contain spaces



Correction -- updated patch attached, to work around the quirk of
shells where x=$(...) strips the trailing newlines of the command
output.
diff --git a/mk/plist/print-plist.mk b/mk/plist/print-plist.mk
index a41caa2ededa..b758d7cfe11b 100644
--- a/mk/plist/print-plist.mk
+++ b/mk/plist/print-plist.mk
@@ -138,6 +138,7 @@ print-PLIST:
 		/^man\// { sub("\\.gz$$", ""); }			\
 		{ print $$0; }'
 	${RUN}\
+	saveIFS=$$IFS; IFS=$$(printf '\n.'); IFS=$${IFS%.};		\
 	for i in `${_PRINT_PLIST_DIRS_CMD}				\
 			| ${AWK} '					\
 				${EARLY_PRINT_PLIST_AWK}		\
@@ -154,8 +155,9 @@ print-PLIST:
 				/^${PKGINFODIR:S|/|\\/|g}$$/ { next; }	\
 				{ print $$0; }'` ;			\
 	do								\
-		if [ `${LS} -la ${DESTDIR}${PREFIX}/$$i | ${WC} -l` = 3 ]; then	\
-			${ECHO} @pkgdir $$i | ${AWK} '			\
+		IFS=$$saveIFS;						\
+		if [ `${LS} -la ${DESTDIR}${PREFIX}/"$$i" | ${WC} -l` = 3 ]; then	\
+			${ECHO} @pkgdir "$$i" | ${AWK} '		\
 			${PRINT_PLIST_AWK}				\
 			{ print $$0; }' ;				\
 		fi ;							\


Home | Main Index | Thread Index | Old Index