modules/generic_stage_target.py: Use portdir, distdir, ... instead of paths for keys
authorBrian Dolbec <dolsen@gentoo.org>
Sun, 15 Dec 2013 22:53:32 +0000 (14:53 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Tue, 31 Dec 2013 00:38:53 +0000 (16:38 -0800)
If snapcache is enabled, self.mounts and self.mountmap had not been
modified like they were if it was not enabled.

Added a print statement for debugging to be converted to logging in
the future.

modules/generic_stage_target.py

index 3e60f72a892ce2d72f7e7e71279a7e557ad28866..6c8cdbc245fdc07fe72759fb095ad711f4f8e3a6 100644 (file)
@@ -174,10 +174,10 @@ class generic_stage_target(generic_target):
 
                """ Setup our mount points """
                if "SNAPCACHE" in self.settings:
-                       self.mounts=["/proc","/dev","/usr/portage","/usr/portage/distfiles","/var/tmp/portage"]
-                       self.mountmap={"/proc":"/proc","/dev":"/dev","devpts":"/dev/pts",
-                               "/usr/portage":self.settings["snapshot_cache_path"]+"/portage",\
-                               "/usr/portage/distfiles":self.settings["distdir"],"/var/tmp/portage":"tmpfs"}
+                       self.mounts=["proc", "dev", "portdir", "distdir", "port_tmpdir"]
+                       self.mountmap={"proc": "/proc", "dev": "/dev", "devpts": "/dev/pts",
+                               "portdir": self.settings["snapshot_cache_path"] + "/portage",
+                               "distdir": self.settings["distdir"], "port_tmpdir": "tmpfs"}
                else:
                        self.mounts = ["proc", "dev", "distdir", "port_tmpdir"]
                        self.mountmap = {"proc":"/proc", "dev":"/dev", "devpts":"/dev/pts",
@@ -904,7 +904,8 @@ class generic_stage_target(generic_target):
                                        os.makedirs(self.mountmap[x],0755)
 
                        src=self.mountmap[x]
-                       if "SNAPCACHE" in self.settings and x == "/usr/portage":
+                       #print "bind(); src =", src
+                       if "SNAPCACHE" in self.settings and x == "portdir":
                                self.snapshot_lock_object.read_lock()
                        if os.uname()[0] == "FreeBSD":
                                if src == "/dev":