File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,19 +71,20 @@ def setNonBlocking(fd):
7171 flags = flags | os .O_NONBLOCK
7272 fcntl .fcntl (fd , FCNTL .F_SETFL , flags )
7373
74- def pollProcess (process ):
74+ def pollProcess (process , suppress_errors = False ):
7575 while True :
7676 dataToStdout ("." )
7777 time .sleep (1 )
7878
7979 returncode = process .poll ()
8080
8181 if returncode is not None :
82- if returncode == 0 :
83- dataToStdout (" done\n " )
84- elif returncode < 0 :
85- dataToStdout (" process terminated by signal %d\n " % returncode )
86- elif returncode > 0 :
87- dataToStdout (" quit unexpectedly with return code %d\n " % returncode )
82+ if not suppress_errors :
83+ if returncode == 0 :
84+ dataToStdout (" done\n " )
85+ elif returncode < 0 :
86+ dataToStdout (" process terminated by signal %d\n " % returncode )
87+ elif returncode > 0 :
88+ dataToStdout (" quit unexpectedly with return code %d\n " % returncode )
8889
8990 break
Original file line number Diff line number Diff line change @@ -35,15 +35,21 @@ def update():
3535 logger .debug (debugMsg )
3636
3737 dataToStdout ("\r [%s] [INFO] update in progress " % time .strftime ("%X" ))
38- process = execute ("git pull %s" % rootDir , shell = True , stdout = PIPE , stderr = PIPE )
39- pollProcess (process )
40- stdout , _ = process .communicate ()
38+ process = execute ("gita pull %s" % rootDir , shell = True , stdout = PIPE , stderr = PIPE )
39+ pollProcess (process , True )
40+ stdout , stderr = process .communicate ()
4141
4242 if not process .returncode :
4343 logger .info ("%s the latest revision '%s'" % ("already at" if "Already" in stdout else "updated to" , REVISION ))
44+ else :
45+ logger .error ("update could not be completed (%s)" % repr (stderr ))
46+
47+ if IS_WIN :
48+ infoMsg = "for Windows platform it's recommended "
49+ infoMsg += "to use a GitHub for Windows client for updating "
50+ infoMsg += "purposes (http://windows.github.com/)"
51+ else :
52+ infoMsg = "for Linux platform it's recommended "
53+ infoMsg += "to use a standard 'git' package (e.g.: 'sudo apt-get install git')"
4454
45- if IS_WIN :
46- infoMsg = "for Windows platform it's recommended "
47- infoMsg += "to use a GitHub for Windows client for updating "
48- infoMsg += "purposes (http://windows.github.com/)"
4955 logger .info (infoMsg )
You can’t perform that action at this time.
0 commit comments