Xavier wrote:
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 :) We could move the file to *.pacold?
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.. Yes if either side is a directory it's missed by the conflict checks. I think the conflict checks need a similar solution to my patch for add_commit().
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. I don't understand (and a directory??), extracting a symlink over a directory should NOT happen.
Slightly OT: Some work is still needed on permissions as well, I've just noticed usr/man/man{1,4} are 0700 :@, not sure what package did it.