Skip to content

Commit

Permalink
Removed versioned Python interpreter from packages in /usr/bin and /u…
Browse files Browse the repository at this point in the history
…sr/lib.

Bump version to 0.2.a1



git-svn-id: https://svn.stdeb.python-hosting.com/trunk@49 30fc0ef2-3a16-0410-b950-f670368b4cad
  • Loading branch information
AndrewStraw authored and AndrewStraw committed Mar 29, 2007
1 parent 1962ac9 commit c76aff2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.txt
@@ -1,3 +1,8 @@
2007-03-28 Removed versioned Python interpreter from packages in
/usr/bin and /usr/lib. Bump version to 0.2.a1

2007-03-15 pycentral support enabled by default

2007-02-04 fix for cases in which setup.py wants __file__ variable

2006-09-07 added --patch-posix to support posix-mode patches
Expand Down
2 changes: 1 addition & 1 deletion stdeb/__init__.py
@@ -1,3 +1,3 @@
# setuptools is required for distutils.commands plugin we use
import setuptools
__version__ = '0.1'
__version__ = '0.2.a1'
26 changes: 25 additions & 1 deletion stdeb/util.py
Expand Up @@ -5,6 +5,7 @@
import ConfigParser
import subprocess
import tempfile
import stdeb

__all__ = ['DebianInfo','build_dsc','expand_tarball','expand_zip',
'stdeb_cmdline_opts','stdeb_cmd_bool_opts','recursive_hardlink',
Expand Down Expand Up @@ -299,6 +300,7 @@ def __init__(self,
cfg.read(cfg_files)

debinfo = self # convert old code...
debinfo.stdeb_version = stdeb.__version__
debinfo.module_name = module_name
debinfo.source = parse_val(cfg,module_name,'Source')
debinfo.package = parse_val(cfg,module_name,'Package')
Expand Down Expand Up @@ -369,6 +371,7 @@ def __init__(self,
else:
debinfo.dh_desktop_line = ''

debinfo.fix_scripts = RULES_FIX_SCRIPTS%debinfo.__dict__

# E. any mime .desktop files
debinfo.copy_files_lines = ''
Expand Down Expand Up @@ -659,7 +662,8 @@ def build_dsc(debinfo,dist_dir,repackaged_dirname,
RULES_MAIN = """\
#!/usr/bin/make -f
# automatically generated by stdeb
# This file was automatically generated by stdeb %(stdeb_version)s at
# %(date822)s
PACKAGE_NAME=%(package)s
MODULE_NAME=%(module_name)s
Expand Down Expand Up @@ -715,6 +719,7 @@ def build_dsc(debinfo,dist_dir,repackaged_dirname,
dh_strip -i%(copy_files_lines)s%(dh_desktop_line)s
dh_compress -i -X.py
dh_fixperms -i
%(fix_scripts)s
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
Expand All @@ -736,6 +741,7 @@ def build_dsc(debinfo,dist_dir,repackaged_dirname,
dh_strip -a%(copy_files_lines)s%(dh_desktop_line)s
dh_compress -a -X.py
dh_fixperms -a
%(fix_scripts)s
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
Expand All @@ -744,3 +750,21 @@ def build_dsc(debinfo,dist_dir,repackaged_dirname,
binary: binary-indep binary-arch
"""

RULES_FIX_SCRIPTS = r""" : # Replace all '#!' calls to python with $(PYTHON)
: # and make them executable
for i in \
`find debian/%(package)s/usr/bin -type f` \
`find debian/%(package)s/usr/lib -type f`; \
do \
case "$$i" in *-[0-9].[0-9]) continue; esac; \
sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
$$i > $$i.temp; \
if cmp --quiet $$i $$i.temp; then \
rm -f $$i.temp; \
else \
mv -f $$i.temp $$i; \
chmod 755 $$i; \
echo "fixed interpreter: $$i"; \
fi; \
done"""

0 comments on commit c76aff2

Please sign in to comment.