summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
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)