pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/fetch The non-writability check for DISTDIR is inte...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a0f031d87fe6
branches:  trunk
changeset: 771288:a0f031d87fe6
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Thu Dec 16 14:10:46 2021 +0000

description:
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.

diffstat:

 mk/fetch/fetch |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (24 lines):

diff -r 75291c3a3706 -r a0f031d87fe6 mk/fetch/fetch
--- a/mk/fetch/fetch    Thu Dec 16 13:44:49 2021 +0000
+++ b/mk/fetch/fetch    Thu Dec 16 14:10:46 2021 +0000
@@ -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



Home | Main Index | Thread Index | Old Index