Re: "pkg upgrade" failing with "Fail to create temporary file: ... Not a directory"

From: Michael Gmelin <grembo_at_freebsd.org>
Date: Thu, 28 Apr 2022 12:20:48 UTC

On Thu, 28 Apr 2022 12:31:06 +0200
Stefan Esser <se@FreeBSD.org> wrote:

> Am 28.04.22 um 09:11 schrieb Baptiste Daroussin> It is 2 things, it
> is a port problem of maintainers who do not check for
> > upgradability of their packages, and it can also been seen as
> > something pkg can deal with, but a complicated case, so I don't
> > know yet how.
> > 
> > The main issue is a file in vX which becomes a directory in vX+1
> > which goes in the way pkg does extract files to be as atomic as
> > possible.  
> 
> This case could be caught and dealt with by removing the file or by
> moving it out of the way (to a temporary name to allow it to be
> recovered if the subsequent steps fail or to be deleted if they
> succeed).
> 
> Further special conditions may apply - but since there is no way a
> file and directory can exist under the same name (on FreeBSD, at
> least), it is safe to assume that the file will not be kept when the
> package is installed.

The opposite case seems more interesting/problematic.

-m

-- 
Michael Gmelin