* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-20 19:03 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-20 19:03 UTC (permalink / raw
To: gentoo-commits
commit: e0c44a29537eff743d03e520966f4e6c2ecb5486
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 20 18:53:38 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 20 18:53:38 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e0c44a29
ebuild creation
* using simpler/easier ebuild creation now
* ebuild variables are now automatically sorted
* ebuild is now a string, not an object
* the common ebuild header is no longer stored in every ebuild,
the overlay module handles this
modified: roverlay/ebuild/__init__.py
new file: roverlay/ebuild/abstractcomponents.py
deleted: roverlay/ebuild/construction.py
modified: roverlay/ebuild/creation.py
new file: roverlay/ebuild/depres.py
new file: roverlay/ebuild/ebuilder.py
new file: roverlay/ebuild/evars.py
---
roverlay/ebuild/__init__.py | 39 ----
roverlay/ebuild/abstractcomponents.py | 93 +++++++++
roverlay/ebuild/construction.py | 333 ---------------------------------
roverlay/ebuild/creation.py | 237 ++++++++----------------
roverlay/ebuild/depres.py | 167 +++++++++++++++++
roverlay/ebuild/ebuilder.py | 36 ++++
roverlay/ebuild/evars.py | 70 +++++++
7 files changed, 445 insertions(+), 530 deletions(-)
diff --git a/roverlay/ebuild/__init__.py b/roverlay/ebuild/__init__.py
index 17e9a8d..e69de29 100644
--- a/roverlay/ebuild/__init__.py
+++ b/roverlay/ebuild/__init__.py
@@ -1,39 +0,0 @@
-# R Overlay -- ebuild creation, ebuild class
-# Copyright 2006-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-class Ebuild ( object ):
-
- def __init__ ( self, content, header=None ):
- """Initializes an Ebuild that has text content and optionally a
- header (text, too).
-
- arguments:
- * content --
- * header --
- """
- self.content = content
- self.header = header
- # --- end of __init__ (...) ---
-
- def write ( self, fh, header=None, header_is_fallback=False ):
- """Write the ebuild into a file-like object.
-
- arguments:
- * fh -- file handle
- """
- if not self.content:
- raise Exception ( "ebuild is empty!" )
-
- header_order = ( self.header, header ) if header_is_fallback \
- else ( header, self.header )
-
- for h in header_order:
- if not h is None:
- fh.write ( h )
- fh.write ( '\n\n' )
- break
-
- fh.write ( self.content )
- fh.write ( '\n' )
- # --- end of write_fh (...) ---
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
new file mode 100644
index 0000000..73dac03
--- /dev/null
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -0,0 +1,93 @@
+# R Overlay -- ebuild creation, <?>
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+INDENT = '\t'
+
+def listlike ( ref ):
+ return hasattr ( ref, '__iter__' ) and not isinstance ( ref, str )
+
+
+class ListValue ( object ):
+ def __init__ ( self, value, indent_level=1, empty_value=None ):
+ self.set_level ( indent_level )
+
+ self.empty_value = empty_value
+
+
+ self.single_line = False
+ self.indent_lines = True
+ # only used in multi line mode
+ self.append_indented_newline = True
+
+ self.val_join = ' '
+
+ self.set_value ( value )
+
+
+ def __len__ ( self ):
+ l = len ( self.value )
+ return l if self.empty_value is None else l - 1
+
+ def set_level ( self, level ):
+ self.level = level
+ self.var_indent = (level - 1) * INDENT
+ self.val_indent = level * INDENT
+ self.line_join = '\n' + self.val_indent
+ # --- end of set_level (...) ---
+
+ def set_value ( self, value ):
+ self.value = list()
+ if self.empty_value is not None:
+ self.value.append ( self.empty_value )
+ self.add_value ( value )
+ # --- end of set_value (...) ---
+
+ def add_value ( self, value ):
+ if value is None:
+ pass
+ elif listlike ( value ):
+ self.value.extend ( value )
+ else:
+ self.value.append ( value )
+ # --- end of add_value (...) ---
+
+ add = add_value
+
+ def to_str ( self ):
+ if len ( self.value ) == 0:
+ ret = ""
+ elif len ( self.value ) == 1:
+ ret = str ( self.value [0] )
+ elif self.single_line:
+ ret = self.val_join.join ( self.value )
+ else:
+ ret = self.line_join.join ( ( self.value ) )
+ if self.append_indented_newline:
+ ret += self.var_indent + '\n'
+
+ return ret
+ # --- end of to_str (...) ---
+
+ __str__ = to_str
+
+
+class EbuildVar ( object ):
+
+ def __init__ ( self, name, value, priority ):
+ self.name = name
+ self.priority = priority
+ self.value = value
+ self.set_level ( 0 )
+
+ def set_level ( self, level ):
+ self.level = level
+ self.indent = self.level * INDENT
+ if hasattr ( self.value, 'set_level' ):
+ self.value.set_level ( level + 1 )
+ # --- end of set_level (...) ---
+
+ def active ( self ): return True
+
+ def __str__ ( self ):
+ return '%s%s="%s"' % ( self.indent, self.name, self.value )
diff --git a/roverlay/ebuild/construction.py b/roverlay/ebuild/construction.py
deleted file mode 100644
index 3e858a0..0000000
--- a/roverlay/ebuild/construction.py
+++ /dev/null
@@ -1,333 +0,0 @@
-# R Overlay -- ebuild creation, ebuild class
-# Copyright 2006-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-import copy
-
-import roverlay.config
-
-from roverlay.util import shorten_str
-from roverlay.ebuild import Ebuild
-
-EBUILD_INDENT = roverlay.config.get ( 'EBUILD.indent', '\t' )
-
-ADD_REMAP = {
- # pkg vs package
- 'package_name' : 'pkg_name',
- 'package_version' : 'pkg_version',
- 'package_revision' : 'pkg_revision',
- # TITLE is in DESCRIPTION
- 'TITLE' : 'DESCRIPTION',
-
- # TODO: remove these entries by fixing ebuildcreator/ebuildjob
- 'DEPENDS' : 'DEPEND',
- 'RDEPENDS' : 'RDEPEND',
- 'RSUGGESTS' : 'R_SUGGESTS',
-}
-
-IUSE_SUGGESTS = "R_suggests"
-
-
-class EbuildConstruction ( object ):
- """Class that helps to create Ebuild objects."""
-
-
-
- def __init__ ( self, logger ):
- """Initializes an EbuildConstruction object.
-
- arguments:
- * logger --
- """
- self.logger = logger
-
- self.has_rsuggests = False
-
- # elements in data are either a str or a list of str
- self._data = dict ()
- # --- end of __init__ (...) ---
-
- def get_ebuild ( self ):
- """Creates and returns an Ebuild."""
- lines = '\n'.join ( self._make_ebuild_lines() )
- return Ebuild ( lines, header=None )
- # --- end of get_ebuild (...) ---
-
- def add ( self, key, value, append=True ):
- """Adds data.
-
- arguments:
- * key -- identifier of the data (e.g. DEPEND).
- May be remapped (e.g. merging 'Title' and 'Description')
- or even refused here.
- * value --
- * append -- whether to append values or overwrite existing ones,
- defaults to True.
-
- returns: None (implicit)
- """
- if self._data is None:
- # -- todo
- raise Exception ("Ebuild is readonly.")
-
- _key = ADD_REMAP [key] if key in ADD_REMAP else key
-
- if _key is None:
- self.logger.debug ( "add (%s, %s): filtered key.", key, value )
- else:
- if append and _key in self._data:
- if not isinstance ( self._data [_key], list ):
- self._data [_key] = [ self._data [_key] ]
-
- if isinstance ( value, list ):
- self._data [_key].extend ( value )
- else:
- self._data [_key].append ( value )
-
- else:
- self._data [_key] = value
-
- # --- end of add (...) ---
-
- def _make_ebuild_lines ( self ):
- """Creates text lines for the Ebuild.
- It assumes that enough data to do this are available.
- Exceptions (KeyError, NameError, ...) are passed if that's not the case.
- """
-
- def get_dep_and_use():
- """Creates values for the DEPEND, RDEPEND, IUSE and, if possible,
- R_SUGGESTS variables and returns them as dict { VARNAME -> VALUE }.
- """
-
- # have suggests if they're set and not empty
- self.has_rsuggests = bool (
- 'R_SUGGESTS' in self._data and self._data ['R_SUGGESTS']
- )
-
- # set defaults: inherit eclass + include depend in rdepend
- # TODO: is ${DEPEND:-},... necessary?
- ret = dict (
- DEPEND = [ '${DEPEND:-}' ],
- # assuming that the eclass includes it's DEPEND in RDEPEND
- RDEPEND = [ '${RDEPEND:-}' ],
- IUSE = [ '${IUSE:-}' ],
- )
-
- for kw in ( x for x in ( 'DEPEND', 'RDEPEND' ) if x in self._data ):
- if isinstance ( self._data [kw], list ):
- ret [kw].extend ( self._data [kw] )
- else:
- ret [kw].append ( self._data [kw] )
-
-
- if self.has_rsuggests:
- ret ['R_SUGGESTS'] = self._data ['R_SUGGESTS']
-
- # +R_SUGGESTS, -R_SUGGESTS?
- ret ['IUSE'].append ( IUSE_SUGGESTS )
- # do these braces help or confuse? TODO FIXME
- ret ['RDEPEND'].append ( '%s? ( ${R_SUGGESTS} )' % IUSE_SUGGESTS )
-
- return ret
-
- # --- end of get_dep_and_use () ---
-
- def make_var (
- varname,
- value=None, oneline_list=True, indent_list=True, indent_level=0
- ):
- """Creates a <name>=<value> statement for ebuilds.
-
- arguments:
- * varname -- name of the variable
- * value -- value of the variable.
- This has to be either None (the default), str,
- or list of str.
- * oneline_list -- if value is a list: controls whether its components
- should be put into one line (True) or multiple.
- Defaults to True.
- * indent_list -- if value is a list and not oneline_list:
- controls whether each value line should be
- indentend (by indent_level + 1) or not ("by 0").
- Defaults to True.
- * indent_level -- current indentation level, defaults to 0
-
- """
-
- # assumption: value is either None,
- # scalar with str representation or list of str
- var_value = None
-
- if not value:
- var_value = ""
-
- elif isinstance ( value, list ):
- if oneline_list:
- var_value = ' '.join ( value )
- elif indent_list:
- var_value = (
- '\n' + (indent_level + 1) * EBUILD_INDENT
- ).join ( value )
- else:
- '\n'.join ( value )
-
- else:
- var_value = str ( value )
-
-
- # (TODO)
- # fixing ebuild var values here
-
- # cut DESCRIPTION line if too long
- if varname == 'DESCRIPTION':
- var_value = shorten_str ( var_value, 45, '... (see metadata)' )
-
-
- ret ='%s%s="%s"' % (
- indent_level * EBUILD_INDENT,
- varname,
- var_value
- )
-
- # (TODO)
- # fixing ebuild var lines here
-
- return ret
-
- # --- end of make_var (...) ---
-
- def remove_newlines ( line_list ):
- """Removes leading, ending and repeated blank lines in line_list.
-
- arguments:
- * line_list --
-
- returns: filtered lines
-
- TODO: check if a filter function could be used for this
- """
- lines = []
- line = None
- last_line_empty = True
-
- for line in line_list:
- line = line.rstrip()
- # re.sub \n{2,} \n :: FIXME?
-
- if line:
- last_line_empty = False
- elif not last_line_empty:
- last_line_empty = True
- else:
- continue
-
- lines.append ( line )
-
- # remove last line if empty
- ##if last_line_empty: (?)
- if len ( lines ) and not lines [-1]:
- del lines [-1]
-
- return lines
-
- # --- end of remove_newlines (...) ---
-
- def add_easyvar (
- ebuild_content, varname,
- value_key=None, add_newline=False
- ):
- """Adds a 'simple' variable to the ebuild lines.
- This means that it can directly be taken from self._data [value_key].
- This method assumes that value_key exists in self._data,
- any exceptions (KeyError) will be passed.
-
- arguments:
- * ebuild_content -- list of ebuild text lines, will be modified
- directly, so copy it before calling addvar if
- you need the original list.
- * varname -- name of the variable.
- Nothing happens if this is None.
- * value_key -- key of the value,
- defaults to varname if it is None
- * add_newline -- adds a newline after the var statement,
- defaults to False
-
- returns: given+modified list (ebuild_content)
- """
-
- if not varname is None:
- if value_key is None:
- ebuild_content.append (
- make_var ( varname, self._data [varname] )
- )
- else:
- ebuild_content.append (
- make_var ( varname, self._data [value_key] )
- )
-
- if add_newline:
- ebuild_content.append ( "" )
-
- return ebuild_content
-
- # --- end of add_easyvar (...) ---
-
- # -- actual start of _make_ebuild_lines (...) --
- try:
- ebuild_lines = []
-
- #if 'ebuild_header' in self._data:
- # ebuild_lines = copy.copy ( self._data ['ebuild_header'] )
- # ebuild_lines.append ( "" )
-
- #add_easyvar ( ebuild_lines, "PKG_FILE" )
- #if 'PKG_ORIGIN' in self._data:
- # add_easyvar ( ebuild_lines, "PKG_ORIGIN", None, False )
-
- ebuild_lines.append ( "" )
-
- # TODO/FIXME: this makes DESCRIPTION mandatory, maybe check with
- # >if 'DESCRIPTION' in self._data<
- add_easyvar ( ebuild_lines, "DESCRIPTION" )
-
- add_easyvar ( ebuild_lines, "SRC_URI", add_newline=True )
-
- # FIXME/TODO: LICENSE?
-
- dep_and_use = get_dep_and_use ()
-
- # check that IUSE has more than one element,
- # don't write IUSE="${IUSE:-}" etc.
- if len ( dep_and_use ['IUSE'] ) > 1:
- ebuild_lines.append (
- make_var ( "IUSE", dep_and_use ['IUSE'], True )
- )
-
- if 'R_SUGGESTS' in dep_and_use:
- ebuild_lines.append (
- make_var ( "R_SUGGESTS", dep_and_use ['R_SUGGESTS'], False )
- )
-
- # see IUSE
- if len ( dep_and_use ['DEPEND'] ) > 1:
- ebuild_lines.append (
- make_var ( "DEPEND", dep_and_use ['DEPEND'], False )
- )
-
- # see IUSE
- if len ( dep_and_use ['RDEPEND'] ) > 1:
- ebuild_lines.append (
- make_var ( "RDEPEND", dep_and_use ['RDEPEND'], False )
- )
-
- del dep_and_use
- return remove_newlines ( ebuild_lines )
-
- except ( ValueError, KeyError, NameError ) as err:
- #self.logger.exception ( err )
- self.logger.error ( "Cannot create ebuild text lines." )
- #return None
- raise
-
- # --- end of make_ebuild_lines (...) ---
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 5fa91ac..d202d78 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -1,34 +1,25 @@
-# R Overlay -- ebuild creation, "job" module
+# R Overlay -- ebuild creation, <?>
# Copyright 2006-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
import logging
-import roverlay.static.depres
+from roverlay.ebuild import depres, ebuilder, evars
-from roverlay.ebuild.construction import EbuildConstruction
+#from roverlay.ebuild.construction import EbuildConstruction
from roverlay.rpackage.descriptionreader import DescriptionReader
-# move this to const / config
-DEPENDENCY_FIELDS = {
- 'R_SUGGESTS' : [ 'Suggests' ],
- 'DEPENDS' : [ 'Depends', 'Imports' ],
- 'RDEPENDS' : [ 'LinkingTo', 'SystemRequirements' ]
-}
LOGGER = logging.getLogger ( 'EbuildCreation' )
+
class EbuildCreation ( object ):
- def __init__ ( self, package_info, depres_channel_spawner=None ):
+ def __init__ ( self, package_info ):
- self.logger = LOGGER.getChild ( package_info ['name'] )
self.package_info = package_info
- if depres_channel_spawner is None:
- self.request_resolver = roverlay.static.depres.get_ebuild_channel
- else:
- self.request_resolver = depres_channel_spawner
+ self.logger = LOGGER.getChild ( package_info ['name'] )
# > 0 busy/working; 0 == done,success; < 0 done,fail
self.status = 1
@@ -36,100 +27,51 @@ class EbuildCreation ( object ):
self.package_info.set_readonly()
# --- end of __init__ (...) ---
- def done() : return self.status < 1
- def busy() : return self.status > 0
- def success() : return self.status == 0
- def fail() : return self.status < 0
+ def done ( self ) : return self.status < 1
+ def busy ( self ) : return self.status > 0
+ def success ( self ) : return self.status == 0
+ def fail ( self ) : return self.status < 0
+
+ def run ( self ):
+ if self.status < 1:
+ raise Exception ( "Cannot run again." )
+
+ try:
+ self._lazyimport_desc_data()
+
+ self.package_info.set_readonly()
+
+ if self._make_ebuild():
+ self.logger.debug ( "Ebuild is ready." )
+ self.status = 0
+ else:
+ self.logger.info ( "Cannot create an ebuild for this package." )
+ self.status = -1
+
+ except Exception as e:
+ # log this and set status to fail
+ self.status = -10
+ self.logger.exception ( e )
+ # --- end of run (...) ---
+ def _lazyimport_desc_data ( self ):
+ if self.package_info.get ( 'desc_data',
+ fallback_value=None, do_fallback=True ) is None:
- def _resolve_dependencies ( self, ebuilder ):
- if self.request_resolver is None:
- self.logger.warning (
- "Cannot resolve dependencies, no resolver available!"
+ logging.warning ( 'Reading description data now.' )
+ reader = DescriptionReader (
+ self.package_info,
+ logger=self.logger,
+ read_now=True
+ )
+ self.package_info.set_writeable()
+ self.package_info.update (
+ desc_data=reader.get_desc ( run_if_unset=False )
)
- return True
-
- res = None
- # -- end pre func block --
-
- def init_channels():
- # collect dep strings and initialize resolver channels
- desc = self.package_info ['desc_data']
- channels = dict()
-
- def get_resolver ( dependency_type ):
- if dependency_type not in channels:
- channels [dependency_type] = self.request_resolver (
- dependency_type,
- self.logger
- )
- return channels [dependency_type]
- # --- end of get_resolver (...) ---
-
- dep_type = desc_field = None
-
- for dep_type in DEPENDENCY_FIELDS:
- resolver = None
-
- for desc_field in DEPENDENCY_FIELDS [dep_type]:
- if desc_field in desc:
- if not resolver:
- resolver = get_resolver ( dep_type )
-
- if isinstance ( desc [desc_field], str ):
- resolver.add_dependency ( desc [desc_field] )
- elif hasattr ( desc [desc_field], '__iter__' ):
- resolver.add_dependencies ( desc [desc_field] )
- else:
- logger.warning (
- "Cannot add dependency '%s'." % desc [desc_field]
- )
- # -- if desc_field
- # -- for desc_field
- # -- for dep_type
- return channels
- # --- end of init_resolvers (...) ---
-
- def try_resolve():
- for r in res.values():
- if r.satisfy_request() is None:
- return False
- return True
- # --- end of try_resolve (...) ---
-
- # TODO
- # replace try_resolve with
- # False in ( r.satisfy_request() for r in res.values() )
- # ?
- res = init_channels()
- if not res: return True
- success = False
-
-
- if try_resolve():
- for dep_type, resolver in res.items():
- deplist = list ( filter ( None, resolver.collect_dependencies() ) )
-
- if deplist is None:
- ## FIXME: false positive: "empty" channel
- raise Exception (
- 'dep_resolver is broken: '
- 'lookup() returns None but satisfy_request() says ok.'
- )
- elif hasattr ( deplist, '__iter__' ):
- # add dependencies in no_append/override mode
- self.logger.debug ( "adding %s to %s", deplist, dep_type )
- ebuilder.add ( dep_type, deplist, False )
- else:
- raise Exception ( "dep_resolver is broken: iterable expected!" )
- # -- for dep_type,..
-
- success = True
-
- # tell the dep resolver channels that we're done
- for r in res.values(): r.close()
- return success
- # --- end of resolve_dependencies (...) ---
+ del reader
+
+ # --- end of _lazyimport_desc_data (...) ---
+
def _make_ebuild ( self ):
desc = self.package_info ['desc_data']
@@ -137,69 +79,48 @@ class EbuildCreation ( object ):
self.logger (
'desc empty- cannot create an ebuild for this package.'
)
- return None
+ return False
+
+ ebuild = ebuilder.Ebuilder()
+
+ _dep_resolution = depres.EbuildDepRes (
+ self.package_info, self.logger,
+ create_iuse=True, run_now=True
+ )
+
+ if not _dep_resolution.success():
+ # log here?
+ return False
+
- ebuilder = EbuildConstruction ( self.logger )
+ dep_result = _dep_resolution.get_result()
- have_desc = False
+ # add *DEPEND, IUSE to the ebuild
+ ebuild.use ( *dep_result [1] )
+
+ description = None
if 'Title' in desc:
- ebuilder.add ( 'DESCRIPTION', desc ['Title'] )
- have_desc = True
+ description = desc ['Title']
if 'Description' in desc:
- if have_desc:
- ebuilder.add ( 'DESCRIPTION', '// ' + desc ['Description'] )
+ if description is None:
+ description = desc ['Description']
else:
- ebuilder.add ( 'DESCRIPTION', desc ['Description'] )
+ description += '// ' + desc ['Description']
+ if description is not None:
+ ebuild.use ( evars.DESCRIPTION ( description ) )
- ebuilder.add ( 'SRC_URI', self.package_info ['package_url'] )
+ ebuild.use ( evars.SRC_URI ( self.package_info ['SRC_URI'] ) )
- if self._resolve_dependencies ( ebuilder ):
- return ( ebuilder.get_ebuild(), ebuilder.has_rsuggests )
+ ebuild_text = ebuild.to_str()
- return None
- # --- end of _make_ebuild (...) ---
+ self.package_info.update_now (
+ ebuild=ebuild_text,
+ depres_result=dep_result
+ )
- def run ( self ):
- if self.status < 1:
- raise Exception ( "Cannot run again." )
+ return True
- try:
- if self.package_info.get ( 'desc_data',
- fallback_value=None, do_fallback=True ) is None:
-
- logging.warning ( 'Reading description data now.' )
- reader = DescriptionReader (
- self.package_info,
- logger=self.logger,
- read_now=True
- )
- self.package_info.set_writeable()
- self.package_info.update (
- desc_data=reader.get_desc ( run_if_unset=False )
- )
- del reader
- # -- if
- self.package_info.set_readonly()
-
- ebuild_info = self._make_ebuild()
- if ebuild_info is None:
- self.logger.info ( "Cannot create an ebuild for this package." )
- self.status = -1
- else:
- self.package_info.set_writeable()
- self.package_info.update (
- ebuild=ebuild_info [0],
- suggests=ebuild_info [1]
- )
- self.package_info.set_readonly()
- self.logger.debug ( "Ebuild is ready." )
- self.status = 0
- except Exception as e:
- # log this and set status to fail
- self.status = -10
- self.logger.exception ( e )
- # --- end of run (...) ---
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
new file mode 100644
index 0000000..f0ec712
--- /dev/null
+++ b/roverlay/ebuild/depres.py
@@ -0,0 +1,167 @@
+# R Overlay -- ebuild creation, <?>
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import roverlay.static.depres
+
+from roverlay.ebuild import evars
+
+# move this to const / config
+FIELDS = {
+ 'R_SUGGESTS' : [ 'Suggests' ],
+ 'DEPENDS' : [ 'Depends', 'Imports' ],
+ 'RDEPENDS' : [ 'LinkingTo', 'SystemRequirements' ]
+}
+
+EBUILDVARS = {
+ 'R_SUGGESTS' : evars.R_SUGGESTS,
+ 'DEPENDS' : evars.DEPEND,
+ 'RDEPENDS' : evars.RDEPEND,
+}
+
+
+class EbuildDepRes ( object ):
+
+ def __init__ (
+ self, package_info, logger,
+ depres_channel_spawner=None, create_iuse=True, run_now=True
+ ):
+ self.logger = logger
+ self.package_info = package_info
+
+ if depres_channel_spawner is None:
+ self.request_resolver = roverlay.static.depres.get_ebuild_channel
+ else:
+ self.request_resolver = depres_channel_spawner
+
+ # > 0 busy/working; 0 == done,success; < 0 done,fail
+ self.status = 1
+ self.result = None
+ self.has_suggests = None
+ self.create_iuse = create_iuse
+
+ self._channels = None
+
+ if run_now:
+ self.resolve()
+
+ # --- end of __init__ (...) ---
+
+ def done ( self ) : return self.status < 1
+ def busy ( self ) : return self.status > 0
+ def success ( self ) : return self.status == 0
+ def fail ( self ) : return self.status < 0
+
+ def get_result ( self ):
+ return ( self.status, self.result, self.has_suggests )
+ # --- end of get_result (...) ---
+
+ def resolve ( self ):
+ try:
+ self.result = None
+ self._init_channels()
+
+ if self._wait_resolve():
+ self._make_result()
+ self.status = 0
+
+ else:
+ # unresolvable
+ self.logger.info ( "Cannot satisfy dependencies!" )
+
+ self.result = None
+ self.status = -5
+
+ finally:
+ self._close_channels()
+ # --- end of resolve (...) ---
+
+ def _get_channel ( self, dependency_type ):
+ if dependency_type not in self._channels:
+ self._channels [dependency_type] = self.request_resolver (
+ dependency_type,
+ self.logger
+ )
+ return self._channels [dependency_type]
+ # --- end of get_channel (...) ---
+
+ def _init_channels ( self ):
+ # collect dep strings and initialize resolver channels
+
+ if self.request_resolver is None:
+ self.logger.warning (
+ "Cannot resolve dependencies, no resolver available!"
+ )
+ return True
+
+ desc = self.package_info ['desc_data']
+ self._channels = dict()
+
+ dep_type = desc_field = None
+
+ for dep_type in FIELDS:
+ resolver = None
+
+ for desc_field in FIELDS [dep_type]:
+ if desc_field in desc:
+ if not resolver:
+ resolver = self._get_channel ( dep_type )
+
+ if isinstance ( desc [desc_field], str ):
+ resolver.add_dependency ( desc [desc_field] )
+ elif hasattr ( desc [desc_field], '__iter__' ):
+ resolver.add_dependencies ( desc [desc_field] )
+ else:
+ logger.warning (
+ "Cannot add dependency '%s'." % desc [desc_field]
+ )
+ # -- for dep_type
+
+ self.has_suggests = bool ( 'R_SUGGESTS' in self._channels )
+
+ # --- end of _init_channels (...) ---
+
+ def _close_channels ( self ):
+ if self._channels is None: return
+
+ for channel in self._channels.values(): channel.close()
+ del self._channels
+ # --- end of _close_channels (...) ---
+
+ def _wait_resolve ( self ):
+ # True if no channels
+ for c in self._channels.values():
+ if c.satisfy_request() is None:
+ return False
+ return True
+ # --- end of _wait_resolve (...) ---
+
+ def _make_result ( self ):
+ _result = list()
+ for dep_type, channel in self._channels.items():
+ deplist = list ( filter ( None, channel.collect_dependencies() ) )
+
+ if deplist is None:
+ ## FIXME: false positive: "empty" channel
+ raise Exception (
+ 'dep_resolver is broken: '
+ 'lookup() returns None but satisfy_request() says ok.'
+ )
+ elif hasattr ( deplist, '__iter__' ):
+ # add dependencies in no_append/override mode
+ self.logger.debug ( "adding %s to %s", deplist, dep_type )
+ _result.append (
+ EBUILDVARS [dep_type] (
+ deplist,
+ using_suggests=self.has_suggests
+ )
+ )
+ else:
+ raise Exception ( "dep_resolver is broken: iterable expected!" )
+ # -- for dep_type,..
+
+ if self.create_iuse:
+ _result.append ( evars.IUSE ( using_suggests=self.has_suggests ) )
+
+ self.result = tuple ( _result )
+ # --- end of _make_result (...) ---
diff --git a/roverlay/ebuild/ebuilder.py b/roverlay/ebuild/ebuilder.py
new file mode 100644
index 0000000..275c6d2
--- /dev/null
+++ b/roverlay/ebuild/ebuilder.py
@@ -0,0 +1,36 @@
+# R Overlay -- ebuild creation, <?>
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+class Ebuilder ( object ):
+
+ def __init__ ( self ):
+ self._evars = list()
+
+ def sort ( self ):
+ self._evars.sort ( key=lambda e: e.priority )
+
+ def get_lines ( self ):
+ self.sort()
+ last = len ( self._evars ) - 1
+
+ newline = lambda i, k=1 : \
+ abs ( self._evars [i + k].priority - self._evars [i].priority ) >= 20
+
+
+ lines = list()
+ for index, e in enumerate ( self._evars ):
+ if e.active():
+ lines.append ( str ( e ) )
+ if index < last and newline ( index ): lines.append ( '' )
+
+ return lines
+
+ def to_str ( self ):
+ return '\n'.join ( self.get_lines() )
+
+ __str__ = to_str
+
+ def use ( self, *evar_list ):
+ for e in evar_list:
+ self._evars.append ( e )
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
new file mode 100644
index 0000000..095f375
--- /dev/null
+++ b/roverlay/ebuild/evars.py
@@ -0,0 +1,70 @@
+# R Overlay -- ebuild creation, <?>
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+from roverlay.util import shorten_str
+
+from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
+
+IUSE_SUGGESTS = 'R_suggests'
+
+# ignoring case policies here (camel case,..)
+
+class DESCRIPTION ( EbuildVar ):
+ def __init__ ( self, description ):
+ super ( DESCRIPTION, self ) . __init__ ( 'DESCRIPTION', description, 80 )
+
+ def __str__ ( self ):
+ return '%s%s="%s"' % (
+ self.indent,
+ self.name,
+ shorten_str ( str ( self.value ) , 45, '... (see metadata)' )
+ )
+
+
+class SRC_URI ( EbuildVar ):
+ def __init__ ( self, src_uri ):
+ super ( SRC_URI, self ) . __init__ ( 'SRC_URI', src_uri, 90 )
+
+
+class IUSE ( EbuildVar ):
+ def __init__ ( self, use_flags=None, using_suggests=False ):
+ super ( IUSE, self ) . __init__ (
+ 'IUSE',
+ ListValue ( use_flags, empty_value='${IUSE:-}' ),
+ 130
+ )
+ self.value.single_line = True
+ if using_suggests:
+ self.value.add ( IUSE_SUGGESTS )
+
+
+class R_SUGGESTS ( EbuildVar ):
+ def __init__ ( self, deps, **kw ):
+ super ( R_SUGGESTS, self ) . __init__ (
+ 'R_SUGGESTS',
+ ListValue ( deps ),
+ 140
+ )
+
+
+class DEPEND ( EbuildVar ):
+ def __init__ ( self, deps, **kw ):
+ super ( DEPEND, self ) . __init__ (
+ 'DEPEND',
+ ListValue ( deps ),
+ 150
+ )
+
+
+class RDEPEND ( EbuildVar ):
+ def __init__ ( self, deps, using_suggests=False, **kw ):
+ super ( RDEPEND, self ) . __init__ (
+ 'RDEPEND',
+ ListValue ( deps, empty_value="${DEPEND:-}" ),
+ 160
+ )
+ if using_suggests: self.enable_suggests()
+
+ def enable_suggests ( self ):
+ self.value.add ( '%s? ( ${R_SUGGESTS} )' % IUSE_SUGGESTS )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-21 16:55 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-21 16:55 UTC (permalink / raw
To: gentoo-commits
commit: b3239e1d3317d22b7a99793e6778e5694fa437d2
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jun 21 16:50:01 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jun 21 16:50:01 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b3239e1d
minor changes/fixes in the ebuild module
modified: roverlay/ebuild/creation.py
modified: roverlay/ebuild/depres.py
modified: roverlay/ebuild/evars.py
---
roverlay/ebuild/creation.py | 42 +++++++++++++++++++++++++-----------------
roverlay/ebuild/depres.py | 13 ++++++++-----
roverlay/ebuild/evars.py | 7 ++++---
3 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index d202d78..e2f4872 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -4,18 +4,18 @@
import logging
-from roverlay.ebuild import depres, ebuilder, evars
-
-#from roverlay.ebuild.construction import EbuildConstruction
+from roverlay.ebuild import depres, ebuilder, evars
from roverlay.rpackage.descriptionreader import DescriptionReader
LOGGER = logging.getLogger ( 'EbuildCreation' )
+USE_FULL_DESCRIPTION = False
+
class EbuildCreation ( object ):
- def __init__ ( self, package_info ):
+ def __init__ ( self, package_info, depres_channel_spawner=None ):
self.package_info = package_info
@@ -24,6 +24,9 @@ class EbuildCreation ( object ):
# > 0 busy/working; 0 == done,success; < 0 done,fail
self.status = 1
+
+ self.depres_channel_spawner = depres_channel_spawner
+
self.package_info.set_readonly()
# --- end of __init__ (...) ---
@@ -77,7 +80,7 @@ class EbuildCreation ( object ):
desc = self.package_info ['desc_data']
if desc is None:
self.logger (
- 'desc empty- cannot create an ebuild for this package.'
+ 'desc empty - cannot create an ebuild for this package.'
)
return False
@@ -85,11 +88,12 @@ class EbuildCreation ( object ):
_dep_resolution = depres.EbuildDepRes (
self.package_info, self.logger,
- create_iuse=True, run_now=True
+ create_iuse=True, run_now=True,
+ depres_channel_spawner=self.depres_channel_spawner
)
if not _dep_resolution.success():
- # log here?
+ # log here? (FIXME)
return False
@@ -99,15 +103,21 @@ class EbuildCreation ( object ):
ebuild.use ( *dep_result [1] )
description = None
-
- if 'Title' in desc:
- description = desc ['Title']
-
- if 'Description' in desc:
- if description is None:
+ if USE_FULL_DESCRIPTION:
+ if 'Title' in desc:
+ description = desc ['Title']
+
+ if 'Description' in desc:
+ if description is None:
+ description = desc ['Description']
+ else:
+ description += '// ' + desc ['Description']
+ else:
+ if 'Title' in desc:
+ description = desc ['Title']
+ elif 'Description' in desc:
description = desc ['Description']
- else:
- description += '// ' + desc ['Description']
+
if description is not None:
ebuild.use ( evars.DESCRIPTION ( description ) )
@@ -122,5 +132,3 @@ class EbuildCreation ( object ):
)
return True
-
-
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index f0ec712..db0f906 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -23,13 +23,16 @@ EBUILDVARS = {
class EbuildDepRes ( object ):
def __init__ (
- self, package_info, logger,
- depres_channel_spawner=None, create_iuse=True, run_now=True
+ self, package_info, logger, depres_channel_spawner,
+ create_iuse=True, run_now=True
):
- self.logger = logger
+ self.logger = logger.getChild ( 'depres' )
self.package_info = package_info
if depres_channel_spawner is None:
+ self.logger.warning (
+ "Using static channel spawner (meant for testing)!"
+ )
self.request_resolver = roverlay.static.depres.get_ebuild_channel
else:
self.request_resolver = depres_channel_spawner
@@ -79,8 +82,8 @@ class EbuildDepRes ( object ):
def _get_channel ( self, dependency_type ):
if dependency_type not in self._channels:
self._channels [dependency_type] = self.request_resolver (
- dependency_type,
- self.logger
+ name=dependency_type,
+ logger=self.logger
)
return self._channels [dependency_type]
# --- end of get_channel (...) ---
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 095f375..78a7326 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -7,6 +7,7 @@ from roverlay.util import shorten_str
from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
IUSE_SUGGESTS = 'R_suggests'
+RSUGGESTS_NAME = "R_SUGGESTS"
# ignoring case policies here (camel case,..)
@@ -18,7 +19,7 @@ class DESCRIPTION ( EbuildVar ):
return '%s%s="%s"' % (
self.indent,
self.name,
- shorten_str ( str ( self.value ) , 45, '... (see metadata)' )
+ shorten_str ( str ( self.value ) , 50, '... (see metadata)' )
)
@@ -42,7 +43,7 @@ class IUSE ( EbuildVar ):
class R_SUGGESTS ( EbuildVar ):
def __init__ ( self, deps, **kw ):
super ( R_SUGGESTS, self ) . __init__ (
- 'R_SUGGESTS',
+ RSUGGESTS_NAME,
ListValue ( deps ),
140
)
@@ -67,4 +68,4 @@ class RDEPEND ( EbuildVar ):
if using_suggests: self.enable_suggests()
def enable_suggests ( self ):
- self.value.add ( '%s? ( ${R_SUGGESTS} )' % IUSE_SUGGESTS )
+ self.value.add ( '%s? ( ${%s} )' % ( IUSE_SUGGESTS, RSUGGESTS_NAME ) )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-26 15:42 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-26 15:42 UTC (permalink / raw
To: gentoo-commits
commit: c258c86810d08365116fda37acbbf476087e47bd
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Jun 26 15:39:37 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Jun 26 15:39:37 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=c258c868
typo
---
roverlay/ebuild/creation.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index fca864d..4d3c412 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -125,7 +125,7 @@ class EbuildCreation ( object ):
def _make_ebuild ( self ):
"""Tries to create ebuild data."""
if self.package_info ['desc_data'] is None:
- self.logger (
+ self.logger.warning (
'desc empty - cannot create an ebuild for this package.'
)
return False
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-28 13:29 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-28 13:29 UTC (permalink / raw
To: gentoo-commits
commit: 9ca4636cfbf9020b513ebab8e1d5ee4fefef8e47
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jun 28 13:28:18 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jun 28 13:28:18 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=9ca4636c
ebuild: don't print empty vars (DEPEND="" etc.)
modified: roverlay/ebuild/abstractcomponents.py
---
roverlay/ebuild/abstractcomponents.py | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 019c252..5437dfc 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -37,9 +37,19 @@ class ListValue ( object ):
self.set_value ( value )
# --- end of __init__ (...) ---
+ def _accept_value ( self, value ):
+ if value is None:
+ return False
+ # "not str or len > 0" will raise exceptions for integers etc.
+ elif isinstance ( value, str ) and len ( value ) == 0:
+ return False
+ else:
+ return True
+ # --- end _accept_value (...) ---
+
def __len__ ( self ):
l = len ( self.value )
- return l if self.empty_value is None else l - 1
+ return max ( 0, l if self.empty_value is None else l - 1 )
def set_level ( self, level ):
"""Sets the indention level."""
@@ -54,12 +64,14 @@ class ListValue ( object ):
self.value = list()
if self.empty_value is not None:
self.value.append ( self.empty_value )
- self.add_value ( value )
+
+ if self._accept_value ( value ):
+ self.add_value ( value )
# --- end of set_value (...) ---
def add_value ( self, value ):
"""Adds/Appends a value."""
- if value is None:
+ if not self._accept_value ( value ):
pass
elif listlike ( value ):
self.value.extend ( value )
@@ -119,7 +131,12 @@ class EbuildVar ( object ):
(EbuildVar's active() returns always True, derived classes may
override this.)
"""
- return True
+ if hasattr ( self, 'enabled' ):
+ return self.enabled
+ elif hasattr ( self.value, '__len__' ):
+ return len ( self.value ) > 0
+ else:
+ return True
def __str__ ( self ):
return '%s%s="%s"' % ( self.indent, self.name, self.value )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-28 15:55 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-28 15:55 UTC (permalink / raw
To: gentoo-commits
commit: dc07d7fd881227bf895b0b50b77a1596e52567e9
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jun 28 15:48:54 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jun 28 15:48:54 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=dc07d7fd
log level in ebuild creation
* decreasing log level for desc reading in ebuild/creation.py,
_lazyimport_desc_data()
modified: roverlay/ebuild/creation.py
---
roverlay/ebuild/creation.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 4d3c412..056b1a2 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -76,7 +76,7 @@ class EbuildCreation ( object ):
if self.package_info.get ( 'desc_data',
fallback_value=None, do_fallback=True ) is None:
- logging.warning ( 'Reading description data now.' )
+ logging.debug ( 'Reading description data now.' )
reader = DescriptionReader (
self.package_info,
logger=self.logger,
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-29 22:48 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-29 22:48 UTC (permalink / raw
To: gentoo-commits
commit: e78a13a4cce2587052b7e734fdde7e405ffb9589
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jun 29 22:25:41 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jun 29 22:25:41 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e78a13a4
evars: applied value quoting changes
modified: roverlay/ebuild/evars.py
---
roverlay/ebuild/evars.py | 50 +++++++++++++++++++++++++++------------------
1 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index da34c68..8900794 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -7,7 +7,9 @@ from roverlay.util import shorten_str
from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
IUSE_SUGGESTS = 'R_suggests'
-RSUGGESTS_NAME = "R_SUGGESTS"
+RSUGGESTS_NAME = IUSE_SUGGESTS.upper()
+
+SEE_METADATA = '... (see metadata)'
# ignoring case policies here (camel case,..)
@@ -20,21 +22,25 @@ class DESCRIPTION ( EbuildVar ):
* description -- description text
* maxlen -- maximum value length (defaults to 50 chars)
"""
- super ( DESCRIPTION, self ) . __init__ ( 'DESCRIPTION', description, 80 )
+ super ( DESCRIPTION, self ) . __init__ (
+ name='DESCRIPTION',
+ value=description,
+ priority=80, param_expansion=False
+ )
self.maxlen = 50 if maxlen is None else maxlen
+ self.use_param_expansion = False
- def __str__ ( self ):
- return '%s%s="%s"' % (
- self.indent,
- self.name,
- shorten_str ( str ( self.value ) , self.maxlen, '... (see metadata)' )
+ def _get_value_str ( self ):
+ return shorten_str (
+ str ( self.value ) , self.maxlen, SEE_METADATA
)
class SRC_URI ( EbuildVar ):
"""A SRC_URI="..." statement."""
def __init__ ( self, src_uri ):
- super ( SRC_URI, self ) . __init__ ( 'SRC_URI', src_uri, 90 )
+ super ( SRC_URI, self ) . __init__ (
+ name='SRC_URI', value=src_uri, priority=90, param_expansion=False )
class IUSE ( EbuildVar ):
@@ -47,9 +53,10 @@ class IUSE ( EbuildVar ):
* using_suggests -- if True: enable R_Suggests USE flag
"""
super ( IUSE, self ) . __init__ (
- 'IUSE',
- ListValue ( use_flags, empty_value='${IUSE:-}' ),
- 130
+ name='IUSE',
+ value=ListValue ( use_flags, empty_value='${IUSE:-}' ),
+ priority=130,
+ param_expansion=True
)
self.value.single_line = True
if using_suggests:
@@ -60,9 +67,10 @@ class R_SUGGESTS ( EbuildVar ):
"""A R_SUGGESTS="..." statement."""
def __init__ ( self, deps, **kw ):
super ( R_SUGGESTS, self ) . __init__ (
- RSUGGESTS_NAME,
- ListValue ( deps ),
- 140
+ name=RSUGGESTS_NAME,
+ value=ListValue ( deps ),
+ priority=140,
+ param_expansion=False
)
@@ -70,9 +78,10 @@ class DEPEND ( EbuildVar ):
"""A DEPEND="..." statement."""
def __init__ ( self, deps, **kw ):
super ( DEPEND, self ) . __init__ (
- 'DEPEND',
- ListValue ( deps ),
- 150
+ name='DEPEND',
+ value=ListValue ( deps ),
+ priority=150,
+ param_expansion=False
)
@@ -80,9 +89,10 @@ class RDEPEND ( EbuildVar ):
"""A RDEPEND="..." statement."""
def __init__ ( self, deps, using_suggests=False, **kw ):
super ( RDEPEND, self ) . __init__ (
- 'RDEPEND',
- ListValue ( deps, empty_value="${DEPEND:-}" ),
- 160
+ name='RDEPEND',
+ value=ListValue ( deps, empty_value="${DEPEND:-}" ),
+ priority=160,
+ param_expansion=True
)
if using_suggests: self.enable_suggests()
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-29 22:48 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-29 22:48 UTC (permalink / raw
To: gentoo-commits
commit: 7bfe60ae3fee591b2476af9a2a0a34ccb2e298e6
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jun 29 22:22:30 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jun 29 22:22:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=7bfe60ae
ebuild variables: remove syntax-violating quotes
* this removes quote chars from var values
* also added the possibility to choose between ' and "
modified: roverlay/ebuild/abstractcomponents.py
---
roverlay/ebuild/abstractcomponents.py | 38 ++++++++++++++++++++++++++++++--
1 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 5437dfc..f943948 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -31,6 +31,7 @@ class ListValue ( object ):
self.indent_lines = True
# only used in multi line mode
self.append_indented_newline = True
+ self.insert_leading_newline = False
self.val_join = ' '
@@ -84,13 +85,21 @@ class ListValue ( object ):
def to_str ( self ):
"""Returns a string representing this ListValue."""
if len ( self.value ) == 0:
+ # empty value
ret = ""
elif len ( self.value ) == 1:
+ # one value
ret = str ( self.value [0] )
elif self.single_line:
+ # several values in a single line
ret = self.val_join.join ( self.value )
else:
- ret = self.line_join.join ( ( self.value ) )
+ if self.insert_leading_newline:
+ ret = '\n' + self.val_indent
+ ret += self.line_join.join ( ( self.value ) )
+ else:
+ ret = self.line_join.join ( ( self.value ) )
+
if self.append_indented_newline:
ret += self.var_indent + '\n'
@@ -103,7 +112,9 @@ class ListValue ( object ):
class EbuildVar ( object ):
"""An ebuild variable."""
- def __init__ ( self, name, value, priority ):
+ QUOTE_CHARS = "\"\'"
+
+ def __init__ ( self, name, value, priority, param_expansion=True ):
"""Initializes an EbuildVar.
arguments:
@@ -116,6 +127,8 @@ class EbuildVar ( object ):
self.priority = priority
self.value = value
self.set_level ( 0 )
+ self.use_param_expansion = param_expansion
+ self.print_empty_var = False
def set_level ( self, level ):
"""Sets the indention level."""
@@ -138,5 +151,24 @@ class EbuildVar ( object ):
else:
return True
+ def _quote_value ( self ):
+ q = '"' if self.use_param_expansion else "'"
+ if hasattr ( self, '_get_value_str' ):
+ vstr = self._get_value_str()
+ else:
+ vstr = str ( self.value )
+ # removing all quote chars from values,
+ # the "constructed" {R,}DEPEND/R_SUGGESTS/IUSE vars don't use them
+ # and DESCRIPTION/SRC_URI don't need them
+ return q + vstr.strip ( EbuildVar.QUOTE_CHARS ) + q
+
def __str__ ( self ):
- return '%s%s="%s"' % ( self.indent, self.name, self.value )
+ valstr = self._quote_value()
+ if len ( valstr ) > 2 or self.print_empty_var:
+ return '%s%s=%s' % ( self.indent, self.name, valstr )
+ else:
+ # empty string 'cause var is not set
+ # -> Ebuilder ignores this var
+ # this filters out the result of strip(QUOTE_CHARS) for values that
+ # contain only quote chars
+ return ""
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-29 22:48 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-29 22:48 UTC (permalink / raw
To: gentoo-commits
commit: 3eb4225fa85134f32a2550b5dd9826f72d89cef1
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jun 29 22:33:19 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jun 29 22:33:19 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=3eb4225f
ebuilder: don't print empty var lines
modified: roverlay/ebuild/ebuilder.py
---
roverlay/ebuild/ebuilder.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/roverlay/ebuild/ebuilder.py b/roverlay/ebuild/ebuilder.py
index aa7d8f5..ae6adcb 100644
--- a/roverlay/ebuild/ebuilder.py
+++ b/roverlay/ebuild/ebuilder.py
@@ -30,8 +30,10 @@ class Ebuilder ( object ):
lines = list()
for index, e in enumerate ( self._evars ):
if e.active():
- lines.append ( str ( e ) )
- if index < last and newline ( index ): lines.append ( '' )
+ varstr = str ( e )
+ if varstr:
+ lines.append ( str ( e ) )
+ if index < last and newline ( index ): lines.append ( '' )
return lines
# --- end of get_lines (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-06-29 22:48 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-06-29 22:48 UTC (permalink / raw
To: gentoo-commits
commit: d477ed333db169615548743eeca1a190f6b84c17
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jun 29 22:30:32 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jun 29 22:30:32 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d477ed33
filter out dependencies provided by eclass
* dev-lang/R will automatically be removed from the ebuild dependencies
unless a version newer than the oldest in the portage tree (2.10.1)
is required
modified: roverlay/ebuild/depres.py
---
roverlay/ebuild/depres.py | 39 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 38 insertions(+), 1 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 6aca522..383831e 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -153,9 +153,46 @@ class EbuildDepRes ( object ):
def _make_result ( self ):
"""Make evars using the depres result."""
+ def dep_allowed ( dep ):
+ #FIXME hardcoded
+
+ # the oldest version of dev-lang/R in portage
+ OLDEST_R_VERSION = ( 2, 20, 1 )
+
+ if not dep:
+ return False
+
+ cat, sep, remainder = dep.partition ( '/' )
+
+ if not sep:
+ raise Exception ( "bad dependency string '%s'!" % dep )
+
+ dep_list = remainder.split ( '-', 2 )
+
+ if len ( dep_list ) < 2:
+ ver = ( 0, )
+ else:
+ ver = tuple ( int (x) for x in dep_list [1].split ( '.' ) )
+
+
+ if cat.endswith ( 'dev-lang' ) \
+ and dep_list [0] == 'R' \
+ and cat [0] != '!' \
+ :
+ if not ver:
+ # filters out 'dev-lang/R'
+ return False
+ else:
+ return ver > OLDEST_R_VERSION
+
+ return True
+ # --- end of dep_allowed (...) ---
+
_result = list()
for dep_type, channel in self._channels.items():
- deplist = list ( filter ( None, channel.collect_dependencies() ) )
+ deplist = tuple ( filter (
+ dep_allowed, channel.collect_dependencies() )
+ )
if deplist is None:
## FIXME: false positive: "empty" channel
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-07-06 22:19 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-07-06 22:19 UTC (permalink / raw
To: gentoo-commits
commit: 6ff7308157e9ec2cc9a189ba4ad9a625328752bc
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jul 6 22:05:39 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jul 6 22:05:39 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6ff73081
fix and extend invalid char in ebuilds
modified: roverlay/ebuild/abstractcomponents.py
---
roverlay/ebuild/abstractcomponents.py | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index f943948..6fbc959 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -1,7 +1,10 @@
# R Overlay -- ebuild creation, <?>
+# -*- coding: utf-8 -*-
# Copyright 2006-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import re
+
INDENT = '\t'
def listlike ( ref ):
@@ -112,7 +115,7 @@ class ListValue ( object ):
class EbuildVar ( object ):
"""An ebuild variable."""
- QUOTE_CHARS = "\"\'"
+ IGNORED_VALUE_CHARS = re.compile ( "[\"'`¸]" )
def __init__ ( self, name, value, priority, param_expansion=True ):
"""Initializes an EbuildVar.
@@ -129,6 +132,7 @@ class EbuildVar ( object ):
self.set_level ( 0 )
self.use_param_expansion = param_expansion
self.print_empty_var = False
+ # --- end of __init__ (...) ---
def set_level ( self, level ):
"""Sets the indention level."""
@@ -150,17 +154,24 @@ class EbuildVar ( object ):
return len ( self.value ) > 0
else:
return True
+ # --- end of active (...) ---
def _quote_value ( self ):
- q = '"' if self.use_param_expansion else "'"
+ q = '"' if self.use_param_expansion else '"'
+
if hasattr ( self, '_get_value_str' ):
vstr = self._get_value_str()
else:
vstr = str ( self.value )
+
# removing all quote chars from values,
# the "constructed" {R,}DEPEND/R_SUGGESTS/IUSE vars don't use them
# and DESCRIPTION/SRC_URI don't need them
- return q + vstr.strip ( EbuildVar.QUOTE_CHARS ) + q
+ if len ( vstr ) == 0:
+ return 2 * q
+ else:
+ return q + EbuildVar.IGNORED_VALUE_CHARS.sub ( '', vstr ) + q
+ # --- end of _quote_value (...) ---
def __str__ ( self ):
valstr = self._quote_value()
@@ -172,3 +183,4 @@ class EbuildVar ( object ):
# this filters out the result of strip(QUOTE_CHARS) for values that
# contain only quote chars
return ""
+ # --- end of __str__ (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-07-12 18:04 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-07-12 18:04 UTC (permalink / raw
To: gentoo-commits
commit: 13586213af9286f7b54e1f1eec227e4111f188c5
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 12 17:47:33 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 12 17:47:33 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=13586213
unused functions commented out
---
roverlay/ebuild/creation.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index b606ae9..778f93a 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -44,10 +44,10 @@ class EbuildCreation ( object ):
self.package_info.set_readonly()
# --- end of __init__ (...) ---
- def done ( self ) : return self.status < 1
- def busy ( self ) : return self.status > 0
- def success ( self ) : return self.status == 0
- def fail ( self ) : return self.status < 0
+ #def done ( self ) : return self.status < 1
+ #def busy ( self ) : return self.status > 0
+ #def success ( self ) : return self.status == 0
+ #def fail ( self ) : return self.status < 0
def run ( self ):
"""Creates an ebuild. Returns None (implicit)."""
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-07-16 16:15 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-07-16 16:15 UTC (permalink / raw
To: gentoo-commits
commit: 106ad472eb656e494fedd7dd90c025a67daf5751
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 16 16:11:04 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 16 16:11:04 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=106ad472
use ascii filter
---
roverlay/ebuild/evars.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 8900794..0e295aa 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -2,7 +2,7 @@
# Copyright 2006-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-from roverlay.util import shorten_str
+from roverlay import util
from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
@@ -31,8 +31,8 @@ class DESCRIPTION ( EbuildVar ):
self.use_param_expansion = False
def _get_value_str ( self ):
- return shorten_str (
- str ( self.value ) , self.maxlen, SEE_METADATA
+ return util.shorten_str (
+ util.ascii_filter ( str ( self.value ) ), self.maxlen, SEE_METADATA
)
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-07-16 16:15 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-07-16 16:15 UTC (permalink / raw
To: gentoo-commits
commit: fdec3cb369d90dd4fc20debb31c6b03156db7b8b
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 16 16:04:30 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 16 16:04:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=fdec3cb3
fix invalid RDEPEND
don't write 'R_Suggests? ( ${R_SUGGESTS} )' if R_SUGGESTS is empty and
therefore not written into the ebuild
geändert: roverlay/ebuild/depres.py
---
roverlay/ebuild/depres.py | 44 +++++++++++++++++++++++---------------------
1 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 9931093..b3cd38c 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -146,15 +146,11 @@ class EbuildDepRes ( object ):
if not resolver:
resolver = self._get_channel ( dep_type )
- # make sure that DescriptionReader reads all dep fields as list
resolver.add_dependencies (
dep_list = desc [desc_field],
deptype_mask = FIELDS [desc_field]
)
# -- for dep_type
-
- self.has_suggests = bool ( 'R_SUGGESTS' in self._channels )
-
# --- end of _init_channels (...) ---
def _close_channels ( self ):
@@ -163,6 +159,8 @@ class EbuildDepRes ( object ):
for channel in self._channels.values(): channel.close()
del self._channels
+
+ self._channels = None
# --- end of _close_channels (...) ---
def _wait_resolve ( self ):
@@ -211,30 +209,34 @@ class EbuildDepRes ( object ):
return True
# --- end of dep_allowed (...) ---
- _result = list()
+ # RDEPEND -> <deps>, DEPEND -> <deps>, ..
+ _depmap = dict()
+ # two for dep_type, <sth> loops to safely determine the actual deps
+ # (e.g. whether to include R_SUGGESTS in RDEPEND)
for dep_type, channel in self._channels.items():
deplist = tuple ( filter (
dep_allowed, channel.collect_dependencies() )
)
- if deplist is None:
- ## FIXME: false positive: "empty" channel
- raise Exception (
- 'dep_resolver is broken: '
- 'lookup() returns None but satisfy_request() says ok.'
- )
- elif hasattr ( deplist, '__iter__' ):
- # add dependencies in no_append/override mode
+ if len ( deplist ) > 0:
self.logger.debug ( "adding %s to %s", deplist, dep_type )
- _result.append (
- EBUILDVARS [dep_type] (
- deplist,
- using_suggests=self.has_suggests
- )
+ _depmap [dep_type] = deplist
+ # else: (effectively) no dependencies for dep_type
+
+
+ self._close_channels()
+
+ self.has_suggests = bool ( 'R_SUGGESTS' in _depmap )
+
+ _result = list()
+ for dep_type, deps in _depmap.items():
+ # add dependencies in no_append/override mode
+ _result.append (
+ EBUILDVARS [dep_type] (
+ deplist,
+ using_suggests=self.has_suggests
)
- else:
- raise Exception ( "dep_resolver is broken: iterable expected!" )
- # -- for dep_type,..
+ )
if self.create_iuse:
_result.append ( evars.IUSE ( using_suggests=self.has_suggests ) )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
2012-07-30 8:52 [gentoo-commits] proj/R_overlay:overlay_wip " André Erdmann
@ 2012-07-30 8:52 ` André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-07-30 8:52 UTC (permalink / raw
To: gentoo-commits
commit: 205370a34a6c5b51e4f1c446341b53813a7c89bf
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 30 08:41:30 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 30 08:41:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=205370a3
try to filter deps, but don't fail
---
roverlay/ebuild/depres.py | 50 ++++++++++++++++++++++++--------------------
1 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index b3cd38c..8b38e91 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -175,36 +175,40 @@ class EbuildDepRes ( object ):
def _make_result ( self ):
"""Make evars using the depres result."""
def dep_allowed ( dep ):
- #FIXME hardcoded
+ try:
+ #FIXME hardcoded
+ #FIXME fails for "qt-core" etc.
- # the oldest version of dev-lang/R in portage
- OLDEST_R_VERSION = ( 2, 20, 1 )
+ # the oldest version of dev-lang/R in portage
+ OLDEST_R_VERSION = ( 2, 20, 1 )
- if not dep:
- return False
-
- cat, sep, remainder = dep.partition ( '/' )
-
- if not sep:
- raise Exception ( "bad dependency string '%s'!" % dep )
+ if not dep:
+ return False
- dep_list = remainder.split ( '-', 2 )
+ cat, sep, remainder = dep.partition ( '/' )
- if len ( dep_list ) < 2:
- ver = ( 0, )
- else:
- ver = tuple ( int (x) for x in dep_list [1].split ( '.' ) )
+ if not sep:
+ raise Exception ( "bad dependency string '%s'!" % dep )
+ dep_list = remainder.split ( '-', 2 )
- if cat.endswith ( 'dev-lang' ) \
- and dep_list [0] == 'R' \
- and cat [0] != '!' \
- :
- if not ver:
- # filters out 'dev-lang/R'
- return False
+ if len ( dep_list ) < 2:
+ ver = ( 0, )
else:
- return ver > OLDEST_R_VERSION
+ ver = tuple ( int (x) for x in dep_list [1].split ( '.' ) )
+
+
+ if cat.endswith ( 'dev-lang' ) \
+ and dep_list [0] == 'R' \
+ and cat [0] != '!' \
+ :
+ if not ver:
+ # filters out 'dev-lang/R'
+ return False
+ else:
+ return ver > OLDEST_R_VERSION
+ except Exception as e:
+ self.logger.exception ( e )
return True
# --- end of dep_allowed (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-02 15:14 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-02 15:14 UTC (permalink / raw
To: gentoo-commits
commit: 6ec1d67b85fd8c5058f360ab1bdbbff332f973fa
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 2 15:03:49 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 2 15:03:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=6ec1d67b
ebuild: comments, string formatting and strutil
---
roverlay/ebuild/abstractcomponents.py | 6 ++++--
roverlay/ebuild/evars.py | 10 +++++++---
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 6fbc959..5326a8e 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -176,11 +176,13 @@ class EbuildVar ( object ):
def __str__ ( self ):
valstr = self._quote_value()
if len ( valstr ) > 2 or self.print_empty_var:
- return '%s%s=%s' % ( self.indent, self.name, valstr )
+ return "{indent}{name}={value}".format (
+ indent=self.indent, name=self.name, value=valstr
+ )
else:
# empty string 'cause var is not set
# -> Ebuilder ignores this var
# this filters out the result of strip(QUOTE_CHARS) for values that
# contain only quote chars
- return ""
+ return self._empty_str() if hasattr ( self, '_empty_str' ) else ""
# --- end of __str__ (...) ---
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 0e295aa..2a7692d 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -2,7 +2,7 @@
# Copyright 2006-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-from roverlay import util
+from roverlay import strutil
from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
@@ -31,8 +31,8 @@ class DESCRIPTION ( EbuildVar ):
self.use_param_expansion = False
def _get_value_str ( self ):
- return util.shorten_str (
- util.ascii_filter ( str ( self.value ) ), self.maxlen, SEE_METADATA
+ return strutil.shorten_str (
+ strutil.ascii_filter ( str ( self.value ) ), self.maxlen, SEE_METADATA
)
@@ -42,6 +42,10 @@ class SRC_URI ( EbuildVar ):
super ( SRC_URI, self ) . __init__ (
name='SRC_URI', value=src_uri, priority=90, param_expansion=False )
+ def _empty_str ( self ):
+ """Called if this SRC_URI evar has no uri stored."""
+ return 'SRC_URI=""\nRESTRICT="fetch"'
+
class IUSE ( EbuildVar ):
"""An IUSE="..." statement."""
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-02 15:14 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-02 15:14 UTC (permalink / raw
To: gentoo-commits
commit: 43760dfaaf7a140a0c941c1cbd89c481796f50cf
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 2 15:04:05 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 2 15:04:05 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=43760dfa
ebuild: replace dep_allowed code
Should be more stable now (and doesn't raise an exception for deps
that cannot be filtered due to various reasons)
---
roverlay/ebuild/depfilter.py | 68 ++++++++++++++++++++++++++++++++++++++++++
roverlay/ebuild/depres.py | 55 +++++++--------------------------
2 files changed, 80 insertions(+), 43 deletions(-)
diff --git a/roverlay/ebuild/depfilter.py b/roverlay/ebuild/depfilter.py
new file mode 100644
index 0000000..8aaf18e
--- /dev/null
+++ b/roverlay/ebuild/depfilter.py
@@ -0,0 +1,68 @@
+def dep_allowed ( dep ):
+ """Filters out redundant dependencies on dev-lang/R."""
+
+ if not dep:
+ return 0
+ elif dep[0] in '|(':
+ # compound dep statements "|| ( a b c )", "( a b c )"
+ return 1
+
+
+ # the oldest version of dev-lang/R in portage
+ OLDEST_R_VERSION = ( 2, 10, 1 )
+# OLDEST_R_VERSION = config.get (
+# "PORTAGE.lowest_r_version", "2.10.1"
+# ).split ( '.' )
+
+ cat, sep, remainder = dep.partition ( '/' )
+ # don't strip leading '!'
+ cat = cat.lstrip ( "<>=" )
+
+
+ if not sep:
+ # cannot parse this
+ return 2
+
+ elif cat != 'dev-lang':
+ # only filtering dev-lang/R
+ return 3
+
+ elif '[' in remainder:
+ # USE flag requirements, e.g. "dev-lang/R[lapack]"
+ return 4
+
+ # result is ${PN}-${PV} or ${PN}-${PV}-${PR}
+ pn_or_pnpv, sepa, ver_or_rev = remainder.rpartition ( '-' )
+
+ if not sepa or not pn_or_pnpv:
+ return 5 if ver_or_rev != 'R' else 0
+
+ elif pn_or_pnpv [0] != 'R' or (
+ len ( pn_or_pnpv ) > 1 and pn_or_pnpv [1] != '-'
+ ):
+ # only filtering dev-lang/R
+ return 6
+
+ elif len ( ver_or_rev ) == 0:
+ return 7
+
+ elif ver_or_rev [0] == 'r':
+ try:
+ pr = int ( ver_or_rev [1:] )
+ except ValueError:
+ return 8
+
+ pn, sepa, ver_or_rev = pn_or_pnpv.rpartition ( '-' )
+
+ else:
+ pn = pn_or_pnpv
+ pr = 0
+
+ try:
+ pv = tuple ( int (x) for x in ver_or_rev.split ( '.' ) ) + ( pr, )
+ except ValueError:
+ raise
+ return 9
+
+ return 10 if pv > OLDEST_R_VERSION else 0
+# --- end of dep_allowed (...) ---
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 8b38e91..b08c913 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -2,10 +2,10 @@
# Copyright 2006-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+from roverlay import config
from roverlay.depres import deptype
-from roverlay.ebuild import evars
+from roverlay.ebuild import evars, depfilter
-# TODO/FIXME/IGNORE move this to const / config
FIELDS_TO_EVAR = {
'R_SUGGESTS' : ( 'Suggests', ),
'DEPENDS' : ( 'Depends', 'Imports' ),
@@ -16,19 +16,24 @@ FIELDS_TO_EVAR = {
# setting per-field dep types here, in accordance with
# http://cran.r-project.org/doc/manuals/R-exts.html#The-DESCRIPTION-file
FIELDS = {
+
# "The Depends field gives a comma-separated
# list of >>package names<< which this package depends on."
'Depends' : deptype.PKG,
+
# "Other dependencies (>>external to the R system<<)
# should be listed in the SystemRequirements field"
'SystemRequirements' : deptype.SYS,
+
# "The Imports field lists >>packages<< whose namespaces
# are imported from (as specified in the NAMESPACE file)
# but which do not need to be attached."
'Imports' : deptype.PKG,
+
# "The Suggests field uses the same syntax as Depends
# and lists >>packages<< that are >>not necessarily needed<<."
'Suggests' : deptype.internal,
+
# "A package that wishes to make use of header files
# in other >>packages<< needs to declare them as
# a comma-separated list in the field LinkingTo in the DESCRIPTION file."
@@ -174,44 +179,6 @@ class EbuildDepRes ( object ):
def _make_result ( self ):
"""Make evars using the depres result."""
- def dep_allowed ( dep ):
- try:
- #FIXME hardcoded
- #FIXME fails for "qt-core" etc.
-
- # the oldest version of dev-lang/R in portage
- OLDEST_R_VERSION = ( 2, 20, 1 )
-
- if not dep:
- return False
-
- cat, sep, remainder = dep.partition ( '/' )
-
- if not sep:
- raise Exception ( "bad dependency string '%s'!" % dep )
-
- dep_list = remainder.split ( '-', 2 )
-
- if len ( dep_list ) < 2:
- ver = ( 0, )
- else:
- ver = tuple ( int (x) for x in dep_list [1].split ( '.' ) )
-
-
- if cat.endswith ( 'dev-lang' ) \
- and dep_list [0] == 'R' \
- and cat [0] != '!' \
- :
- if not ver:
- # filters out 'dev-lang/R'
- return False
- else:
- return ver > OLDEST_R_VERSION
- except Exception as e:
- self.logger.exception ( e )
-
- return True
- # --- end of dep_allowed (...) ---
# RDEPEND -> <deps>, DEPEND -> <deps>, ..
_depmap = dict()
@@ -219,15 +186,17 @@ class EbuildDepRes ( object ):
# (e.g. whether to include R_SUGGESTS in RDEPEND)
for dep_type, channel in self._channels.items():
deplist = tuple ( filter (
- dep_allowed, channel.collect_dependencies() )
+ depfilter.dep_allowed, channel.collect_dependencies() )
)
if len ( deplist ) > 0:
- self.logger.debug ( "adding %s to %s", deplist, dep_type )
+ self.logger.debug (
+ "adding {deps} to {depvar}".format (
+ deps=deplist, depvar=dep_type
+ ) )
_depmap [dep_type] = deplist
# else: (effectively) no dependencies for dep_type
-
self._close_channels()
self.has_suggests = bool ( 'R_SUGGESTS' in _depmap )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-03 13:38 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-03 13:38 UTC (permalink / raw
To: gentoo-commits
commit: 846caaf50d5e7e3721af5e2480ff01f79a78775b
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Aug 3 11:40:11 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Aug 3 11:40:11 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=846caaf5
add bash arrays to ebuild/abstractcomponents
---
roverlay/ebuild/abstractcomponents.py | 92 ++++++++++++++++++++++-----------
1 files changed, 61 insertions(+), 31 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 5326a8e..db0a632 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -14,7 +14,9 @@ def listlike ( ref ):
class ListValue ( object ):
"""An evar value with a list of elements."""
- def __init__ ( self, value, indent_level=1, empty_value=None ):
+ def __init__ ( self,
+ value, indent_level=1, empty_value=None, bash_array=False
+ ):
"""Initializes a ListValue.
arguments:
@@ -34,7 +36,9 @@ class ListValue ( object ):
self.indent_lines = True
# only used in multi line mode
self.append_indented_newline = True
- self.insert_leading_newline = False
+
+ self.is_bash_array = bash_array
+ self.insert_leading_newline = self.is_bash_array
self.val_join = ' '
@@ -73,7 +77,7 @@ class ListValue ( object ):
self.add_value ( value )
# --- end of set_value (...) ---
- def add_value ( self, value ):
+ def add ( self, value ):
"""Adds/Appends a value."""
if not self._accept_value ( value ):
pass
@@ -81,30 +85,49 @@ class ListValue ( object ):
self.value.extend ( value )
else:
self.value.append ( value )
- # --- end of add_value (...) ---
+ # --- end of add (...) ---
- add = add_value
+ add_value = add
def to_str ( self ):
"""Returns a string representing this ListValue."""
- if len ( self.value ) == 0:
- # empty value
- ret = ""
- elif len ( self.value ) == 1:
- # one value
- ret = str ( self.value [0] )
- elif self.single_line:
- # several values in a single line
- ret = self.val_join.join ( self.value )
+
+ value_count = len ( self.value )
+ if self.is_bash_array:
+ if value_count == 0:
+ # empty value
+ ret = "()"
+ elif value_count == 1:
+ # one value
+ ret = "('" + str ( self.value [0] ) + "')"
+ elif self.single_line:
+ # several values in a single line
+ ret = self.val_join.join ( self.value )
+ else:
+ ret = "{intro}{values}{tail}{newline}".format (
+ intro = '(\n' + self.val_indent \
+ if self.insert_leading_newline else '( ',
+ values = self.line_join.join (
+ "'" + str ( x ) + "'" for x in self.value
+ ),
+ tail = '\n{indent})'.format ( indent=self.var_indent ),
+ newline = self.var_indent + '\n' \
+ if self.append_indented_newline else ''
+ )
else:
- if self.insert_leading_newline:
- ret = '\n' + self.val_indent
- ret += self.line_join.join ( ( self.value ) )
+ if value_count == 0:
+ ret = ""
+ elif value_count == 1:
+ ret = str ( self.value [0] )
else:
- ret = self.line_join.join ( ( self.value ) )
+ if self.insert_leading_newline:
+ ret = '\n' + self.val_indent
+ ret += self.line_join.join ( ( self.value ) )
+ else:
+ ret = self.line_join.join ( ( self.value ) )
- if self.append_indented_newline:
- ret += self.var_indent + '\n'
+ if self.append_indented_newline:
+ ret += self.var_indent + '\n'
return ret
# --- end of to_str (...) ---
@@ -126,12 +149,15 @@ class EbuildVar ( object ):
* priority -- used for sorting (e.g. 'R_SUGGESTS' before 'DEPEND'),
lower means higher priority
"""
- self.name = name
- self.priority = priority
- self.value = value
+ self.name = name
+ self.priority = priority
+ self.value = value
self.set_level ( 0 )
self.use_param_expansion = param_expansion
self.print_empty_var = False
+
+ if hasattr ( self.value, 'add' ):
+ self.add_value = self.value.add
# --- end of __init__ (...) ---
def set_level ( self, level ):
@@ -157,20 +183,24 @@ class EbuildVar ( object ):
# --- end of active (...) ---
def _quote_value ( self ):
- q = '"' if self.use_param_expansion else '"'
-
if hasattr ( self, '_get_value_str' ):
vstr = self._get_value_str()
else:
vstr = str ( self.value )
- # removing all quote chars from values,
- # the "constructed" {R,}DEPEND/R_SUGGESTS/IUSE vars don't use them
- # and DESCRIPTION/SRC_URI don't need them
- if len ( vstr ) == 0:
- return 2 * q
+ if self.use_param_expansion is None:
+ # value quoting / unquoting is disabled
+ return vstr
+
else:
- return q + EbuildVar.IGNORED_VALUE_CHARS.sub ( '', vstr ) + q
+ q = '"' if self.use_param_expansion else '"'
+ # removing all quote chars from values,
+ # the "constructed" {R,}DEPEND/R_SUGGESTS/IUSE vars don't use them
+ # and DESCRIPTION/SRC_URI don't need them
+ if len ( vstr ) == 0:
+ return 2 * q
+ else:
+ return q + EbuildVar.IGNORED_VALUE_CHARS.sub ( '', vstr ) + q
# --- end of _quote_value (...) ---
def __str__ ( self ):
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-03 13:38 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-03 13:38 UTC (permalink / raw
To: gentoo-commits
commit: 1c70fb2ef1c0345a432a5ba2eeacef45b9ed5ea0
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Aug 3 11:40:28 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Aug 3 11:40:28 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=1c70fb2e
MISSINGDEPS evar
---
roverlay/ebuild/evars.py | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 2a7692d..4262956 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -64,7 +64,7 @@ class IUSE ( EbuildVar ):
)
self.value.single_line = True
if using_suggests:
- self.value.add ( IUSE_SUGGESTS )
+ self.add_value ( IUSE_SUGGESTS )
class R_SUGGESTS ( EbuildVar ):
@@ -102,4 +102,21 @@ class RDEPEND ( EbuildVar ):
def enable_suggests ( self ):
"""Adds the optional R_SUGGESTS dependencies to RDEPEND."""
- self.value.add ( '%s? ( ${%s} )' % ( IUSE_SUGGESTS, RSUGGESTS_NAME ) )
+ self.add_value ( '{USE}? ( ${{DEPS}} )'.format (
+ USE = IUSE_SUGGESTS,
+ DEPS = RSUGGESTS_NAME
+ ) )
+
+
+class MISSINGDEPS ( EbuildVar ):
+ def __init__ ( self, missing_deps, do_sort=False, **kw ):
+ super ( MISSINGDEPS, self ) . __init__ (
+ name = '_UNRESOLVED_PACKAGES',
+ value = ListValue (
+ missing_deps if not do_sort \
+ else tuple ( sorted ( missing_deps, key=lambda s : s.lower() ) ),
+ bash_array=True
+ ),
+ priority = 200,
+ param_expansion = None,
+ )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-07 8:50 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-07 8:50 UTC (permalink / raw
To: gentoo-commits
commit: 9da3deb5d4b5e4b2e850139d6e0f9c9fbf1c0655
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Aug 7 07:38:24 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Aug 7 07:38:24 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=9da3deb5
fix str formatting issue
---
roverlay/ebuild/evars.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 5ead5c5..d1a228c 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -117,7 +117,7 @@ class RDEPEND ( EbuildVar ):
def enable_suggests ( self ):
"""Adds the optional R_SUGGESTS dependencies to RDEPEND."""
- self.add_value ( '{USE}? ( ${{DEPS}} )'.format (
+ self.add_value ( '{USE}? ( ${{{DEPS}}} )'.format (
USE = IUSE_SUGGESTS,
DEPS = RSUGGESTS_NAME
) )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2012-08-09 9:26 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2012-08-09 9:26 UTC (permalink / raw
To: gentoo-commits
commit: 13e54a168f5ad283b422220498815f4b6696dae3
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Aug 9 09:24:36 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Aug 9 09:24:36 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=13e54a16
ebuild/depres: fix ebuild var creation
* the ebuild var creation loop using the correct dep list now
* RDEPENDS will now be created if it is empty, but R_SUGGESTS is not
---
roverlay/ebuild/depres.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 71eb691..d5d4c63 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -216,10 +216,11 @@ class EbuildDepRes ( object ):
self._close_channels()
+ # empty R_SUGGESTS has been filtered out
self.has_suggests = bool ( 'R_SUGGESTS' in _depmap )
_result = list()
- for dep_type, deps in _depmap.items():
+ for dep_type, deplist in _depmap.items():
# add dependencies in no_append/override mode
_result.append (
EBUILDVARS [dep_type] (
@@ -228,6 +229,12 @@ class EbuildDepRes ( object ):
)
)
+ # When using suggested dependencies, RDEPENDS is required even if empty
+ if self.has_suggests and 'RDEPENDS' not in _depmap:
+ _result.append (
+ EBUILDVARS ['RDEPENDS'] ( None, using_suggests=True )
+ )
+
if unresolvable_optional_deps:
# if not self.has_suggests: raise AssertionError() #?
_result.append (
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-01-30 20:16 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-01-30 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 5a5de449586726eaa99a807781552753659d32c1
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jan 30 20:02:30 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jan 30 20:02:30 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=5a5de449
ebuild/ebuilder: has(<name>), get_names()
Added helper functions that can be used to add an evar only if it does not
already exist (etc.).
---
roverlay/ebuild/ebuilder.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/roverlay/ebuild/ebuilder.py b/roverlay/ebuild/ebuilder.py
index 2032d25..fb15e18 100644
--- a/roverlay/ebuild/ebuilder.py
+++ b/roverlay/ebuild/ebuilder.py
@@ -16,6 +16,7 @@ class Ebuilder ( object ):
"""Used to create ebuilds."""
def __init__ ( self ):
+ # or use dict() to speed up has(<>) calls
self._evars = list()
# newlines \n will be inserted after an evar if the priority
# delta (current evar, next evar) is >= this value.
@@ -60,3 +61,22 @@ class Ebuilder ( object ):
"""
for e in evar_list:
if e is not None: self._evars.append ( e )
+ # --- end of use (...) ---
+
+ def has ( self, evar_name ):
+ """Returns True if an evar with name evar_name exists.
+
+ arguments:
+ * evar_name --
+ """
+ for e in self._evars:
+ if e.name == evar_name:
+ return True
+ return False
+ # --- end of has (...) ---
+
+ def get_names ( self ):
+ """Yields all evar names."""
+ for e in self._evars:
+ yield e.name
+ # --- end of get_names (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-01-30 20:16 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-01-30 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 343b9f40f7614424b14eca9038d7ae2f1157bb2b
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jan 30 20:00:57 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jan 30 20:00:57 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=343b9f40
ebuild/abstractcomponents: typo + doc
Added parameter description for param_expansion to EbuildVar.__init__()
Fixed Typo: Use ' (instead of") as quote char if param_expansion is false.
---
roverlay/ebuild/abstractcomponents.py | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index c7e4a98..5b12260 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -157,10 +157,14 @@ class EbuildVar ( object ):
"""Initializes an EbuildVar.
arguments:
- * name -- e.g. 'SRC_URI'
- * value --
- * priority -- used for sorting (e.g. 'R_SUGGESTS' before 'DEPEND'),
- lower means higher priority
+ * name -- e.g. 'SRC_URI'
+ * value --
+ * priority -- used for sorting (e.g. 'R_SUGGESTS'
+ before 'DEPEND'), lower means higher priority
+ * param_expansion -- set the char that is used to quote the value
+ True : "
+ False: '
+ None : use raw value string
"""
self.name = name
self.priority = priority
@@ -206,7 +210,7 @@ class EbuildVar ( object ):
return vstr
else:
- q = '"' if self.use_param_expansion else '"'
+ q = '"' if self.use_param_expansion else "'"
# removing all quote chars from values,
# the "constructed" {R,}DEPEND/R_SUGGESTS/IUSE vars don't use them
# and DESCRIPTION/SRC_URI don't need them
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-01-30 20:16 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-01-30 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 759021cbd6f6e40e497995a6407e43cd9a438050
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jan 30 20:04:05 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jan 30 20:04:05 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=759021cb
ebuild/evars: KEYWORDS
Added the KEYWORDS ebuild variable
Also removed some param_expansion= keywords from the var constructors.
---
roverlay/ebuild/evars.py | 22 +++++++++++++++++-----
1 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index d1a228c..cb3ec17 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -14,7 +14,7 @@ is printed as bash array.
"""
__all__ = [ 'DEPEND', 'DESCRIPTION', 'IUSE', 'MISSINGDEPS',
- 'RDEPEND', 'R_SUGGESTS', 'SRC_URI',
+ 'RDEPEND', 'R_SUGGESTS', 'SRC_URI', 'KEYWORDS',
]
from roverlay import strutil
@@ -43,19 +43,32 @@ class DESCRIPTION ( EbuildVar ):
priority=80, param_expansion=False
)
self.maxlen = 50 if maxlen is None else maxlen
- self.use_param_expansion = False
+ # --- end of __init__ (...) ---
def _get_value_str ( self ):
return strutil.shorten_str (
strutil.ascii_filter ( str ( self.value ) ), self.maxlen, SEE_METADATA
)
+ # --- end of _get_value_str (...) ---
+
+
+class KEYWORDS ( EbuildVar ):
+ """A KEYWORDS="amd64 -x86 ..." statement."""
+ def __init__ ( self, keywords ):
+ super ( KEYWORDS, self ).__init__ (
+ name=self.__class__.__name__,
+ value=keywords,
+ priority=80
+ )
+ # --- end of __init__ (...) ---
class SRC_URI ( EbuildVar ):
"""A SRC_URI="..." statement."""
def __init__ ( self, src_uri ):
super ( SRC_URI, self ) . __init__ (
- name='SRC_URI', value=src_uri, priority=90, param_expansion=False )
+ name='SRC_URI', value=src_uri, priority=90
+ )
def _empty_str ( self ):
"""Called if this SRC_URI evar has no uri stored."""
@@ -89,7 +102,6 @@ class R_SUGGESTS ( EbuildVar ):
name=RSUGGESTS_NAME,
value=ListValue ( deps ),
priority=140,
- param_expansion=False
)
@@ -100,7 +112,7 @@ class DEPEND ( EbuildVar ):
name='DEPEND',
value=ListValue ( deps ),
priority=150,
- param_expansion=False
+ param_expansion=True,
)
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-01-30 20:16 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-01-30 20:16 UTC (permalink / raw
To: gentoo-commits
commit: 3b7a4c0fd1780614fce5285f0fcbeacab9899634
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jan 30 20:05:12 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jan 30 20:05:12 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=3b7a4c0f
ebuild/creation: use PackageInfo ebuild variables
add evars from the PackageInfo instance to the ebuild if available
---
roverlay/ebuild/creation.py | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 2f591a2..6c35bf7 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -16,6 +16,7 @@ import logging
from roverlay.ebuild import depres, ebuilder, evars
+EMPTY_ITERABLE = tuple()
LOGGER = logging.getLogger ( 'EbuildCreation' )
@@ -114,6 +115,9 @@ class EbuildCreation ( object ):
def _make_ebuild ( self ):
"""Tries to create ebuild data."""
+ # TODO rewrite this function
+ # if overriding (R)DEPEND,IUSE vars is required
+
if self.package_info ['desc_data'] is None:
self.logger.warning (
'desc empty - cannot create an ebuild for this package.'
@@ -132,6 +136,10 @@ class EbuildCreation ( object ):
ebuild = ebuilder.Ebuilder()
+ ebuild.use ( *self.package_info.get ( 'EVAR', EMPTY_ITERABLE ) )
+ #evars_overridden = tuple ( ebuild.get_names() )
+ # if k.name not in evars_overridden: ebuild.use ( k )
+
# add *DEPEND, IUSE to the ebuild
ebuild.use ( *dep_result [1] )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-04-25 16:44 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-04-25 16:44 UTC (permalink / raw
To: gentoo-commits
commit: fd838576df5db122a01f3e2001577842db3575a3
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Sun Mar 17 14:02:15 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Sun Mar 17 16:06:30 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=fd838576
ebuild/evars: make value strings more robust
This commit adds the following actions in order to protect against
undesirable side-effects:
* eliminate character sequences starting with "$("
* fix the value string of ListValues on a per-item basis
instead if editing the (final) ListValue string
* strip backslash chars at the end of value strings
---
roverlay/ebuild/abstractcomponents.py | 165 ++++++++++++++++++++++++---------
roverlay/ebuild/evars.py | 27 +++--
2 files changed, 136 insertions(+), 56 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 5b12260..b33189e 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -18,11 +18,68 @@ __all__ = [ 'ListValue', 'EbuildVar', ]
import re
+import roverlay.strutil
+
INDENT = '\t'
+# IGNORED_VALUE_CHARS
+# chars not allowed in value strings
+# Additionally, backslashes at the end of a string will be removed.
+IGNORED_VALUE_CHARS = "\"'`;"
+
+def _value_char_allowed ( c ):
+ """Returns True if the given char is allowed, else False (=char should
+ be ignored.
+
+ arguments:
+ * c --
+ """
+ return c not in IGNORED_VALUE_CHARS
+# --- end of _value_char_allowed (...) ---
+
+## IGNORED_VALUE_CODE, catches:
+## * command substitution: $(<cmd>), $(< <file>)
+## * arithmetic expansion: $((<statement>))
+##
+#IGNORED_VALUE_CODE = re.compile (
+# '[$][(]{1,2}[<]?(?P<text>.*?)[)]{1,2}\s*'
+#)
+
+# IGNORED_VALUE_CODE (strict), catches:
+# * any (sub)string beginning with '$(' which is either not allowed
+# or it leads to syntax errors
+#
+# This will remove more text than the variant above, but we cannot trust
+# that code injection always uses correct syntax.
+#
+IGNORED_VALUE_CODE = re.compile ( '[$][(].*' )
+
+def get_value_str ( value, quote_char=None ):
+ """Removes bad chars / substrings from vstr:
+ * non-ascii chars (this could be a no-op)
+ * IGNORED_VALUE_CHARS
+ * any substring starting with $(
+ * backslash characters at the end of the string
+
+ arguments:
+ * value --
+ """
+ s = IGNORED_VALUE_CODE.sub (
+ "",
+ roverlay.strutil.ascii_filter (
+ str ( value ), additional_filter=_value_char_allowed
+ )
+ ).rstrip ( "\\" )
+ if quote_char:
+ return quote_char + s + quote_char
+ else:
+ return s
+# --- end of get_value_str (...) ---
+
def listlike ( ref ):
"""Returns True if ref is listlike (a non-str iterable)."""
return hasattr ( ref, '__iter__' ) and not isinstance ( ref, str )
+# --- end of listlike (...) ---
class ListValue ( object ):
@@ -34,27 +91,27 @@ class ListValue ( object ):
arguments:
* value --
- * indent_level -- indention level ('\t') for extra value lines
+ * indent_level -- indention level ('\t') for value string lines
* empty_value -- if set: a string value that is always part
- of this ListValue's elements but ignored
- by len().
- Use cases are '${IUSE:-}' in the IUSE var etc.
+ of this ListValue's elements but ignored when
+ checking the number of stored items.
+ Use cases are '${IUSE:-}' in the IUSE var etc.
+ Defaults to None (which disables this feature).
+ * bash_array -- whether this value is a bash array or a string
+ Defaults to False.
"""
- self.set_level ( indent_level )
-
- self.empty_value = empty_value
-
-
+ self.empty_value = empty_value
self.single_line = False
self.indent_lines = True
- # only used in multi line mode
- self.append_indented_newline = True
-
self.is_bash_array = bash_array
self.insert_leading_newline = self.is_bash_array
- self.val_join = ' '
+ # only used when dealing with multi-line non-bash array values:
+ # append \n<var_indent> to the value string if True (useful for quoting
+ # such strings)
+ self.append_indented_newline = True
+ self.set_level ( indent_level )
self.set_value ( value )
# --- end of __init__ (...) ---
@@ -71,13 +128,14 @@ class ListValue ( object ):
def __len__ ( self ):
l = len ( self.value )
return max ( 0, l if self.empty_value is None else l - 1 )
+ # --- end of __len__ (...) ---
def set_level ( self, level ):
"""Sets the indention level."""
- self.level = level
- self.var_indent = (level - 1) * INDENT
- self.val_indent = level * INDENT
- self.line_join = '\n' + self.val_indent
+ self.level = level
+ self.var_indent = (level - 1) * INDENT
+ self.val_indent = level * INDENT
+ self.line_join_str = '\n' + self.val_indent
# --- end of set_level (...) ---
def set_value ( self, value ):
@@ -86,8 +144,7 @@ class ListValue ( object ):
if self.empty_value is not None:
self.value.append ( self.empty_value )
- if self._accept_value ( value ):
- self.add_value ( value )
+ self.add_value ( value )
# --- end of set_value (...) ---
def add ( self, value ):
@@ -105,54 +162,61 @@ class ListValue ( object ):
def to_str ( self ):
"""Returns a string representing this ListValue."""
+ def get_value_strings ( join_str, quoted=False ):
+ return join_str.join (
+ get_value_str (
+ v,
+ quote_char = "'" if quoted else None
+ ) for v in self.value
+ )
+ # --- end of get_value_strings (...) ---
+
value_count = len ( self.value )
+
if self.is_bash_array:
if value_count == 0:
# empty value
ret = "()"
- elif value_count == 1:
- # one value
- ret = "('" + str ( self.value [0] ) + "')"
- elif self.single_line:
- # several values in a single line
- ret = self.val_join.join ( self.value )
+
+ elif self.single_line or value_count == 1:
+ # one value or several values in a single line
+ ret = "( " + get_value_strings ( ' ', True ) + " )"
+
else:
- ret = "{intro}{values}{tail}{newline}".format (
- intro = '(\n' + self.val_indent \
- if self.insert_leading_newline else '( ',
- values = self.line_join.join (
- "'" + str ( x ) + "'" for x in self.value
+ ret = "{head}{values}{tail}".format (
+ head = (
+ ( '(\n' + self.val_indent )
+ if self.insert_leading_newline else '( '
),
- tail = '\n{indent})'.format ( indent=self.var_indent ),
- newline = self.var_indent + '\n' \
- if self.append_indented_newline else ''
+ values = get_value_strings ( self.line_join_str, True ),
+ tail = '\n' + self.var_indent + ')\n'
)
else:
if value_count == 0:
ret = ""
- elif value_count == 1:
- ret = str ( self.value [0] )
+ elif self.single_line or value_count == 1:
+ ret = get_value_strings ( ' ' )
else:
if self.insert_leading_newline:
ret = '\n' + self.val_indent
- ret += self.line_join.join ( ( self.value ) )
+ ret += get_value_strings ( self.line_join_str )
else:
- ret = self.line_join.join ( ( self.value ) )
+ ret = get_value_strings ( self.line_join_str )
if self.append_indented_newline:
- ret += self.var_indent + '\n'
+ ret += '\n' + self.var_indent
return ret
# --- end of to_str (...) ---
__str__ = to_str
+# --- end of ListValue ---
+
class EbuildVar ( object ):
"""An ebuild variable."""
- IGNORED_VALUE_CHARS = re.compile ( "[\"'`¸]" )
-
def __init__ ( self, name, value, priority, param_expansion=True ):
"""Initializes an EbuildVar.
@@ -199,11 +263,20 @@ class EbuildVar ( object ):
return True
# --- end of active (...) ---
- def _quote_value ( self ):
- if hasattr ( self, '_get_value_str' ):
- vstr = self._get_value_str()
+ def _get_value_str ( self ):
+ # hasattr ( ?? )
+ if isinstance ( self.value, ListValue ):
+ return self.value.to_str()
else:
- vstr = str ( self.value )
+ return get_value_str ( self.value )
+ # --- end of _get_value_str (...) ---
+
+ def _quote_value ( self ):
+ vstr = self._get_value_str()
+
+ if hasattr ( self, '_transform_value_str' ):
+ vstr = self._transform_value_str ( vstr )
+ # -- end if
if self.use_param_expansion is None:
# value quoting / unquoting is disabled
@@ -217,7 +290,7 @@ class EbuildVar ( object ):
if len ( vstr ) == 0:
return 2 * q
else:
- return q + EbuildVar.IGNORED_VALUE_CHARS.sub ( '', vstr ) + q
+ return q + vstr + q
# --- end of _quote_value (...) ---
def __str__ ( self ):
@@ -233,3 +306,5 @@ class EbuildVar ( object ):
# contain only quote chars
return self._empty_str() if hasattr ( self, '_empty_str' ) else ""
# --- end of __str__ (...) ---
+
+# --- end of EbuildVar ---
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index cb3ec17..cd8becb 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -17,39 +17,44 @@ __all__ = [ 'DEPEND', 'DESCRIPTION', 'IUSE', 'MISSINGDEPS',
'RDEPEND', 'R_SUGGESTS', 'SRC_URI', 'KEYWORDS',
]
-from roverlay import strutil
+import roverlay.strutil
from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
IUSE_SUGGESTS = 'R_suggests'
RSUGGESTS_NAME = IUSE_SUGGESTS.upper()
-SEE_METADATA = '... (see metadata)'
-
-# ignoring case policies here (camel case,..)
+# ignoring style guide here (camel case, ...)
class DESCRIPTION ( EbuildVar ):
"""A DESCRIPTION="..." statement."""
- def __init__ ( self, description, maxlen=50 ):
+
+ SEE_METADATA = '... (see metadata)'
+
+ def __init__ ( self, description, maxlen=None ):
"""A DESCRIPTION="..." statement. Long values will be truncated.
arguments:
* description -- description text
- * maxlen -- maximum value length (defaults to 50 chars)
+ * maxlen -- maximum value length (>0, defaults to 50 chars)
"""
+ assert maxlen is None or maxlen > 0
+
super ( DESCRIPTION, self ) . __init__ (
name='DESCRIPTION',
value=description,
priority=80, param_expansion=False
)
- self.maxlen = 50 if maxlen is None else maxlen
+ self.maxlen = maxlen or 50
# --- end of __init__ (...) ---
- def _get_value_str ( self ):
- return strutil.shorten_str (
- strutil.ascii_filter ( str ( self.value ) ), self.maxlen, SEE_METADATA
+ def _transform_value_str ( self, _str ):
+ return roverlay.strutil.shorten_str (
+ _str,
+ self.maxlen,
+ self.SEE_METADATA
)
- # --- end of _get_value_str (...) ---
+ # --- end of _transform_value_str (...) ---
class KEYWORDS ( EbuildVar ):
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-04-25 16:44 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-04-25 16:44 UTC (permalink / raw
To: gentoo-commits
commit: b933346697353a11d83c0d7fa955d149d52f5b5a
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Apr 25 15:08:00 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Apr 25 15:08:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b9333466
ebuild/creation: dont add an empty DESCRIPTION var
---
roverlay/ebuild/creation.py | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 6494a4c..42977ab 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -92,20 +92,22 @@ class EbuildCreation ( object ):
description = desc ['Title']
if 'Description' in desc:
- if description is None:
- description = desc ['Description']
- else:
+ if description:
description += '// ' + desc ['Description']
+ else:
+ description = desc ['Description']
+
else:
# use either Title or Description for DESCRIPTION=
# (Title preferred 'cause it should be shorter)
if 'Title' in desc:
description = desc ['Title']
- elif 'Description' in desc:
+
+ if not description and 'Description' in desc:
description = desc ['Description']
- if description is not None:
+ if description:
return evars.DESCRIPTION ( description )
elif FALLBACK_DESCRIPTION:
return evars.DESCRIPTION ( FALLBACK_DESCRIPTION )
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
2013-06-05 18:08 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
@ 2013-06-13 16:34 ` André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-06-13 16:34 UTC (permalink / raw
To: gentoo-commits
commit: 86c8b9ce562b4cecab65c03d2cbd2cae983d1b57
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 5 17:56:47 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 5 17:56:47 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=86c8b9ce
support '->' in SRC_URI
---
roverlay/ebuild/abstractcomponents.py | 34 ++++++++++++++++++----------------
roverlay/ebuild/creation.py | 7 ++++++-
roverlay/ebuild/evars.py | 33 ++++++++++++++++++++++++++++++---
3 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index ec3db04..f8c9aed 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -144,7 +144,7 @@ class ListValue ( object ):
if self.empty_value is not None:
self.value.append ( self.empty_value )
- self.add_value ( value )
+ self.add ( value )
# --- end of set_value (...) ---
def add ( self, value ):
@@ -157,20 +157,22 @@ class ListValue ( object ):
self.value.append ( value )
# --- end of add (...) ---
- add_value = add
+ def add_value ( self, *args, **kwargs ):
+ raise NotImplementedError ( "add_value() is deprecated - use add()!" )
+ # --- end of add_value (...) ---
+
+ def join_value_str ( self, join_str, quoted=False ):
+ return join_str.join (
+ get_value_str (
+ v,
+ quote_char = "'" if quoted else None
+ ) for v in self.value
+ )
+ # --- end of join_value_str (...) ---
def to_str ( self ):
"""Returns a string representing this ListValue."""
- def get_value_strings ( join_str, quoted=False ):
- return join_str.join (
- get_value_str (
- v,
- quote_char = "'" if quoted else None
- ) for v in self.value
- )
- # --- end of get_value_strings (...) ---
-
value_count = len ( self.value )
if self.is_bash_array:
@@ -180,7 +182,7 @@ class ListValue ( object ):
elif self.single_line or value_count == 1:
# one value or several values in a single line
- ret = "( " + get_value_strings ( ' ', True ) + " )"
+ ret = "( " + self.join_value_str ( ' ', True ) + " )"
else:
ret = "{head}{values}{tail}".format (
@@ -188,20 +190,20 @@ class ListValue ( object ):
( '(\n' + self.val_indent )
if self.insert_leading_newline else '( '
),
- values = get_value_strings ( self.line_join_str, True ),
+ values = self.join_value_str ( self.line_join_str, True ),
tail = '\n' + self.var_indent + ')\n'
)
else:
if value_count == 0:
ret = ""
elif self.single_line or value_count == 1:
- ret = get_value_strings ( ' ' )
+ ret = self.join_value_str ( ' ' )
else:
if self.insert_leading_newline:
ret = '\n' + self.val_indent
- ret += get_value_strings ( self.line_join_str )
+ ret += self.join_value_str ( self.line_join_str )
else:
- ret = get_value_strings ( self.line_join_str )
+ ret = self.join_value_str ( self.line_join_str )
if self.append_indented_newline:
ret += '\n' + self.var_indent
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 8ea1854..de5a358 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -153,7 +153,12 @@ class EbuildCreation ( object ):
ebuild.use ( self._get_ebuild_description() )
# SRC_URI
- ebuild.use ( evars.SRC_URI ( self.package_info ['SRC_URI'] ) )
+ ebuild.use ( evars.SRC_URI (
+ src_uri = self.package_info ['SRC_URI'],
+ src_uri_dest = self.package_info.get (
+ "src_uri_dest", do_fallback=True
+ )
+ ) )
ebuild_text = ebuild.to_str()
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 7bc461b..23f7e27 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -19,7 +19,7 @@ __all__ = [ 'DEPEND', 'DESCRIPTION', 'IUSE', 'MISSINGDEPS',
import roverlay.strutil
-from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar
+from roverlay.ebuild.abstractcomponents import ListValue, EbuildVar, get_value_str
IUSE_SUGGESTS = 'R_suggests'
RSUGGESTS_NAME = IUSE_SUGGESTS.upper()
@@ -68,11 +68,38 @@ class KEYWORDS ( EbuildVar ):
# --- end of __init__ (...) ---
+class SRC_URI_ListValue ( ListValue ):
+ """List value that represents SRC_URI entries."""
+
+ def _accept_value ( self, value ): raise NotImplementedError()
+
+ def add ( self, value ):
+ """Adds/Appends a value."""
+ if value [0]:
+ self.value.append ( value )
+ else:
+ raise ValueError ( value )
+ # --- end of add (...) ---
+
+ def join_value_str ( self, join_str, quoted=False ):
+ return join_str.join (
+ get_value_str (
+ (
+ "{} -> {}".format ( v[0], v[1] ) if v[1] else str ( v[0] )
+ ),
+ quote_char=( "'" if quoted else None )
+ ) for v in self.value
+ )
+ # --- end of join_value_str (...) ---
+
+
class SRC_URI ( EbuildVar ):
"""A SRC_URI="..." statement."""
- def __init__ ( self, src_uri ):
+ def __init__ ( self, src_uri, src_uri_dest ):
super ( SRC_URI, self ) . __init__ (
- name='SRC_URI', value=src_uri, priority=90
+ name = 'SRC_URI',
+ value = SRC_URI_ListValue ( value=( src_uri, src_uri_dest ) ),
+ priority = 90
)
def _empty_str ( self ):
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
2013-06-19 18:58 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
@ 2013-06-19 18:59 ` André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-06-19 18:59 UTC (permalink / raw
To: gentoo-commits
commit: d58688a7338049e1762b5fe9702cca820fd7fee2
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 19 18:47:40 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 19 18:47:40 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d58688a7
roverlay/ebuild: useflagmap
This should've been committed yesterday.
UseFlagRenameMap/UseFlagAliasMap allow to rename USE_EXPAND flags.
---
roverlay/ebuild/useflagmap.py | 152 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 152 insertions(+)
diff --git a/roverlay/ebuild/useflagmap.py b/roverlay/ebuild/useflagmap.py
new file mode 100644
index 0000000..8b5d7a6
--- /dev/null
+++ b/roverlay/ebuild/useflagmap.py
@@ -0,0 +1,152 @@
+# R overlay -- ebuild creation, USE_EXPAND alias map
+# -*- coding: utf-8 -*-
+# Copyright (C) 2013 André Erdmann <dywi@mailerd.de>
+# Distributed under the terms of the GNU General Public License;
+# either version 2 of the License, or (at your option) any later version.
+
+import roverlay.util
+import roverlay.strutil
+
+__all__ = [ 'UseFlagAliasMap', 'UseFlagRenameMap', ]
+
+class _UseFlagMapBase ( dict ):
+
+ class AbstractMethod ( NotImplementedError ):
+ pass
+
+ class BadFile ( Exception ):
+ pass
+
+ def __init__ ( self, from_file=None ):
+ super ( _UseFlagMapBase, self ).__init__()
+ if from_file:
+ self.read_file ( from_file )
+ # --- end of __init__ (...) ---
+
+ def add_entry ( self, flag, alias_list, **kw ):
+ raise self.__class__.AbstractMethod()
+ # --- end of add_entry (...) ---
+
+ def get_alias_map ( self ):
+ raise self.__class__.AbstractMethod()
+ # --- end of get_alias_map (...) ---
+
+ def get_rename_map ( self ):
+ raise self.__class__.AbstractMethod()
+ # --- end of get_rename_map (...) ---
+
+ def __invert__ ( self ):
+ raise self.__class__.AbstractMethod()
+ # --- end of __invert__ (...) ---
+
+ def read_file ( self, filepath ):
+ with open ( filepath, 'rt' ) as FH:
+ current_flag = None
+ for line in FH.readlines():
+ sline = line.strip()
+ if not sline or sline [0] == '#':
+ pass
+ elif sline [0] != line [0]:
+ # append to last flag
+ alias = roverlay.strutil.split_whitespace ( sline )
+ if alias:
+ self.add_entry ( current_flag, alias )
+ else:
+ next_flag, alias = roverlay.util.headtail (
+ roverlay.strutil.split_whitespace ( sline )
+ )
+ next_flag = next_flag.lower()
+ if not next_flag or next_flag == '=':
+ raise self.__class__.BadFile()
+ elif alias:
+ if alias [0] == '=':
+ self.add_entry ( next_flag, alias [1:] )
+ else:
+ self.add_entry ( next_flag, alias )
+ # -- end if;
+ current_flag = next_flag
+ # -- end if;
+ # -- end for;
+ # --- end of read_file (...) ---
+
+ def _iter_sorted ( self ):
+ return sorted ( self.items(), key=lambda e: e[0] )
+ # --- end of _iter_sorted (...) ---
+
+ def get_export_str ( self ):
+ raise self.__class__.AbstractMethod()
+ # --- end of get_export_str (...) ---
+
+# --- end of _UseFlagMapBase ---
+
+
+# { new_name => [original_name...] }
+class UseFlagAliasMap ( _UseFlagMapBase ):
+
+ def add_entry ( self, flag, alias_list, not_a_list=False ):
+ existing_entry = self.get ( flag, None )
+ if existing_entry:
+ if not_a_list:
+ existing_entry.add ( alias_list )
+ else:
+ existing_entry.update ( alias_list )
+ elif not_a_list:
+ self [flag] = { alias_list, }
+ else:
+ self [flag] = set ( alias_list )
+ # --- end of add_entry (...) ---
+
+ def get_rename_map ( self ):
+ c = UseFlagRenameMap()
+ for flag, alias in self.items():
+ c.add_entry ( flag, alias )
+ return c
+ # --- end of get_rename_map (...) ---
+
+ def get_alias_map ( self ):
+ return self
+ # --- end of get_alias_map (...) ---
+
+ def __invert__ ( self ):
+ return self.get_rename_map()
+ # --- end of __invert__ (...) ---
+
+ def get_export_str ( self ):
+ return '\n'.join (
+ '{flag} : {alias}'.format ( flag=k, alias=' '.join ( sorted ( v ) ) )
+ for k, v in self._iter_sorted()
+ )
+ # --- end of get_export_str (...) ---
+
+# --- end of UseFlagMap ---
+
+
+# { original_name => new_name }
+class UseFlagRenameMap ( _UseFlagMapBase ):
+
+ def add_entry ( self, flag, alias_list ):
+ for alias in alias_list:
+ #assert alias not in self
+ self [alias] = flag
+ # --- end of add_entry (...) ---
+
+ def get_rename_map ( self ):
+ return self
+ # --- end of get_rename_map (...) ---
+
+ def get_alias_map ( self ):
+ c = UseFlagAliasMap()
+ for alias, flag in self.items():
+ c.add_entry ( flag, alias, not_a_list=True )
+ return c
+ # --- end of get_alias_map ( self )
+
+ def __invert__ ( self ):
+ return self.get_alias_map()
+ # --- end of __invert__ (...) ---
+
+ def get_export_str ( self ):
+ return self.get_alias_map().get_export_str()
+ # --- end of get_export_str (...) ---
+
+# --- end of UseFlagRenameMap ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
2013-07-10 8:26 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
@ 2013-07-10 16:16 ` André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-10 16:16 UTC (permalink / raw
To: gentoo-commits
commit: 9a3c8889b88e751086616592413a8038dd57e41c
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jul 10 08:21:00 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jul 10 08:21:00 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=9a3c8889
ebuild creation: LICENSE variable
create a LICENSE variable if possible and add it to the ebuild
This commit also fixes a case (in)sensitivity issue in UseExpandListValue.
---
roverlay/ebuild/creation.py | 19 ++++++++-----
roverlay/ebuild/evars.py | 65 ++++++++++++++++++++++++++++-----------------
2 files changed, 53 insertions(+), 31 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 52a5034..b2a291e 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -96,12 +96,10 @@ class EbuildCreation ( object ):
raise
# --- end of run (...) ---
- def _get_ebuild_description ( self ):
+ def _get_ebuild_description ( self, desc ):
"""Creates a DESCRIPTION variable."""
# FIXME: could be moved to _run_create()
- desc = self.package_info ['desc_data']
-
description = None
if USE_FULL_DESCRIPTION:
# use Title and Description for DESCRIPTION=
@@ -181,8 +179,7 @@ class EbuildCreation ( object ):
self.status = 3
p_info = self.package_info
dep_resolution = self.dep_resolution
-
- # FIXME: selfdep reduction should not remove any package (optional deps!)
+ desc = self.package_info ['desc_data']
if p_info.end_selfdep_validate():
ebuild = ebuilder.Ebuilder()
@@ -209,7 +206,7 @@ class EbuildCreation ( object ):
# ebuild.use ( evars.IUSE() )
# DESCRIPTION
- ebuild.use ( self._get_ebuild_description() )
+ ebuild.use ( self._get_ebuild_description ( desc ) )
# SRC_URI
ebuild.use ( evars.SRC_URI (
@@ -217,7 +214,15 @@ class EbuildCreation ( object ):
src_uri_dest = p_info.get ( "src_uri_dest", do_fallback=True )
) )
- ebuild_text = ebuild.to_str()
+ # LICENSE (optional)
+ license_str = desc.get ( 'License' )
+ if license_str:
+ ebuild.use ( evars.LICENSE ( license_str ) )
+
+
+ #ebuild_text = ebuild.to_str()
+ ## FIXME: debug rstrip()
+ ebuild_text = ebuild.to_str().rstrip()
p_info.update_now (
ebuild=ebuild_text,
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 573647c..138fc04 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -14,7 +14,7 @@ is printed as bash array.
"""
__all__ = [ 'DEPEND', 'DESCRIPTION', 'IUSE', 'MISSINGDEPS',
- 'RDEPEND', 'R_SUGGESTS', 'R_SUGGESTS_USE_EXPAND', 'SRC_URI', 'KEYWORDS',
+ 'RDEPEND', 'R_SUGGESTS_USE_EXPAND', 'SRC_URI', 'KEYWORDS',
]
import collections
@@ -112,45 +112,38 @@ class UseExpandListValue (
**kw
)
self.insert_leading_newline = True
+ # dict { <internal flag name> => <overlay flag name> }
self.alias_map = alias_map or None
self.basename = basename.rstrip ( '_' ).lower()
self.sort_flags = True
+ # dict { <overlay flag name> => <list [dep...]> }
+ #self.depdict = dict()
self.set_value ( deps )
# --- end of __init__ (...) ---
def _get_depstr_key ( self, dep ):
- if hasattr ( dep, 'package' ):
- return dep.package
+ # tries to get the use flag name from dep.dep
+ # str(dep) == dep.dep
+ match = self.__class__.RE_USENAME.match ( dep.dep )
+ if match:
+ return self._get_use_key (
+ ( match.group ( "pn" ) or match.group ( "pf" ) )
+ )
else:
- # tries to get the use flag name from dep.dep
- # str(dep) == dep.dep
- match = self.__class__.RE_USENAME.match ( dep.dep )
- if match:
- return self._get_use_key (
- ( match.group ( "pn" ) or match.group ( "pf" ) ).lower()
- )
- else:
- raise ValueError (
- "depstr {!r} cannot be parsed".format ( depstr )
- )
+ raise ValueError (
+ "depstr {!r} cannot be parsed".format ( depstr )
+ )
# --- end of _get_depstr_key (...) ---
def _get_use_key ( self, orig_key ):
+ key_low = orig_key.lower()
if self.alias_map:
- return self.alias_map.get ( orig_key, orig_key ).lower()
+ return self.alias_map.get ( key_low, key_low ).lower()
else:
- return orig_key.lower()
+ return key_low
# --- end of _get_use_key (...) ---
- def _accept_value ( self, value ):
- if hasattr ( value, '__iter__' ):
- if isinstance ( value, str ):
- raise ValueError ( "x" )
- else:
- return False
- # --- end of _accept_value (...) ---
-
def set_value ( self, deps ):
self.depdict = dict()
if deps: self.add ( deps )
@@ -163,6 +156,9 @@ class UseExpandListValue (
if hasattr ( item, '__iter__' ) and not isinstance ( item, str ):
key = self._get_use_key ( str ( item [0] ) )
val = item [1].dep
+ elif hasattr ( item, 'package' ):
+ key = self._get_use_key ( item.package )
+ val = item.dep
else:
key = self._get_depstr_key ( item )
val = item.dep
@@ -234,6 +230,27 @@ class UseExpandListValue (
# --- end of UseExpandListValue ---
+class LICENSE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
+ def __init__ ( self, license_str ):
+ super ( LICENSE, self ).__init__ (
+ name = 'LICENSE',
+ value = license_str,
+ priority = 100,
+ )
+ # --- end of __init__ (...) ---
+# --- end of LICENSE ---
+
+
+class HOMEPAGE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
+ def __init__ ( self, homepage ):
+ super ( HOMEPAGE, self ).__init__ (
+ name = 'HOMEPAGE',
+ value = homepage,
+ priority = 95,
+ )
+ # --- end of __init__ (...) ---
+# --- end of HOMEPAGE ---
+
class DESCRIPTION ( roverlay.ebuild.abstractcomponents.EbuildVar ):
"""A DESCRIPTION="..." statement."""
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-10 16:16 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-10 16:16 UTC (permalink / raw
To: gentoo-commits
commit: a12e8a089a6c8d6df6a6f3dac0da2e95f7d3b714
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jul 10 13:36:07 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jul 10 13:36:07 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a12e8a08
roveray/ebuild/: disable debug dep iterator
---
roverlay/ebuild/depres.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 86015db..81f2711 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -79,7 +79,6 @@ class DepResultIterator ( object ):
# a list of package names that should trigger "possibly broken" behavior
# (see below)
WATCHLIST = frozenset ({
- 'wavethresh',
})
def __init__ ( self, deps ):
@@ -355,7 +354,8 @@ class EbuildDepRes ( object ):
if 'DEPEND' in depmap:
evar_list.append (
EBUILDVARS ['DEPEND'] (
- DepResultIterator ( depmap ['DEPEND'] ),
+ #DepResultIterator ( depmap ['DEPEND'] ),
+ depmap ['DEPEND'],
using_suggests=has_suggests, use_expand=True
)
)
@@ -363,7 +363,8 @@ class EbuildDepRes ( object ):
if 'RDEPEND' in depmap:
evar_list.append (
EBUILDVARS ['RDEPEND'] (
- DepResultIterator ( depmap ['RDEPEND'] ),
+ #DepResultIterator ( depmap ['RDEPEND'] ),
+ depmap ['RDEPEND'],
using_suggests=has_suggests, use_expand=True
)
)
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-25 8:06 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-25 8:06 UTC (permalink / raw
To: gentoo-commits
commit: fa7dde5a292a7cab14c39bb1197b82d842827342
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 25 08:05:04 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 25 08:05:04 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=fa7dde5a
ebuild/evars: reduce LOC
---
roverlay/ebuild/evars.py | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 87d595c..b4560c9 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -30,9 +30,7 @@ RSUGGESTS_NAME = 'R_SUGGESTS'
# ignoring style guide here (camel case, ...)
-class DependListValue (
- roverlay.ebuild.abstractcomponents.ListValue
-):
+class DependListValue ( roverlay.ebuild.abstractcomponents.ListValue ):
def add ( self, deps ):
if deps:
@@ -315,10 +313,8 @@ class SRC_URI_ListValue ( roverlay.ebuild.abstractcomponents.ListValue ):
def join_value_str ( self, join_str, quoted=False ):
return join_str.join (
- roverlay.ebuild.abstractcomponents.get_value_str (
- (
- "{} -> {}".format ( v[0], v[1] ) if v[1] else str ( v[0] )
- ),
+ get_value_str (
+ ( "{} -> {}".format ( v[0], v[1] ) if v[1] else str ( v[0] ) ),
quote_char=( "'" if quoted else None )
) for v in self.value
)
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-25 8:06 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-25 8:06 UTC (permalink / raw
To: gentoo-commits
commit: d5d60cb4944cf7f39083aeb2d618eca6b2acd7ad
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 25 08:02:24 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 25 08:02:24 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=d5d60cb4
ebuild/evars: make R_SUGGESTS str more robust
Use get_value_str() to remove potentially malicious char sequences.
---
roverlay/ebuild/evars.py | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index f602033..87d595c 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -24,7 +24,7 @@ import roverlay.strutil
import roverlay.ebuild.abstractcomponents
-from roverlay.ebuild.abstractcomponents import ListValue
+from roverlay.ebuild.abstractcomponents import ListValue, get_value_str
RSUGGESTS_NAME = 'R_SUGGESTS'
@@ -206,19 +206,25 @@ class UseExpandListValue (
# --- end of cleanup (...) ---
def join_value_str ( self, join_str, quoted=False ):
- # get_value_str() not necessary here
+ # get_value_str() not strictly necessary here,
+ # but it catches incorrect handling of config options/values
+ #
if self.sort_flags:
return join_str.join (
- "{basename}_{flag}? ( {deps} )".format (
- basename=self.basename, flag=k, deps=' '.join ( v )
+ get_value_str (
+ "{basename}_{flag}? ( {deps} )".format (
+ basename=self.basename, flag=k, deps=' '.join ( v )
+ )
) for k, v in sorted (
self.depdict.items(), key=( lambda item : item[0] )
)
)
else:
return join_str.join (
- "{basename}_{flag}? ( {deps} )".format (
- basename=self.basename, flag=k, deps=' '.join ( v )
+ get_value_str (
+ "{basename}_{flag}? ( {deps} )".format (
+ basename=self.basename, flag=k, deps=' '.join ( v )
+ )
) for k, v in self.depdict.items()
)
# --- end of join_value_str (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-25 13:25 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-25 13:25 UTC (permalink / raw
To: gentoo-commits
commit: a7bdada50b0c77b48e0f925d86374f73744398a9
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 25 13:19:10 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 25 13:19:10 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=a7bdada5
roverlay/ebuild: fixup / HOMEPAGE
* create a HOMEPAGE variable if enough information available
* create RDEPEND if DEPEND and/or R_SUGGESTS present
* wrap long values in IUSE
---
roverlay/ebuild/abstractcomponents.py | 22 +++++++++++++++++++---
roverlay/ebuild/creation.py | 5 +++++
roverlay/ebuild/depres.py | 4 ++--
roverlay/ebuild/evars.py | 21 ++++++++++++++-------
4 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/roverlay/ebuild/abstractcomponents.py b/roverlay/ebuild/abstractcomponents.py
index 9b47b88..87d699b 100644
--- a/roverlay/ebuild/abstractcomponents.py
+++ b/roverlay/ebuild/abstractcomponents.py
@@ -17,6 +17,7 @@ This module defines two classes:
__all__ = [ 'ListValue', 'EbuildVar', ]
import re
+import textwrap
import roverlay.strutil
@@ -145,7 +146,10 @@ class AbstractListValue ( object ):
value_count = len ( self )
if value_count == 0:
# empty value
- return "()"
+ if self.empty_value is None:
+ return "()"
+ else:
+ return "({})".format ( self.empty_value )
elif self.single_line or value_count == 1:
# one value or several values in a single line
return "( " + self.join_value_str ( ' ', True ) + " )"
@@ -163,7 +167,10 @@ class AbstractListValue ( object ):
def _get_sh_list_str ( self ):
value_count = len ( self )
if value_count == 0:
- return ""
+ if self.empty_value is None:
+ return ""
+ else:
+ return str ( self.empty_value )
elif self.single_line or value_count == 1:
return self.join_value_str ( ' ' )
elif self.insert_leading_newline:
@@ -261,6 +268,11 @@ class ListValue ( AbstractListValue ):
class EbuildVar ( object ):
"""An ebuild variable."""
+ VALUE_WRAPPER = textwrap.TextWrapper (
+ width=70, initial_indent='', subsequent_indent=INDENT,
+ break_long_words=False, break_on_hyphens=False
+ )
+
def __init__ ( self, name, value, priority, param_expansion=True ):
"""Initializes an EbuildVar.
@@ -285,6 +297,10 @@ class EbuildVar ( object ):
self.add_value = self.value.add
# --- end of __init__ (...) ---
+ def fold_value ( self, value ):
+ return '\n'.join ( self.VALUE_WRAPPER.wrap ( value ) )
+ # --- end of fold_value (...) ---
+
def get_pseudo_hash ( self ):
"""Returns a 'pseudo hash' that identifies the variable represented
by this EbuildVar, but not its value.
@@ -311,7 +327,7 @@ class EbuildVar ( object ):
if hasattr ( self, 'enabled' ):
return self.enabled
elif hasattr ( self.value, '__len__' ):
- return len ( self.value ) > 0
+ return self.print_empty_var or len ( self.value ) > 0
else:
return True
# --- end of active (...) ---
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 334c276..7b936fa 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -219,6 +219,11 @@ class EbuildCreation ( object ):
if license_str:
ebuild.use ( evars.LICENSE ( license_str ) )
+ # HOMEPAGE (optional)
+ homepage_str = desc.get ( 'Homepage' )
+ if homepage_str:
+ ebuild.use ( evars.HOMEPAGE ( homepage_str ) )
+
#ebuild_text = ebuild.to_str()
## FIXME: debug rstrip()
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index 3bdbee9..e972eb3 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -360,10 +360,10 @@ class EbuildDepRes ( object ):
using_suggests=has_suggests, use_expand=True
)
)
- elif has_suggests:
+ elif has_suggests or 'DEPEND' in depmap:
evar_list.append (
EBUILDVARS ['RDEPEND'] (
- None, using_suggests=True, use_expand=True
+ None, using_suggests=has_suggests, use_expand=True
)
)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index b4560c9..2b0e4ce 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -237,9 +237,10 @@ class UseExpandListValue (
class LICENSE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
def __init__ ( self, license_str ):
super ( LICENSE, self ).__init__ (
- name = 'LICENSE',
- value = license_str,
- priority = 100,
+ name = 'LICENSE',
+ value = license_str,
+ priority = 100,
+ param_expansion = False,
)
# --- end of __init__ (...) ---
# --- end of LICENSE ---
@@ -248,9 +249,10 @@ class LICENSE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
class HOMEPAGE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
def __init__ ( self, homepage ):
super ( HOMEPAGE, self ).__init__ (
- name = 'HOMEPAGE',
- value = homepage,
- priority = 95,
+ name = 'HOMEPAGE',
+ value = homepage,
+ priority = 95,
+ param_expansion = False,
)
# --- end of __init__ (...) ---
# --- end of HOMEPAGE ---
@@ -333,10 +335,11 @@ class SRC_URI ( roverlay.ebuild.abstractcomponents.EbuildVar ):
def _empty_str ( self ):
"""Called if this SRC_URI evar has no uri stored."""
return 'SRC_URI=""\nRESTRICT="fetch"'
-
+# --- end of SRC_URI ---
class IUSE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
"""An IUSE="..." statement."""
+
def __init__ ( self, use_flags=None ):
"""An IUSE="..." statement.
@@ -352,6 +355,10 @@ class IUSE ( roverlay.ebuild.abstractcomponents.EbuildVar ):
)
self.value.single_line = True
+ # bind text wrapper
+ self._transform_value_str = self.fold_value
+ # --- end of __init__ (...) ---
+# --- end of IUSE ---
class R_SUGGESTS_USE_EXPAND ( roverlay.ebuild.abstractcomponents.EbuildVar ):
"""A R_SUGGESTS="..." statement with USE_EXPAND support."""
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-25 16:39 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-25 16:39 UTC (permalink / raw
To: gentoo-commits
commit: e8b6f1a35286f79d6d78ac8989583a300922266c
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Jul 25 16:35:52 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Jul 25 16:35:52 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e8b6f1a3
roverlay/ebuild: print empty value for (R)DEPEND
Print *DEPEND variables even if empty (but requested by ebuild creation).
This results in printing an "empty" RDEPEND=${DEPEND-} variable (as it used to
be prior to introducing the DependencyVariable class).
---
roverlay/ebuild/evars.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 2b0e4ce..6ec6a2e 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -55,6 +55,8 @@ class DependencyVariable ( roverlay.ebuild.abstractcomponents.EbuildVar ):
param_expansion = True,
#ignore **kw
)
+ if empty_value is not None:
+ self.print_empty_var = True
# --- end of __init__ (...) ---
# --- end of DependencyVariable ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-07-29 8:55 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-07-29 8:55 UTC (permalink / raw
To: gentoo-commits
commit: 487fe4cebbbd5715a32dc3bbf215e972e23fc54b
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 29 08:49:20 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 29 08:49:20 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=487fe4ce
ebuild creation: hardwire DESCRIPTION variable
Removed USE_FULL_DESCRIPTION=True|False from ebuild/creation.py.
Non-full description (Title if given else Description) is now always used.
This doesn't change the ebuild output.
---
roverlay/ebuild/creation.py | 56 ++++++++++++---------------------------------
1 file changed, 14 insertions(+), 42 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 4242c86..a2a021d 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -18,14 +18,11 @@ from roverlay.ebuild import depres, ebuilder, evars
LOGGER = logging.getLogger ( 'EbuildCreation' )
-# USE_FULL_DESCRIPTION
-# * True: use Title and Description for ebuild's DESCRIPTION variable
-# * else: use Title _or_ Description
-USE_FULL_DESCRIPTION = False
+# FALLBACK_DESCRIPTION is used as DESCRIPTION variable (if not None)
+# if the R package's desc data has no Title/Description
+FALLBACK_DESCRIPTION = evars.DESCRIPTION ( "<none>" )
+#FALLBACK_DESCRIPTION = None
-# FALLBACK_DESCRIPTION is used as DESCRIPTION= value if not empty and
-# the R package has no Title/Description
-FALLBACK_DESCRIPTION = "<none>"
class EbuildCreation ( object ):
"""Used to create an ebuild using DESCRIPTION data."""
@@ -106,40 +103,6 @@ class EbuildCreation ( object ):
raise
# --- end of run (...) ---
- def _get_ebuild_description ( self, desc ):
- """Creates a DESCRIPTION variable."""
- # FIXME: could be moved to _run_create()
-
- description = None
- if USE_FULL_DESCRIPTION:
- # use Title and Description for DESCRIPTION=
- if 'Title' in desc:
- description = desc ['Title']
-
- if 'Description' in desc:
- if description:
- description += '// ' + desc ['Description']
- else:
- description = desc ['Description']
-
- else:
- # use either Title or Description for DESCRIPTION=
- # (Title preferred 'cause it should be shorter)
- if 'Title' in desc:
- description = desc ['Title']
-
- if not description and 'Description' in desc:
- description = desc ['Description']
-
-
- if description:
- return evars.DESCRIPTION ( description )
- elif FALLBACK_DESCRIPTION:
- return evars.DESCRIPTION ( FALLBACK_DESCRIPTION )
- else:
- return None
- # --- end of _get_ebuild_description (...) ---
-
def _run_prepare ( self, stats ):
self.status = 2
@@ -218,7 +181,16 @@ class EbuildCreation ( object ):
# ebuild.use ( evars.IUSE() )
# DESCRIPTION
- ebuild.use ( self._get_ebuild_description ( desc ) )
+ # use either Title or Description for DESCRIPTION=
+ # (Title preferred 'cause it should be shorter)
+ if 'Title' in desc:
+ ebuild.use ( evars.DESCRIPTION ( desc ['Title'] ) )
+
+ elif 'Description' in desc:
+ ebuild.use ( evars.DESCRIPTION ( desc ['Description'] ) )
+
+ elif FALLBACK_DESCRIPTION is not None:
+ ebuild.use ( FALLBACK_DESCRIPTION )
# SRC_URI
ebuild.use ( evars.SRC_URI (
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-08-23 13:52 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-08-23 13:52 UTC (permalink / raw
To: gentoo-commits
commit: 11b56c2339c86c3906a5e4fb3cc163eb0dbf18ae
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Aug 23 13:41:46 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Aug 23 13:41:46 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=11b56c23
ebuild creation, depres: add injected deps
This commit (finally) allows to insert additional dependencies via package
rules.
package rule example:
MATCH:
any
ACTION:
add DEPEND sci-libs/fftw
add RDEPEND virtual/jdk dev-lang/perl
END;
---
roverlay/ebuild/depres.py | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index e972eb3..fa3a5bb 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -265,7 +265,8 @@ class EbuildDepRes ( object ):
"""Make evars using the depres result."""
# <ebuild varname> => <deps>
- depmap = dict()
+ depmap = dict()
+ depconf = self.package_info.depconf
unresolvable_optional_deps = set()
for dep_type, channel in self._channels.items():
@@ -284,6 +285,22 @@ class EbuildDepRes ( object ):
self._close_channels()
+ # add injected deps
+ if depconf and 'extra' in depconf:
+ for dep_type, depset in depconf ['extra'].items():
+ self.logger.debug (
+ "adding extra deps {deps} to {depvar}".format (
+ deps=depset, depvar=dep_type
+ )
+ )
+
+ if dep_type not in depmap:
+ depmap [dep_type] = depset
+ else:
+ depmap [dep_type] |= depset
+ # -- end if depconf->extra
+
+
# remove redundant deps (DEPEND in RDEPEND, RDEPEND,DEPEND in R_SUGGESTS)
if 'RDEPEND' in depmap and 'DEPEND' in depmap:
depmap ['RDEPEND'] -= depmap ['DEPEND']
@@ -346,8 +363,8 @@ class EbuildDepRes ( object ):
if 'DEPEND' in depmap:
evar_list.append (
EBUILDVARS ['DEPEND'] (
- #DepResultIterator ( depmap ['DEPEND'] ),
- depmap ['DEPEND'],
+ DepResultIterator ( depmap ['DEPEND'] ),
+ #depmap ['DEPEND'],
using_suggests=has_suggests, use_expand=True
)
)
@@ -355,8 +372,8 @@ class EbuildDepRes ( object ):
if 'RDEPEND' in depmap:
evar_list.append (
EBUILDVARS ['RDEPEND'] (
- #DepResultIterator ( depmap ['RDEPEND'] ),
- depmap ['RDEPEND'],
+ DepResultIterator ( depmap ['RDEPEND'] ),
+ #depmap ['RDEPEND'],
using_suggests=has_suggests, use_expand=True
)
)
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-08-28 9:38 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-08-28 9:38 UTC (permalink / raw
To: gentoo-commits
commit: f39267a36a595947e8b42191c663fc335a5c9be6
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Aug 28 09:37:43 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Aug 28 09:37:43 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=f39267a3
roverlay/ebuild/depres: add depstr_ignore functionality
---
roverlay/ebuild/depres.py | 52 +++++++++++++++++++++++++++++++++++------------
1 file changed, 39 insertions(+), 13 deletions(-)
diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py
index fa3a5bb..9ce1ed8 100644
--- a/roverlay/ebuild/depres.py
+++ b/roverlay/ebuild/depres.py
@@ -222,24 +222,50 @@ class EbuildDepRes ( object ):
)
return True
- desc = self.package_info ['desc_data']
+ desc = self.package_info ['desc_data']
+ depconf = self.package_info.depconf
+ depstr_ignore = depconf.get ( 'depstr_ignore' ) if depconf else None
self._channels = dict()
- dep_type = desc_field = None
+ dep_type = None
+ desc_field = None
- for dep_type in FIELDS_TO_EVAR:
- resolver = None
+ if depstr_ignore:
+ depstr_ignore_all = depstr_ignore.get ( 'all' )
- for desc_field in FIELDS_TO_EVAR [dep_type]:
- if desc_field in desc:
- if not resolver:
- resolver = self._get_channel ( dep_type )
+ for dep_type, desc_fields in FIELDS_TO_EVAR.items():
+ resolver = None
+ # ignore based on evar name ([R]DEPEND/RSUGGESTS)
+ depstr_ignore_specific = depstr_ignore.get ( dep_type )
+
+ for desc_field in desc_fields:
+ if desc_field in desc:
+ if resolver is None:
+ resolver = self._get_channel ( dep_type )
+
+ resolver.add_dependencies_filtered (
+ dep_list = desc [desc_field],
+ deptype_mask = FIELDS [desc_field],
+ common_blacklist = depstr_ignore_all,
+ specific_blacklist = depstr_ignore_specific,
+ )
+ # -- end for dep_type
+
+ else:
+ for dep_type, desc_fields in FIELDS_TO_EVAR.items():
+ resolver = None
+
+ for desc_field in desc_fields:
+ if desc_field in desc:
+ if resolver is None:
+ resolver = self._get_channel ( dep_type )
+
+ resolver.add_dependencies (
+ dep_list = desc [desc_field],
+ deptype_mask = FIELDS [desc_field]
+ )
+ # -- end for dep_type
- resolver.add_dependencies (
- dep_list = desc [desc_field],
- deptype_mask = FIELDS [desc_field]
- )
- # -- for dep_type
# --- end of _init_channels (...) ---
def _close_channels ( self ):
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2013-09-05 15:43 André Erdmann
0 siblings, 0 replies; 40+ messages in thread
From: André Erdmann @ 2013-09-05 15:43 UTC (permalink / raw
To: gentoo-commits
commit: 114a2ff20bd0d9bdc39b4c09fd1dfd2584701c65
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Thu Sep 5 15:06:10 2013 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Thu Sep 5 15:06:10 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=114a2ff2
ebuild creation: do not override LICENSE, HOMEPAGE
... if already set
+ clarify comment concerning overridden evars
---
roverlay/ebuild/creation.py | 17 ++++++++++-------
roverlay/ebuild/ebuilder.py | 2 ++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index fafd099..ed16423 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -173,7 +173,8 @@ class EbuildCreation ( object ):
ebuild.use ( *evars_extra )
#evars_overridden = tuple ( ebuild.get_names() )
- # if k.name not in evars_overridden: ebuild.use ( k )
+ # for k in evars_dep <other evars...>:
+ # if k.name not in evars_overridden: ebuild.use ( k )
#else:
# ...
@@ -207,14 +208,16 @@ class EbuildCreation ( object ):
) )
# LICENSE (optional)
- license_str = desc.get ( 'License' )
- if license_str:
- ebuild.use ( evars.LICENSE ( license_str ) )
+ if 'LICENSE' not in ebuild:
+ license_str = desc.get ( 'License' )
+ if license_str:
+ ebuild.use ( evars.LICENSE ( license_str ) )
# HOMEPAGE (optional)
- homepage_str = desc.get ( 'Homepage' )
- if homepage_str:
- ebuild.use ( evars.HOMEPAGE ( homepage_str ) )
+ if 'HOMEPAGE' not in ebuild:
+ homepage_str = desc.get ( 'Homepage' )
+ if homepage_str:
+ ebuild.use ( evars.HOMEPAGE ( homepage_str ) )
#ebuild_text = ebuild.to_str()
diff --git a/roverlay/ebuild/ebuilder.py b/roverlay/ebuild/ebuilder.py
index 047a678..6da697c 100644
--- a/roverlay/ebuild/ebuilder.py
+++ b/roverlay/ebuild/ebuilder.py
@@ -77,6 +77,8 @@ class Ebuilder ( object ):
return evar_name in self._evars
# --- end of has (...) ---
+ __contains__ = has
+
def get ( self, evar_name ):
return self._evars.get ( evar_name, None )
# --- end of get (...) ---
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2019-08-17 16:41 Benda XU
0 siblings, 0 replies; 40+ messages in thread
From: Benda XU @ 2019-08-17 16:41 UTC (permalink / raw
To: gentoo-commits
commit: ae70ffefbe473b4f4d0a2a69b2cec814ded13681
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 17 16:40:14 2019 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sat Aug 17 16:40:14 2019 +0000
URL: https://gitweb.gentoo.org/proj/R_overlay.git/commit/?id=ae70ffef
[USE] in the DEPEND should be extracted.
Example: tk? ( dev-lang/R[tk] ), not r[tk]?.
roverlay/ebuild/evars.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/roverlay/ebuild/evars.py b/roverlay/ebuild/evars.py
index 6ec6a2e..c2e355d 100644
--- a/roverlay/ebuild/evars.py
+++ b/roverlay/ebuild/evars.py
@@ -96,9 +96,7 @@ class UseExpandListValue (
RE_USENAME = re.compile (
(
'(?P<prefix>.*[/])?'
- '(?P<pf>'
- '((?P<pn>.*)(?P<pvr>[-][0-9].*([-]r[0-9]+)?))'
- '|.*)'
+ '(?P<pn>[^\[]*)(\[(?P<use>[^\]]*)\])?(?P<pvr>[-][0-9].*([-]r[0-9]+)?)?'
)
)
@@ -128,7 +126,7 @@ class UseExpandListValue (
match = self.__class__.RE_USENAME.match ( dep.dep )
if match:
return self._get_use_key (
- ( match.group ( "pn" ) or match.group ( "pf" ) )
+ ( match.group ( "use" ) or match.group ( "pn" ) )
)
else:
raise ValueError (
^ permalink raw reply related [flat|nested] 40+ messages in thread
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
@ 2023-08-01 3:38 Benda XU
0 siblings, 0 replies; 40+ messages in thread
From: Benda XU @ 2023-08-01 3:38 UTC (permalink / raw
To: gentoo-commits
commit: c28b07285e2ad983feb0794a78f503bd859a8ef1
Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 1 03:37:50 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Tue Aug 1 03:37:50 2023 +0000
URL: https://gitweb.gentoo.org/proj/R_overlay.git/commit/?id=c28b0728
r/ebuild/creation.py: add {x,arm}64-macos keywords.
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
roverlay/ebuild/creation.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py
index 8418240..30ae3be 100644
--- a/roverlay/ebuild/creation.py
+++ b/roverlay/ebuild/creation.py
@@ -220,7 +220,7 @@ class EbuildCreation ( object ):
ebuild.use ( evars.HOMEPAGE ( homepage_str ) )
if 'KEYWORDS' not in ebuild:
- ebuild.use ( evars.KEYWORDS ( "~amd64" ) )
+ ebuild.use ( evars.KEYWORDS ( "~amd64 ~x64-macos ~arm64-macos" ) )
#ebuild_text = ebuild.to_str()
## FIXME: debug rstrip()
^ permalink raw reply related [flat|nested] 40+ messages in thread
end of thread, other threads:[~2023-08-01 3:38 UTC | newest]
Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 22:48 [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/ André Erdmann
-- strict thread matches above, loose matches on Subject: below --
2023-08-01 3:38 Benda XU
2019-08-17 16:41 Benda XU
2013-09-05 15:43 André Erdmann
2013-08-28 9:38 André Erdmann
2013-08-23 13:52 André Erdmann
2013-07-29 8:55 André Erdmann
2013-07-25 16:39 André Erdmann
2013-07-25 13:25 André Erdmann
2013-07-25 8:06 André Erdmann
2013-07-25 8:06 André Erdmann
2013-07-10 16:16 André Erdmann
2013-07-10 8:26 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-07-10 16:16 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-19 18:58 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-19 18:59 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-06-05 18:08 [gentoo-commits] proj/R_overlay:gsoc13/next " André Erdmann
2013-06-13 16:34 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2013-04-25 16:44 André Erdmann
2013-04-25 16:44 André Erdmann
2013-01-30 20:16 André Erdmann
2013-01-30 20:16 André Erdmann
2013-01-30 20:16 André Erdmann
2013-01-30 20:16 André Erdmann
2012-08-09 9:26 André Erdmann
2012-08-07 8:50 André Erdmann
2012-08-03 13:38 André Erdmann
2012-08-03 13:38 André Erdmann
2012-08-02 15:14 André Erdmann
2012-08-02 15:14 André Erdmann
2012-07-30 8:52 [gentoo-commits] proj/R_overlay:overlay_wip " André Erdmann
2012-07-30 8:52 ` [gentoo-commits] proj/R_overlay:master " André Erdmann
2012-07-16 16:15 André Erdmann
2012-07-16 16:15 André Erdmann
2012-07-12 18:04 André Erdmann
2012-07-06 22:19 André Erdmann
2012-06-29 22:48 André Erdmann
2012-06-29 22:48 André Erdmann
2012-06-29 22:48 André Erdmann
2012-06-28 15:55 André Erdmann
2012-06-28 13:29 André Erdmann
2012-06-26 15:42 André Erdmann
2012-06-21 16:55 André Erdmann
2012-06-20 19:03 André Erdmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox