summaryrefslogtreecommitdiff
path: root/classes/package.bbclass
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2006-09-08 08:08:58 +0000
committerChris Larson <clarson@kergoth.com>2006-09-08 08:08:58 +0000
commit93c40996e9da30e39a06cffd85b3fdc403d71c47 (patch)
treeb9b2f97765e2dc095da1a10b04ad5ceab400d457 /classes/package.bbclass
parent1cd49843e337ea08e4f35facc77f62a11c272fd7 (diff)
package.bbclass:
Make legitimize_package_name also convert <U0123> style encoding of unicode codepoints into their utf-8 representation, as in glibc locale files.
Diffstat (limited to 'classes/package.bbclass')
-rw-r--r--classes/package.bbclass11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/package.bbclass b/classes/package.bbclass
index 9b913ecf82..03999a54ef 100644
--- a/classes/package.bbclass
+++ b/classes/package.bbclass
@@ -1,4 +1,15 @@
def legitimize_package_name(s):
+ import re
+
+ def fixutf(m):
+ cp = m.group(1)
+ if cp:
+ return ('\u%s' % cp).decode('unicode_escape').encode('utf-8')
+
+ # Handle unicode codepoints encoded as <U0123>, as in glibc locale files.
+ s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s)
+
+ # Remaining package name validity fixes
return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-')
STAGING_PKGMAPS_DIR ?= "${STAGING_DIR}/pkgmaps"