diff install.py @ 417:6dbef23ca6bd

Update subrepos if they're already cloned.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 21 Jan 2018 12:50:45 -0800
parents 222b477ad678
children 350f7a55ff33
line wrap: on
line diff
--- a/install.py	Fri Jan 19 09:19:34 2018 -0800
+++ b/install.py	Sun Jan 21 12:50:45 2018 -0800
@@ -185,8 +185,8 @@
         'source "%s"' % _p('lib/mutt/mutt-colors-solarized/'
                            'mutt-colors-solarized-dark-256.muttrc')
     ])
-    
-    
+
+
 def _on_error_try_make_readable(func, path, exc_info):
     if not os.access(path, os.W_OK):
         os.chmod(path, stat.S_IWUSR)
@@ -198,7 +198,9 @@
 def clone_git(url, path, force=False):
     if os.path.isdir(path):
         if not force:
-            print("Skipping git clone of %s -- directory exists" % path)
+            print("git pull origin master %s" % path)
+            subprocess.check_call(['git', 'pull', 'origin', 'master'],
+                                  cwd=path)
             return
         else:
             print("Deleting existing: %s" % path)
@@ -212,7 +214,8 @@
 def clone_hg(url, path, force=False):
     if os.path.isdir(path):
         if not force:
-            print("Skipping hg clone of %s -- directory exists" % path)
+            print("hg pull -u %s" % path)
+            subprocess.check_call(['hg', 'pull', '-u'], cwd=path)
             return
         else:
             print("Deleting existing: %s" % path)
@@ -258,7 +261,7 @@
 
         name = an[len('install_'):]
         mod_names.append(name)
-        
+
     # See if we have any local install script.
     local_mod = None
     local_install_py = os.path.join(dotfiles_dir, 'local',