/stdhome

To get this branch, use:
bzr branch http://bzr.ed.am/stdhome

« back to all changes in this revision

Viewing changes to lib/stdhome/walker/copy_base.py

  • Committer: Tim Marston
  • Date: 2016-04-10 20:29:46 UTC
  • Revision ID: tim@ed.am-20160410202946-9eoh5i3et9443aq6
fixed greps in tools/dev to detect home-dir lines in stdhomerc

Show diffs side-by-side

added added

removed removed

21
21
 
22
22
import filecmp, os, shutil
23
23
from walker import Walker
24
 
import stdhome.the as the
 
24
from stdhome import the
 
25
from stdhome import util
25
26
 
26
27
 
27
28
class CopyBaseWalker( Walker ):
61
62
                        # if dst entity is a directory, copy permissions, as required (and
62
63
                        # recurse)
63
64
                        elif dst.type == 'd':
64
 
                                # TODO: should check permission and only do as necessary
65
 
                                self.print_op( rel_file, 'd', '*', 'd' )
66
 
                                shutil.copystat( src.file, dst.file )
 
65
                                if os.stat( src.file ).st_mode != os.stat( dst.file ).st_mode:
 
66
                                        self.print_op( rel_file, 'd', '*', 'd' )
 
67
                                        shutil.copystat( src.file, dst.file )
 
68
                                else:
 
69
                                        self.print_op( rel_file, 'd', '=', 'd' )
67
70
                                return True
68
71
 
69
72
                        # if dst entity is a symlink to a directory, and this is an