summaryrefslogtreecommitdiff
path: root/pkgtools/url2pkg
diff options
context:
space:
mode:
authorhubertf <hubertf>2005-09-04 20:02:55 +0000
committerhubertf <hubertf>2005-09-04 20:02:55 +0000
commit3995f1261eb4c59a9d5b0117508c0de141748edc (patch)
tree8959c564c1e2b302f5ac2eeb2934452b6873463f /pkgtools/url2pkg
parentd21ba9d5518d55f2bddf5a64d663b5726abb3df9 (diff)
downloadpkgsrc-3995f1261eb4c59a9d5b0117508c0de141748edc.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')
-rw-r--r--pkgtools/url2pkg/Makefile4
-rwxr-xr-xpkgtools/url2pkg/files/url2pkg35
2 files changed, 28 insertions, 11 deletions
diff --git a/pkgtools/url2pkg/Makefile b/pkgtools/url2pkg/Makefile
index a958c28f9fa..fd28ee6c177 100644
--- a/pkgtools/url2pkg/Makefile
+++ b/pkgtools/url2pkg/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.35 2005/04/11 21:47:06 tv Exp $
+# $NetBSD: Makefile,v 1.36 2005/09/04 20:03:10 hubertf Exp $
#
-DISTNAME= url2pkg-1.28
+DISTNAME= url2pkg-1.29
CATEGORIES= pkgtools sysutils
MASTER_SITES= # Nothing
DISTFILES= # Nothing
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} : '\(.*\)\.[^.]*'`