This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setup.exe sizes openldap-2-2-15


Brian Dessent schrieb:
Reini Urban wrote:
Esp. "Replaces: sh-utils fileutils textutils" would be needed for
coreutils. And it doesn't require additional user-input.

It's not strictly necessary. There's already the _ZZZRemovedPackages thing where you can stick dummy empty packages of things that have gone away.

Sure, but this is ugly, and Robert has already written most of the "Replaces:" codepath and much more.
My upset patch for this is on the way (well, I attach it), and the setup.exe needs further testing.
--
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/
? mksetup
? upset.patch
Index: upset
===================================================================
RCS file: /cvs/sourceware/infra/bin/cygwin/upset,v
retrieving revision 1.25
diff -u -b -r1.25 upset
--- upset	19 Sep 2003 17:18:42 -0000	1.25
+++ upset	27 Oct 2004 01:57:10 -0000
@@ -26,8 +26,15 @@
 my $package = new Cygwin::Setup;
 
 $. = 0;
-if ($u && open(U, $u)) {
+if ($u && open(U, '<', $u)) {
     $initfn = $u;
+    if ($u =~ /.bz2$/) {
+      $initfn =~ s/\.bz2$//;
+      if (system "bunzip2 $u") {
+	$u = $initfn;
+	open(U, '<', $u);
+      }
+    }
     while ($package->iniparse ($u, \*U)) {
 	next;
     }
@@ -100,15 +107,25 @@
     } else {
 	print "category: ", 'Misc', "\n";
     }
-    if ($pkgbase->{'requires'}) {
-	foreach my $r (split(' ', $pkgbase->{'requires'})) {
+    # keys which take multiple packages (only partial setup.exe support yet)
+    foreach my $key (@Cygwin::Setup::pkgkeys) {
+      if ($pkgbase->{$key}) {
+	foreach my $r (split(' ', $pkgbase->{$key})) {
 	    if (!defined($package->{$r})) {
-		warn "upset: *** warning package $p requires non-existent package $r\n";
+		warn "upset: *** warning package $p $key non-existent package $r\n";
+	    }
+	}
+	print $key, ": ", $pkgbase->{$key}, "\n";
+	delete $pkgbase->{$key};
+      }
+    }
+    # other new keys
+    foreach my $key (@Cygwin::Setup::otherkeys) {
+      if ($pkgbase->{$key}) {
+	print $key, ": ", $pkgbase->{$key}, "\n";
+	delete $pkgbase->{$key};
 	    }
 	}
-	print "requires: ", $pkgbase->{'requires'}, "\n";
-	delete $pkgbase->{'requires'};
-    };
     for my $g ('', 'prev', 'test') {
 	my $ver = $pkg->{$g} or next;
 	print "[$g]\n" if length($g);
@@ -148,6 +165,8 @@
 
 if ($u) {
     my $changed = 0;
+    die "Couldnt open $u" unless $initfn;
+    close(U);
     open(STDOUT, ">/dev/null");
     system  qw/diff -I^setup-timestamp -w -B -q/, $initfn, $newfn and do {
 	system 'mv', $newfn, $initfn;
Index: Cygwin/Setup.pm
===================================================================
RCS file: /cvs/sourceware/infra/bin/cygwin/Cygwin/Setup.pm,v
retrieving revision 1.13
diff -u -b -r1.13 Setup.pm
--- Cygwin/Setup.pm	1 Mar 2003 05:21:34 -0000	1.13
+++ Cygwin/Setup.pm	27 Oct 2004 01:57:11 -0000
@@ -8,7 +8,15 @@
 BEGIN {
     $Cygwin::Setup::stringkeys = qr!^(?:sdesc|ldesc)$!io;
     $Cygwin::Setup::validstates = qr!^(?:curr|test|prev|exp)!;
-    $Cygwin::Setup::replacekeys = qr!^(?:sdesc|ldesc|category|requires|skip|verpat|external-source)$!io;
+    @Cygwin::Setup::pkgkeys = 0 ? qw(requires Recommends Replaces Depends Pre-Depends Build-Depends
+				     Conflicts Suggests Provides)
+                                : qw(requires);
+    @Cygwin::Setup::otherkeys = 0 ? qw(Maintainer Architecture Source Binary Standards-Version
+				       Priority Files Directory)
+                                : ();
+    @Cygwin::Setup::replacekeys = qw( sdesc ldesc category requires skip verpat external-source );
+    push(@Cygwin::Setup::replacekeys, (@Cygwin::Setup::pkgkeys, @Cygwin::Setup::otherkeys));
+    $Cygwin::Setup::replacekeys = qr!^(?:@{[join('|' => @Cygwin::Setup::replacekeys)]})$!io;
     $Cygwin::Setup::skipkeys = qr!^(?:version|install|source)$!io;
     $Cygwin::Setup::validinikeys = qr!^(?:setup-timestamp|setup-version)$!io;
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]