Yeah, I can definitely see the appeal in not just creating directories all over the place - in the case of misspellings, for instance. I guess you could have some configuration flags to switch auto-creation on or off, but you could just as well consider that to be unnecessary bloat. Hm, after looking closer at the resulting directory structures I realize that makepkg actually appends pkgname to SRCDEST and BUILDDIR. So, as William says, there's really no reason to automatically create SRCDEST or PKGDEST since you don't need to keep them package-specific. Guess I didn't RTFM properly. :D I don't think auto-creation is needed. Changing the error message in case SRCDEST or PKGDEST don't exist might be good, but it's not exactly difficult to figure out that the problem is that the directory doesn't exist. Thanks for the input! /Emil On Tue, Jan 7, 2014 at 5:58 PM, Allan McRae <allan@archlinux.org> wrote:
On 07/01/14 18:33, William Giokas wrote:
On Mon, Jan 06, 2014 at 10:37:22PM +0900, Emil Lundberg wrote:
Hello!
While playing around with a package of mine, I noticed that the command
$ SRCDEST=/tmp/emil/foo/src makepkg
fails with error message "You do not have write permission to store downloads in /tmp/emil/foo/src." if the directory does not already exist. Likewise, setting PKGDEST to a nonexistent directory causes failure with error message "You do not have write permission to store packages in PKGDEST".
I patched /usr/bin/makepkg to create the directories if necessary, and now it works fine. Since it was so easy, and I imagine others have experimented with the above environment variables, I am lead to ask: Is this behaviour by design, or should I submit my patch?
I believe that it is a feature. It also does it with a few of the other 'DEST' variables, namely SRCPKGDEST and LOGDEST, as well as BUILDDIR. I consider this a feature. These directories are something that the user should keep maintained, and should not be dismantled or removed on a whim, with the exception of BUILDDEST. Even if you are using a directory in /tmp or some other temporary filesystem, you can use tmpfiles.d(5) to guide you on how to auto-create a directory or directories. I currently do this to save some disk activity on my SSD.
You can still submit the patch, however this has a -1 from me already.
I'm +/-0 on whether makepkg should create these, but there error message in the case the directory does not exist could be changed.
Allan