how to implement uninstall & Logging paths of installed files?

Isaac Jones ijones at syntaxpolice.org
Tue Sep 19 12:38:43 EDT 2006


"Johan Tibell" <johan.tibell at gmail.com> writes:

>> I think that logging & uninstall could be implemented quite
>> effectively by tweaking the "install" target so that it first copies
>> stuff into a temporary location, then uses a "find" type algorithm to
>> discover all of the files that are meant to be installed.
>
> I have essentially already implemented the find algorithm under the
> assumption that files that would be copied to for example /usr/bin
> will be but in /my/tmp/dir/usr/bin during the build. 

I don't think I understand your assumption. What do you mean "during
the build"? I think the only way to make sure that your paths are
correct is to do a "fake" install into a temp directory and then do a
recursive copy.

For instance, I think we have dist/build/foo/foo.exe (or something)
would get installed in /usr/bin/foo.exe, and dist/doc/foo.html would
be installed in /usr/share/doc/foo/foo.html.  So the install paths
aren't correct at build time, only at install time.

> I've also written a piece of code that removes the files again given
> a log file with paths. 

Cool!

> The files are removed in a way that will also remove empty
> directories. I was thinking of putting a timestamp on the files as
> well. 

And maybe a sha1 sum?

> I also added a dry-run feature. Perhaps storing the log files
> somewhere under Cabal's install dir would be a good idea?

Yeah :)

peace,

  isaac


More information about the cabal-devel mailing list