]> git.ipfire.org Git - pakfire.git/commitdiff
builder: Use distro information in snapshot path
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Apr 2021 10:57:53 +0000 (10:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 22 Apr 2021 10:57:53 +0000 (10:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/builder.py

index 2713a618d2285ed32256bcb40e61791ddbd72d23..4dafe0d293ae9e474e98147144f65eb68098f46c 100644 (file)
@@ -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