tech-pkg archive

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

downgrade fetch writability error to warning

I propose the following small change:


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.

Index: mk/fetch/fetch
RCS file: /cvsroot/pkgsrc/mk/fetch/fetch,v
retrieving revision 1.20
diff -u -r1.20 fetch
--- mk/fetch/fetch	27 Aug 2020 11:45:45 -0000	1.20
+++ mk/fetch/fetch	14 Dec 2021 18:09:58 -0000
@@ -228,10 +228,8 @@

 ${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
+${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