equal
deleted
inserted
replaced
2833 shutil.copyfile(source_str, dest_str) |
2833 shutil.copyfile(source_str, dest_str) |
2834 return exportwhatlog |
2834 return exportwhatlog |
2835 |
2835 |
2836 sourceMTime = 0 |
2836 sourceMTime = 0 |
2837 destMTime = 0 |
2837 destMTime = 0 |
|
2838 sourceStat = 0 |
2838 try: |
2839 try: |
2839 sourceMTime = os.stat(source_str)[stat.ST_MTIME] |
2840 sourceStat = os.stat(source_str) |
|
2841 sourceMTime = sourceStat[stat.ST_MTIME] |
2840 destMTime = os.stat(dest_str)[stat.ST_MTIME] |
2842 destMTime = os.stat(dest_str)[stat.ST_MTIME] |
2841 except OSError, e: |
2843 except OSError, e: |
2842 if sourceMTime == 0: |
2844 if sourceMTime == 0: |
2843 message = "Source of export does not exist: " + str(source) |
2845 message = "Source of export does not exist: " + str(source) |
2844 if not self.__Raptor.keepGoing: |
2846 if not self.__Raptor.keepGoing: |
2848 |
2850 |
2849 if destMTime == 0 or destMTime < sourceMTime: |
2851 if destMTime == 0 or destMTime < sourceMTime: |
2850 if os.path.exists(dest_str): |
2852 if os.path.exists(dest_str): |
2851 os.chmod(dest_str,stat.S_IREAD | stat.S_IWRITE) |
2853 os.chmod(dest_str,stat.S_IREAD | stat.S_IWRITE) |
2852 shutil.copyfile(source_str, dest_str) |
2854 shutil.copyfile(source_str, dest_str) |
|
2855 |
|
2856 # Ensure that the destination file remains executable if the source was also: |
|
2857 os.chmod(dest_str,sourceStat[stat.ST_MODE] | stat.S_IREAD | stat.S_IWRITE | stat.S_IWGRP ) |
2853 self.__Raptor.Info("Copied %s to %s", source_str, dest_str) |
2858 self.__Raptor.Info("Copied %s to %s", source_str, dest_str) |
2854 else: |
2859 else: |
2855 self.__Raptor.Info("Up-to-date: %s", dest_str) |
2860 self.__Raptor.Info("Up-to-date: %s", dest_str) |
2856 |
2861 |
2857 |
2862 |