/[rdiff-backup]/rdiff-backup/rdiff_backup/rpath.py
ViewVC logotype

Diff of /rdiff-backup/rdiff_backup/rpath.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.81 by bescoto, Wed Aug 10 05:47:56 2005 UTC revision 1.82 by bescoto, Thu Aug 11 03:34:03 2005 UTC
# Line 152  def copy_attribs(rpin, rpout): Line 152  def copy_attribs(rpin, rpout):
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())
# Line 173  def copy_attribs_inc(rpin, rpout): Line 173  def copy_attribs_inc(rpin, rpout):
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())
# Line 775  class RPath(RORPath): Line 775  class RPath(RORPath):
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    

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.82

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26