[elbe-devel] [PATCH v2 03/24] elbeproject: build_sysroot rework

Manuel Traut manut at linutronix.de
Thu Feb 8 14:16:49 CET 2018


split out sysroot paths into private function to
improve readability. The paths don't make sense for external usage, so
keep the function private.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/elbeproject.py | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index a06a99cb..986d08c5 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -155,6 +155,29 @@ class ElbeProject (object):
                 --exclude=./proc/* --exclude=./var/cache/* \
                 -C %s ." % (self.builddir, self.chrootpath))
 
+    def __get_sysroot_paths(self):
+        triplet = self.xml.defs["triplet"]
+
+        paths = [
+            './usr/include',
+            './usr/include/' + triplet,
+            './etc/ld.so.conf*',
+            './opt/*/lib/*.so',
+            '/opt/*lib/*.so.*',
+            './opt/*/include/',
+            './opt/*/lib/' + triplet,
+            './opt/*/include/' + triplet,
+            './lib/*.so',
+            './lib/*.so.*',
+            './lib/' + triplet,
+            './usr/lib/*.so',
+            './usr/lib/*.so',
+            './usr/lib/*.so.*',
+            './usr/lib/' + triplet]
+
+        return paths
+
+
     def build_sysroot(self):
 
         # ignore packages from debootstrap
@@ -187,24 +210,7 @@ class ElbeProject (object):
             self.log.do("chroot %s /usr/bin/symlinks -cr /usr/lib" %
                         self.chrootpath)
 
-        triplet = self.xml.defs["triplet"]
-
-        paths = [
-            './usr/include',
-            './usr/include/' + triplet,
-            './etc/ld.so.conf*',
-            './opt/*/lib/*.so',
-            '/opt/*lib/*.so.*',
-            './opt/*/include/',
-            './opt/*/lib/' + triplet,
-            './opt/*/include/' + triplet,
-            './lib/*.so',
-            './lib/*.so.*',
-            './lib/' + triplet,
-            './usr/lib/*.so',
-            './usr/lib/*.so',
-            './usr/lib/*.so.*',
-            './usr/lib/' + triplet]
+        paths = self.__get_sysrootpaths()
 
         self.log.do("rm %s" % sysrootfilelist, allow_fail=True)
 
-- 
2.15.1




More information about the elbe-devel mailing list