From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id DB8D9138247 for ; Sun, 15 Dec 2013 04:01:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E62DE0B33; Sun, 15 Dec 2013 04:00:59 +0000 (UTC) Received: from qmta03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by pigeon.gentoo.org (Postfix) with ESMTP id 5F3F2E0B33 for ; Sun, 15 Dec 2013 04:00:58 +0000 (UTC) Received: from omta15.westchester.pa.mail.comcast.net ([76.96.62.87]) by qmta03.westchester.pa.mail.comcast.net with comcast id 1fw11n0051swQuc53g0yC0; Sun, 15 Dec 2013 04:00:58 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta15.westchester.pa.mail.comcast.net with comcast id 1g0x1n004152l3L3bg0xtt; Sun, 15 Dec 2013 04:00:58 +0000 Received: by odin.tremily.us (Postfix, from userid 1000) id BEBC2D69969; Sat, 14 Dec 2013 20:00:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1387080055; bh=ligkw6VkI52fQG6g4xr/GGuYUcVDe041jnyfveRox80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References; b=BVSATmA6DCnuRZ5/hBRovEKZM2syO+b0oIVy8VR864n9LV238ehCZDB9wR90g5NlO a0b1WDAhA0NYZBCl/G69H8e07mr1fYHHSz6YC+lHqwfGAly5dsuLBjQC/OYClA89jk GnagTzdBwQNsxAi+0uwRuoTWDz37h3DQZJ4vS+KA= From: "W. Trevor King" To: Catalyst Cc: Brian Dolbec , "W. Trevor King" Subject: [gentoo-catalyst] [PATCH v3 10/19] modules/generic_stage_target.py: Don't use paths as mountmap keys Date: Sat, 14 Dec 2013 20:00:36 -0800 Message-Id: <6283c148a609138513c4e9b7829be8264bceecca.1387079534.git.wking@tremily.us> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: <20131215032258.GK25409@odin.tremily.us> In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1387080058; bh=acnoniSJHeGE+DybhC+wXSUh5uyHe9DoGSy/kKgrWNs=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=Euabr60hwAKMik0Qnqdrt+2/lyOq9ikhvgnFXBAQTUF8bxXhw4M9PCzgVDFlWDxt8 VUBMhDczZUMEZmQH+tEyOcvQk6Q2Oxd3xABuz1QBUsGNAQ1ihpr3SOzgtzHLai0pK1 WNw3FOO0lK7Kga4YR+nH4yNAkWQEPyYmdnmms12LmEIEUA7Rxi84tfPOCij5mWcka7 dqvR9802FkbSWAsyblIEcphHqtk5Kcfn7eYACrnM4CgHwJGvSPj3UxwbbUDiokImIV v3GvWahI1LEKfc4GC1gQ4HTDoEcGwnm+VtPfMRMajt5i6EfGKdwVG1FDpZxS+I1Dzw QhLwOJjOcvC/w== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Archives-Salt: 8d17e0ce-c151-47fd-a7a7-14197f00f4de X-Archives-Hash: 58911a7a772192d4a1d074085bd742b9 From: Brian Dolbec W. Trevor King: Refactored Git history for Brian Dolbec's content changes. Signed-off-by: W. Trevor King Signed-off-by: Brian Dolbec --- modules/generic_stage_target.py | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index c890773..a68b356 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -615,21 +615,21 @@ class generic_stage_target(generic_target): return for x in self.mounts: - if not os.path.exists(mypath+x): + if not os.path.exists(mypath + self.mountmap[x]): continue - if ismount(mypath+x): + if ismount(mypath + self.mountmap[x]): """ Something is still mounted "" """ try: - print x+" is still mounted; performing auto-bind-umount...", + print self.mountmap[x] + " is still mounted; performing auto-bind-umount...", """ Try to umount stuff ourselves """ self.unbind() - if ismount(mypath+x): - raise CatalystError, "Auto-unbind failed for "+x + if ismount(mypath + self.mountmap[x]): + raise CatalystError, "Auto-unbind failed for " + self.mountmap[x] else: print "Auto-unbind successful..." except CatalystError: - raise CatalystError, "Unable to auto-unbind "+x + raise CatalystError, "Unable to auto-unbind " + self.mountmap[x] def unpack(self): unpack=True @@ -897,7 +897,7 @@ class generic_stage_target(generic_target): def bind(self): for x in self.mounts: - if not os.path.exists(self.settings["chroot_path"]+x): + if not os.path.exists(self.settings["chroot_path"] + self.mountmap[x]): os.makedirs(self.settings["chroot_path"]+x,0755) if not os.path.exists(self.mountmap[x]): @@ -909,11 +909,11 @@ class generic_stage_target(generic_target): self.snapshot_lock_object.read_lock() if os.uname()[0] == "FreeBSD": if src == "/dev": - retval=os.system("mount -t devfs none "+\ - self.settings["chroot_path"]+x) + retval = os.system("mount -t devfs none " + + self.settings["chroot_path"] + src) else: - retval=os.system("mount_nullfs "+src+" "+\ - self.settings["chroot_path"]+x) + retval = os.system("mount_nullfs " + src + " " + + self.settings["chroot_path"] + src) else: if src == "tmpfs": if "var_tmpfs_portage" in self.settings: @@ -921,11 +921,11 @@ class generic_stage_target(generic_target): self.settings["var_tmpfs_portage"]+"G "+src+" "+\ self.settings["chroot_path"]+x) else: - retval=os.system("mount --bind "+src+" "+\ - self.settings["chroot_path"]+x) + retval = os.system("mount --bind " + src + " " + + self.settings["chroot_path"] + src) if retval!=0: self.unbind() - raise CatalystError,"Couldn't bind mount "+src + raise CatalystError,"Couldn't bind mount " + src def unbind(self): ouch=0 @@ -934,25 +934,26 @@ class generic_stage_target(generic_target): myrevmounts.reverse() """ Unmount in reverse order for nested bind-mounts """ for x in myrevmounts: - if not os.path.exists(mypath+x): + if not os.path.exists(mypath + self.mountmap[x]): continue - if not ismount(mypath+x): + if not ismount(mypath + self.mountmap[x]): continue retval=os.system("umount "+\ - os.path.join(mypath,x.lstrip(os.path.sep))) + os.path.join(mypath, self.mountmap[x].lstrip(os.path.sep))) if retval!=0: - warn("First attempt to unmount: "+mypath+x+" failed.") + warn("First attempt to unmount: " + mypath + + self.mountmap[x] +" failed.") warn("Killing any pids still running in the chroot") self.kill_chroot_pids() - retval2=os.system("umount "+mypath+x) + retval2 = os.system("umount " + mypath + self.mountmap[x]) if retval2!=0: ouch=1 - warn("Couldn't umount bind mount: "+mypath+x) + warn("Couldn't umount bind mount: " + mypath + self.mountmap[x]) if "SNAPCACHE" in self.settings and x == "/usr/portage": try: -- 1.8.3.2