diff options
| author | Chris Larson <chris_larson@mentor.com> | 2010-03-23 20:33:19 -0700 |
|---|---|---|
| committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-25 17:25:51 +0000 |
| commit | ec3f9089485a4d77f777c3512646874f608bcc2d (patch) | |
| tree | 40c56021691b328f151e4f19dced5dacff0f515e /bitbake/lib/bb/utils.py | |
| parent | 80a52e7ad64d0870db18cddeda9588dc5b723f52 (diff) | |
| download | poky-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/lib/bb/utils.py')
| -rw-r--r-- | bitbake/lib/bb/utils.py | 8 |
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 | ||
| 22 | digits = "0123456789" | ||
| 23 | ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" | ||
| 24 | separators = ".-" | 22 | separators = ".-" |
| 25 | 23 | ||
| 26 | import re, fcntl, os, types, bb | 24 | import re, fcntl, os, types, bb, string |
| 27 | 25 | ||
| 28 | def explode_version(s): | 26 | def 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) |
