Thu Dec 16 14:10:46 2021 UTC ()
The non-writability check for DISTDIR is intended to prevent wasting
resources when fetchers wouldn't be able to save what they download. On
my build farm with pkgsrc (and pkgsrc/distfiles) mounted over NFS,
however, the check gives false positives for NetBSD 9.2 and -current.
Downgrade it to a warning so that these fetches can succeed, while
leaving a breadcrumb in case someone encounters a true positive.
It would of course be interesting to sort out why, in my environment, a
wide variety of other OSes get 1 for "${TEST} ! -w $fetchdir" while
NetBSD gets 0. In the meantime, joerg@ suggested this workaround and
gdt@ agrees it's reasonable to try.
(schmonz)
diff -r1.20 -r1.21 pkgsrc/mk/fetch/fetch
--- pkgsrc/mk/fetch/fetch 2020/08/27 11:45:45 1.20
+++ pkgsrc/mk/fetch/fetch 2021/12/16 14:10:46 1.21
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: fetch,v 1.20 2020/08/27 11:45:45 jperkin Exp $
+# $NetBSD: fetch,v 1.21 2021/12/16 14:10:46 schmonz Exp $
#
# Copyright (c) 2006, 2015 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -228,10 +228,8 @@
fi
${TEST} -d $fetchdir || ${MKDIR} -p $fetchdir 2>/dev/null
-if ${TEST} ! -w $fetchdir; then
- ${ECHO} 1>&2 "$self: Cannot write to `cd $fetchdir && pwd`"
- exit 1
-fi
+
+${TEST} -w $fetchdir || ${ECHO} 1>&2 "$self: WARNING: DISTDIR `cd $fetchdir && pwd` looks non-writable."
# Set the name of the output file. In the "resume" case, we initialize
# the fetch loop by ensuring that the temporary output file already