View | Details | Raw Unified | Return to bug 168222
Collapse All | Expand All

(-)bsd.port.mk (-15 / +33 lines)
Lines 109-114 Link Here
109
#				  patches. Make will look for them at PATCH_SITES (see below).
109
#				  patches. Make will look for them at PATCH_SITES (see below).
110
#				  They will automatically be uncompressed before patching if
110
#				  They will automatically be uncompressed before patching if
111
#				  the names end with ".gz", ".bz2" or ".Z".
111
#				  the names end with ".gz", ".bz2" or ".Z".
112
#				  For each file you can optionally specify a strip
113
#				  flag of patch(1) after a colon if it has a different
114
#				  base directory, e.g. "file1 file2:-p1 file3".
112
#				  Default: not set.
115
#				  Default: not set.
113
# PATCH_SITES	- Primary location(s) for distribution patch files
116
# PATCH_SITES	- Primary location(s) for distribution patch files
114
#				  if not found locally.
117
#				  if not found locally.
Lines 2706-2714 Link Here
2706
.endfor
2709
.endfor
2707
_G_TEMP=	DEFAULT
2710
_G_TEMP=	DEFAULT
2708
.for _P in ${PATCHFILES}
2711
.for _P in ${PATCHFILES}
2709
_P_TEMP=	${_P:S/^${_P:C/:[^:]+$//}//}
2712
_P_TEMP=	${_P:C/:[^-:][^:]*$//}
2710
.	if !empty(_P_TEMP)
2713
_P_groups=	${_P:S/^${_P:C/:[^:]+$//}//:S/^://}
2711
.		for _group in ${_P_TEMP:S/^://:S/,/ /g}
2714
_P_file=	${_P_TEMP:C/:-[^:]+$//}
2715
_P_strip=	${_P_TEMP:S/^${_P_TEMP:C/:-[^:]*$//}//:S/^://}
2716
.	if !empty(_P_groups)
2717
.		for _group in ${_P_groups:S/,/ /g}
2712
.			if !defined(_PATCH_SITES_${_group})
2718
.			if !defined(_PATCH_SITES_${_group})
2713
_G_TEMP_TEMP=	${_G_TEMP:M/${_group}/}
2719
_G_TEMP_TEMP=	${_G_TEMP:M/${_group}/}
2714
.				if empty(_G_TEMP_TEMP)
2720
.				if empty(_G_TEMP_TEMP)
Lines 2717-2727 Link Here
2717
.				endif
2723
.				endif
2718
.			endif
2724
.			endif
2719
.		endfor
2725
.		endfor
2720
_PATCHFILES+=	${_P:C/:[^:]+$//}
2726
.	endif
2721
.	else
2727
_PATCHFILES:=	${_PATCHFILES} ${_P_file}
2722
_PATCHFILES+=	${_P}
2728
.	if !empty(_P_strip)
2729
_PATCH_DIST_STRIP_CASES:=	${_PATCH_DIST_STRIP_CASES} ("${_P_file}") printf %s "${_P_strip}" ;;
2723
.	endif
2730
.	endif
2724
.endfor
2731
.endfor
2732
_P_groups=
2733
_P_file=
2734
_P_strip=
2725
_G_TEMP=
2735
_G_TEMP=
2726
_G_TEMP_TEMP=
2736
_G_TEMP_TEMP=
2727
ALLFILES?=	${_DISTFILES} ${_PATCHFILES}
2737
ALLFILES?=	${_DISTFILES} ${_PATCHFILES}
Lines 2790-2796 Link Here
2790
.endfor
2800
.endfor
2791
_PATCH_SITES_ENV=	_PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2801
_PATCH_SITES_ENV=	_PATCH_SITES_DEFAULT="${_PATCH_SITES_DEFAULT}"
2792
.for _F in ${PATCHFILES}
2802
.for _F in ${PATCHFILES}
2793
_F_TEMP=	${_F:S/^${_F:C/:[^:]+$//}//:S/^://}
2803
_F_TEMP=	${_F:S/^${_F:C/:[^-:][^:]*$//}//:S/^://}
2794
.	if !empty(_F_TEMP)
2804
.	if !empty(_F_TEMP)
2795
.		for _group in ${_F_TEMP:S/,/ /g}
2805
.		for _group in ${_F_TEMP:S/,/ /g}
2796
.			if defined(_PATCH_SITES_${_group})
2806
.			if defined(_PATCH_SITES_${_group})
Lines 3508-3515 Link Here
3508
	@cd ${_DISTDIR};\
3518
	@cd ${_DISTDIR};\
3509
	${_PATCH_SITES_ENV} ; \
3519
	${_PATCH_SITES_ENV} ; \
3510
	for _file in ${PATCHFILES}; do \
3520
	for _file in ${PATCHFILES}; do \
3511
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
3521
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
3512
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3522
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
3523
		file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
3513
		force_fetch=false; \
3524
		force_fetch=false; \
3514
		filebasename=$${file##*/}; \
3525
		filebasename=$${file##*/}; \
3515
		for afile in ${FORCE_FETCH}; do \
3526
		for afile in ${FORCE_FETCH}; do \
Lines 3611-3631 Link Here
3611
.if defined(PATCHFILES)
3622
.if defined(PATCHFILES)
3612
	@${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME}"
3623
	@${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME}"
3613
	@(cd ${_DISTDIR}; \
3624
	@(cd ${_DISTDIR}; \
3625
	  patch_dist_strip () { \
3626
		case "$$1" in \
3627
		  ${_PATCH_DIST_STRIP_CASES} \
3628
		esac; \
3629
	  }; \
3614
	  for i in ${_PATCHFILES}; do \
3630
	  for i in ${_PATCHFILES}; do \
3615
		if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3631
		if [ ${PATCH_DEBUG_TMP} = yes ]; then \
3616
			${ECHO_MSG} "===>   Applying distribution patch $$i" ; \
3632
			${ECHO_MSG} "===>   Applying distribution patch $$i" ; \
3617
		fi; \
3633
		fi; \
3618
		case $$i in \
3634
		case $$i in \
3619
			*.Z|*.gz) \
3635
			*.Z|*.gz) \
3620
				${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
3636
				${GZCAT} $$i; \
3621
				;; \
3637
				;; \
3622
			*.bz2) \
3638
			*.bz2) \
3623
				${BZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \
3639
				${BZCAT} $$i; \
3624
				;; \
3640
				;; \
3625
			*) \
3641
			*) \
3626
				${PATCH} ${PATCH_DIST_ARGS} < $$i; \
3642
				${CAT} $$i; \
3627
				;; \
3643
				;; \
3628
		esac; \
3644
		esac | ${PATCH} ${PATCH_DIST_ARGS} `patch_dist_strip $$i`; \
3629
	  done)
3645
	  done)
3630
.endif
3646
.endif
3631
.if defined(EXTRA_PATCHES)
3647
.if defined(EXTRA_PATCHES)
Lines 4652-4659 Link Here
4652
	@(cd ${_DISTDIR}; \
4668
	@(cd ${_DISTDIR}; \
4653
	 ${_PATCH_SITES_ENV} ; \
4669
	 ${_PATCH_SITES_ENV} ; \
4654
	 for _file in ${PATCHFILES}; do \
4670
	 for _file in ${PATCHFILES}; do \
4655
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4671
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4656
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4672
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4673
		file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4657
		if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4674
		if [ ! -f $$file -a ! -f $${file##*/} ]; then \
4658
			if [ ! -z "$$select" ] ; then \
4675
			if [ ! -z "$$select" ] ; then \
4659
				__PATCH_SITES_TMP= ; \
4676
				__PATCH_SITES_TMP= ; \
Lines 4720-4728 Link Here
4720
	@(cd ${_DISTDIR}; \
4737
	@(cd ${_DISTDIR}; \
4721
	${_PATCH_SITES_ENV} ; \
4738
	${_PATCH_SITES_ENV} ; \
4722
	for _file in ${PATCHFILES}; do \
4739
	for _file in ${PATCHFILES}; do \
4723
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^:]+$$//'` ; \
4740
		file=`${ECHO_CMD} $$_file | ${SED} -E -e 's/:[^-:][^:]*$$//'` ; \
4724
			fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4725
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4741
		select=`${ECHO_CMD} $${_file#$${file}} | ${SED} -e 's/^://' -e 's/,/ /g'` ; \
4742
		file=`${ECHO_CMD} $$file | ${SED} -E -e 's/:-[^:]+$$//'` ; \
4743
		fileptn=`${ECHO_CMD} $$file | ${SED} 's|/|\\\\/|g;s/\./\\\\./g;s/\+/\\\\+/g;s/\?/\\\\?/g'` ; \
4726
		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4744
		if [ ! -z "${LISTALL}" -o ! -f $$file -a ! -f $${file##*/} ]; then \
4727
			if [ ! -z "$$select" ] ; then \
4745
			if [ ! -z "$$select" ] ; then \
4728
				__PATCH_SITES_TMP= ; \
4746
				__PATCH_SITES_TMP= ; \

Return to bug 168222