Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 36 lines (29 sloc) 0.989 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#!/usr/bin/env python
import sys
import shlex
import logging
import commands
from tarfile import TarFile
from optparse import OptionParser

def main(args=None):
    parser = OptionParser()
    parser.add_option('--version', default=None)
    opts, args = parser.parse_args(args)

    logging.basicConfig(level=logging.INFO,
                        format='[%(levelname)s] %(message)s')

    if not opts.version:
        version = commands.getoutput('python setup.py --version')
    else:
        version = opts.version

    name = 'holland-%s' % version

    status, output = commands.getstatusoutput('git archive --prefix=%s/ HEAD '
                                              '| gzip --fast > %s.tar.gz' %
                                              (name, name))
    if status != 0:
        logging.error("%s failed.", sys.argv[0])
        return 1
    else:
        logging.info("created archive %s.tar.gz", name)
        return 0


if __name__ == '__main__':
    sys.exit(main())
Something went wrong with that request. Please try again.