[elbe-devel] [PATCH v3 5/8] Check existance of '/rfs/etc/apt/sources.list' with 'lexist'

dion at linutronix.de dion at linutronix.de
Wed May 29 16:24:57 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Since we're going to write to '/rfs/etc/apt/sources.list' we
want to make sure that we don't write to a broken link.

Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Torben Hohn <torben.hogn at linutronix.de>
---
 elbepack/rfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index 0018c442..623c917f 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -259,7 +259,7 @@ class BuildEnv (object):
     def initialize_dirs(self, build_sources=False):
         mirror = self.xml.create_apt_sources_list(build_sources=build_sources)
 
-        if self.rfs.exists("etc/apt/sources.list"):
+        if self.rfs.lexists("etc/apt/sources.list"):
             self.rfs.remove("etc/apt/sources.list")
 
         self.rfs.write_file("etc/apt/sources.list", 0o644, mirror)
-- 
2.11.0




More information about the elbe-devel mailing list