Index: postinstall.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/postinstall.cc,v
retrieving revision 2.25
diff -u -r2.25 postinstall.cc
--- postinstall.cc	30 Jul 2010 20:53:42 -0000	2.25
+++ postinstall.cc	27 Aug 2010 17:06:39 -0000
@@ -161,13 +161,29 @@
       Progress.SetBar2 (k, numpkg);
     }
 
-  // Look for any scripts in /etc/postinstall which haven't been renamed .done,
-  // and try to run them...
+  // Look for any scripts in /etc/postinstall which haven't been renamed .done
   std::string postinst = cygpath ("/etc/postinstall");
   vector<Script> scripts;
   RunFindVisitor myVisitor (&scripts);
   Find (postinst).accept (myVisitor);
 
+  // Remove anything which we just tried to run (so we don't try twice)
+  for (i = packages.begin (); i != packages.end (); ++i)
+    {
+       packagemeta & pkg = **i;
+       for (std::vector<Script>::const_iterator j = pkg.installed.scripts().begin();
+            j != pkg.installed.scripts().end();
+            j++)
+         {
+           std::vector<Script>::iterator p = find(scripts.begin(), scripts.end(), *j);
+           if (p != scripts.end())
+             {
+               scripts.erase(p);
+             }
+         }
+    }
+
+  // and try to run what's left...
   {
     RunScript scriptRunner("No package", scripts);
     scriptRunner.run_all(s);
Index: script.h
===================================================================
RCS file: /cvs/cygwin-apps/setup/script.h,v
retrieving revision 2.13
diff -u -r2.13 script.h
--- script.h	16 Apr 2006 15:37:49 -0000	2.13
+++ script.h	27 Aug 2010 17:06:39 -0000
@@ -35,6 +35,7 @@
    or command.com (9x).  Returns the exit status of the process, or 
    negative error if any.  */
   int run() const;
+  bool operator == (const Script s) { return s.scriptName == scriptName; } ;
 private:
   std::string scriptName;
   static char const ETCPostinstall[];
