Skip to content

Commit

Permalink
move profiles to separate directory
Browse files Browse the repository at this point in the history
this way profiles will be able to ship custom files in debian directory
  • Loading branch information
p1otr committed Sep 20, 2015
1 parent 1de3bcd commit 6c6f95e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions pypi2deb/__init__.py
Expand Up @@ -26,6 +26,8 @@
abspath(join(dirname(__file__), '..', 'templates')))
OVERRIDES_PATH = environ.get('PYPI2DEB_OVERRIDES_PATH',
abspath(join(dirname(__file__), '..', 'overrides')))
PROFILES_PATH = environ.get('PYPI2DEB_PROFILES_PATH',
abspath(join(dirname(__file__), '..', 'profiles')))
VERSION = '0.20150816'
# Add path to dh-python's private library
# (yeah, it's not stable enough to make it public one, fortunatly
Expand Down
6 changes: 4 additions & 2 deletions pypi2deb/debianize.py
Expand Up @@ -25,7 +25,7 @@
from os.path import exists, join
from shutil import copy

from pypi2deb import VERSION, TEMPLATES_PATH, OVERRIDES_PATH
from pypi2deb import VERSION, OVERRIDES_PATH, PROFILES_PATH, TEMPLATES_PATH
from pypi2deb.tools import execute

from jinja2 import Environment, FileSystemLoader
Expand Down Expand Up @@ -72,7 +72,7 @@ def debianize(dpath, ctx, profile=None):
with open(profile) as fp:
ctx.update(load(fp))
else:
profile_fpath = join(OVERRIDES_PATH, profile + '.json')
profile_fpath = join(PROFILES_PATH, profile, 'ctx.json')
if exists(profile_fpath):
with open(profile_fpath) as fp:
ctx.update(load(fp))
Expand All @@ -92,6 +92,8 @@ def debianize(dpath, ctx, profile=None):
override_dpath = join(override_path, 'debian')
_copy_static_files(override_dpath, debian_dir)
_copy_static_files(join(TEMPLATES_PATH, 'debian'), debian_dir)
if profile:
_copy_static_files(join(PROFILES_PATH, profile, 'debian'), debian_dir)

env = Environment(loader=FileSystemLoader([dpath, override_path,
TEMPLATES_PATH]))
Expand Down

0 comments on commit 6c6f95e

Please sign in to comment.