summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-03-23 20:33:19 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-03-25 17:25:51 +0000
commitec3f9089485a4d77f777c3512646874f608bcc2d (patch)
tree40c56021691b328f151e4f19dced5dacff0f515e /bitbake
parent80a52e7ad64d0870db18cddeda9588dc5b723f52 (diff)
downloadpoky-ec3f9089485a4d77f777c3512646874f608bcc2d.tar.gz
bb.utils: utilize string.letters and string.digits
(Bitbake rev: 7af05cba87ec9f3ea5e53689b3d9f0a63784d1b5) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/utils.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 1bb9e9472d..ef049f7c7b 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -19,23 +19,21 @@ BitBake Utility Functions
19# with this program; if not, write to the Free Software Foundation, Inc., 19# with this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 21
22digits = "0123456789"
23ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
24separators = ".-" 22separators = ".-"
25 23
26import re, fcntl, os, types, bb 24import re, fcntl, os, types, bb, string
27 25
28def explode_version(s): 26def explode_version(s):
29 r = [] 27 r = []
30 alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$') 28 alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$')
31 numeric_regexp = re.compile('^(\d+)(.*)$') 29 numeric_regexp = re.compile('^(\d+)(.*)$')
32 while (s != ''): 30 while (s != ''):
33 if s[0] in digits: 31 if s[0] in string.digits:
34 m = numeric_regexp.match(s) 32 m = numeric_regexp.match(s)
35 r.append(int(m.group(1))) 33 r.append(int(m.group(1)))
36 s = m.group(2) 34 s = m.group(2)
37 continue 35 continue
38 if s[0] in ascii_letters: 36 if s[0] in string.letters:
39 m = alpha_regexp.match(s) 37 m = alpha_regexp.match(s)
40 r.append(m.group(1)) 38 r.append(m.group(1))
41 s = m.group(2) 39 s = m.group(2)