aboutsummaryrefslogtreecommitdiff
path: root/synchronise.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-12 08:43:13 +0200
committermarha <marha@users.sourceforge.net>2012-06-12 08:43:13 +0200
commit669b562a737c9418c53bfae69c0dbf1aabe318b4 (patch)
tree3689f9b209df6a4b74eb185f202286e435c71538 /synchronise.py
parent59afae8769ef1f757929421e7f55449d5f6b5baf (diff)
parent925b68a7b26823fdfa1cb25d3edc3545fc2175b1 (diff)
downloadvcxsrv-669b562a737c9418c53bfae69c0dbf1aabe318b4.tar.gz
vcxsrv-669b562a737c9418c53bfae69c0dbf1aabe318b4.tar.bz2
vcxsrv-669b562a737c9418c53bfae69c0dbf1aabe318b4.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'synchronise.py')
-rw-r--r--synchronise.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/synchronise.py b/synchronise.py
index 305583bd8..66d6ad581 100644
--- a/synchronise.py
+++ b/synchronise.py
@@ -49,8 +49,8 @@ g_NoSkipGit=g_Options.NoSkipGit
g_WriteMask=stat.S_IWUSR|stat.S_IWGRP|stat.S_IWOTH
-SrcDir=g_Args[0]
-DestDir=g_Args[1]
+g_SrcDir=os.path.realpath(g_Args[0])
+g_DestDir=os.path.realpath(g_Args[1])
if g_Options.Extension:
g_Extre=re.compile('.*\.%s$'%g_Options.Extension,re.I)
@@ -58,10 +58,14 @@ else:
g_Extre=None
###############################################################################
+g_LenSrcDir=len(g_SrcDir)
+if g_SrcDir[-1]!=os.path.sep:
+ g_LenSrcDir+=1
+
def SkipDir(SrcDir,File):
Ret = g_DirsToSkip.has_key(File)
- if SrcDir[1]==':':
- SrcDir=SrcDir[3:]
+ SrcDir=SrcDir[g_LenSrcDir:]
+
while not Ret and SrcDir:
SrcDir,Part=os.path.split(SrcDir)
File=os.path.join(Part,File)
@@ -102,8 +106,8 @@ def PrintBusy():
sys.stdout.write(chr(8)*len(item))
###############################################################################
-if not os.path.isdir(DestDir):
- print DestDir,"is not a directory"
+if not os.path.isdir(g_DestDir):
+ print g_DestDir,"is not a directory"
sys.exit(1)
def FileDiff(SrcFile,DestFile):
@@ -227,5 +231,5 @@ def SynchroniseDir(SrcDir,DestDir):
PrintBusy()
g_Dot=1
-SynchroniseDir(SrcDir,DestDir)
+SynchroniseDir(g_SrcDir,g_DestDir)
sys.stdout.write("\n")