Fixed paths to prefix and man page.

This commit is contained in:
Elf M. Sternberg 2016-10-03 08:24:50 -07:00
parent dd4aeb1cad
commit aa4b5aa978
2 changed files with 3 additions and 16 deletions

View File

@ -9,3 +9,4 @@ recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-include docs *.rst conf.py Makefile make.bat *.jpg *.png *.gif
include docs/_build/man/git-lint.1

View File

@ -5,27 +5,15 @@ import argparse
import os.path
def _resolve_prefix(prefix, type):
osx_system_prefix = r'^/System/Library/Frameworks/Python.framework/Versions'
matches = {'man': [(r'^/usr$', '/usr/share'),
(r'^/usr/local$', '/usr/local/share'),
(osx_system_prefix, '/usr/share')]}
match = [i[1] for i in matches.get(type, []) if re.match(i[0], prefix)]
if not len(match):
raise ValueError("not supported type: {}".format(type))
return match.pop()
def get_data_files(prefix):
return [(os.path.join(_resolve_prefix(prefix, 'man'), 'man/man1'), ['docs/_build/man/git-lint.1'])]
return [(os.path.join(prefix, 'share/man/man1'), ['docs/_build/man/git-lint.1'])]
parser = argparse.ArgumentParser()
parser.add_argument('--prefix', default='',
help='prefix to install data files')
opts, _ = parser.parse_known_args(sys.argv)
prefix = opts.prefix or '/usr'
prefix = opts.prefix or sys.prefix or '/usr'
try:
from setuptools import setup
@ -47,8 +35,6 @@ test_requirements = [
# TODO: put package test requirements here
]
print get_data_files(prefix)
setup(
name='git_linter',
version='0.0.4',