Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Aug 2000 13:31:34 +0200 (CEST)
From:      "Ralf S. Engelschall" <rse@en1.engelschall.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/20678: make SORTED_MASTER_SITES_CMD variable overridable
Message-ID:  <200008171131.e7HBVYk56997@en1.engelschall.com>

next in thread | raw e-mail | index | archive | help

>Number:         20678
>Category:       ports
>Synopsis:       make SORTED_MASTER_SITES_CMD variable overridable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 17 04:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ralf S. Engelschall
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
Engelschall, Germany.
>Environment:

FreeBSD en1.engelschall.com 4.1-STABLE FreeBSD 4.1-STABLE #0: Sun Aug 13
15:33:17 CEST 2000     rse@en1.engelschall.com:/usr/obj/usr/src/sys/EN1  i386

>Description:

With our recently introduced sorting of the master sites, it is no longer
possible to extend/override the master sites on a *per-distfile basis*.
Previously MASTER_SITE_OVERRIDE could be used for this purpose by using things
like this in /etc/make.conf:

MASTER_SITE_OVERRIDE=`/path/to/script $$$${file}`

I used this since years to run /path/to/script with the currently to be
fetched distfile. If this script determined (how it does this is outside of
this scope) that the distfile already exists somewhere locally, the ports
system first tried it to fetch from there. Keep in mind that a script has to
be used here, because the files are stored not in a single directory (for me
they are stored in a very large software archive with thousands of subdirs).
So something like MASTER_SITE_OVERRIDE=/path/to/local/stuff is not sufficient.

But this no longer works with the current bsd.port.mk stuff after the
introduced master site sorting. But if one is again able to override
SORTED_MASTER_SITES_CMD in /etc/make.conf one can achieve the old effect with:

SORTED_MASTER_SITES_CMD=\
    /path/to/script $$file; \
    echo '${MASTER_SITES}' | ${AWK} '${MASTER_SORT_AWK}'

Voila! All which is required to again have such local flexibility is that we
are nice and allow the SORTED_MASTER_SITES_CMD variable to be overridden from
/etc/make.conf. The following patch does it. It is harmless but very useful as
I tried to explain.

I would highly appreciate if we could apply this patch to bsd.port.mk soon.

>How-To-Repeat:

Without editing a ports Makefile, try to force the port to first try to fetch
the distfile from a location which was determined on-the-fly by a script.

>Fix:

This patch allows one to override SORTED_MASTER_SITES_CMD and
this way one is again able to achieve the effect.

Index: bsd.port.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.345
diff -u -d -r1.345 bsd.port.mk
--- bsd.port.mk	2000/08/03 09:28:57	1.345
+++ bsd.port.mk	2000/08/08 12:17:15
@@ -1115,7 +1115,7 @@
 MASTER_SORT_AWK+= /${srt:S^/^\\/^g}/ { good["${srt}"] = good["${srt}"] " " $$0 ; next; } 
 .endfor
 MASTER_SORT_AWK+= { rest = rest " " $$0; } END { n=split(gl, gla); for(i=1;i<=n;i++) { print good[gla[i]]; } print rest; }
-SORTED_MASTER_SITES_CMD= echo '${MASTER_SITES}' | ${AWK} '${MASTER_SORT_AWK}'
+SORTED_MASTER_SITES_CMD?= echo '${MASTER_SITES}' | ${AWK} '${MASTER_SORT_AWK}'
 
 DISTFILES?=		${DISTNAME}${EXTRACT_SUFX}
 ALLFILES?=	${DISTFILES} ${PATCHFILES}



>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008171131.e7HBVYk56997>