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

Robustness patch for bsd.port.mk



Make substitution is not very robust if MASTER_SITE_SUBDIR happens to 
hold '/', especially when the bug that necessitates 
MASTER_SITES ?=
to avoid `variable XXX is recursive' finally gets fixed (the fix is in
NetBSD, and will soon be in OpenBSD)

Anyway, replacing those slashes with characters unlikely to yield 
trouble (,) in variable substitution makes sense, as substitution of
variables there is a grey area of make anyway.

Comments ?


Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.130
diff -u -r1.130 bsd.port.mk
--- bsd.port.mk	1999/10/08 11:38:05	1.130
+++ bsd.port.mk	1999/10/26 15:46:04
@@ -871,28 +871,28 @@
 PATCH_SITES9?=
 
 # Substitute subdirectory names in intermediate form
-_MASTER_SITES:=		${MASTER_SITES:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES0:=	${MASTER_SITES0:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES1:=	${MASTER_SITES1:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES2:=	${MASTER_SITES2:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES3:=	${MASTER_SITES3:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES4:=	${MASTER_SITES4:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES5:=	${MASTER_SITES5:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES6:=	${MASTER_SITES6:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES7:=	${MASTER_SITES7:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES8:=	${MASTER_SITES8:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_MASTER_SITES9:=	${MASTER_SITES9:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}
-_PATCH_SITES=		${PATCH_SITES:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES0:=		${PATCH_SITES0:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES1:=		${PATCH_SITES1:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES2:=		${PATCH_SITES2:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES3:=		${PATCH_SITES3:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES4:=		${PATCH_SITES4:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES5:=		${PATCH_SITES5:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES6:=		${PATCH_SITES6:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES7:=		${PATCH_SITES7:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES8:=		${PATCH_SITES8:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
-_PATCH_SITES9:=		${PATCH_SITES9:S/%SUBDIR%/${PATCH_SITE_SUBDIR}/}
+_MASTER_SITES:=		${MASTER_SITES:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES0:=	${MASTER_SITES0:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES1:=	${MASTER_SITES1:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES2:=	${MASTER_SITES2:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES3:=	${MASTER_SITES3:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES4:=	${MASTER_SITES4:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES5:=	${MASTER_SITES5:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES6:=	${MASTER_SITES6:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES7:=	${MASTER_SITES7:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES8:=	${MASTER_SITES8:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_MASTER_SITES9:=	${MASTER_SITES9:S,%SUBDIR%,${MASTER_SITE_SUBDIR},}
+_PATCH_SITES=		${PATCH_SITES:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES0:=		${PATCH_SITES0:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES1:=		${PATCH_SITES1:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES2:=		${PATCH_SITES2:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES3:=		${PATCH_SITES3:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES4:=		${PATCH_SITES4:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES5:=		${PATCH_SITES5:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES6:=		${PATCH_SITES6:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES7:=		${PATCH_SITES7:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES8:=		${PATCH_SITES8:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
+_PATCH_SITES9:=		${PATCH_SITES9:S,%SUBDIR%,${PATCH_SITE_SUBDIR},}
 
 # I guess we're in the master distribution business! :)  As we gain mirror
 # sites for distfiles, add them to this list.