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

Torben Hohn torben.hohn at linutronix.de
Thu May 23 17:09:28 CEST 2019


On Wed, May 22, 2019 at 03:33:45PM +0200, dion at linutronix.de wrote:
> 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.hohn 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 78da015b..ee942b81 100644
> --- a/elbepack/rfs.py
> +++ b/elbepack/rfs.py
> @@ -254,7 +254,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
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list