[elbe-devel] [PATCH] Copy usr files before corresponding [s]bin and lib

bage at linutronix.de bage at linutronix.de
Tue Dec 3 01:35:06 CET 2019


From: Bastian Germann <bage at linutronix.de>

Sorting the file list that is copied from chroot to target has the following
effect: The files from /bin, /lib, and /sbin fail to copy on buster targets
because they are dangling symlinks to the /usr/... hierarchy at the copy time.

Change the order to fix the problem.

Signed-off-by: Bastian Germann <bage at linutronix.de>
---
 elbepack/efilesystem.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index ef26c21bd..8d7ccd3b2 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -78,7 +78,8 @@ def extract_target(src, xml, dst, cache):
                 "var/lib/dpkg/info/%s:%s.conffiles" %
                 (line, arch))
 
-        file_list = list(sorted(set(file_list)))
+        file_list = sorted(set(file_list),
+                           key = lambda k: k[4:] if k.startswith('/usr') else k)
         copy_filelist(src, file_list, dst)
     else:
         # first copy most diretories
-- 
2.20.1




More information about the elbe-devel mailing list