summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-08-21 15:22:45 +0000
committerjoerg <joerg@pkgsrc.org>2008-08-21 15:22:45 +0000
commita53176bf0ef62ccf6c8a19085a37dda1750646bb (patch)
tree2b744f826583ad97207454846c14b7ebed9784d2 /net
parent58ed6ec92479ed6924c4f8b2f86a1be4a8fbaca9 (diff)
downloadpkgsrc-a53176bf0ef62ccf6c8a19085a37dda1750646bb.tar.gz
libfetch-2.15:
Rewrite errlist processing to include the full message, not just the first word.
Diffstat (limited to 'net')
-rw-r--r--net/libfetch/Makefile4
-rw-r--r--net/libfetch/files/Makefile12
-rw-r--r--net/libfetch/files/errlist.awk12
-rwxr-xr-xnet/libfetch/files/errlist.sh11
4 files changed, 19 insertions, 20 deletions
diff --git a/net/libfetch/Makefile b/net/libfetch/Makefile
index 90425d87e4e..2ffb7137409 100644
--- a/net/libfetch/Makefile
+++ b/net/libfetch/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.17 2008/05/09 00:39:06 joerg Exp $
+# $NetBSD: Makefile,v 1.18 2008/08/21 15:22:45 joerg Exp $
#
-DISTNAME= libfetch-2.14
+DISTNAME= libfetch-2.15
CATEGORIES= net
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/net/libfetch/files/Makefile b/net/libfetch/files/Makefile
index 85c35b87bf7..699f9ee78df 100644
--- a/net/libfetch/files/Makefile
+++ b/net/libfetch/files/Makefile
@@ -31,12 +31,12 @@ CPPFLAGS+= -DFTP_COMBINE_CWDS
WARNS?= 4
-ftperr.h: ${.CURDIR}/ftp.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.awk
- awk -v variable=ftp_errlist -v protocol=FTP \
- -f ${.CURDIR}/errlist.awk ${.CURDIR}/ftp.errors > ${.TARGET}
+ftperr.h: ${.CURDIR}/ftp.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
+ ${.CURDIR}/errlist.sh ftp_errlist FTP \
+ ${.CURDIR}/ftp.errors > ${.TARGET}
-httperr.h: ${.CURDIR}/http.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.awk
- awk -v variable=http_errlist -v protocol=HTTP \
- -f ${.CURDIR}/errlist.awk ${.CURDIR}/http.errors > ${.TARGET}
+httperr.h: ${.CURDIR}/http.errors ${.CURDIR}/Makefile ${.CURDIR}/errlist.sh
+ ${.CURDIR}/errlist.sh http_errlist HTTP \
+ ${.CURDIR}/http.errors > ${.TARGET}
.include <bsd.lib.mk>
diff --git a/net/libfetch/files/errlist.awk b/net/libfetch/files/errlist.awk
deleted file mode 100644
index 720705cc397..00000000000
--- a/net/libfetch/files/errlist.awk
+++ /dev/null
@@ -1,12 +0,0 @@
-BEGIN {
- printf "static struct fetcherr %s[] = {\n", variable
-}
-
-/^#/ { next }
-
-{ printf "\t{ %d, FETCH_%s, \"%s\" },\n", $1, $2, $3 }
-
-END {
- printf "\t{ -1, FETCH_UNKNOWN, \"Unknown %s error\" }\n", protocol
- printf "};\n"
-}
diff --git a/net/libfetch/files/errlist.sh b/net/libfetch/files/errlist.sh
new file mode 100755
index 00000000000..673103389e9
--- /dev/null
+++ b/net/libfetch/files/errlist.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# $NetBSD: errlist.sh,v 1.1 2008/08/21 15:22:45 joerg Exp $
+
+printf "static struct fetcherr $1[] = {\n"
+while read code type msg; do
+ [ "${code}" = "#" ] && continue
+ printf "\t{ ${code}, FETCH_${type}, \"${msg}\" },\n"
+done < $3
+
+printf "\t{ -1, FETCH_UNKNOWN, \"Unknown $2 error\" }\n"
+printf "};\n"