]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
2002-07-08 Robert Collins <rbtcollins@hotmail.com>
authorRobert Collins <rbtcollins@hotmail.com>
Sun, 7 Jul 2002 15:35:04 +0000 (15:35 +0000)
committerRobert Collins <rbtcollins@hotmail.com>
Sun, 7 Jul 2002 15:35:04 +0000 (15:35 +0000)
        * install.cc (NoReplaceOnReboot): New command line option to prevent
        replacing in use files.
        (install_one_source): Check the option and use it.
        * README: Update TODO lists.

ChangeLog
README
install.cc

index 0e85b79450ede94c83dc6379cbc24fd5667c2d6e..0d388ed3e2fec11c182b51cdee11653daaaf21f9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-08  Robert Collins  <rbtcollins@hotmail.com>
+
+       * install.cc (NoReplaceOnReboot): New command line option to prevent
+       replacing in use files.
+       (install_one_source): Check the option and use it.
+       * README: Update TODO lists.
+
 2002-07-08  Robert Collins  <rbtcollins@hotmail.com>
 
        * PickCategoryLine.cc: Change bucket to use STL container syntax 
diff --git a/README b/README
index 99ace1c862acd78ba0c27018cd42ba33c01f7024..f58aab2a26d803bd40afb78f53a1d5800c647f0e 100644 (file)
--- a/README
+++ b/README
@@ -73,3 +73,4 @@ recently completed
  * Src tickbox /source only can be confusing.
  * Handle UNC paths for the localdir correctly.
  * Chooser dialog needs work.
+ * A command line option to prevent overwrite-on-reboot functionality.
index 7b2c0995ac237ef37e6efea4b859f8ca127ca82c..b12e41c817a8fce7affe9057f015b88537cb44ae 100644 (file)
@@ -65,6 +65,7 @@ static const char *cvsid = "\n%%% $Id$\n";
 #include "md5.h"
 
 #include "Exception.h"
+#include "getopt++/BoolOption.h"
 
 extern ThreeBarProgressPage Progress;
 
@@ -72,6 +73,10 @@ static int total_bytes = 0;
 static int total_bytes_sofar = 0;
 static int package_bytes = 0;
 
+static BoolOption NoReplaceOnReboot (false, 'r', "no-replaceonreboot", 
+                                    "Disable replacing in-use files on next "
+                                    "reboot.");
+
 static void
 init_dialog ()
 {
@@ -243,6 +248,13 @@ install_one_source (packagemeta & pkgm, packagesource & source,
          log (LOG_BABBLE, String("Installing file ") + prefixURL + prefixPath + fn);
          if (archive::extract_file (thefile, prefixURL, prefixPath) != 0)
            {
+             if (NoReplaceOnReboot)
+               {
+                 ++errors;
+                 log (LOG_PLAIN, String("Not replacing in-use file ") +
+                      prefixURL + prefixPath + fn);
+               }
+             else
              //extract to temp location
              if (archive::extract_file (thefile, prefixURL, prefixPath, ".new") != 0)
                {
This page took 0.04311 seconds and 5 git commands to generate.