public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
@ 2012-06-20 19:03 André Erdmann
  0 siblings, 0 replies; 5+ messages in thread
From: André Erdmann @ 2012-06-20 19:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e284b806710c534f11e74ae1adaa7db887e730d8
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Jun 20 10:49:36 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Jun 20 10:49:36 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e284b806

remove global USE flags from metadata creation

	modified:   roverlay/metadata/__init__.py

---
 roverlay/metadata/__init__.py |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/roverlay/metadata/__init__.py b/roverlay/metadata/__init__.py
index 82821bb..074cce3 100644
--- a/roverlay/metadata/__init__.py
+++ b/roverlay/metadata/__init__.py
@@ -61,16 +61,15 @@ class MetadataJob ( object ):
 			) )
 			have_desc = True
 
-		mref.add_useflag ( 'byte-compile', 'enable byte-compiling' )
-
-		if package_info ['has_suggests']:
-			mref.add_useflag ( 'R_suggests', 'install optional dependencies' )
+		# these USE flags are described in profiles/use.desc,
+		#  no need to include them here
+		#mref.add_useflag ( 'byte-compile', 'enable byte-compiling' )
+		#
+		#if package_info ['has_suggests']:
+		#	mref.add_useflag ( 'R_suggests', 'install optional dependencies' )
 
 	# --- end of update (...) ---
 
-	# used in some test scripts
-	update_metadata = update
-
 	def write ( self, _file ):
 		"""Writes the metadata into a file.
 



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
@ 2012-06-25 18:19 André Erdmann
  0 siblings, 0 replies; 5+ messages in thread
From: André Erdmann @ 2012-06-25 18:19 UTC (permalink / raw
  To: gentoo-commits

commit:     bd3de81c48d6cbc0bab375f188b4866ae91d3e37
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jun 25 18:06:56 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jun 25 18:06:56 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=bd3de81c

fix DescriptionNode creation in metadata

	modified:   roverlay/metadata/__init__.py

---
 roverlay/metadata/__init__.py |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/roverlay/metadata/__init__.py b/roverlay/metadata/__init__.py
index 8d94325..3385119 100644
--- a/roverlay/metadata/__init__.py
+++ b/roverlay/metadata/__init__.py
@@ -40,25 +40,22 @@ class MetadataJob ( object ):
 
 		max_textline_width = roverlay.config.get ( 'METADATA.linewidth', 65 )
 
-		have_desc = False
+		# FIXME/TODO remove long/not long bool from DescriptionNode!
 
-		if 'Title' in desc_data:
+		if 'Description' in desc_data:
+			# !passing have_desc for DescriptionNode's is_long parameter redirects
+			# !the second description info into <longdescription.../>
 			mref.add ( nodes.DescriptionNode (
-				desc_data ['Title'],
-				is_long=have_desc,
+				desc_data ['Description'],
+				is_long=True,
 				linewidth=max_textline_width
 			) )
-			have_desc = True
-
-		if 'Description' in desc_data:
-			# passing have_desc for DescriptionNode's is_long parameter redirects
-			# the second description info into <longdescription.../>
+		elif 'Title' in desc_data:
 			mref.add ( nodes.DescriptionNode (
-				desc_data ['Description'],
-				is_long=have_desc,
+				desc_data ['Title'],
+				is_long=True,
 				linewidth=max_textline_width
 			) )
-			have_desc = True
 
 		# these USE flags are described in profiles/use.desc,
 		#  no need to include them here



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
@ 2012-06-26 15:42 André Erdmann
  0 siblings, 0 replies; 5+ messages in thread
From: André Erdmann @ 2012-06-26 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     b0739582a711f64395226e8c33a4a3a6b9b66298
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Tue Jun 26 15:38:46 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Tue Jun 26 15:38:46 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b0739582

fix metadata creation

* replaces yesterday's workaround

	modified:   roverlay/metadata/__init__.py
	modified:   roverlay/metadata/nodes.py

---
 roverlay/metadata/__init__.py |   37 ++++++++++++++++++++-----------------
 roverlay/metadata/nodes.py    |   10 ++++------
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/roverlay/metadata/__init__.py b/roverlay/metadata/__init__.py
index 3385119..13fc169 100644
--- a/roverlay/metadata/__init__.py
+++ b/roverlay/metadata/__init__.py
@@ -6,6 +6,8 @@ import roverlay.config
 
 from roverlay.metadata import nodes
 
+USE_FULL_DESCRIPTION = True
+
 class MetadataJob ( object ):
 	"""R package description data -> metadata.xml interface."""
 
@@ -34,28 +36,29 @@ class MetadataJob ( object ):
 
 		returns: None (implicit)
 		"""
-		desc_data = package_info ['desc_data']
+		data = package_info ['desc_data']
 
 		mref = self._metadata
 
 		max_textline_width = roverlay.config.get ( 'METADATA.linewidth', 65 )
 
-		# FIXME/TODO remove long/not long bool from DescriptionNode!
-
-		if 'Description' in desc_data:
-			# !passing have_desc for DescriptionNode's is_long parameter redirects
-			# !the second description info into <longdescription.../>
-			mref.add ( nodes.DescriptionNode (
-				desc_data ['Description'],
-				is_long=True,
-				linewidth=max_textline_width
-			) )
-		elif 'Title' in desc_data:
-			mref.add ( nodes.DescriptionNode (
-				desc_data ['Title'],
-				is_long=True,
-				linewidth=max_textline_width
-			) )
+
+		description = None
+
+		if USE_FULL_DESCRIPTION and 'Title' in data and 'Description' in data:
+			description = data ['Title'] + ' // ' + data ['Description']
+
+		elif 'Description' in data:
+			description = ddata ['Description']
+
+		elif 'Title' in data:
+			description = data ['Title']
+
+		#if description:
+		if description is not None:
+			mref.add (
+				nodes.DescriptionNode ( description, linewidth=max_textline_width )
+			)
 
 		# these USE flags are described in profiles/use.desc,
 		#  no need to include them here

diff --git a/roverlay/metadata/nodes.py b/roverlay/metadata/nodes.py
index 4d4d5fd..1fba079 100644
--- a/roverlay/metadata/nodes.py
+++ b/roverlay/metadata/nodes.py
@@ -100,25 +100,23 @@ class MetadataRoot ( MetadataNodeNamedAccess ):
 
 
 class DescriptionNode ( MetadataLeaf ):
-	"""A description (<description.../>, <longdescription.../>) node."""
+	"""A description (<longdescription.../>) node."""
 
-	def __init__ ( self, description, is_long=False, linewidth=None ):
+	def __init__ ( self, description, linewidth=None ):
 		"""Initializes a DescriptionNode.
 
 		arguments:
 		* description -- description text
-		* is_long     -- if this is a longdescription or a description node
 		* linewidth   -- max text line width
 		"""
 		super ( DescriptionNode, self ) . __init__ (
-			'longdescription' if is_long else 'description',
-			value=description,
+			'longdescription', value=description
 		)
 
 		if not linewidth is None and linewidth > 0:
 			self.linewidth = linewidth
 
-		self.priority = 150 if is_long else 149
+		self.priority = 150
 	# --- end of __init__ (...) ---
 
 	# using value formatting



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
@ 2012-07-06 22:19 André Erdmann
  0 siblings, 0 replies; 5+ messages in thread
From: André Erdmann @ 2012-07-06 22:19 UTC (permalink / raw
  To: gentoo-commits

commit:     991537a979fb2c3929e8447ec5a5aa9719322629
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Jul  6 22:06:25 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Jul  6 22:06:25 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=991537a9

metadata: remove invalid chars "&<>" from values

	modified:   roverlay/metadata/abstractnodes.py

---
 roverlay/metadata/abstractnodes.py |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/roverlay/metadata/abstractnodes.py b/roverlay/metadata/abstractnodes.py
index f5a5c31..9e792e6 100644
--- a/roverlay/metadata/abstractnodes.py
+++ b/roverlay/metadata/abstractnodes.py
@@ -2,11 +2,12 @@
 # Copyright 2006-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import re
 import textwrap
 
 INDENT = '\t'
 
-get_indent = lambda k : k * INDENT
+def get_indent ( k ): return k * INDENT
 
 # -- "abstract" metadata nodes --
 class _MetadataBasicNode ( object ):
@@ -14,6 +15,10 @@ class _MetadataBasicNode ( object ):
 	This is the most basic metadata node that should never be used directly.
 	"""
 
+	# these chars lead to metadata.bad: invalid token
+	# TODO/FIXME: look into repoman's / portage's source to get _all_ chars
+	INVALID_CHARS = "&<>"
+
 	def __init__ ( self, name, flags ):
 		"""Initializes a _MetadataBasicNode.
 
@@ -210,7 +215,13 @@ class MetadataLeaf ( _MetadataBasicNode ):
 				width=self.linewidth if hasattr ( self, 'linewidth' ) else 50
 			)
 
-		val_lines = self._text_wrapper.wrap ( self.value )
+		val_lines = self._text_wrapper.wrap (
+			re.sub (
+				"[{}]".format ( self.__class__.INVALID_CHARS ),
+				'',
+				self.value
+			)
+		)
 		if len ( val_lines ) < 1:
 			# why?
 			return ""



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/
@ 2012-07-16 16:15 André Erdmann
  0 siblings, 0 replies; 5+ messages in thread
From: André Erdmann @ 2012-07-16 16:15 UTC (permalink / raw
  To: gentoo-commits

commit:     216a6a365f78ff364f7f2ce0b4fd869092bbf9d4
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 16 16:11:20 2012 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 16 16:11:20 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=216a6a36

use ascii filter in metadata

---
 roverlay/metadata/nodes.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/roverlay/metadata/nodes.py b/roverlay/metadata/nodes.py
index 1fba079..69b325c 100644
--- a/roverlay/metadata/nodes.py
+++ b/roverlay/metadata/nodes.py
@@ -2,6 +2,7 @@
 # Copyright 2006-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+from roverlay import util
 # import abstract nodes
 from roverlay.metadata.abstractnodes import \
 	MetadataNode, MetadataNodeNamedAccess, MetadataLeaf
@@ -66,7 +67,7 @@ class MetadataRoot ( MetadataNodeNamedAccess ):
 
 		raises: *passes IOError
 		"""
-		to_write = self.to_str()
+		to_write = util.ascii_filter ( self.to_str() )
 
 		own_fh  = False
 		fh      = None



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-07-16 16:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 18:19 [gentoo-commits] proj/R_overlay:master commit in: roverlay/metadata/ André Erdmann
  -- strict thread matches above, loose matches on Subject: below --
2012-07-16 16:15 André Erdmann
2012-07-06 22:19 André Erdmann
2012-06-26 15:42 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