You are not logged in.

#1 2012-02-12 08:53:40

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Existing directories in /var/tmp

makepkg untar its source to /tmp. But it use bsdtar that does not clean an existing directory, it just overwrite existing files. To be sure to build a clean package from a clean directory, we have to rm -rf /tmp/makepkg/src before building the package. Is this an expected behavior? Would it not be preferable to remove an existing build directory before building a package by default? (I would do it unless of course the -e option is given to makepkg).

Offline

#2 2012-02-12 09:02:24

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,658
Website

Re: Existing directories in /var/tmp

makepkg does not untar to /tmp...

Offline

#3 2012-02-12 09:13:27

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Existing directories in /var/tmp

Allan wrote:

makepkg does not untar to /tmp...

From pacman 4, it untar in /tmp/makepkg by default (configurable in /etc/makepkg.conf). Previous version untar it in the directory containing the PKGBUILD file (but although more visible, the problem of not cleaning existing src directory was the same).

Offline

#4 2012-02-12 09:43:09

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,658
Website

Re: Existing directories in /var/tmp

BUILDDIR is actually commented by default...

Anyway, file a bug report asking for this to be fixed.

Offline

#5 2012-02-12 09:55:05

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Existing directories in /var/tmp

Allan wrote:

BUILDDIR is actually commented by default...

Anyway, file a bug report asking for this to be fixed.

Yes that's true, probably I had uncommented it. But I will find a bug because wherever the source is untarred, the problem is the same.

[updated]: bug report: https://bugs.archlinux.org/task/28374

Last edited by olive (2012-02-12 10:03:36)

Offline

#6 2012-02-12 15:28:09

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Existing directories in /var/tmp

Would 'makepkg -cfi' help?

       -c, --clean
           Clean up leftover work files and directories after a successful
           build.

Offline

#7 2012-02-12 16:17:24

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Existing directories in /var/tmp

karol wrote:

Would 'makepkg -cfi' help?

       -c, --clean
           Clean up leftover work files and directories after a successful
           build.

Somehow, yes. But the src will be left if the build is unsuccessful. I think makepkg should clean the src before the build to ensure the integrity of the build. The documentation says that makepkg "download and validate source files" which is not true if there are remaining junk in the src directory. In this case it does not "validate" the source files used to build the package only the downloaded .tar.gz files.

If we want to speed up the build using previous build files, it is IMHO much better to use ccache. Anyway it is not that difficult to just rm -rf src before building.

Offline

Board footer

Powered by FluxBB