aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gmail.com>2015-12-04 02:38:34 -0500
committerTim Harder <radhermit@gmail.com>2015-12-04 02:44:41 -0500
commitf12cfe655fccb05215e777bdc604021ca8cb251c (patch)
tree1fd43fab677e5d3c8d3a3a24fbd062064d8e69e8
parentpquery: minor whitespace consistency (diff)
downloadpkgcore-f12cfe655fccb05215e777bdc604021ca8cb251c.tar.gz
pkgcore-f12cfe655fccb05215e777bdc604021ca8cb251c.tar.bz2
pkgcore-f12cfe655fccb05215e777bdc604021ca8cb251c.zip
update pkgdist
-rw-r--r--pkgdist.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgdist.py b/pkgdist.py
index 4e22714e..b5398e88 100644
--- a/pkgdist.py
+++ b/pkgdist.py
@@ -72,6 +72,11 @@ class sdist(dst_sdist.sdist):
self.build_docs = False
def generate_verinfo(self, base_dir):
+ """Generate project version module.
+
+ This is used by the --version option in interactive programs among
+ other things.
+ """
from snakeoil.version import get_git_version
log.info('generating _verinfo')
data = get_git_version(base_dir)
@@ -303,19 +308,22 @@ class build_scripts(dst_build_scripts.build_scripts):
"""Create and build (copy and modify #! line) the wrapper scripts."""
- def run(self):
+ def finalize_options(self):
+ dst_build_scripts.build_scripts.finalize_options(self)
script_dir = os.path.join(
os.path.dirname(self.build_dir), '.generated_scripts')
self.mkpath(script_dir)
self.scripts = [os.path.join(script_dir, x) for x in os.listdir('bin')]
+
+ def run(self):
for script in self.scripts:
with open(script, 'w') as f:
f.write(textwrap.dedent("""\
- #!/usr/bin/env python
+ #!%s
from os.path import basename
from %s import scripts
scripts.main(basename(__file__))
- """ % project))
+ """ % (sys.executable, project)))
self.copy_scripts()