The following commit has been merged in the master branch:
commit 8723aba31f025bcc5befe7c6f0280d0b5684f539
Author: Andreas Tille <[email protected]>
Date:   Tue Mar 17 09:12:17 2015 +0100

    Take over whole FetchTasksFiles from blendstasktool.py to 
blendstasktoolsold.py (admittedly this is hackish but blendstasktoolsold.py 
should go away rather sooner than later anyway)

diff --git a/webtools/blendstasktoolsold.py b/webtools/blendstasktoolsold.py
index a25df13..973ed18 100644
--- a/webtools/blendstasktoolsold.py
+++ b/webtools/blendstasktoolsold.py
@@ -430,27 +430,52 @@ def FetchTasksFiles(data):
 
     # tasks directory to obtain dependencies and debian/control to obtain meta
     # information like the metapackage prefix
-    for dir in ('tasks', 'debian'):
-        tasksdir = data['datadir'] + '/' + dir
-        if not os.access(tasksdir, os.W_OK):
-            try:
-               os.makedirs(tasksdir)
-            except:
-               logger.error("Unable to create data directory", tasksdir)
-        # Checkout/Update tasks from SVN
-        svncommand = "svn %%s %s/%s %s >> /dev/null" % (data['vcsdir'], dir, 
tasksdir)
-        if os.path.isdir(tasksdir+'/.svn'):
-           svncommand = svncommand % 'up'
-        else:
-            os.system("mkdir -p %s" % (tasksdir))
-            svncommand = svncommand % 'co'
-        if os.system(svncommand):
-           logger.error("SVN command %s failed" % (svncommand))
+    # Checkout/Update tasks from SVN
+    if data['vcsdir'].startswith('svn:'):
+        for dir in ('tasks', 'debian'):
+            tasksdir = data['datadir'] + '/' + dir
+            if not os.access(tasksdir, os.W_OK):
+                try:
+                    os.makedirs(tasksdir)
+                except:
+                    logger.error("Unable to create data directory", tasksdir)
+           svncommand = "svn %%s %s/%s %s >> /dev/null" % (data['vcsdir'], 
dir, tasksdir)
            if os.path.isdir(tasksdir+'/.svn'):
-               logger.error("Trying old files in %s ..." % tasksdir)
+               svncommand = svncommand % ' --accept theirs-conflict up'
+            else:
+                os.system("mkdir -p %s" % (tasksdir))
+                svncommand = svncommand % 'co'
+            if os.system(svncommand):
+               logger.error("SVN command %s failed" % (svncommand))
+               if os.path.isdir(tasksdir+'/.svn'):
+                   logger.error("Trying old files in %s ..." % tasksdir)
+               else:
+                    if os.listdir(tasksdir):
+                        logger.warning("No .svn directory found in %s but 
trying those random files there as tasks files." % tasksdir)
+                    else:
+                        logger.error("There are no old files in %s -> giving 
up" % tasksdir)
+                        exit(-1)
+    elif data['vcsdir'].startswith('git:') or 
data['vcsdir'].startswith('http:'):
+        githtml = data['vcsdir']
+#        if githtml.startswith('git:'):
+#            githtml=githtml.replace('git://','http://')
+       if os.path.isdir(data['datadir']+'/.git'):
+           gitcommand = "cd %s; git pull --quiet" % data['datadir']
+       else:
+           gitcommand = "cd %s; git clone --quiet %s" % (re.sub('/[^/]+$', '', 
data['datadir']), githtml)
+        if os.system(gitcommand):
+           logger.error("Git command %s failed" % (gitcommand))
+           if os.path.isdir(data['datadir']+'/.git'):
+                logger.error("Trying old files in %s ..." % data['datadir'])
            else:
-               logger.error("There are no old files in %s -> giving up" % 
tasksdir)
-               exit(-1)
+                if os.listdir(data['datadir']):
+                    logger.warning("No .git directory found in %s but trying 
those random files there as tasks files." % data['datadir'])
+                else:
+                    logger.error("There are no old files in %s -> giving up" % 
data['datadir'])
+                    exit(-1)
+    else:
+        logger.error("Don't know how to checkout tasks files from %s -> giving 
up" % data['vcsdir'])
+        exit(-1)
     return data['datadir'] + '/tasks'
 
 def RowDictionaries(cursor):

-- 
Static and dynamic websites for Debian Pure Blends

_______________________________________________
Blends-commit mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/blends-commit

Reply via email to