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

Re: deletion of files

On Wed, 25 Jun 2003, Alan Peery wrote:

> lrtaylor@micron.com wrote:
> >There may be a better way to do this, but you can do it using the find command:
> >
> >	find <base-dir> -name "*.c" -exec rm -f {} \;
> >
> A more cautious person  runs
> find <base-dir> -name "*.c" -print
> before running the previous command.
> This lets you catch yourself being silly.  You may also spot the hard 
> links (rather than symlinks) to other directories that someone has been 
> scattering around the hard drive before you got there.  That one hurt. :-(
> RPM technology is still on my "to be learned" list, so I may be 
> incorrect here, but this looks quite dangerous to me.  If this command 
> is going into a before or after script for an RPM package, this could 
> cause major problems if the installing user choses to use a different 
> root directory for installation...  Shouldn't the list of files be 
> contained in the package header, and thus automatically removed at 
> package removal?
Hehe,  I put out this one application, Tech Tracker, and was not using 
such a method (i.e. either using RPM to keep track of the files, or in
the case of a tarball, generating a manifest and only deleting the files
that were installed).  Instead I was doing a "rm -rf" on the install
directory.  Well, one day I get an email from some irate admin in Israel
complaining that he set the install dir to /opt, and....well you can 
imagine the rest.  At least I know I did my part for world peace (-;

Seriously, absolutely you do not want to use the above approach to 
figure out what files need to go away when a package is removed.  let
rpm do the work for you, as it only does explicit deletes of what it 


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