pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/fetch Move ${DISTDIR} write permission check to jus...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2bf45f86bab9
branches:  trunk
changeset: 531694:2bf45f86bab9
user:      obache <obache%pkgsrc.org@localhost>
date:      Sat Aug 04 15:00:29 2007 +0000

description:
Move ${DISTDIR} write permission check to just before really need to write.
Patch provided by Aleksej Saushev in PR 36473.

diffstat:

 mk/fetch/fetch |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (37 lines):

diff -r 6a4f316b8860 -r 2bf45f86bab9 mk/fetch/fetch
--- a/mk/fetch/fetch    Sat Aug 04 14:29:43 2007 +0000
+++ b/mk/fetch/fetch    Sat Aug 04 15:00:29 2007 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: fetch,v 1.8 2007/01/18 10:51:48 rillig Exp $
+# $NetBSD: fetch,v 1.9 2007/08/04 15:00:29 obache Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -171,12 +171,6 @@
        exit 1
 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
-
 # Compute the expected size of the fetched file.
 distsize=
 distunits=
@@ -223,6 +217,12 @@
        exit 0
 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
+
 # Set the name of the output file.  In the "resume" case, we initialize
 # the fetch loop by ensuring that the temporary output file already
 # exists.



Home | Main Index | Thread Index | Old Index