mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
90e9b071d8
commit
7bae01ec5e
@ -53,6 +53,7 @@ path=(~/bin "$path[@]")
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import sys, os, shutil, platform, subprocess, stat, py_compile, glob, textwrap, tarfile
|
import sys, os, shutil, platform, subprocess, stat, py_compile, glob, textwrap, tarfile
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
from setup import Command, modules, basenames, functions, __version__, __appname__
|
from setup import Command, modules, basenames, functions, __version__, __appname__
|
||||||
from setup.build_environment import QT_DLLS, QT_PLUGINS, qt, PYQT_MODULES, sw as SW
|
from setup.build_environment import QT_DLLS, QT_PLUGINS, qt, PYQT_MODULES, sw as SW
|
||||||
@ -87,12 +88,14 @@ def binary_includes():
|
|||||||
|
|
||||||
arch = 'x86_64' if is64bit else 'i686'
|
arch = 'x86_64' if is64bit else 'i686'
|
||||||
|
|
||||||
def ignore_in_lib(base, items):
|
def ignore_in_lib(base, items, ignored_dirs=None):
|
||||||
ans = []
|
ans = []
|
||||||
|
if ignored_dirs is None:
|
||||||
|
ignored_dirs = {'.svn', '.bzr', '.git', 'test', 'tests', 'testing'}
|
||||||
for name in items:
|
for name in items:
|
||||||
path = os.path.join(base, name)
|
path = os.path.join(base, name)
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
if name in {'.svn', '.bzr', '.git', 'test', 'tests', 'testing'} or not os.path.exists(j(path, '__init__.py')):
|
if name in ignored_dirs or not os.path.exists(j(path, '__init__.py')):
|
||||||
if name != 'plugins':
|
if name != 'plugins':
|
||||||
ans.append(name)
|
ans.append(name)
|
||||||
else:
|
else:
|
||||||
@ -210,7 +213,7 @@ class LinuxFreeze(Command):
|
|||||||
for x in os.listdir(self.SRC):
|
for x in os.listdir(self.SRC):
|
||||||
c = self.j(self.SRC, x)
|
c = self.j(self.SRC, x)
|
||||||
if os.path.exists(self.j(c, '__init__.py')):
|
if os.path.exists(self.j(c, '__init__.py')):
|
||||||
shutil.copytree(c, self.j(dest, x), ignore=ignore_in_lib)
|
shutil.copytree(c, self.j(dest, x), ignore=partial(ignore_in_lib, ignored_dirs={}))
|
||||||
elif os.path.isfile(c):
|
elif os.path.isfile(c):
|
||||||
shutil.copy2(c, self.j(dest, x))
|
shutil.copy2(c, self.j(dest, x))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user