delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/03/11:46:54

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Vin Shelton <vshelton AT aoainc DOT com>
Subject: Re: Uhh-oh, I used a non-standard directory for install
Date: Fri, 03 Nov 2006 11:42:01 -0500
Lines: 32
Message-ID: <eifrgq$f6p$1@sea.gmane.org>
References: <003f01c6ff35$e5aede30$210110ac AT TOSHIBASOBE> <01ad01c6ff43$beae6630$a501a8c0 AT CAM DOT ARTIMI DOT COM>
Mime-Version: 1.0
User-Agent: Thunderbird 1.5.0.7 (Windows/20060909)
In-Reply-To: <01ad01c6ff43$beae6630$a501a8c0@CAM.ARTIMI.COM>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hey that's nice, thanks.

Dave Korn wrote:
>   Yep.  It's in /etc/setup/installed.db.  Here's a shell script to generate a
> dos batch file to remove all your cygwin files.
> 
> #!/bin/bash
> cut -f1 -d' ' < /etc/setup/installed.db | grep -v INSTALLED.DB \
> | xargs cygcheck -l | xargs cygpath -w  | sed -e 's/^/del /g' \
>> remove-all-cyg-files.bat
> 
> 
>   This doesn't take care of the left-over directories.  Running the list
> through dirname sort uniq xargs cygpath and sed 's/^/rd /g'
>> another-batch-file.bat is left as an exercise for the reader.

I noticed a couple of small potential gotchas: the generated batch file has 
some of the filenames repeated.  Also, in my installation there is one file 
name with spaces:

e:\cygwin\usr\share\lcms\profiles\sRGB Color Space Profile.icm

so here is a version modified slightly to remove duplicate filenames and to 
handle filenames with spaces.

     #!/bin/bash
     cut -f1 -d' ' < /etc/setup/installed.db | grep -v INSTALLED.DB | \
     xargs --delim='\n' cygcheck -l | xargs --delim='\n' cygpath -w  | \
     sed -e 's/\(.*\)/del "\1"/g' | sort -u > remove-all-cyg-files.bat

Regards,
   Vin Shelton


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019