[pacman-dev] difficult symlink "puzzle"

Xavier shiningxc at gmail.com
Sun Jul 8 16:23:48 EDT 2007


On Sun, Jul 08, 2007 at 08:52:48PM +0100, Andrew Fyfe wrote:
> Andrew Fyfe wrote:
> > Xavier wrote:
> >> I'm just realizing there are many odd cases I didn't consider, eg
> >> extracting a directory when a file already exists on the filesystem.
> >> Using only NO_OVERWRITE, the directory will never be extracted,
> >> while with the behavior above, it would be extracted.
> > I forgot about this as well, I need to go do a little more testing :)
> > 
> 
> Without NO_OVERWRITE it always overwrites (DUH :P),
> 
> pkg = file/dir in package
> fs = file/dir on filesystem
> 
> if isfile(pkg) && isdir(fs) then skip
> if isdir(pkg) && isfile(fs) then extract
> 
> Does that look ok or should we skip on both cases?
> 

If we skip the second case, and the package has some files in file/dir, then
this is going to be weird :)
But what I don't get is why doesn't it totally fail in both cases ?
Shouldn't there be a conflict between a regular file and a directory ?
It looks like this isn't the case currently. Apparently, as long as there is
a directory on one side, conflict check are skipped. So there might be a
reason for that, I'm not sure..

I think it's rather between a symlink to a directory and a directory that we
can choose between skipping and extracting, but I could be wrong.




More information about the pacman-dev mailing list