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 1474A138247 for ; Sat, 14 Dec 2013 22:25:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CDED5E0B36; Sat, 14 Dec 2013 22:24:48 +0000 (UTC) Received: from qmta05.westchester.pa.mail.comcast.net (qmta05.westchester.pa.mail.comcast.net [76.96.62.48]) by pigeon.gentoo.org (Postfix) with ESMTP id 0FA16E0B23 for ; Sat, 14 Dec 2013 22:24:46 +0000 (UTC) Received: from omta02.westchester.pa.mail.comcast.net ([76.96.62.19]) by qmta05.westchester.pa.mail.comcast.net with comcast id 1aDU1n0020QuhwU55aQmot; Sat, 14 Dec 2013 22:24:46 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta02.westchester.pa.mail.comcast.net with comcast id 1aQl1n008152l3L3NaQlVF; Sat, 14 Dec 2013 22:24:46 +0000 Received: by odin.tremily.us (Postfix, from userid 1000) id D8FBCD68B4D; Sat, 14 Dec 2013 14:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1387059884; bh=OO4HKyEOjJGit0A8m943JU5qzmj38tlO+pcdfKna71U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:In-Reply-To: References; b=i3Zddznf0nCGyIaHusBLV6Bs37GdCyvsraN7QMbNBkdtoHeBGx1KKY7TSQxww4jX0 ASoSmYaZilUvP4np99C/lV57orF7x4E5AYgjSk+97Ox6Uk0SW1QrMxZFdnSDXPB3pN oT8YtLRuop9SYG965eN+/jigXt5B4maSJ/azv5GY= From: "W. Trevor King" To: Catalyst Cc: Brian Dolbec , "W. Trevor King" Subject: [gentoo-catalyst] [PATCH v2 11/21] modules/generic_stage_target.py: Don't use paths as mountmap keys Date: Sat, 14 Dec 2013 14:24:19 -0800 Message-Id: X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1387059886; bh=OokPBvv+pAczgidx0x+9n6HHacHg++h5nb3012Df64E=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=NYxDYQulrTOjPahPToBH3GQ7uUYYLcuc1thM188xoosG5oZRqiEbTtWPOfFZ1Q/8l 0XcCmhwThsMW3t8CH0p+L6HtEaCorEeMh64RJ3mZBL+eJyrou1F6GoRKvLkbqQI+sF cLTiul4goXGos019tLW8o3ZCMs5f+mB2E1lM24kGhlgpQtDmjUJ+WIfWmx0PKJ3Vru iEpbCLVT5h6y8vvo8+K6tOudUY+3kVAUx3fA/echkc7jHFWc62TT+9vxq6+uUc6zQn msqQzqiXr6lE6yczPsZ0pQo9m0oGFSDJHrNyls2Ypc8pRDiUgv8KZgREI29l2y61ov rG5Y5b3wODCBg== 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: de91396e-5c8a-4fda-b2f3-409c3051b4f8 X-Archives-Hash: b1ea74c9212260146318d18e09067aa4 From: Brian Dolbec W. Trevor King: Refactored Git history for Brian Dolbec's content changes. Signed-off-by: W. Trevor King --- 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