From b578b4e882a1fb5867dd787e7d84d32ae4829163 Mon Sep 17 00:00:00 2001 From: Joshua Nichols Date: Wed, 28 Jun 2006 13:29:45 +0000 Subject: Renamed java-config.1 to java-config-2.1, and updated setup.py accordingly. svn path=/java-config-ng/branches/axxo/; revision=2391 --- man/java-config-2.1 | 129 ++++++++++++++++++++++++++++++++++++++ man/java-config.1 | 129 -------------------------------------- setup.py | 2 +- src/java_config/VersionManager.py | 23 +++++++ 4 files changed, 153 insertions(+), 130 deletions(-) create mode 100644 man/java-config-2.1 delete mode 100644 man/java-config.1 diff --git a/man/java-config-2.1 b/man/java-config-2.1 new file mode 100644 index 0000000..23c0672 --- /dev/null +++ b/man/java-config-2.1 @@ -0,0 +1,129 @@ +.TH "JAVA-CONFIG" "1" "June 2005" "java-config 2.0.0" "User Commands" +.SH "NAME" +java\-config \- The Java configuration tool for Gentoo +.SH "SYNOPSIS" +.B java\-config +\fI[options]\fB +.SH "DESCRIPTION" +.PP +.I java\-config +Is used to query/set properties of your system's Java environment. It can be +used to list available VMs, java packages, set system default JVM and set user +default JVM. +.PP +In addition, it is used by Portage as a common interface to querying +properties about the various JVMs. +.SH "OPTIONS " +.TP +\fB\-c \-\-javac\fI +Show full path to currently selected Java compiler. +.TP +\fB\-j \-\-jar\fI +Show full path to currently selected +.I jar +command. +.TP +\fB\-O \-\-jdk\-home\fI +Show path to currently selected JDK. +.TP +\fB\-o \-\-jre\-home\fI +Show path to currently selected JRE. +.TP +\fB\-v \-\-java\-version\fI +Query current JVM for version. +.TP +\fB\-p [pkg1[\-SLOT],pkg2[\-SLOT],...] \-\-classpath[=package1,package2,...]\fI +Calculate classpath for a package. If a package is installed in different +slots you can also specify the slot to get the specific classpath informations. +.TP +\fB\-e filename \-\-exec=filename\fI +Figure full path to one of the JDK/JRE utilities, such as +.I keytool +, +.I rmic +and others. +. +.TP +\fB\-i PACKAGE(S), \-\-library=PACKAGE(S)\fI +Print java library paths for these packages. Used for example in wrapper +scripts like this: -Djava.library.path=$(java-config -i swt-3). Follows the same +pkg[\-SLOT] convention as for example \-\-classpath. +. +.TP +\fB\-l \-\-list\-available\-packages\fI +List available Java packages. Used for selection by +.I \-\-classpath +, +.I \-\-set\-system\-classpath +and +.I \-\-set\-user\-classpath +. +.TP +\fB\-L \-\-list\-available\-vms\fI +Lists available JVMs. Used with +.I \-\-set\-system\-vm +and +.I \-\-set\-user\-vm +. +.TP +\fB\-S \-\-set\-system\-vm=\fI +Sets the system\-wide default JVM. +.TP +\fB\-s \-\-set\-user\-vm=\fI +Sets the user\-specific JVM by putting all necessary env vars into +.I $HOME/.gentoo/java\-env . +.TP +\fB\-f \-\-show\-active\-vm\fI +Show the JVM that's currently active, as set via \-\-set\-system\-vm or \-\-set\-user\-vm. +.TP +\fB\-A ,,... \-\-set\-system\-classpath=,,...\fI +Sets the system\-wide default CLASSPATH. +.TP +\fB\-a ,,... \-\-set\-user\-classpath=,,...\fI +Sets the user\-specific CLASSPATH by putting all necessary env vars into +.I $HOME/.gentoo/java\-env\-classpath +(sourced from $HOME/.gentoo/java\-env). +.TP +\fB\-X \-\-clean\-system\-classpath\fI +Cleans the system\-wide default classpath, leaving only vm needed jars +on it. +.TP +\fB\-x \-\-clean\-user\-classpath\fI +Cleans the user specific classpath that was specified by +.I \-\-set\-user\-classpath +by deleting +.I $HOME/.gentoo/java\-env\-classpath . +. +.TP +\fB\-n \-\-nocolor\fI +Turn off all colors. +.TP +\fB\-P \-\-print=\fI +Print the environment information for the specified virtual machine. +. + +.SH "NOTES" +You can get the that is used with +.I \-\-set\-system\-vm= +and +.I \-\-set\-user\-vm= +in the output of +.I java\-config \-\-list\-available\-vms +inside the brackets. Ex. [blackdown\-jdk\-1.4.1] and you can use this to +set your default Java Virtual Machine. + +.SH "AUTHORS" +Karl Trygve Kalleberg +.br +Adrian Almenar +.br +Jason Mobarak + +.SH "BUGS" +It cannot be used to set default browser plugin yet. + +.SH "SEE ALSO" +env\-update(5) +.TP +The \fI/usr/bin/java\-config\fR script. +.TP diff --git a/man/java-config.1 b/man/java-config.1 deleted file mode 100644 index 23c0672..0000000 --- a/man/java-config.1 +++ /dev/null @@ -1,129 +0,0 @@ -.TH "JAVA-CONFIG" "1" "June 2005" "java-config 2.0.0" "User Commands" -.SH "NAME" -java\-config \- The Java configuration tool for Gentoo -.SH "SYNOPSIS" -.B java\-config -\fI[options]\fB -.SH "DESCRIPTION" -.PP -.I java\-config -Is used to query/set properties of your system's Java environment. It can be -used to list available VMs, java packages, set system default JVM and set user -default JVM. -.PP -In addition, it is used by Portage as a common interface to querying -properties about the various JVMs. -.SH "OPTIONS " -.TP -\fB\-c \-\-javac\fI -Show full path to currently selected Java compiler. -.TP -\fB\-j \-\-jar\fI -Show full path to currently selected -.I jar -command. -.TP -\fB\-O \-\-jdk\-home\fI -Show path to currently selected JDK. -.TP -\fB\-o \-\-jre\-home\fI -Show path to currently selected JRE. -.TP -\fB\-v \-\-java\-version\fI -Query current JVM for version. -.TP -\fB\-p [pkg1[\-SLOT],pkg2[\-SLOT],...] \-\-classpath[=package1,package2,...]\fI -Calculate classpath for a package. If a package is installed in different -slots you can also specify the slot to get the specific classpath informations. -.TP -\fB\-e filename \-\-exec=filename\fI -Figure full path to one of the JDK/JRE utilities, such as -.I keytool -, -.I rmic -and others. -. -.TP -\fB\-i PACKAGE(S), \-\-library=PACKAGE(S)\fI -Print java library paths for these packages. Used for example in wrapper -scripts like this: -Djava.library.path=$(java-config -i swt-3). Follows the same -pkg[\-SLOT] convention as for example \-\-classpath. -. -.TP -\fB\-l \-\-list\-available\-packages\fI -List available Java packages. Used for selection by -.I \-\-classpath -, -.I \-\-set\-system\-classpath -and -.I \-\-set\-user\-classpath -. -.TP -\fB\-L \-\-list\-available\-vms\fI -Lists available JVMs. Used with -.I \-\-set\-system\-vm -and -.I \-\-set\-user\-vm -. -.TP -\fB\-S \-\-set\-system\-vm=\fI -Sets the system\-wide default JVM. -.TP -\fB\-s \-\-set\-user\-vm=\fI -Sets the user\-specific JVM by putting all necessary env vars into -.I $HOME/.gentoo/java\-env . -.TP -\fB\-f \-\-show\-active\-vm\fI -Show the JVM that's currently active, as set via \-\-set\-system\-vm or \-\-set\-user\-vm. -.TP -\fB\-A ,,... \-\-set\-system\-classpath=,,...\fI -Sets the system\-wide default CLASSPATH. -.TP -\fB\-a ,,... \-\-set\-user\-classpath=,,...\fI -Sets the user\-specific CLASSPATH by putting all necessary env vars into -.I $HOME/.gentoo/java\-env\-classpath -(sourced from $HOME/.gentoo/java\-env). -.TP -\fB\-X \-\-clean\-system\-classpath\fI -Cleans the system\-wide default classpath, leaving only vm needed jars -on it. -.TP -\fB\-x \-\-clean\-user\-classpath\fI -Cleans the user specific classpath that was specified by -.I \-\-set\-user\-classpath -by deleting -.I $HOME/.gentoo/java\-env\-classpath . -. -.TP -\fB\-n \-\-nocolor\fI -Turn off all colors. -.TP -\fB\-P \-\-print=\fI -Print the environment information for the specified virtual machine. -. - -.SH "NOTES" -You can get the that is used with -.I \-\-set\-system\-vm= -and -.I \-\-set\-user\-vm= -in the output of -.I java\-config \-\-list\-available\-vms -inside the brackets. Ex. [blackdown\-jdk\-1.4.1] and you can use this to -set your default Java Virtual Machine. - -.SH "AUTHORS" -Karl Trygve Kalleberg -.br -Adrian Almenar -.br -Jason Mobarak - -.SH "BUGS" -It cannot be used to set default browser plugin yet. - -.SH "SEE ALSO" -env\-update(5) -.TP -The \fI/usr/bin/java\-config\fR script. -.TP diff --git a/setup.py b/setup.py index 3db9fca..6d2e344 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup ( scripts = ['src/java-config-2','src/depend-java-query','src/run-java-tool', 'src/gjl'], data_files = [ ('share/java-config-2/pym/java_config/', ['src/java_config/'+file for file in listdir('src/java_config/')] ), - ('share/man/man1', ['man/java-config.1']), + ('share/man/man1', ['man/java-config-2.1']), ('share/java-config-2/launcher', ['src/launcher.bash']), ('share/eselect/modules', ['src/eselect/java-vm.eselect']), ('/etc/java-config-2/', ['config/virtuals']), diff --git a/src/java_config/VersionManager.py b/src/java_config/VersionManager.py index 3367dc4..aba2615 100644 --- a/src/java_config/VersionManager.py +++ b/src/java_config/VersionManager.py @@ -23,6 +23,29 @@ class VersionManager: """ #atom_parser = re.compile(r"([~!<>=]*)virtual/(jre|jdk)-([0-9\.]+)") atom_parser = re.compile(r"([<>=]+)virtual/(jre|jdk)-([0-9\.*]+)") + or_parser = re.compile(r"\|\| \( (.*) \)") + # TODO have a || parser + # TODO have a java use flag parser + re.compile(r"([<>=]+)virtual/(jre|jdk)-([0-9\.*]+)") + or_parser = re.compile(r"\|\| \( (.*) \)") + # TODO have a || parser + # TODO have a java use flag parser + pref_files = ['/etc/java-config-2/build/jdk.conf', '/usr/share/java-config-2/config/jdk-defaults.conf'] + _prefs = None + + def __init__(self): + pass + + def get_prefs(self): + if self._prefs: + return self._prefs + else: + self._prefs = [] + for file in self.pref_files: + if os.path.exists(file): + self._prefs += PrefsFileParser(file).get_config() + return self._prefs + pref_files = ['/etc/java-config-2/build/jdk.conf', '/usr/share/java-config-2/config/jdk-defaults.conf'] _prefs = None -- cgit v1.2.3-65-gdbad