mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Exclude .git when push to build vms
This commit is contained in:
parent
6f408ec810
commit
7f0f7ce605
@ -15,7 +15,7 @@ BASE_RSYNC = ['rsync', '-avz', '--delete', '--force']
|
|||||||
EXCLUDES = []
|
EXCLUDES = []
|
||||||
for x in [
|
for x in [
|
||||||
'src/calibre/plugins', 'src/calibre/manual', 'src/calibre/trac',
|
'src/calibre/plugins', 'src/calibre/manual', 'src/calibre/trac',
|
||||||
'.bzr', '.build', '.svn', 'build', 'dist', 'imgsrc', '*.pyc', '*.pyo', '*.swp',
|
'.bzr', '.git', '.build', '.svn', 'build', 'dist', 'imgsrc', '*.pyc', '*.pyo', '*.swp',
|
||||||
'*.swo', 'format_docs']:
|
'*.swo', 'format_docs']:
|
||||||
EXCLUDES.extend(['--exclude', x])
|
EXCLUDES.extend(['--exclude', x])
|
||||||
SAFE_EXCLUDES = ['"%s"'%x if '*' in x else x for x in EXCLUDES]
|
SAFE_EXCLUDES = ['"%s"'%x if '*' in x else x for x in EXCLUDES]
|
||||||
@ -31,7 +31,7 @@ def is_vm_running(name):
|
|||||||
try:
|
try:
|
||||||
cmdline = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()
|
cmdline = open(os.path.join('/proc', pid, 'cmdline'), 'rb').read()
|
||||||
except IOError:
|
except IOError:
|
||||||
continue # file went away
|
continue # file went away
|
||||||
if 'vmware-vmx' in cmdline and pat in cmdline:
|
if 'vmware-vmx' in cmdline and pat in cmdline:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -76,7 +76,6 @@ class Push(Command):
|
|||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class VMInstaller(Command):
|
class VMInstaller(Command):
|
||||||
|
|
||||||
EXTRA_SLEEP = 5
|
EXTRA_SLEEP = 5
|
||||||
@ -103,7 +102,6 @@ class VMInstaller(Command):
|
|||||||
if not parser.has_option('--vm'):
|
if not parser.has_option('--vm'):
|
||||||
parser.add_option('--vm', help='Path to VM launcher script')
|
parser.add_option('--vm', help='Path to VM launcher script')
|
||||||
|
|
||||||
|
|
||||||
def get_build_script(self):
|
def get_build_script(self):
|
||||||
rs = ['export RSYNC_PASSWORD=%s'%get_rsync_pw()]
|
rs = ['export RSYNC_PASSWORD=%s'%get_rsync_pw()]
|
||||||
ans = '\n'.join(self.BUILD_PREFIX + rs)+'\n\n'
|
ans = '\n'.join(self.BUILD_PREFIX + rs)+'\n\n'
|
||||||
@ -133,9 +131,9 @@ class VMInstaller(Command):
|
|||||||
while 'vmblock' in open('/proc/modules').read():
|
while 'vmblock' in open('/proc/modules').read():
|
||||||
subprocess.check_call('sudo rmmod -f vmblock')
|
subprocess.check_call('sudo rmmod -f vmblock')
|
||||||
|
|
||||||
|
|
||||||
def run_vm(self):
|
def run_vm(self):
|
||||||
if is_vm_running(self.VM_CHECK or self.VM_NAME): return
|
if is_vm_running(self.VM_CHECK or self.VM_NAME):
|
||||||
|
return
|
||||||
self.__p = subprocess.Popen([self.vm])
|
self.__p = subprocess.Popen([self.vm])
|
||||||
|
|
||||||
def start_vm(self, sleep=75):
|
def start_vm(self, sleep=75):
|
||||||
@ -182,3 +180,4 @@ class VMInstaller(Command):
|
|||||||
installer = self.installer()
|
installer = self.installer()
|
||||||
if os.path.exists(installer):
|
if os.path.exists(installer):
|
||||||
os.remove(installer)
|
os.remove(installer)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user