From fadd5e615c795475f5b4d8d18aeb21e3825144ed Mon Sep 17 00:00:00 2001 From: jmmv Date: Fri, 7 Sep 2012 12:48:32 +0000 Subject: 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. --- sysutils/sysupgrade/Makefile | 4 ++-- sysutils/sysupgrade/files/sysupgrade.sh | 4 +++- sysutils/sysupgrade/files/sysupgrade_test.sh | 16 ++++++++++++---- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'sysutils/sysupgrade') 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 <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 \ -- cgit v1.2.3