aboutsummaryrefslogtreecommitdiff
path: root/synchronise.py
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-06-11 13:56:12 +0200
committermarha <marha@users.sourceforge.net>2012-06-11 13:56:12 +0200
commit567cbd4acc1e35ae40d99b24bb321d97632399db (patch)
treee60e809194cdb42720208de4b76f935f955a9107 /synchronise.py
parent080d1527a5358dd66ac927acbe0ec61cba7aa7e1 (diff)
downloadvcxsrv-567cbd4acc1e35ae40d99b24bb321d97632399db.tar.gz
vcxsrv-567cbd4acc1e35ae40d99b24bb321d97632399db.tar.bz2
vcxsrv-567cbd4acc1e35ae40d99b24bb321d97632399db.zip
Fixed some minor mistakes in sync scripts
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")