Author: rmeggins
Update of /cvs/dirsec/setuputil/installer/unix
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv592/setuputil/installer/unix
Modified Files:
installer.cc product.cc
Log Message:
Resolves: bug 239494
Description: setuputil: use adm.conf instead of dbswitch.conf, ldap.conf, etc.
Fix Description: We only really need one config file - adm.conf - so just add extra fields
as necessary.
Reviewed by: nhosoi (Thanks!)
Index: installer.cc
===================================================================
RCS file: /cvs/dirsec/setuputil/installer/unix/installer.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- installer.cc 4 Apr 2007 22:29:46 -0000 1.6
+++ installer.cc 9 May 2007 00:27:48 -0000 1.7
@@ -27,14 +27,11 @@
**
** HISTORY:
** $Log$
-** Revision 1.6 2007/04/04 22:29:46 nhosoi
-** Resolves: #234893
-** Summary: Build SetupUtil with autotools (Comment #13, #15)
-** Changes: 1) resource file and inf file could be an absolute path,
-** or they could be located in the same dir as dssetup binary or
-** in $datadir/setuputil.
-** 2) dssetup does not issue "Notice: Your LD_LIBRARY_PATH variable is set to
.."
-** since the library path is set in the wrapper script by the autotools.
+** Revision 1.7 2007/05/09 00:27:48 rmeggins
+** Resolves: bug 239494
+** Description: setuputil: use adm.conf instead of dbswitch.conf, ldap.conf, etc.
+** Fix Description: We only really need one config file - adm.conf - so just add extra
fields as necessary.
+** Reviewed by: nhosoi (Thanks!)
**
** Revision 1.5 2006/03/27 21:18:35 nhosoi
** [186642] Directory Server Makefile updates for Internal build
@@ -801,42 +798,9 @@
if (filename)
{
- /*
- * resource file can be specified in the [General] section of setup.inf
- * # All dialog strings can be defined in a resource file (optional).
- * Resource = setup.res
- * The value can be an absolute path.
- * If the value is a relative path or just a file name,
- * first the code checks if the value starting from the
- * setup binary location exists.
- * If it does not exist, then it checks in PROPERTYDIR,
- * which is defined at the build time.
- * If the resource value is set and the file does not exist,
- * it issues an warning and steps forward.
- */
- NSString resourceFile = NULL;
- if ('/' == *filename) /* absolute path */
- {
- resourceFile = filename;
- }
- else
- {
- resourceFile = _baseDir + "/" + filename;
- if (InstUtil::fileExists(resourceFile) == False)
- {
- /* the file is not in _baseDir (where dssetup is located) */
- resourceFile = NSString(PROPERTYDIR) + "/" + filename;
- }
- }
- if (InstUtil::fileExists(resourceFile) == False)
- {
- setupLogMessage(WARN, "Setup",
- "Resource file %s does not exist.\n", resourceFile);
- }
- else
- {
- customResource.read(resourceFile);
- }
+ NSString resourceFile;
+ resourceFile = _baseDir + "/" + filename;
+ customResource.read(resourceFile);
}
// Even without resource file defined, we still want to
@@ -971,6 +935,8 @@
/*
* Start the first stage - common installer's questions
*/
+
+ printNotice();
prepreInstall();
if (_installMode == Silent)
@@ -1470,44 +1436,20 @@
{
NSString infFile;
- /*
- * sourceDir: start point to look for inf file (infName)
- * infName:
- * The value can be an absolute path.
- * If the value is a relative path or just a file name,
- * first the code checks if the value starting from sourceDir.
- * If it does not exist, then it checks in PROPERTYDIR,
- * which is defined at the build time.
- */
- if ('/' == *infName) /* absolute path */
- {
- infFile = infName;
- }
- else
- {
- infFile = sourceDir + "/";
- infFile = infFile + infName;
+ infFile = sourceDir + "/";
+ infFile = infFile + infName;
- if (InstUtil::fileExists(infFile) == False)
- {
- /* the file is not in sourceDir, try PROPERTYDIR */
- infFile = NSString(PROPERTYDIR) + "/" + infName;
- }
- }
- /*
- * If the resource value is set and the file does not exist, it returns -1.
- */
if (InstUtil::fileExists(infFile) == False)
{
- return -1; /* infFile does not exist */
+ return -1;
}
-
+
if (sourceDir == _sourceDir && _newSuiteSpot.numComponents())
{
return 0;
}
- if (_newSuiteSpot.retrieveSuiteSpot(sourceDir, infFile) == 0 &&
_newSuiteSpot.numComponents())
+ if (_newSuiteSpot.retrieveSuiteSpot(sourceDir, infName) == 0 &&
_newSuiteSpot.numComponents())
{
_newSuiteSpot.getComponents()->sortComponents();
_newSuiteSpot.select();
@@ -3353,3 +3295,50 @@
{
return _checkDomainName;
}
+
+
+
+void
+Installer::printNotice()
+{
+ /* Bug 408242: Check if the LD_LIBRARY_PATH/SHLIB_PATH is set.
+ * If so, display a warning. Also, unset ENV variable.
+ */
+
+ char *lib_name = NULL, *lib_path = NULL, tmp[XSM_BUF], *env_path = NULL;
+
+#if defined (HPUX)
+ lib_name = strdup("SHLIB_PATH");
+#else
+ lib_name = strdup("LD_LIBRARY_PATH");
+#endif
+
+ memset(tmp, '\0', XSM_BUF);
+ if (lib_path = getenv(lib_name))
+ {
+ DialogManager::disableWinMode();
+ printf("\n%s %s %s\n\n", "Notice: Your", lib_name,
"variable is set to:");
+ printf("\t%s\n\n", lib_path);
+ printf("%s %s %s\n", "Please unset", lib_name, "or
verify that the");
+ printf("%s\n", "above setting is correct before continuing
with");
+ printf("%s\n", "the installation. An incorrect setting may
cause");
+ printf("%s\n", "problems during the installation such as the
wrong");
+ printf("%s\n\n", "copy of a shared library being used.");
+ if (_installMode != Silent)
+ {
+ printf("%s", "Continue [n]? ");
+ fflush(stdout);
+ fgets(tmp, sizeof(tmp), stdin);
+ if (tmp[0] == 'n' || tmp[0] == 'N' || tmp[0] == '\0'
|| (tmp[0] < 0x20))
+ {
+ free(lib_name);
+ exit(0);
+ }
+ }
+ }
+
+ free(lib_name);
+
+ env_path = strdup("ENV=");
+ putenv(env_path);
+}
Index: product.cc
===================================================================
RCS file: /cvs/dirsec/setuputil/installer/unix/product.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- product.cc 4 Apr 2007 22:29:46 -0000 1.6
+++ product.cc 9 May 2007 00:27:48 -0000 1.7
@@ -27,14 +27,11 @@
**
** HISTORY:
** $Log$
-** Revision 1.6 2007/04/04 22:29:46 nhosoi
-** Resolves: #234893
-** Summary: Build SetupUtil with autotools (Comment #13, #15)
-** Changes: 1) resource file and inf file could be an absolute path,
-** or they could be located in the same dir as dssetup binary or
-** in $datadir/setuputil.
-** 2) dssetup does not issue "Notice: Your LD_LIBRARY_PATH variable is set to
.."
-** since the library path is set in the wrapper script by the autotools.
+** Revision 1.7 2007/05/09 00:27:48 rmeggins
+** Resolves: bug 239494
+** Description: setuputil: use adm.conf instead of dbswitch.conf, ldap.conf, etc.
+** Fix Description: We only really need one config file - adm.conf - so just add extra
fields as necessary.
+** Reviewed by: nhosoi (Thanks!)
**
** Revision 1.5 2006/03/23 15:59:17 rmeggins
** Bug(s) fixed: 186280
@@ -637,29 +634,7 @@
// This is top level master configuration file
init();
- /*
- * sourceDir: start point to look for inf file (infName)
- * infName:
- * The value can be an absolute path.
- * If the value is a relative path or just a file name,
- * first the code checks if the value starting from sourceDir.
- * If it does not exist, then it checks in PROPERTYDIR,
- * which is defined at the build time.
- */
- if ('/' == *fileName) /* absolute path */
- {
- snprintf(tstr, sizeof(tstr), "%s", fileName);
- }
- else
- {
- NSString setupFile = sourceDir + "/" + fileName;
- if (InstUtil::fileExists(setupFile) == False)
- {
- /* the file is not in sourceDir, try PROPERTYDIR */
- setupFile = NSString(PROPERTYDIR) + "/" + fileName;
- }
- snprintf(tstr, sizeof(tstr), "%s", setupFile.data(), fileName);
- }
+ snprintf(tstr, sizeof(tstr), "%s/%s", sourceDir.data(), fileName);
tstr[sizeof(tstr)-1] = 0;
_packageInfo = new PackageInfo(tstr);
@@ -724,29 +699,7 @@
init();
- /*
- * sourceDir: start point to look for inf file (fileName)
- * fileame:
- * The value can be an absolute path.
- * If the value is a relative path or just a file name,
- * first the code checks if the value starting from sourceDir.
- * If it does not exist, then it checks in PROPERTYDIR,
- * which is defined at the build time.
- */
- if ('/' == *fileName) /* absolute path */
- {
- snprintf(tstr, sizeof(tstr), "%s", fileName);
- }
- else
- {
- NSString subFile = sourceDir + "/" + fileName;
- if (InstUtil::fileExists(subFile) == False)
- {
- /* the file is not in sourceDir, try PROPERTYDIR */
- subFile = NSString(PROPERTYDIR) + "/" + fileName;
- }
- snprintf(tstr, sizeof(tstr), "%s", subFile.data(), fileName);
- }
+ snprintf(tstr, sizeof(tstr), "%s/%s", sourceDir.data(), fileName);
tstr[sizeof(tstr)-1] = 0;
_packageInfo = new PackageInfo(tstr);