diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-01-07 11:33:00 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-01-07 11:33:00 +0000 |
commit | e42c1238d2204101c0763105514ce64b8eff8d87 (patch) | |
tree | 46f43e651bfddb18b09a5ee625cde57f4b021d21 /javainstaller2 | |
parent | c5b10c8367426f11074b9d79a40580804c6913e5 (diff) |
INTEGRATION: CWS native114 (1.2.16); FILE MERGED
2007/10/31 14:11:41 is 1.2.16.1: #150863# introducing dependencies for packages (checkSolaris)
Diffstat (limited to 'javainstaller2')
3 files changed, 80 insertions, 46 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/Installer.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/Installer.java index eb131e15541e..9738e7154e2a 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/Installer.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/Installer.java @@ -4,9 +4,9 @@ * * $RCSfile: Installer.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-07-03 11:53:48 $ + * last change: $Author: obo $ $Date: 2008-01-07 12:32:35 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -71,6 +71,10 @@ public abstract class Installer { return null; } + public boolean isPackageNameInstalled(String packageName, InstallData installData) { + return false; + } + public abstract void installPackage(PackageDescription packageData); public abstract void uninstallPackage(PackageDescription packageData); diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java index 6461aba02f6f..5c658389f50d 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java @@ -4,9 +4,9 @@ * * $RCSfile: SolarisInstaller.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-07-03 11:54:27 $ + * last change: $Author: obo $ $Date: 2008-01-07 12:32:47 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -313,57 +313,63 @@ public class SolarisInstaller extends Installer { } - public boolean isPackageInstalled(PackageDescription packageData, InstallData installData) { + public boolean isPackageNameInstalled(String packageName, InstallData installData) { + String rootString = ""; + String rootPath = null; + String pkgCommand; + String[] pkgCommandArray; + boolean useLocalRoot = false; boolean isInstalled = false; - String packageName = packageData.getPackageName(); + if (installData.isUserInstallation()) { + rootPath = installData.getDatabasePath(); + } - if ( packageName.equals("")) { - packageName = null; + if (( rootPath != null ) && (! rootPath.equals("null"))) { + rootString = "-R"; + useLocalRoot = true; } - if ( packageName != null ) { - String rootString = ""; - String rootPath = null; - String pkgCommand; - String[] pkgCommandArray; - boolean useLocalRoot = false; + if (useLocalRoot) { + pkgCommand = "pkginfo " + rootString + " " + rootPath + " " + packageName; + pkgCommandArray = new String[4]; + pkgCommandArray[0] = "pkginfo"; + pkgCommandArray[1] = rootString; + pkgCommandArray[2] = rootPath; + pkgCommandArray[3] = packageName; + } else { + pkgCommand = "pkginfo " + packageName; + pkgCommandArray = new String[2]; + pkgCommandArray[0] = "pkginfo"; + pkgCommandArray[1] = packageName; + } - if (installData.isUserInstallation()) { - rootPath = installData.getDatabasePath(); - } + // Vector returnVector = new Vector(); + int returnValue = ExecuteProcess.executeProcessReturnValue(pkgCommandArray); - if (( rootPath != null ) && (! rootPath.equals("null"))) { - rootString = "-R"; - useLocalRoot = true; - } + if ( returnValue == 0 ) { + isInstalled = true; + String log = pkgCommand + "<br><b>Returns: " + returnValue + " Package is installed" + "</b><br>"; + LogManager.addCommandsLogfileComment(log); + } else { + String log = pkgCommand + "<br><b>Returns: " + returnValue + " Package is not installed" + "</b><br>"; + LogManager.addCommandsLogfileComment(log); + } - if (useLocalRoot) { - pkgCommand = "pkginfo " + rootString + " " + rootPath + " " + packageName; - pkgCommandArray = new String[4]; - pkgCommandArray[0] = "pkginfo"; - pkgCommandArray[1] = rootString; - pkgCommandArray[2] = rootPath; - pkgCommandArray[3] = packageName; - } else { - pkgCommand = "pkginfo " + packageName; - pkgCommandArray = new String[2]; - pkgCommandArray[0] = "pkginfo"; - pkgCommandArray[1] = packageName; - } + return isInstalled; + } - // Vector returnVector = new Vector(); - int returnValue = ExecuteProcess.executeProcessReturnValue(pkgCommandArray); + public boolean isPackageInstalled(PackageDescription packageData, InstallData installData) { + boolean isInstalled = false; - if ( returnValue == 0 ) { - isInstalled = true; - String log = pkgCommand + "<br><b>Returns: " + returnValue + " Package is installed" + "</b><br>"; - LogManager.addCommandsLogfileComment(log); - } else { - String log = pkgCommand + "<br><b>Returns: " + returnValue + " Package is not installed" + "</b><br>"; - LogManager.addCommandsLogfileComment(log); - } + String packageName = packageData.getPackageName(); + if ( packageName.equals("")) { + packageName = null; + } + + if ( packageName != null ) { + isInstalled = isPackageNameInstalled(packageName, installData); } return isInstalled; diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/PackageDescription.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/PackageDescription.java index f5ff8e1311d4..b17fa5ef10db 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/PackageDescription.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/PackageDescription.java @@ -4,9 +4,9 @@ * * $RCSfile: PackageDescription.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: rt $ $Date: 2007-07-03 11:59:00 $ + * last change: $Author: obo $ $Date: 2008-01-07 12:33:00 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -78,6 +78,7 @@ public class PackageDescription implements TreeNode { /* display information */ private String dpyName = ""; private String dpyDescription = ""; + private String checkSolaris = ""; private int instSize = 0; private int dpySortKey = 0; private boolean isDefault = true; @@ -95,6 +96,7 @@ public class PackageDescription implements TreeNode { private String pkgRelease = null; private String pkgRealName = null; private String pkgSubdir = null; + private String pkgLanguage = null; private int pkgSize = 0; private int pkgType = NOTA_UNIT; private boolean pkgExists = true; // must be default, especially for uninstallation @@ -144,6 +146,10 @@ public class PackageDescription implements TreeNode { return dpyDescription; } + public String getCheckSolaris() { + return checkSolaris; + } + public int getSize() { return pkgSize; } @@ -312,6 +318,14 @@ public class PackageDescription implements TreeNode { pkgSubdir = subdir; } + public String getPkgLanguage() { + return pkgLanguage; + } + + public void setPkgLanguage(String language) { + pkgLanguage = language; + } + /** * extract the name and the description according to the locale */ @@ -386,6 +400,11 @@ public class PackageDescription implements TreeNode { // dontUninstall = Boolean.parseBoolean(dontUninstallValue); } + subSection = section.getElement("checksolaris"); + if (subSection != null) { + checkSolaris = subSection.getValue(); + } + subSection = section.getElement("isupdatepackage"); if (subSection != null) { String isUpdatePackageValue = subSection.getValue(); @@ -445,6 +464,11 @@ public class PackageDescription implements TreeNode { isRelocatable = Parser.parseBoolean(relocatableValue); // isRelocatable = Boolean.parseBoolean(relocatableValue); } + subSection = section.getElement("solarislanguage"); + if (subSection != null) { + pkgLanguage = subSection.getValue(); + } + } /* line up the subpackages */ |