From 866bbaec9115183a823cf2379faafc78a8ea392a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 May 2013 16:49:21 +0530 Subject: [PATCH] Switch to using git to generate source tarballs --- setup/install.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/setup/install.py b/setup/install.py index 0567cb1afe..be786f326c 100644 --- a/setup/install.py +++ b/setup/install.py @@ -54,7 +54,7 @@ class Develop(Command): via the --prefix option. ''') short_description = 'Setup a development environment for calibre' - MODE = 0755 + MODE = 0o755 sub_commands = ['build', 'resources', 'iso639', 'gui',] @@ -66,7 +66,6 @@ class Develop(Command): help='Don\'t run post install actions like creating MAN pages, setting'+ ' up desktop integration and so on') - def add_options(self, parser): parser.add_option('--prefix', help='Binaries will be installed in /bin') @@ -115,7 +114,6 @@ class Develop(Command): self.info('\tLIB:', self.staging_libdir) self.info('\tSHARE:', self.staging_sharedir) - def pre_sub_commands(self, opts): if not (islinux or isbsd): self.info('\nSetting up a source based development environment is only ' @@ -287,12 +285,14 @@ class Sdist(Command): if not self.e(self.d(self.DEST)): os.makedirs(self.d(self.DEST)) tdir = tempfile.mkdtemp() - tdir = self.j(tdir, 'calibre') atexit.register(shutil.rmtree, tdir) - self.info('\tRunning bzr export...') - subprocess.check_call(['bzr', 'export', '--format', 'dir', tdir]) - for x in open('.bzrignore').readlines(): - if not x.startswith('resources/'): continue + tdir = self.j(tdir, 'calibre') + self.info('\tRunning git export...') + os.mkdir(tdir) + subprocess.check_call('git archive master | tar -x -C ' + tdir, shell=True) + for x in open('.gitignore').readlines(): + if not x.startswith('resources/'): + continue p = x.strip().replace('/', os.sep) for p in glob.glob(p): d = self.j(tdir, os.path.dirname(p)) @@ -304,7 +304,8 @@ class Sdist(Command): shutil.copy2(p, d) for x in os.walk(os.path.join(self.SRC, 'calibre')): for f in x[-1]: - if not f.endswith('_ui.py'): continue + if not f.endswith('_ui.py'): + continue f = os.path.join(x[0], f) f = os.path.relpath(f) dest = os.path.join(tdir, self.d(f)) @@ -319,3 +320,4 @@ class Sdist(Command): os.remove(self.DEST) +