Subject: Re: pkg/36473: Postpone ${DISTDIR} write permission check till it's really needed
To: None <gnats-bugs@NetBSD.org>
From: Aleksej Saushev <asau@hotbox.ru>
List: pkgsrc-bugs
Date: 07/21/2007 21:20:47
"OBATA Akio" <obache@netbsd.org> writes:

>  On Tue, 12 Jun 2007 04:10:00 +0900, Aleksej Saushev <asau@hotbox.ru> wrote:
>  
>  > When write permission is checked after it's made sure
>  > distribution file is missing, it becomes possible to use the
>  > same DISTDIR for private pkgsrc tree in more convenient way.
>  > It allows building from read-only DISTDIR.
>  > The regular user is no longer forced to create links into
>  > "system-wide" DISTDIR nor to loose his efforts just to make
>  > separate custom installation of ported software.
>  
>  Normally, mk/fetc/fetch is never called if all DISTFILES exists in DISTDIR.

Sorry, it contradicts the facts.

> is mk/fetch/fetch called even if all DISTFILE exists?

It is. See:

$ cd /usr/pkgsrc/archivers/unzip/
$ make
=> Required installed package digest>=20010302: digest-20060826 found
audit-packages: not found
===> Skipping vulnerability checks.
WARNING: No /pkg-vulnerabilities file found.
WARNING: To fix run: `download-vulnerability-list'.
=> Fetching unzip552.tgz
fetch: Cannot write to /usr/pkgsrc/distfiles/unzip-5.52
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/archivers/unzip
$ stat /usr/pkgsrc/distfiles/unzip-5.52/unzip552.tar.gz >/dev/null && echo ok
ok
$ id -u
1000
$ stat /usr/pkgsrc/distfiles | cut -d ' ' -f1-6
5 539392 drwxr-xr-x 41 root wheel

With fresh pkgsrc tree.

Thus, you can't reuse read-only DISTDIR.