tech-pkg archive

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

Re: no downloads except during fetch phase



On Mon, Apr 29, 2024 at 04:19:15PM +0200, Joerg Sonnenberger wrote:
> On Monday, April 29, 2024 1:17:36 PM GMT+2 Thomas Klausner wrote:
> > Hi!
> > 
> > Since this keeps popping up, I thought how we could disable downloads
> > during configure/build/test, and came up with the attached patch.
> > 
> > Basically, it's setting the proxy environment variables to an invalid
> > value, so everything that honors them will break with a hopefully easy
> > to understand error.
> 
> Two comments.
> 
> 1) Isn't it enough to add it to ALL_ENV? The rest should inherit from that.

That would be enough, but then the fetch stage is also affected, which
we don't want.

> 2) Shouldn't we also override no_proxy?

Ok. I didn't know that one.
 Thomas
Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.2053
diff -u -r1.2053 bsd.pkg.mk
--- bsd.pkg.mk	20 Aug 2023 18:38:37 -0000	1.2053
+++ bsd.pkg.mk	29 Apr 2024 14:26:17 -0000
@@ -184,6 +184,11 @@
 ALL_ENV+=	MAKELEVEL=0
 ALL_ENV+=	CONFIG_SITE=${PKGSRC_CONFIG_SITE:U}
 
+NO_FETCH_ENV+=	ftp_proxy=downloads-forbidden-except-during-fetch
+NO_FETCH_ENV+=	http_proxy=downloads-forbidden-except-during-fetch
+NO_FETCH_ENV+=	https_proxy=downloads-forbidden-except-during-fetch
+NO_FETCH_ENV+=	no_proxy=
+
 # This variable can be added to MAKE_ENV to ease installation of packages
 # that use BSD-style Makefiles.
 BSD_MAKE_ENV=	BINOWN=${BINOWN} BINGRP=${BINGRP}
Index: build/build.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/build/build.mk,v
retrieving revision 1.34
diff -u -r1.34 build.mk
--- build/build.mk	12 Jun 2020 17:33:23 -0000	1.34
+++ build/build.mk	29 Apr 2024 14:26:17 -0000
@@ -49,7 +49,7 @@
 BUILD_TARGET?=		all
 
 BUILD_MAKE_CMD= \
-	${PKGSRC_SETENV} ${MAKE_ENV}					\
+	${PKGSRC_SETENV} ${MAKE_ENV} ${NO_FETCH_ENV}			\
 		${MAKE_PROGRAM} ${_MAKE_JOBS}				\
 			${MAKE_FLAGS} ${BUILD_MAKE_FLAGS}		\
 			-f ${MAKE_FILE}
@@ -215,4 +215,4 @@
 		${BUILD_DIRS:S,^${WRKSRC}$,.,:S,^${WRKSRC}/,,:Q}
 .endif
 	${RUN}${_ULIMIT_CMD}						\
-	cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${BUILD_ENV_SHELL}
+	cd ${WRKSRC} && ${PKGSRC_SETENV} ${MAKE_ENV} ${NO_FETCH_ENV} ${BUILD_ENV_SHELL}
Index: build/test.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/build/test.mk,v
retrieving revision 1.25
diff -u -r1.25 test.mk
--- build/test.mk	23 Nov 2022 13:30:38 -0000	1.25
+++ build/test.mk	29 Apr 2024 14:26:17 -0000
@@ -55,6 +55,7 @@
 
 TEST_DIRS?=		${BUILD_DIRS}
 TEST_ENV+=		${MAKE_ENV}
+TEST_ENV+=		${NO_FETCH_ENV}
 TEST_MAKE_FLAGS?=	# none
 
 TEST_MAKE_CMD= \
Index: configure/configure.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/configure/configure.mk,v
retrieving revision 1.32
diff -u -r1.32 configure.mk
--- configure/configure.mk	12 Jan 2023 19:37:35 -0000	1.32
+++ configure/configure.mk	29 Apr 2024 14:26:17 -0000
@@ -56,6 +56,7 @@
 
 CONFIGURE_SCRIPT?=	./configure
 CONFIGURE_ENV+=		${ALL_ENV}
+CONFIGURE_ENV+=		${NO_FETCH_ENV}
 CONFIGURE_ARGS?=	# empty
 CONFIG_SHELL?=		${SH}
 CONFIG_SHELL_FLAGS?=	# none


Home | Main Index | Thread Index | Old Index