Lines 120-136
Link Here
|
120 |
|
120 |
|
121 |
for x in self.settings["livecd/empty"]: |
121 |
for x in self.settings["livecd/empty"]: |
122 |
myemp=self.settings["chroot_path"]+x |
122 |
myemp=self.settings["chroot_path"]+x |
123 |
if not os.path.isdir(myemp): |
123 |
if not os.path.isdir(myemp) or os.path.islink(myemp): |
124 |
print x,"not a directory or does not exist, skipping 'empty' operation." |
124 |
print x,"not a directory or does not exist, skipping 'empty' operation." |
125 |
continue |
125 |
|
126 |
print "Emptying directory",x |
126 |
else: |
127 |
# stat the dir, delete the dir, recreate the dir and set |
127 |
print "Emptying directory",x |
128 |
# the proper perms and ownership |
128 |
# stat the dir, delete the dir, recreate the dir and set |
129 |
mystat=os.stat(myemp) |
129 |
# the proper perms and ownership |
130 |
shutil.rmtree(myemp) |
130 |
mystat=os.stat(myemp) |
131 |
os.makedirs(myemp) |
131 |
shutil.rmtree(myemp) |
132 |
os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) |
132 |
os.makedirs(myemp) |
133 |
os.chmod(myemp,mystat[ST_MODE]) |
133 |
os.chown(myemp,mystat[ST_UID],mystat[ST_GID]) |
|
|
134 |
os.chmod(myemp,mystat[ST_MODE]) |
134 |
|
135 |
|
135 |
if self.settings.has_key("livecd/rm"): |
136 |
if self.settings.has_key("livecd/rm"): |
136 |
|
137 |
|