summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2012-09-07 12:48:32 +0000
committerjmmv <jmmv@pkgsrc.org>2012-09-07 12:48:32 +0000
commitfadd5e615c795475f5b4d8d18aeb21e3825144ed (patch)
tree1964acd1981a3f03a77ecd761ed47b3331a3dd32 /sysutils
parentf38c58efa51ae6b00f11a13a52d157e9e6906c5a (diff)
downloadpkgsrc-fadd5e615c795475f5b4d8d18aeb21e3825144ed.tar.gz
Update to 1.3:
- ftp(1) in NetBSD 1.5.2 does not support using -R on files that do not exist yet. Avoid using this option unless necessary. - httpd(8) in NetBSD 1.5.2 does not support the -P option. Skip the http test unless this option is present, as otherwise we cannot easily kill the spawned httpd instance on a test failure.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/sysupgrade/Makefile4
-rw-r--r--sysutils/sysupgrade/files/sysupgrade.sh4
-rw-r--r--sysutils/sysupgrade/files/sysupgrade_test.sh16
3 files changed, 17 insertions, 7 deletions
diff --git a/sysutils/sysupgrade/Makefile b/sysutils/sysupgrade/Makefile
index 49223289a07..f5df71e4c28 100644
--- a/sysutils/sysupgrade/Makefile
+++ b/sysutils/sysupgrade/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.3 2012/08/25 01:57:27 jmmv Exp $
+# $NetBSD: Makefile,v 1.4 2012/09/07 12:48:32 jmmv Exp $
-DISTNAME= sysupgrade-1.2
+DISTNAME= sysupgrade-1.3
CATEGORIES= sysutils
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/sysutils/sysupgrade/files/sysupgrade.sh b/sysutils/sysupgrade/files/sysupgrade.sh
index 27eefe1d3bb..2214789f12a 100644
--- a/sysutils/sysupgrade/files/sysupgrade.sh
+++ b/sysutils/sysupgrade/files/sysupgrade.sh
@@ -210,7 +210,9 @@ sysupgrade_fetch() {
local url="${releasedir}/${relative_file}"
shtk_cli_info "Downloading ${url} into ${cachedir}"
rm -f "${local_file}"
- ftp -R -o"${local_file}.tmp" "${url}" \
+ local rflag=
+ [ ! -f "${local_file}.tmp" ] || rflag=-R
+ ftp ${rflag} -o"${local_file}.tmp" "${url}" \
|| shtk_cli_error "Failed to fetch ${url}"
mv "${local_file}.tmp" "${local_file}"
fi
diff --git a/sysutils/sysupgrade/files/sysupgrade_test.sh b/sysutils/sysupgrade/files/sysupgrade_test.sh
index df6f263d508..18e6dec9318 100644
--- a/sysutils/sysupgrade/files/sysupgrade_test.sh
+++ b/sysutils/sysupgrade/files/sysupgrade_test.sh
@@ -278,6 +278,8 @@ EOF
PATH="$(pwd):${PATH}"
SYSUPGRADE_CACHEDIR="$(pwd)/a/b/c"; export SYSUPGRADE_CACHEDIR
+ mkdir -p a/b/c
+ touch a/b/c/foo.tgz.tmp
atf_check -o ignore -e ignore sysupgrade -c /dev/null \
-o RELEASEDIR="ftp://example.net/pub/NetBSD/X.Y/a-machine" \
-o KERNEL=GENERIC -o SETS="a foo" fetch
@@ -285,7 +287,6 @@ EOF
cat >expout <<EOF
Command: ftp
Directory: $(pwd)
-Arg: -R
Arg: -o$(pwd)/a/b/c/a.tgz.tmp
Arg: ftp://example.net/pub/NetBSD/X.Y/a-machine/binary/sets/a.tgz
@@ -297,7 +298,6 @@ Arg: ftp://example.net/pub/NetBSD/X.Y/a-machine/binary/sets/foo.tgz
Command: ftp
Directory: $(pwd)
-Arg: -R
Arg: -o$(pwd)/a/b/c/netbsd-GENERIC.gz.tmp
Arg: ftp://example.net/pub/NetBSD/X.Y/a-machine/binary/kernel/netbsd-GENERIC.gz
@@ -313,8 +313,16 @@ fetch__http_head() {
fetch__http_body() {
create_mock_release www/a-machine base comp etc netbsd-GENERIC tests text
- /usr/libexec/httpd -b -s -d -I 30401 -P "$(pwd)/httpd.pid" "$(pwd)/www" \
- || atf_fail "Failed to start test HTTP server"
+ if ! /usr/libexec/httpd -b -s -d -I 30401 -P "$(pwd)/httpd.pid" \
+ "$(pwd)/www" >httpd.out 2>httpd.err; then
+ if grep 'unknown option -- P' httpd.err >/dev/null; then
+ atf_skip "httpd does not support -P"
+ else
+ sed 's,^,httpd.out:,' httpd.out
+ sed 's,^,httpd.err:,' httpd.err
+ atf_fail "Failed to start test HTTP server"
+ fi
+ fi
SYSUPGRADE_CACHEDIR="$(pwd)/cache"; export SYSUPGRADE_CACHEDIR
atf_check -o ignore -e ignore sysupgrade -c /dev/null \