[sword-svn] r3879 - in trunk: include src/mgr utilities

scribe at crosswire.org scribe at crosswire.org
Sat Aug 6 07:15:57 EDT 2022


Author: scribe
Date: 2022-08-06 07:15:57 -0400 (Sat, 06 Aug 2022)
New Revision: 3879

Modified:
   trunk/include/installmgr.h
   trunk/src/mgr/installmgr.cpp
   trunk/utilities/installmgr.cpp
Log:
added new InstallMgr method which skips recording repo source info upon install



Modified: trunk/include/installmgr.h
===================================================================
--- trunk/include/installmgr.h	2022-08-06 11:12:49 UTC (rev 3878)
+++ trunk/include/installmgr.h	2022-08-06 11:15:57 UTC (rev 3879)
@@ -81,6 +81,7 @@
 	long timeoutMillis;
 	SWBuf u, p;
 	bool unverifiedPeerAllowed;
+	bool forgetInstallSource;
 
 	/** override this method and provide your own custom RemoteTransport subclass
 	 */
@@ -289,6 +290,7 @@
 	long getTimeoutMillis() { return timeoutMillis; }
 
 	void setUnverifiedPeerAllowed(bool allowed) { this->unverifiedPeerAllowed = allowed; }
+	void setForgetInstallSource(bool forget) { this->forgetInstallSource = forget; }
 	bool isUnverifiedPeerAllowed() { return unverifiedPeerAllowed; }
 
 	/** Request nicely to terminate an ongoing transfer.

Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp	2022-08-06 11:12:49 UTC (rev 3878)
+++ trunk/src/mgr/installmgr.cpp	2022-08-06 11:15:57 UTC (rev 3879)
@@ -646,12 +646,14 @@
 								retVal = FileMgr::copyFile(modFile.c_str(), targetFile.c_str());
 							}
 						}
-						// let's add our install source information
-						SWConfig *newConfig = new SWConfig(targetFile.c_str());
-						newConfig->setValue(modName, "InstallSourceID", sourceUID);
-						newConfig->setValue(modName, "InstallSourceCaption", sourceCaption);
-						newConfig->save();
-						delete newConfig;
+						if (!forgetInstallSource) {
+							// let's add our install source information
+							SWConfig *newConfig = new SWConfig(targetFile.c_str());
+							newConfig->setValue(modName, "InstallSourceID", sourceUID);
+							newConfig->setValue(modName, "InstallSourceCaption", sourceCaption);
+							newConfig->save();
+							delete newConfig;
+						}
 					}
 
 					delete config;

Modified: trunk/utilities/installmgr.cpp
===================================================================
--- trunk/utilities/installmgr.cpp	2022-08-06 11:12:49 UTC (rev 3878)
+++ trunk/utilities/installmgr.cpp	2022-08-06 11:15:57 UTC (rev 3879)
@@ -51,6 +51,7 @@
 
 bool isConfirmedByForce;
 bool isUnvPeerAllowed;
+bool isForgetInstallSource;
 
 
 void usage(const char *progName = 0, const char *error = 0);
@@ -177,6 +178,9 @@
 		if (isConfirmedByForce) { 
 			installMgr->setUserDisclaimerConfirmed(true);
 		}
+		if (isForgetInstallSource) {
+			installMgr->setForgetInstallSource(true);
+		}
 	}
 }
 
@@ -442,6 +446,7 @@
 		"\t -ll <path>\t\t\tlist available modules at local path\n"
 		"\t -li <path> <modName>\t\tinstall module from local path\n"
 		"\t -d\t\t\t\tturn debug output on\n"
+		"\t -xr\t\t\t\tdon't record from where module was installed\n"
 		, (progName ? progName : "installmgr"), SWVersion::currentVersion.getText());
 	finish(-1);
 }
@@ -451,6 +456,7 @@
 	
 	isConfirmedByForce = false;
 	isUnvPeerAllowed = false;
+	isForgetInstallSource = false;
 	
 	if (argc < 2) usage(*argv);
 
@@ -464,6 +470,9 @@
 		else if (!strcmp(argv[i], "--allow-unverified-tls-peer")) {
 			isUnvPeerAllowed = true;
 		}
+		else if (!strcmp(argv[i], "-xr")) {
+			isForgetInstallSource = true;
+		}
 		else if (!strcmp(argv[i], "-init")) {
 			initConfig();
 		}



More information about the sword-cvs mailing list