152 |
""" |
""" |
153 |
log.Log("Copying attributes from %s to %s" % (rpin.index, rpout.path), 7) |
log.Log("Copying attributes from %s to %s" % (rpin.index, rpout.path), 7) |
154 |
assert rpin.lstat() == rpout.lstat() or rpin.isspecial() |
assert rpin.lstat() == rpout.lstat() or rpin.isspecial() |
155 |
if rpin.issym(): return # symlinks have no valid attributes |
if Globals.change_ownership: rpout.chown(*user_group.map_rpath(rpin)) |
156 |
|
if rpin.issym(): return # symlinks don't have times or perms |
157 |
if Globals.resource_forks_write and rpin.isreg(): |
if Globals.resource_forks_write and rpin.isreg(): |
158 |
rpout.write_resource_fork(rpin.get_resource_fork()) |
rpout.write_resource_fork(rpin.get_resource_fork()) |
159 |
if Globals.carbonfile_write and rpin.isreg(): |
if Globals.carbonfile_write and rpin.isreg(): |
160 |
rpout.write_carbonfile(rpin.get_carbonfile()) |
rpout.write_carbonfile(rpin.get_carbonfile()) |
161 |
if Globals.eas_write: rpout.write_ea(rpin.get_ea()) |
if Globals.eas_write: rpout.write_ea(rpin.get_ea()) |
|
if Globals.change_ownership: rpout.chown(*user_group.map_rpath(rpin)) |
|
162 |
rpout.chmod(rpin.getperms()) |
rpout.chmod(rpin.getperms()) |
163 |
if Globals.acls_write: rpout.write_acl(rpin.get_acl()) |
if Globals.acls_write: rpout.write_acl(rpin.get_acl()) |
164 |
if not rpin.isdev(): rpout.setmtime(rpin.getmtime()) |
if not rpin.isdev(): rpout.setmtime(rpin.getmtime()) |
173 |
""" |
""" |
174 |
log.Log("Copying inc attrs from %s to %s" % (rpin.index, rpout.path), 7) |
log.Log("Copying inc attrs from %s to %s" % (rpin.index, rpout.path), 7) |
175 |
check_for_files(rpin, rpout) |
check_for_files(rpin, rpout) |
176 |
if rpin.issym(): return # symlinks have no valid attributes |
if Globals.change_ownership: apply(rpout.chown, rpin.getuidgid()) |
177 |
|
if rpin.issym(): return # symlinks don't have times or perms |
178 |
if Globals.resource_forks_write and rpin.isreg() and rpout.isreg(): |
if Globals.resource_forks_write and rpin.isreg() and rpout.isreg(): |
179 |
rpout.write_resource_fork(rpin.get_resource_fork()) |
rpout.write_resource_fork(rpin.get_resource_fork()) |
180 |
if Globals.carbonfile_write and rpin.isreg() and rpout.isreg(): |
if Globals.carbonfile_write and rpin.isreg() and rpout.isreg(): |
181 |
rpout.write_carbonfile(rpin.get_carbonfile()) |
rpout.write_carbonfile(rpin.get_carbonfile()) |
182 |
if Globals.eas_write: rpout.write_ea(rpin.get_ea()) |
if Globals.eas_write: rpout.write_ea(rpin.get_ea()) |
|
if Globals.change_ownership: apply(rpout.chown, rpin.getuidgid()) |
|
183 |
if rpin.isdir() and not rpout.isdir(): |
if rpin.isdir() and not rpout.isdir(): |
184 |
rpout.chmod(rpin.getperms() & 0777) |
rpout.chmod(rpin.getperms() & 0777) |
185 |
else: rpout.chmod(rpin.getperms()) |
else: rpout.chmod(rpin.getperms()) |
775 |
|
|
776 |
def chown(self, uid, gid): |
def chown(self, uid, gid): |
777 |
"""Set file's uid and gid""" |
"""Set file's uid and gid""" |
778 |
self.conn.os.chown(self.path, uid, gid) |
self.conn.C.lchown(self.path, uid, gid) |
779 |
self.data['uid'] = uid |
self.data['uid'] = uid |
780 |
self.data['gid'] = gid |
self.data['gid'] = gid |
781 |
|
|