Permalink
Browse files

bugfixes on refactoring to support calling from scripts

git-svn-id: https://svn.stdeb.python-hosting.com/trunk@7 30fc0ef2-3a16-0410-b950-f670368b4cad
  • Loading branch information...
1 parent 41fa9a3 commit f4fa8f3121422d3a543450e368e5117114bd7106 AndrewStraw committed Jun 19, 2006
Showing with 29 additions and 3 deletions.
  1. +2 −0 CHANGELOG.txt
  2. +11 −0 README.txt
  3. +1 −1 stdeb/py2dsc.py
  4. +3 −1 stdeb/stdeb_run_setup.py
  5. +12 −1 stdeb/util.py
View
@@ -1,3 +1,5 @@
+2006-06-18 Refactored to support calling from scripts.
+
===========================================================
2006-06-14 Release 0.0.1, svn version 3
View
@@ -105,6 +105,17 @@ Here's an example .cfg file for my build of numpy_::
.. _numpy: http://scipy.org/NumPy
+Using stdeb on stdeb
+--------------------
+
+There is a chicken-and-egg problem when trying to make a Debian
+package of stdeb with stdeb. Here's a recipe to avoid it::
+
+ # in the stdeb distribution directory (with setup.py)
+ python setup.py sdist
+ python setup.py build
+ PYTHONPATH="build/lib" python stdeb/py2dsc.py dist/stdeb-0.0.2.tar.gz
+
TODO
----
View
@@ -84,7 +84,7 @@ def runit():
attr = parser.get_attr_name(long)[:-1]
if hasattr(optobj,attr):
val = getattr(optobj,attr)
- extra_args.append('--%s%s'%(long,repr(val)))
+ extra_args.append('--'+long+str(val))
#args = [sys.executable,'setup.py','--dist-dir=%s'%abs_dist_dir]+extra_args
args = [sys.executable,'-c',"import stdeb, sys; f='setup.py'; sys.argv[0]=f; execfile(f)",
@@ -5,13 +5,15 @@
"""
-import sys
+import sys, os
import stdeb
def main():
f='setup.py'
sys.argv[0] = f
sys.argv.insert(1,'sdist_dsc')
+ this_dir = os.path.abspath(os.curdir)
+ sys.path.insert(0,this_dir) # setuptools-installed scripts don't have this
execfile(f,{'__name__':'__main__'})
if __name__=='__main__':
View
@@ -30,6 +30,12 @@ def debianize_name(name):
name = name.lower()
return name
+def debianize_version(name):
+ "make name acceptable as a Debian package name"
+ name = name.replace('_','-')
+ name = name.lower()
+ return name
+
def get_date_822():
"""return output of 822-date command"""
args = ['/usr/bin/822-date']
@@ -164,14 +170,18 @@ def __init__(self,
)
cfg = ConfigParser.SafeConfigParser(cfg_defaults)
+ cfg.read(cfg_files)
debinfo = self # convert old code...
debinfo.module_name = module_name
debinfo.source = parse_val(cfg,module_name,'Source')
debinfo.package = parse_val(cfg,module_name,'Package')
debinfo.pure_upstream_version = upstream_version
upstream_version_prefix = parse_val(cfg,module_name,'Upstream-Version-Prefix')
- debinfo.upstream_version = upstream_version_prefix+debinfo.pure_upstream_version
+ upstream_version_suffix = parse_val(cfg,module_name,'Upstream-Version-Suffix')
+ debinfo.upstream_version = (upstream_version_prefix+
+ debianize_version(debinfo.pure_upstream_version)+
+ upstream_version_suffix)
debinfo.packaging_version = parse_val(cfg,module_name,'Debian-Version')
debinfo.full_version = '%s-%s'%(debinfo.upstream_version,
debinfo.packaging_version)
@@ -276,6 +286,7 @@ def _make_cfg_defaults(self,
defaults['Debian-Version']='1'
defaults['Upstream-Version-Prefix']=''
+ defaults['Upstream-Version-Suffix']=''
defaults['Maintainer'] = default_maintainer

0 comments on commit f4fa8f3

Please sign in to comment.