mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update push for new windows VM
This commit is contained in:
parent
4e086bb3d6
commit
4c89fcbe74
@ -6,7 +6,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import subprocess, tempfile, os, time, socket
|
import subprocess, tempfile, os, time
|
||||||
|
|
||||||
from setup import Command, installer_name
|
from setup import Command, installer_name
|
||||||
from setup.build_environment import HOST, PROJECT
|
from setup.build_environment import HOST, PROJECT
|
||||||
@ -57,23 +57,25 @@ class Push(Command):
|
|||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
threads = []
|
threads = {}
|
||||||
for host, vmname in {
|
for host, vmname in {
|
||||||
r'Owner@winxp:/cygdrive/c/Documents\ and\ Settings/Owner/calibre':'winxp',
|
r'Owner@winxp:/cygdrive/c/Documents\ and\ Settings/Owner/calibre':'winxp',
|
||||||
'kovid@ox:calibre':None,
|
'kovid@ox:calibre':None,
|
||||||
r'kovid@win7:/cygdrive/c/Users/kovid/calibre':'Windows 7',
|
r'kovid@win7:/cygdrive/c/Users/kovid/calibre':'Windows 7',
|
||||||
'kovid@getafix:calibre-src':None,
|
'kovid@win7-64:calibre-src':None,
|
||||||
}.iteritems():
|
}.iteritems():
|
||||||
if '@getafix:' in host and socket.gethostname() == 'getafix':
|
|
||||||
continue
|
|
||||||
if vmname is None or is_vm_running(vmname):
|
if vmname is None or is_vm_running(vmname):
|
||||||
rcmd = BASE_RSYNC + EXCLUDES + ['.', host]
|
rcmd = BASE_RSYNC + EXCLUDES + ['.', host]
|
||||||
print '\n\nPushing to:', vmname or host, '\n'
|
print '\n\nPushing to:', vmname or host, '\n'
|
||||||
threads.append(Thread(target=subprocess.check_call, args=(rcmd,),
|
threads[vmname or host] = thread = Thread(target=subprocess.check_call, args=(rcmd,),
|
||||||
kwargs={'stdout':open(os.devnull, 'wb')}))
|
kwargs={'stdout':open(os.devnull, 'wb')})
|
||||||
threads[-1].start()
|
thread.start()
|
||||||
for thread in threads:
|
while threads:
|
||||||
thread.join()
|
for name, thread in tuple(threads.iteritems()):
|
||||||
|
thread.join(0.01)
|
||||||
|
if not thread.is_alive():
|
||||||
|
print '\n\n', name, 'done'
|
||||||
|
threads.pop(name)
|
||||||
|
|
||||||
|
|
||||||
class VMInstaller(Command):
|
class VMInstaller(Command):
|
||||||
|
@ -69,7 +69,8 @@ to login as the normal user account with ssh. To do this, follow these steps:
|
|||||||
rm -R /etc/ssh*
|
rm -R /etc/ssh*
|
||||||
mkpasswd -cl > /etc/passwd
|
mkpasswd -cl > /etc/passwd
|
||||||
mkgroup --local > /etc/group
|
mkgroup --local > /etc/group
|
||||||
* Assign the necessary rights to the normal user account::
|
* Assign the necessary rights to the normal user account (administrator
|
||||||
|
command prompt needed)::
|
||||||
editrights.exe -a SeAssignPrimaryTokenPrivilege -u kovid
|
editrights.exe -a SeAssignPrimaryTokenPrivilege -u kovid
|
||||||
editrights.exe -a SeCreateTokenPrivilege -u kovid
|
editrights.exe -a SeCreateTokenPrivilege -u kovid
|
||||||
editrights.exe -a SeTcbPrivilege -u kovid
|
editrights.exe -a SeTcbPrivilege -u kovid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user