On Sun, Dec 11, 2005 at 06:45:59PM +0100, Andreas Bartelt wrote:
> My goal is to savely remove all files from older releases, which aren't 
> needed anymore.

This is simple scripts which gets at least two arguments. First is
filelist from your current running system and the second is directory
which should be scanned for some old stuff. If filelist is a signle
dash (`-') clean-up reads from standard input.

Filelist can be generated (useful if you are running OpenBSD-current)
from `makeflist' script and directly send to clean-up which can check
`sbin' directory for obsolete files:

        # ( cd /usr/src/distrib/sets && sh makeflist ) | \
                sh clean-up - sbin > review-remove.txt

After upgrade to newer release or snapshot from tgz sets you can create
filelist with tar(1):

        $ echo base??.tgz man??.tgz | xargs -n1 tar -ztf > current.txt
        $ sh clean-up current.txt sbin usr/share > review-remove.txt

You _must_ carefuly review output file from clean-up and remove lines
with files and directories which should not be removed from your system.
After review xargs(1) utility can simply wipeout obolete stuff:

        # cat review-remove.txt | ( cd ${DESTDIR:=/} && xargs rm )

References:
 1. http://kubek.no-ip.org/~hns/downloads/bsd/sh.clean-up

-- 
best regards
q#

Reply via email to