[Top][All Lists]

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

$INSTALL_LOG for install(1)

From: Frank Tobin
Subject: $INSTALL_LOG for install(1)
Date: Sun, 24 Mar 2002 19:57:56 -0500 (EST)

Note: If you reply to this, please CC me (I'm not on the list).

A co-worker and I happened to be talking about different packaging
mechanisms, and what most people really need.  What always tends to be a
problem is tracking non-packaged installed tarballs (the old ./configure;
make; make install routine).  My co-worker is very technically adept, but
he concedes that he doesn't bother installing from tarballs because they
get lost on the system; removing them becomes a pain.

This got us thinking to how such installations could be tracked, and it
turns out to be a pretty simple idea that we thought of.  Since most
GNU-tool-based tarballs use install(1) to move files into the system, why
not setup a little catch inside of install(1) to record what it's putting

So I created a little patch (attached) to install(1) so that each time it
copies a file, it writes a small log to the file named in $INSTALL_LOG, if
it's set.  The idea is that you set $INSTALL_LOG to a filename before you
run "make install", run "make install", and then you can stuff the logfile
away after running the install, needing only the logfile later to
deinstall the program.  Of course, program installs can be more complex
than simply copying files, but that sort of leads me to my next point...

What does this have over "make uninstall"?  Well, it's simpler to use, for
one.  You also don't need to keep the source tree around for the Makefiles
merely to remove a program, and execute code to deinstall.  The
deinstallation procedure is quite simple;  the log messages are merely
lines of "install: /foo/bar".  This is human-readable, and you can 'see'
what was installed, too, easily.  E.g., from just installing nilsimsa:

install: /usr/local/doc/nilsimsa/index.html
install: /usr/local/doc/nilsimsa/index-1.html
install: /usr/local/doc/nilsimsa/index-2.html
install: /usr/local/doc/nilsimsa/index-3.html
install: /usr/local/doc/nilsimsa/index-4.html
install: /usr/local/doc/nilsimsa/index-5.html
install: /usr/local/doc/nilsimsa/index-6.html
install: /usr/local/bin/nilsimsa

The goal: you manipulate this easily with text-processing utils.  Maybe
people are looking for this functionality, maybe not.  I think it's a
nice, clean solution that is much better than relying on "make uninstall".
"make uninstall" has the potential to be much more powerful, but takes a
huge complexity hit.

Note that install(1) doesn't record creating directories, only copying
files.  The make_path was external to install.c, and I wanted keep my
changes minimal.

Any comments/ideas on this subject are appreciated.  Have people thought
of this before and been shot down?

Disclaimer: I don't like writing C, so you're likely to find a problem in
the attached patches.  However, again, it's really a simple patch.

I didn't write any docs for it, because I don't know TeX or roff.

Oh, and I created a test too for this functionality (also attached).

Frank Tobin             http://www.neverending.org/~ftobin/

Attachment: create-log
Description: tests/install/create-log

Attachment: fileutils.diff
Description: fileutils.diff

reply via email to

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