public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.920
@ 2022-07-02 12:40 Jon TURNEY
  0 siblings, 0 replies; only message in thread
From: Jon TURNEY @ 2022-07-02 12:40 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=df567cdb822e189ac1011024fffa77a70cc736bb

commit df567cdb822e189ac1011024fffa77a70cc736bb
Author: Christian Franke <christian.franke@t-online.de>
Date:   Wed Jun 29 16:51:47 2022 +0200

    Clear filename on GUI after running perpetual preremove scripts

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=6fa3f022f1d98a27aec12c1c707ff960a6d47845

commit 6fa3f022f1d98a27aec12c1c707ff960a6d47845
Author: Christian Franke <christian.franke@t-online.de>
Date:   Wed Jun 29 19:57:26 2022 +0200

    Also run stratum 'z' perpetual preremove scripts


Diff:
---
 install.cc | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/install.cc b/install.cc
index 6689a08d..1fdc699f 100644
--- a/install.cc
+++ b/install.cc
@@ -76,26 +76,28 @@ struct std_dirs_t {
   mode_t mode;
 };
 
-class Perpetual0RemoveFindVisitor : public FindVisitor
+class PerpetualRemoveFindVisitor : public FindVisitor
 {
 public:
-  explicit Perpetual0RemoveFindVisitor (std::vector<Script> *scripts)
-    : _scripts(scripts)
+  PerpetualRemoveFindVisitor (std::vector<Script> *scripts, const std::string& stratum)
+    : _scripts(scripts),
+      stratum(stratum)
   {}
   virtual void visitFile(const std::string& basePath,
                          const WIN32_FIND_DATA *theFile)
     {
       std::string fn = std::string("/etc/preremove/") + theFile->cFileName;
       Script script(fn);
-      if (script.is_p("0"))
+      if (script.is_p(stratum))
 	  _scripts->push_back(Script (fn));
     }
-  virtual ~ Perpetual0RemoveFindVisitor () {}
+  virtual ~ PerpetualRemoveFindVisitor () {}
 protected:
-  Perpetual0RemoveFindVisitor (Perpetual0RemoveFindVisitor const &);
-  Perpetual0RemoveFindVisitor & operator= (Perpetual0RemoveFindVisitor const &);
+  PerpetualRemoveFindVisitor (PerpetualRemoveFindVisitor const &);
+  PerpetualRemoveFindVisitor & operator= (PerpetualRemoveFindVisitor const &);
 private:
   std::vector<Script> *_scripts;
+  const std::string stratum;
 };
 
 class Installer
@@ -105,7 +107,7 @@ class Installer
     Installer();
     void initDialog();
     void progress (int bytes);
-    void preremovePerpetual0 ();
+    void preremovePerpetual (const std::string& stratum);
     void preremoveOne (packagemeta &);
     void uninstallOne (packagemeta &);
     void replaceOnRebootFailed (const std::string& fn);
@@ -177,21 +179,22 @@ Installer::StandardDirs[] = {
 static int num_installs, num_uninstalls;
 
 void
-Installer::preremovePerpetual0 ()
+Installer::preremovePerpetual (const std::string& stratum)
 {
   std::vector<Script> perpetual;
-  Perpetual0RemoveFindVisitor visitor (&perpetual);
+  PerpetualRemoveFindVisitor visitor (&perpetual, stratum);
   Find (cygpath ("/etc/preremove")).accept (visitor);
   if (perpetual.empty())
     return;
 
   Progress.SetText1 (IDS_PROGRESS_PREREMOVE);
-  Progress.SetText2 ("0/Perpetual");
+  Progress.SetText2 ((stratum + "/Perpetual").c_str ());
   std::sort (perpetual.begin(), perpetual.end());
   for (std::vector<Script>::iterator i = perpetual.begin (); i != perpetual.end (); ++i) {
     Progress.SetText3 (i->fullName ().c_str());
     i->run();
   }
+  Progress.SetText3 ("");
 }
 
 void
@@ -904,7 +907,7 @@ do_install_thread (HINSTANCE h, HWND owner)
 
   /* start with uninstalls - remove files that new packages may replace */
   Progress.SetBar2(0);
-  myInstaller.preremovePerpetual0 ();
+  myInstaller.preremovePerpetual ("0");
 
   Progress.SetBar2(0);
   for (std::vector <packageversion>::iterator i = uninstall_q.begin ();
@@ -916,6 +919,9 @@ do_install_thread (HINSTANCE h, HWND owner)
     Progress.SetBar2(std::distance(uninstall_q.begin(), i) + 1, uninstall_q.size());
   }
 
+  Progress.SetBar2(0);
+  myInstaller.preremovePerpetual ("z");
+
   Progress.SetBar2(0);
   for (std::vector <packageversion>::iterator i = uninstall_q.begin ();
        i != uninstall_q.end (); ++i)



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-07-02 12:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-02 12:40 [setup - the official Cygwin setup program] branch master, updated. release_2.920 Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).