* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-28 13:15 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-28 13:15 UTC (permalink / raw
To: gentoo-commits
commit: a8f7cdd353767bb7592385cbc85b356186d97dde
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 16:24:55 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Fri Dec 27 16:24:55 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=a8f7cdd3
Remove unused Error MissingOptionalsError
---
src/java_config_2/Errors.py | 5 -----
1 file changed, 5 deletions(-)
diff --git a/src/java_config_2/Errors.py b/src/java_config_2/Errors.py
index 0122e3e..a3d4aeb 100644
--- a/src/java_config_2/Errors.py
+++ b/src/java_config_2/Errors.py
@@ -44,11 +44,6 @@ class ProviderUnavailableError(Exception):
return """No provider is available for """ + self._virtual + """
Please check your environment."""
-class MissingOptionalsError(Exception):
- """
- Some optional utilities are missing from a valid VM
- """
-
class PermissionError(Exception):
"""
The permission on the file are wrong or you are not a privileged user
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2020-07-16 20:50 Patrice Clement
0 siblings, 0 replies; 8+ messages in thread
From: Patrice Clement @ 2020-07-16 20:50 UTC (permalink / raw
To: gentoo-commits
commit: d9ac25402fa9ff918e1f1da4e3e0d97281e437c4
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 16 20:46:02 2020 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Thu Jul 16 20:48:34 2020 +0000
URL: https://gitweb.gentoo.org/proj/java-config.git/commit/?id=d9ac2540
allow java-config to parse inverted conditions.
... aka exclamation marks.
Patch courtesy of njsg on IRC.
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
src/java_config_2/VersionManager.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/java_config_2/VersionManager.py b/src/java_config_2/VersionManager.py
index cb30e88..a876f02 100644
--- a/src/java_config_2/VersionManager.py
+++ b/src/java_config_2/VersionManager.py
@@ -110,7 +110,11 @@ class VersionManager:
for token in tokens:
if token[-1] == "?":
- if token[:-1] not in useflags:
+ if token.startswith("!"):
+ skip = token[1:-1] in useflags
+ else:
+ skip = token[:-1] not in useflags
+ if skip:
level = 0
while 1:
token = next(tokens)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2017-09-08 21:22 Patrice Clement
0 siblings, 0 replies; 8+ messages in thread
From: Patrice Clement @ 2017-09-08 21:22 UTC (permalink / raw
To: gentoo-commits
commit: 82a5a6343e7b6172af6aaa1b3ea0a61a43afd206
Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 19 14:04:10 2017 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Jul 19 14:04:10 2017 +0000
URL: https://gitweb.gentoo.org/proj/java-config.git/commit/?id=82a5a634
remove useless else clauses.
src/java_config_2/Package.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/java_config_2/Package.py b/src/java_config_2/Package.py
index 2ecacc3..83c8c89 100644
--- a/src/java_config_2/Package.py
+++ b/src/java_config_2/Package.py
@@ -59,8 +59,7 @@ class Package:
"""
if var in self._config:
return self._config[var]
- else:
- return None
+ return None
def deps(self):
"""
@@ -76,13 +75,12 @@ class Package:
def __get_deps(self, query):
"""
- Return package's (optional) dependencies;
- @param query: variable to read from package.env
+ Return a package's (optional) dependencies.
+ @param query: variable to read from package.env.
"""
depstr = self.query(query)
if depstr:
return [dep.split("@") for dep in depstr.split(":")]
- else:
- return []
+ return []
-# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
\ No newline at end of file
+# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-28 13:15 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-28 13:15 UTC (permalink / raw
To: gentoo-commits
commit: a98d389c9bbc5f691938780c22557533fb885e8b
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 10:49:39 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 12:28:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=a98d389c
Rename variable active to active_vm
Self-documenting code is good
---
src/java_config_2/EnvironmentManager.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
index ab83dd1..d573d64 100644
--- a/src/java_config_2/EnvironmentManager.py
+++ b/src/java_config_2/EnvironmentManager.py
@@ -24,7 +24,7 @@ class EnvironmentManager(object):
self.virtuals = {}
self.virtuals_pref = None
self.virtual_machines = None
- self.active = None
+ self.active_vm = None
self.eprefix = eprefix
self.eroot = root + eprefix
@@ -107,7 +107,7 @@ class EnvironmentManager(object):
if vm_name:
vm = self.get_vm(vm_name)
if vm:
- self.active = vm
+ self.active_vm = vm
return vm
for link in self.vm_links():
@@ -115,17 +115,17 @@ class EnvironmentManager(object):
vm_name = basename(os.readlink(link))
vm = self.get_vm(vm_name)
if vm:
- self.active = vm
+ self.active_vm = vm
return vm
raise InvalidVMError("Unable to determine valid vm. Please see http://www.gentoo.org/doc/en/java.xml#doc_chap4")
def set_active_vm(self, vm):
- self.active = vm
+ self.active_vm = vm
def get_active_vm(self):
- if self.active is None:
+ if self.active_vm is None:
self.load_active_vm()
- return self.active
+ return self.active_vm
def get_virtual_machines(self):
if self.virtual_machines is None:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-28 13:15 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-28 13:15 UTC (permalink / raw
To: gentoo-commits
commit: 290395c552c68adfbbf5b0f3870e166bfc5f19c4
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 10:44:06 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 12:28:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=290395c5
Should be instance variables
---
src/java_config_2/EnvironmentManager.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
index afb80df..ab83dd1 100644
--- a/src/java_config_2/EnvironmentManager.py
+++ b/src/java_config_2/EnvironmentManager.py
@@ -17,16 +17,14 @@ import os, re, sys
class EnvironmentManager(object):
"""This is the central class, which manages all information from the 'environment'"""
- virtual_machines = None
- virtuals = None
- virtuals_pref = None
- active = None
-
def __init__(self, root='', eprefix=''):
self.all_packages_loaded = False
self.packages = {}
self.virtuals = {}
+ self.virtuals_pref = None
+ self.virtual_machines = None
+ self.active = None
self.eprefix = eprefix
self.eroot = root + eprefix
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-28 13:15 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-28 13:15 UTC (permalink / raw
To: gentoo-commits
commit: cc5d3204d40388fb20d63917ef3e7281365ebd27
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 16:29:04 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Fri Dec 27 16:29:04 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=cc5d3204
OutputFormatter: drop unused xtitle code
---
src/java_config_2/OutputFormatter.py | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/src/java_config_2/OutputFormatter.py b/src/java_config_2/OutputFormatter.py
index d554fd0..c385da2 100644
--- a/src/java_config_2/OutputFormatter.py
+++ b/src/java_config_2/OutputFormatter.py
@@ -29,40 +29,14 @@ class OutputFormatter:
def __init__(self, displayColor=True, displayTitle=True, autoIndent=True):
self.colorOutput = displayColor
- self.consoleTitle = displayTitle
self.autoIndent = autoIndent
- if displayTitle and "TERM" in os.environ:
- if os.environ["TERM"] not in [ "xterm", "Eterm", "aterm", "rxvt" ]:
- self.consoleTitle = False
-
def __call__(self, displayColor=True, displayTitle=True, autoIndent=True):
return self
def setColorOutputStatus(self, status):
self.colorOutput = status
- def setDisplayTitleStatus(self, status):
- if status and "TERM" in os.environ:
- if os.environ["TERM"] in [ "xterm", "Eterm", "aterm", "rxvt" ]:
- self.consoleTitle = True
- else:
- self.consoleTitle = False
- else:
- self.consoleTitle = False
-
- def isColorOutputEnabled(self):
- return self.colorOutput
-
- def isTitleDisplayEnabled(self):
- return self.consoleTitle
-
-
- def __setTitle(self, title):
- if self.consoleTitle:
- sys.stderr.write("\x1b]1;\x07\x1b]2;" + str(title) + "\x07")
- sys.stderr.flush()
-
def __indent(self, prefix, message):
if self.autoIndent is True:
num = len(prefix)
@@ -116,9 +90,6 @@ class OutputFormatter:
message = "%H%C" + self.__indent("!!! ALERT: ", message) + "%$"
sys.stderr.write(self.__parseColor(message) + '\n')
- def setTitle(self, message):
- self.__setTitle(self.__parseColor(message))
-
OutputFormatter = OutputFormatter()
# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-28 13:15 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-28 13:15 UTC (permalink / raw
To: gentoo-commits
commit: 0b5fb248b47320ad73b7e410d282e9482aa55ba7
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 16:32:38 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Fri Dec 27 16:32:38 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=0b5fb248
VersionManager cleanup
---
src/java_config_2/VersionManager.py | 24 +-----------------------
1 file changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/java_config_2/VersionManager.py b/src/java_config_2/VersionManager.py
index c37b0f1..c3fcc3f 100644
--- a/src/java_config_2/VersionManager.py
+++ b/src/java_config_2/VersionManager.py
@@ -1,14 +1,12 @@
# -*- coding: UTF-8 -*-
+# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
# Copyright 2005-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public license v2
-# $Header: $
import sys
sys.path.append("/usr/lib/portage/pym")
-import re
-
from . import VM, Errors
from java_config_2.FileParser import *
import os, glob, re
@@ -359,23 +357,3 @@ needed dependency, report this to http://bugs.gentoo.org.
unresolved.add(p)
return resolved
-
-#vator=VersionManager()
-#for i in [
-# ">=virtual/jdk-1.3",
-# ">=virtual/jdk-1.4",
-# ">=virtual/jdk-1.5",
-# "|| ( =virtual/jdk-1.4* =virtual/jdk-1.3* )",
-# "|| ( =virtual/jdk-1.3* =virtual/jdk-1.4* )",
-# "=virtual/jdk-1.5*",
-# "=virtual/jdk-1.4*",
-# "=virtual/jdk-1.3*",
-# ]:
-# print i
-# try:
-# print vator.get_vm(i)
-# except Exception, ex:
-# print ex
-# print
-
-# vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap:
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/java-config:master commit in: src/java_config_2/
@ 2013-12-27 11:28 Ralph Sennhauser
0 siblings, 0 replies; 8+ messages in thread
From: Ralph Sennhauser @ 2013-12-27 11:28 UTC (permalink / raw
To: gentoo-commits
commit: 8120125c466356fbdcce9365e14a605ece206cb0
Author: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
AuthorDate: Fri Dec 27 11:01:23 2013 +0000
Commit: Ralph Sennhauser <sera <AT> gentoo <DOT> org>
CommitDate: Fri Dec 27 11:01:23 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/java-config.git;a=commit;h=8120125c
Remove unused functions from EnvironmentManager after commit 1362e25
---
src/java_config_2/EnvironmentManager.py | 67 ---------------------------------
1 file changed, 67 deletions(-)
diff --git a/src/java_config_2/EnvironmentManager.py b/src/java_config_2/EnvironmentManager.py
index 8d47e6e..afb80df 100644
--- a/src/java_config_2/EnvironmentManager.py
+++ b/src/java_config_2/EnvironmentManager.py
@@ -269,14 +269,6 @@ class EnvironmentManager(object):
else:
return None
- def clean_classpath(self, targets):
- for target in targets:
- if os.path.isfile(target['file']):
- try:
- os.remove(target['file'])
- except IOError:
- raise PermissionError
-
def add_path_elements(self, elements, path):
if elements:
for p in elements.split(':'):
@@ -290,9 +282,6 @@ class EnvironmentManager(object):
return path
- def build_classpath(self, pkgs):
- return self.build_path(pkgs, "CLASSPATH")
-
def get_pkg_deps(self, pkg):
"""
Returns list of package's deps and optional deps.
@@ -413,62 +402,6 @@ class EnvironmentManager(object):
missing_deps.add(dep[-1])
return env
- def set_classpath(self, targets, pkgs):
- classpath = self.build_classpath(pkgs)
-
- if classpath:
- self.clean_classpath(targets)
-
- self.write_classpath(targets, classpath)
-
- def get_old_classpath(self, target):
- """Returns the current set classpath in the file"""
- oldClasspath = ''
- if os.path.isfile(target['file']):
- try:
- stream = open(target['file'], 'r')
- except IOError:
- raise PermissionError
-
- for line in stream:
- line = line.strip(' \n')
- if line.find('CLASSPATH') != -1:
- try:
- oldClasspath = line.split(target['format'].split('%s')[-2])[-1].strip()
- except:
- pass
- stream.close()
-
- return oldClasspath
-
- def append_classpath(self, targets, pkgs):
- classpath = self.build_classpath(pkgs)
-
- if classpath:
- oldClasspath = None
- for target in targets:
- for cp in self.get_old_classpath(target).split(':'):
- if cp not in classpath:
- classpath.append(cp)
-
- self.clean_classpath(targets)
-
- self.write_classpath(targets, classpath)
-
- def write_classpath(self, targets, classpath):
- for target in targets:
- dir = dirname(target['file'])
- if not os.path.isdir(dir):
- os.makedirs(dir)
-
- try:
- stream = open(target['file'], 'w')
- except IOError:
- raise PermissionError
-
- stream.write(target['format'] % ("CLASSPATH", ':'.join(classpath)))
- stream.close()
-
def have_provider(self, virtuals, virtualMachine, versionManager):
result=True
storeVM = self.get_active_vm()
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-07-16 20:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-28 13:15 [gentoo-commits] proj/java-config:master commit in: src/java_config_2/ Ralph Sennhauser
-- strict thread matches above, loose matches on Subject: below --
2020-07-16 20:50 Patrice Clement
2017-09-08 21:22 Patrice Clement
2013-12-28 13:15 Ralph Sennhauser
2013-12-28 13:15 Ralph Sennhauser
2013-12-28 13:15 Ralph Sennhauser
2013-12-28 13:15 Ralph Sennhauser
2013-12-27 11:28 Ralph Sennhauser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox