def set_snapcache_path(self):
if "SNAPCACHE" in self.settings:
- self.settings["snapshot_cache_path"]=\
- normpath(self.settings["snapshot_cache"]+"/"+\
- self.settings["snapshot"]+"/")
+ self.settings["snapshot_cache_path"] = \
+ normpath(self.settings["snapshot_cache"] + "/" +
+ self.settings["snapshot"])
self.snapcache_lock=\
catalyst_lock.LockDir(self.settings["snapshot_cache_path"])
print "Caching snapshot to "+self.settings["snapshot_cache_path"]
def set_chroot_path(self):
"""
- NOTE: the trailing slash is very important!
- Things *will* break without it!
+ NOTE: the trailing slash has been removed
+ Things *could* break if you don't use a proper join()
"""
self.settings["chroot_path"]=normpath(self.settings["storedir"]+\
- "/tmp/"+self.settings["target_subpath"]+"/")
+ "/tmp/"+self.settings["target_subpath"])
self.chroot_lock=catalyst_lock.LockDir(self.settings["chroot_path"])
def set_autoresume_path(self):
if "SNAPCACHE" in self.settings:
snapshot_cache_hash=\
- read_from_clst(self.settings["snapshot_cache_path"]+\
- "catalyst-hash")
+ read_from_clst(self.settings["snapshot_cache_path"] + "/" +
+ "catalyst-hash")
destdir=self.settings["snapshot_cache_path"]
if "bz2" == self.settings["chroot_path"][-3:]:
unpack_cmd="tar -I lbzip2 -xpf "+self.settings["snapshot_path"]+" -C "+destdir
cmd(unpack_cmd,unpack_errmsg,env=self.env)
if "SNAPCACHE" in self.settings:
- myf=open(self.settings["snapshot_cache_path"]+"catalyst-hash","w")
+ myf=open(self.settings["snapshot_cache_path"] +
+ "/" + "catalyst-hash","w")
myf.write(self.settings["snapshot_path_hash"])
myf.close()
else:
# and executes it.
local file_name=$(basename ${1})
local subdir=${2}
- local destdir=".${subdir}/tmp"
+ local destdir="${subdir}/tmp"
echo "Copying ${file_name} to ${destdir}"
copy_to_chroot ${1} ${destdir}
echo "Ensure the file has the executable bit set"
chmod +x ${chroot_path}/${destdir}/${file_name}
- echo "Running ${file_name} in chroot ${chroot_path}"
+ echo "Running ${file_name} in chroot:"
+ echo " ${clst_CHROOT} ${chroot_path} ${destdir}/${file_name}"
${clst_CHROOT} ${chroot_path} ${destdir}/${file_name} || exit 1
delete_from_chroot ${destdir}/${file_name}