On 09/ 3/10 02:00 PM, [email protected] wrote:
On Fri, Sep 03, 2010 at 01:53:09PM -0700, Shawn Walker wrote:
This was done intentionally because we essentially have no way to
guarantee that the target directory isn't being used for something
else or that continuing with the operation won't cause loss of data
or other unexpected behaviour.

I really didn't want to have to verify that the target directory was
really empty although I could be convinced that approach is valid.

At least in the case of a mountpoint, it seems excessive to require
creation a subdirectory just to add a pkg repository.  Having one
filesystem per repo is a model that would be easy to administer through
ZFS.

It should be relatively easy to see if a directory is empty or not,
though.

if len(os.listdir(repodir))>  0:
        raise DirectoryNotEmptyError

or something similar, would work nicely.

Yes, I'm aware it's simple to do, it just seemed somewhat wrong that given that a repository is a pre-defined set of directories that a creation operation wouldn't actually be the one to create that entire set.

We've also had feedback from users in the past that they were surprised when they pointed at a directory that wasn't a repository and pkg.depotd started putting things in it.

As I said, I could be convinced that simply checking for an empty directory is reasonable.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to