From: Michael Tremer Date: Thu, 22 Apr 2021 10:57:53 +0000 (+0000) Subject: builder: Use distro information in snapshot path X-Git-Tag: 0.9.28~1285^2~276 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17a41afd5368256d1d8da67ed724393e40e123a1;p=pakfire.git builder: Use distro information in snapshot path Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/builder.py b/src/pakfire/builder.py index 2713a618d..4dafe0d29 100644 --- a/src/pakfire/builder.py +++ b/src/pakfire/builder.py @@ -176,19 +176,15 @@ class BuilderContext(object): """ Sets up the environment by installing some basic packages """ - # XXX this needs to be unique for each distribution - snapshot_path = "/var/cache/pakfire/snapshot-XXX.tar.zst" + snapshot_path = self.pakfire.make_cache_path("snapshot.tar.zst") # Restore the snapshot if available try: self.pakfire.restore_snapshot(snapshot_path) # Ignore if no snapshot was present - except IOError as e: - if e.code == errno.ENOENT: - pass - else: - raise + except FileNotFoundError: + pass # Install any updates and essential packages # If there have been updates, or on a fresh install, re-create the snapshot