# Distributed under the GPL v2
# $Id$
+ 13 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/target/generic_stage.py, modules/catalyst/util.py:
+ Create catalyst.util.mkdir() helper function and use it
+
13 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/target/generic_stage.py,
modules/catalyst/target/netboot.py, modules/catalyst/util.py:
for x in self.settings["portage_overlay"]:
if os.path.exists(x):
msg("Copying overlay dir " + x)
- cmd("mkdir -p "+self.settings["chroot_path"]+\
- "/usr/local/portage",\
- "Could not make portage_overlay dir",env=self.env)
+ catalyst.util.mkdir(self.settings["chroot_path"] + "/usr/local/portage")
cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+\
"/usr/local/portage",\
"Could not copy portage_overlay",env=self.env)
and not "portage_confdir" in self.settings:
if not os.path.exists(self.settings["chroot_path"]+\
"/etc/portage"):
- cmd("mkdir "+self.settings["chroot_path"]+"/etc/portage")
+ catalyst.util.mkdir(self.settings["chroot_path"] + "/etc/portage")
myf=open(self.settings["chroot_path"]+\
"/etc/portage/modules","a")
myf.write("portdbapi.auxdbmodule = cache.metadata_overlay.database\n")
self.settings["boot/kernel/" + kname + \
"/initramfs_overlay"])
- cmd("mkdir -p "+\
- self.settings["chroot_path"]+\
- "/tmp/initramfs_overlay/"+\
- self.settings["boot/kernel/"+kname+\
- "/initramfs_overlay"],env=self.env)
+ catalyst.util.mkdir(self.settings["chroot_path"] + \
+ "/tmp/initramfs_overlay/" + \
+ self.settings["boot/kernel/" + kname + \
+ "/initramfs_overlay"])
cmd("cp -R "+self.settings["boot/kernel/"+\
kname+"/initramfs_overlay"]+"/* "+\
try:
mystat = os.stat(path)
remove_path(path, False)
- os.makedirs(path, 0755)
+ mkdir(path)
os.chown(path, mystat[stat.ST_UID], mystat[stat.ST_GID])
os.chmod(path, mystat[stat.ST_MODE])
except:
if retval != 0:
raise CatalystError("Could not unpack tarball '%s'" % (src,))
+def mkdir(path, perms=0755):
+ try:
+ os.makedirs(path, perms)
+ except:
+ raise CatalystError("Could not create directory '%s'" % (path,))
+
# vim: ts=4 sw=4 sta noet sts=4 ai