aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2013-02-10 15:30:45 +0000
committerRalph Sennhauser <sera@gentoo.org>2013-02-10 15:30:45 +0000
commit4ecad279f7f7e84ae2e104748c5b5ff64e3ab44f (patch)
treec1ac1d5aede1879893d4f1b9e83c7b4f77b9969a
parentMerge testsuite2 into testsuite and use new ROOT support in EnvironmentManager (diff)
downloadjava-config-4ecad279f7f7e84ae2e104748c5b5ff64e3ab44f.tar.gz
java-config-4ecad279f7f7e84ae2e104748c5b5ff64e3ab44f.tar.bz2
java-config-4ecad279f7f7e84ae2e104748c5b5ff64e3ab44f.zip
Make the scripts ROOT and EPREFIX aware
svn path=/projects/java-config-2/trunk/; revision=9191
-rw-r--r--setup.py16
-rwxr-xr-xsrc/depend-java-query2
-rwxr-xr-xsrc/gjl4
-rwxr-xr-xsrc/java-config-214
4 files changed, 26 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index d3ba2cf..78a26de 100644
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,24 @@
#!/usr/bin/env python
+from distutils.command.build import build
+import fileinput, os, sys
+
+class my_build(build):
+
+ def run(self):
+ build.run(self)
+
+ eprefix = os.getenv('EPREFIX', '')
+ for base, dirs, files in os.walk(self.build_base):
+ for f in files:
+ for line in fileinput.input(os.path.join(base, f),inplace=True):
+ sys.stdout.write(line.replace('@GENTOO_PORTAGE_EPREFIX@', eprefix))
+
+
from distutils.core import setup
setup (
+ cmdclass={'build' : my_build},
name = 'java-config',
version = '2.1.12',
description = 'java enviroment configuration tool',
diff --git a/src/depend-java-query b/src/depend-java-query
index 64f7b5d..0ac9eb6 100755
--- a/src/depend-java-query
+++ b/src/depend-java-query
@@ -65,7 +65,7 @@ def parse_depend_string(option, opt, value, parse):
if __name__ == '__main__':
global printer, manager, verman
printer = OutputFormatter(True, True)
- manager = EnvironmentManager()
+ manager = EnvironmentManager(os.getenv('ROOT', ''), os.getenv('EPREFIX', '@GENTOO_PORTAGE_EPREFIX@'))
verman = VersionManager(manager)
usage = "depend-java-query [options]\n\n"
diff --git a/src/gjl b/src/gjl
index 2feb30e..c561e30 100755
--- a/src/gjl
+++ b/src/gjl
@@ -48,7 +48,7 @@ def get_args(pkg):
envlp = os.getenv('LD_LIBRARY_PATH')
envjlp = os.getenv('JAVA_LIBRARY_PATH')
- newlibrary = '/lib:/usr/lib'
+ newlibrary = manager.eprefix + '/lib:'+ manager.eprefix + '/usr/lib'
if library:
newlibrary = ':'.join((library, newlibrary))
if envjlp:
@@ -102,7 +102,7 @@ if __name__ == '__main__':
global printer, manager, verman
printer = OutputFormatter(True, True)
- manager = EnvironmentManager()
+ manager = EnvironmentManager(os.getenv('ROOT', ''), os.getenv('EPREFIX', '@GENTOO_PORTAGE_EPREFIX@'))
verman = VersionManager(manager)
if not options.package:
diff --git a/src/java-config-2 b/src/java-config-2
index f9d3b2f..d3af8d7 100755
--- a/src/java-config-2
+++ b/src/java-config-2
@@ -217,13 +217,13 @@ def set_user_vm(option, opt, value, parser):
# Deprecated
def system_classpath_target():
# TODO: MAKE THIS MODULAR!! (compnerd)
- return [{'file': '/etc/env.d/21java-classpath', 'format': '%s=%s\n' }]
+ return [{'file': manager.eprefix + '/etc/env.d/21java-classpath', 'format': '%s=%s\n' }]
def user_classpath_target():
# TODO: MAKE THIS MODULAR!! (compnerd)
return [
- {'file': os.path.join(os.environ.get("HOME"), '.gentoo/java-env-classpath'), 'format': 'export %s=%s\n' },
- {'file': os.path.join(os.environ.get("HOME"), '.gentoo/java-env-classpath.csh'), 'format': 'setenv %s %s\n' }
+ {'file': os.path.join(os.environ.get("HOME"), '.gentoo' + manager.eprefix + '/java-env-classpath'), 'format': 'export %s=%s\n' },
+ {'file': os.path.join(os.environ.get("HOME"), '.gentoo' + manager.eprefix + '/java-env-classpath.csh'), 'format': 'setenv %s %s\n' }
]
# Deprecated
def set_system_classpath(option, opt, value, parser):
@@ -300,12 +300,12 @@ def select_vm(option, opt, value, parser):
fatalError("The vm could not be found")
def update_env():
- printer._print(getoutput("/usr/sbin/env-update"))
+ printer._print(getoutput(manager.eprefix + "/usr/sbin/env-update"))
printer._printAlert("If you want the changes too take effect in your current session, you should update\n\
- your environment by running: source /etc/profile")
+ your environment by running: source " + manager.eprefix + "/etc/profile")
def user_update_env():
- printer._printAlert("Environment files in ~/.gentoo/ have been updated. You should source these from your shell's profile.\n\
+ printer._printAlert("Environment files in ~/.gentoo" + manager.eprefix + "/ have been updated. You should source these from your shell's profile.\n\
If you want the changes too take effect in your current sessiosn, you should resource these files")
def deprecation_notice():
@@ -318,7 +318,7 @@ def fatalError(msg):
if __name__ == '__main__':
global printer, manager
printer = OutputFormatter(True, True)
- manager = EnvironmentManager()
+ manager = EnvironmentManager(os.getenv('ROOT', ''), os.getenv('EPREFIX', '@GENTOO_PORTAGE_EPREFIX@'))
usage = "java-config [options]\n\n"
usage += "Java Configuration Utility Version " + str(__version__) + "\n"