[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-stow] address@hidden: Bug#133243: stow deletes directories it d

From: Gaël Roualland
Subject: Re: [Bug-stow] address@hidden: Bug#133243: stow deletes directories it did not create if they're empty.]
Date: Tue, 12 Feb 2002 16:51:09 +0100 (CET)

Guillaume Morin a écrit :

> Dans un message du 12 fév à  1:41, Gaël Roualland écrivait :
> > > If you create a /usr/local/stow/foo/bin/bar file, then 'stow' the 'foo'
> > > package, things works fine.
> > > 
> > > However, when I want to delete the 'foo' package, stow deletes the
> > > /usr/local/bin directory, if it's empty. I think this is a bug, as stow
> > > didn't create this dir in the first place.
> > 
> > Is that really a bug ?? if the directory was share/package, it would
> > seem logical that stow removes it with the package. 
> > 
> > And except from hard coding some well know directories (bin, lib, etc,
> > ...) in sto,w I don't see how to avoid these problems. And removing an
> > empty directory is not a big deal since it contains nothing...
> There is two possible behaviors
> 1) We remove empty directories. This is what we do at the moment.
> 2) If a directory is a symlink to the package directory, we remove it.
> If it is not, we just leave it. Of course, this means that there will be
> some leftovers. So we should print an warning, something like 'Warning:
> foo is empty, Stow will not remove it. You might want to delete it
> yourself'. We can image to introduce a switch to force the removing of
> empty directories...
> What I meant is to at least think about 2)...
> What do you think ?

Yes, that might be a saner behavior actually... Thinking on how stow
operates, it is theorically not possible to have a directory populated by
links to only one package, since then stow will create the directory as a
link to the package directory, instead of linking its contents. So if we
happen to be in the situation where we have a directory with only links to
one package, it was probably not created by stow (or somebody unstowed
something not in the stow way).

However, we have to think of this issue together with the wanted "fast
unstow" functionnality: I guess to do that, we need to scan the package
for it's files and directories, and check in the target directory if
there are links to it where expected, instead of scanning the target
directory for links to the package. What about "expanded directory" then
? Suppose we have a common directory "stuff" with files from two packages
"A" and "B". As said before, unstowing "A" the regluar way will turn the
"stuff" directory into a link to "B/stuff". But would the "fast unstow" do
that too ? (which requires scanning the "stuff" directory and its
subdirectories for links and check if they all point to the same package
-- this would be more or less like scanning the whole target
directory for a package spanning several current directories). If not,
then we might create empty directories on purpose, and knowing wether we
need to leave them or not would not be as easy...

Other thoughts ?


Gaël Roualland -+- address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]