<p><br>
On Feb 18, 2013 3:32 AM, "Vinay Sajip" <<a href="mailto:vinay_sajip@yahoo.co.uk">vinay_sajip@yahoo.co.uk</a>> wrote:<br>
><br>
> PJ Eby <pje <at> <a href="http://telecommunity.com">telecommunity.com</a>> writes:<br>
><br>
> > Yes - it's unnecessary for library directories (e.g. stuff under<br>
> > site-packages).  You may safely remove any empty subdirectory of the<br>
> > directories containing the .dist-info, that is a parent of any of the<br>
> > files belonging to the distribution you are uninstalling.  (In<br>
><br>
> I'm not so much concerned about that - as you say, .dist-info lives under<br>
> site-packages, so you know where site-packages is, and you *know* it's a<br>
> shared location between distributions. What you don't necessarily know is where<br>
> anything *else* is - scripts, man pages, HTML docs etc., and that was the focus<br>
> of my post.<br>
><br>
> > addition, you may optionally detect and offer to remove extraneous<br>
> > files by cross-checking against all other .dist-info records for that<br>
> > same directory -- a file not listed anywhere is an orphan.)<br>
><br>
> That might be a reasonable thing for a "clean" command to do, but it's not<br>
> necessarily something you might want to run on every uninstallation:<br>
><br>
> (a) I'm not sure, if someone has a lot of distributions, whether there might<br>
>     be a noticeable pause while all the distributions are checked.<br>
><br>
> (b) For the time being, a lot of distributions will not have all the metadata<br>
>     available - e.g. ones installed using distutils, or installed using a<br>
>     distro package manager. So the information to do this is generally not<br>
>     all there.<br>
><br>
> > Scripts, man pages, and all that are a separate issue.  I would think<br>
> > it would *generally* be safe to use the "remove any empty subdirectory<br>
> > of the relevant base directory which is a parent of a file you<br>
> > uninstalled" rule, but orphan detection would not be possible, and<br>
> > there's some possibility that you could delete an empty directory<br>
><br>
> I don't have a problem with deleting empty directories - it's more about<br>
> alerting users about directories that aren't empty, which were originally<br>
> installed into. Since you can override installation directories at the<br>
> time of installation, there is no way  that you can tell that such-and-such a<br>
> directory was used for scripts (=> likely to be shared with other<br>
> distributions), unless you record the values actually used.<br>
><br>
> > erroneously.  For that purpose, some sort of site-local configuration<br>
> > might be useful, especially if it tracks local conventions like being<br>
> > able to say that e.g., /usr/share/doc/$DISTNAME-$VERSION is the base<br>
> > directory for a package's docs and that it should be considered<br>
> > distribution-owned (and therefore removed if empty, and considered to<br>
> > have orphans if any non-project files are in it).<br>
><br>
> ISTM that what I suggested is a sort of site-local configuration - it's just<br>
> dist-local. The problem I described wouldn't arise if you could be sure that<br>
> everything was always in the same place, FHS-style. It's because users are<br>
> allowed to override locations that we need to store what their choices were<br>
> when they installed something.</p>
<p>If you want eby-style uninstall to be fast, index record in sqlite in a post-install hook.</p>
<p>I'm horrified that "overwrite any file on my system" is a feature. I think gem and npm get along without it, if you want to write into /etc then you should be building rpms.</p>
<p>Bento (used to?) optionally write the install scheme to a .py file named by the package author. Just lines of variable assignments path name = "some-path". And only if your program needs it at run time.</p>
<p>It doesn't have to be another all capital letters filename in dist-info either. In the old system all the egg-info metadata was lowercase file names except PKG-INFO. Somehow uppercase has become the new style. I am guilty of it as well with WHEEL.</p>

<p>For the uninstall, recording created directory names in record is the most potentially sensible thing. It feels very wrong for the uninstaller to care about which folders are scripts and docs. You will have to explain more clearly to convince me.</p>

<p>Daniel Holth</p>