public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/
Date: Fri,  6 Jul 2012 22:19:07 +0000 (UTC)	[thread overview]
Message-ID: <1341612339.6ff7308157e9ec2cc9a189ba4ad9a625328752bc.dywi@gentoo> (raw)

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__ (...) ---



             reply	other threads:[~2012-07-06 22:19 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 22:19 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-08-01  3:38 [gentoo-commits] proj/R_overlay:master commit in: roverlay/ebuild/ 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-06-29 22:48 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341612339.6ff7308157e9ec2cc9a189ba4ad9a625328752bc.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox