Skip to contentSkip to conversation

uclibc: remove redundant python code

PATCH In review Phil Blundell 2 participants 2 messages Jun 10, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uclibc: remove redundant python code

This chunk of python code has been around for a while (witness the comment about gcc 3.4.0) and predates the availability of COMPATIBLE_HOST. Rewrite it using a more modern idiom.

---
 meta/recipes-core/uclibc/uclibc.inc                |   12 +--------
meta/recipes-core/uclibc/uclibc.inc +1 -11
index c1bc422..a2c6ee5 100644
@@ -36,21 +36,11 @@ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
 sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
 "
 
-#
 # For now, we will skip building of a gcc package if it is a uclibc one
 # and our build is not a uclibc one, and we skip a glibc one if our build
 # is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
+COMPATIBLE_HOST = ".*-uclibc.*"
 
-python __anonymous () {
-    import bb, re
-    uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
-    if not uc_os:
-        raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   bb.data.getVar('TARGET_OS', d, 1))
-}
 PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
 DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            virtual/${TARGET_PREFIX}gcc-intermediate \
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Phil Blundell

This chunk of python code has been around for a while (witness the comment about gcc 3.4.0) and predates the availability of COMPATIBLE_HOST. Rewrite it using a more modern idiom.

Quoted 37 lines
---
  meta/recipes-core/uclibc/uclibc.inc                |   12 +--------
meta/recipes-core/uclibc/uclibc.inc +1 -11
index c1bc422..a2c6ee5 100644
@@ -36,21 +36,11 @@ cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
  sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
  "
 
-#
  # For now, we will skip building of a gcc package if it is a uclibc one
  # and our build is not a uclibc one, and we skip a glibc one if our build
  # is a uclibc build.
-#
-# See the note in gcc/gcc_3.4.0.oe
-#
+COMPATIBLE_HOST = ".*-uclibc.*"
 
-python __anonymous () {
-    import bb, re
-    uc_os = (re.match('.*uclibc*', bb.data.getVar('TARGET_OS', d, 1)) != None)
-    if not uc_os:
-        raise bb.parse.SkipPackage("incompatible with target %s" %
-                                   bb.data.getVar('TARGET_OS', d, 1))
-}
  PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
  DEPENDS = "virtual/${TARGET_PREFIX}binutils \
             virtual/${TARGET_PREFIX}gcc-intermediate \

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core