diff options
author | hubertf <hubertf@pkgsrc.org> | 2005-09-04 20:02:55 +0000 |
---|---|---|
committer | hubertf <hubertf@pkgsrc.org> | 2005-09-04 20:02:55 +0000 |
commit | cd5fa34ef106935c44c6e321985ed929e03acabe (patch) | |
tree | 8959c564c1e2b302f5ac2eeb2934452b6873463f /pkgtools/url2pkg/files | |
parent | 41bf574b2949b1b2c04b0d48969273b6fbb8fb10 (diff) | |
download | pkgsrc-cd5fa34ef106935c44c6e321985ed929e03acabe.tar.gz |
Update url2pkg to 1.29. Change:
Patch by pancake <pancake@phreaker.net> that permits url2pkg to scan
bsd.sites.mk and recreate the MASTER_SITE string. He has tested a bit
against GNU, GNOME, SOURCEFORGE master sites, and seems to do the things
fine.
Diffstat (limited to 'pkgtools/url2pkg/files')
-rwxr-xr-x | pkgtools/url2pkg/files/url2pkg | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg b/pkgtools/url2pkg/files/url2pkg index 579ac0b65ef..67bd2517c5e 100755 --- a/pkgtools/url2pkg/files/url2pkg +++ b/pkgtools/url2pkg/files/url2pkg @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: url2pkg,v 1.30 2005/05/07 22:14:32 wiz Exp $ +# $NetBSD: url2pkg,v 1.31 2005/09/04 20:03:10 hubertf Exp $ # # url2pkg # (c) 1999-2002 Hubert Feyrer <hubert@feyrer.de> @@ -39,18 +39,35 @@ if [ ! -f w*/.extract_done ]; then url="$1" fi - sourceforge="http://prdownloads.sourceforge.net/" - if [ `expr "$url" : "$sourceforge.*"` -gt 0 ]; then - DISTNAME=`expr "$url" : '.*/\([^/?]*\)'` - sfname=`expr "$url" : "${sourceforge}\(.*\)/[^/]*\$"` - MASTER_SITES='${MASTER_SITE_SOURCEFORGE:='"$sfname"'/}' - HOMEPAGE="http://$sfname.sourceforge.net/" - else + found=0 + for A in `cat ../../mk/bsd.sites.mk`; do + if [ "`expr "$A" : ".*+="`" -gt 0 ]; then + master_site="`echo $A|cut -f1 -d +`" + fi + if [ ! "${A}" = "\\" ]; then + if [ `expr "$url" : "$A"` -gt 0 ]; then + found=1 + DISTNAME=`expr "$url" : '.*/\([^/?]*\)'` + name=`expr "$url" : "${A}\(.*\)/[^/]*\$"` + MASTER_SITES="\${${master_site}:=${name}}" + case "${master_site}" in + "MASTER_SITE_SOURCEFORGE") + HOMEPAGE="http://$name.sourceforge.net/" ; ;; + "MASTER_SITE_GNU") + HOMEPAGE="http://www.gnu.org/software/$name/" ; ;; + esac + HOMEPAGE=`expr "$url" : '\(.*/\)[^/]*$'` + break + fi + fi + done + + if [ $found = 0 ]; then DISTNAME=`expr "$url" : '.*/\([^/]*\)$'` MASTER_SITES=`expr "$url" : '\(.*/\)[^/]*$'` HOMEPAGE=$MASTER_SITES fi - + case "$DISTNAME" in *.tgz) EXTRACT_SUFX=".tgz" DISTNAME=`expr ${DISTNAME} : '\(.*\)\.[^.]*'` |