delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/19/13:55:31

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Sun, 19 Dec 2004 10:55:19 -0800
From: Yitzchak Scott-Thoennes <sthoenna AT efn DOT org>
To: cygwin AT cygwin DOT com
Subject: how do I uninstall a cygwin snapshot?
Message-ID: <20041219185519.GA3252@efn.org>
Mime-Version: 1.0
User-Agent: Mutt/1.4.1i
Organization: bs"d
X-IsSubscribed: yes

(Subject phrased as a question for the archives.)

If you just installed a cygwin1-ccyymmdd.dll.bz2 snapshot, stop all cygwin
services and reinstall the cygwin package (or reinstall the cygwin package
and then reboot).

If you installed a cygwin-inst-ccyymmdd.tar.bz2 snapshot, do the same,
but in addition to the cygwin package, you may occasionally need to
reinstall additional packages or delete files that do not have a
package, depending on what all was changed in the snapshot.

This perl script, given a tarball name, will identify which files from
which packages are present in a snapshot.  For correct identification,
you need to have previously installed the relevant packages via setup.

#!/usr/bin/perl
use warnings;
use strict;
my @files = `tar tjf $ARGV[0]`
   or die "error getting file list from $ARGV[0]\n";
@files = map { s!(.*?)\r?\n!/$1!; m!/\z! ? () : $_ } @files;
my %files;
my %pkgs;
@files{@files}=@files;
while (keys %files) {
   my $file = each %files;
   my $pkg = `cygcheck -f $file`;
   if ($pkg) {
      $pkg =~ s/-[-\d.]+\r?\n//;
      my @pkgfiles = map { s/\r?\n//; $_} `cygcheck -l $pkg`;
      my @found = grep defined, delete @files{@pkgfiles}
         or die "cygcheck inconsistent for $file/$pkg\n";
      push @{$pkgs{$pkg}}, (@found == @pkgfiles) ? "all" : @found;
   } else {
      push @{$pkgs{"no package"}}, delete $files{$file};
   }
}
for my $pkg (sort keys %pkgs) {
   print "$pkg:\n";
   print "   $_\n" for @{$pkgs{$pkg}};
}

--
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