From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/
Date: Mon, 16 Jul 2012 16:15:47 +0000 (UTC) [thread overview]
Message-ID: <1342437440.f5e0ea775cc86046fc424a2c63e9709670a4fe6d.dywi@gentoo> (raw)
Message-ID: <20120716161547.9VIKD7U-BNBtU5131TIjflVbwdN12zN-dA_4vdE9B5k@z> (raw)
commit: f5e0ea775cc86046fc424a2c63e9709670a4fe6d
Author: André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Mon Jul 16 11:17:20 2012 +0000
Commit: André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Mon Jul 16 11:17:20 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=f5e0ea77
move fix_ebuild_name to util
---
roverlay/packageinfo.py | 9 ++-------
roverlay/util.py | 10 ++++++++++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/roverlay/packageinfo.py b/roverlay/packageinfo.py
index cc09a6b..052fad7 100644
--- a/roverlay/packageinfo.py
+++ b/roverlay/packageinfo.py
@@ -41,10 +41,6 @@ class PackageInfo ( object ):
config.get_or_fail ( 'R_PACKAGE.suffix_regex' ) + '$'
)
- ILLEGAL_NAME_CHARS = re.compile ( "[.:]{1,}" )
- ILLEGAL_NAME_CHARS_REPLACE_BY = '_'
-
-
def __init__ ( self, **initial_info ):
"""Initializes a PackageInfo.
@@ -308,9 +304,8 @@ class PackageInfo ( object ):
# using pkg_version for the ebuild version
# removing illegal chars from the package_name
- ebuild_name = PackageInfo.ILLEGAL_NAME_CHARS.sub (
- PackageInfo.ILLEGAL_NAME_CHARS_REPLACE_BY, package_name
- )
+ ebuild_name = util.fix_ebuild_name ( package_name )
+
if ebuild_name != package_name:
self ['name'] = ebuild_name
diff --git a/roverlay/util.py b/roverlay/util.py
index f66532a..d658b15 100644
--- a/roverlay/util.py
+++ b/roverlay/util.py
@@ -11,6 +11,16 @@ from roverlay import config
LOGGER = logging.getLogger ( 'util' )
+_EBUILD_NAME_ILLEGAL_CHARS = re.compile ( "[.:]{1,}" )
+_EBUILD_NAME_ILLEGAL_CHARS_REPLACE_BY = '_'
+
+def fix_ebuild_name ( name ):
+ return _EBUILD_NAME_ILLEGAL_CHARS.sub (
+ _EBUILD_NAME_ILLEGAL_CHARS_REPLACE_BY,
+ name
+ )
+# --- end of fix_ebuild_name (...) ---
+
def shorten_str ( s, maxlen, replace_end=None ):
if not replace_end is None:
rlen = maxlen - len ( replace_end )
next reply other threads:[~2012-07-16 16:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-16 16:15 André Erdmann [this message]
2012-07-16 16:15 ` [gentoo-commits] proj/R_overlay:master commit in: roverlay/ André Erdmann
-- strict thread matches above, loose matches on Subject: below --
2012-07-16 16:15 André Erdmann
2012-07-13 10:44 ` [gentoo-commits] proj/R_overlay:depres_wip " 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=1342437440.f5e0ea775cc86046fc424a2c63e9709670a4fe6d.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