diff options
author | 2013-01-02 16:39:11 +0000 | |
---|---|---|
committer | 2013-01-02 16:39:11 +0000 | |
commit | 62a427c5b0431a2c9ff74aaf0b2ab58f947a451b (patch) | |
tree | 6df2186bf78d2cb46d651595afded468ba98b9bd | |
parent | Update MANIFEST.in. (diff) | |
download | java-config-62a427c5b0431a2c9ff74aaf0b2ab58f947a451b.tar.gz java-config-62a427c5b0431a2c9ff74aaf0b2ab58f947a451b.tar.bz2 java-config-62a427c5b0431a2c9ff74aaf0b2ab58f947a451b.zip |
Don't require uid 0 for setting system vm, write permission for the link is sufficient and will work for Gentoo Prefix as well.
svn path=/projects/java-config-2/trunk/; revision=9140
-rwxr-xr-x | src/java-config-2 | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/java-config-2 b/src/java-config-2 index a28e596..6a9a5bf 100755 --- a/src/java-config-2 +++ b/src/java-config-2 @@ -181,21 +181,18 @@ def set_system_vm(option, opt, value, parser): if not vm: fatalError("Could not find a vm matching: %s" % value) else: - if os.getuid() is 0: - try: - manager.set_system_vm(vm) - printer._print("Now using %s as your generation-2 system JVM" % (vm) ) - if vm.is_build_only(): - printer._printWarning("%s is marked as a build-only JVM. Using this vm is not recommended. " % (vm)) - printer._printWarning("Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information.") - except PermissionError: - fatalError("You do not have enough permissions to set the system VM!") - except EnvironmentUndefinedError: - fatalError("The selected VM is missing critical environment variables.") - except InvalidConfigError as e: - fatalError("Target file already exists and is not a symlink: %s" % e.file) - else: + try: + manager.set_system_vm(vm) + printer._print("Now using %s as your generation-2 system JVM" % (vm) ) + if vm.is_build_only(): + printer._printWarning("%s is marked as a build-only JVM. Using this vm is not recommended. " % (vm)) + printer._printWarning("Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information.") + except PermissionError: fatalError("You do not have enough permissions to set the system VM!") + except EnvironmentUndefinedError: + fatalError("The selected VM is missing critical environment variables.") + except InvalidConfigError as e: + fatalError("Target file already exists and is not a symlink: %s" % e.file) def set_user_vm(option, opt, value, parser): vm = manager.get_vm(value) |