[Python-checkins] python/nondist/sandbox/Lib bdist_dpkg.py,1.3,1.4

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Thu Sep 25 08:34:33 EDT 2003


Update of /cvsroot/python/python/nondist/sandbox/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv26426
Modified Files:
	bdist_dpkg.py 
Log Message:
Patch from Mikhail Sobolev: Create debian/copyright file; add gain-root-command (should it default to fakeroot?) and do-not-build (odd name; is dry-run appropriate?) options
Index: bdist_dpkg.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/Lib/bdist_dpkg.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** bdist_dpkg.py	23 Sep 2003 13:56:57 -0000	1.3
--- bdist_dpkg.py	25 Sep 2003 12:34:30 -0000	1.4
***************
*** 1,5 ****
 """distutils.command.bdist_dpkg
 
! Implements the Distutils 'bdist_dpkg' command (create a Debian packaging).
 """
 
--- 1,5 ----
 """distutils.command.bdist_dpkg
 
! Implements the Distutils 'bdist_dpkg' command (create a Debian package).
 """
 
***************
*** 18,21 ****
--- 18,22 ----
 from distutils import log
 
+ import time
 
 MARKER_STRING = "GENERATED BY BDIST_DPKG"
***************
*** 26,35 ****
 
 user_options = [
 ]
 
! boolean_options = []
 
 def initialize_options (self):
! pass
 # initialize_options()
 
--- 27,41 ----
 
 user_options = [
+ ('gain-root-command=', 'r', 'command that allows to gain root rights'),
+ # XXX this option name is a bit odd; what would be a better one?
+ ('do-not-build', None, 'do not build the package, just create the debian/ stuff')
 ]
 
! boolean_options = [ 'do-not-build' ]
 
 def initialize_options (self):
! self.gain_root_command = None
! self.do_not_build = None
! 
 # initialize_options()
 
***************
*** 50,56 ****
 self._create_dpkg_files()
 
! # build package
! log.info("building DPKG")
! self.spawn(["dpkg-buildpackage", "-rfakeroot"])
 
 # run()
--- 56,69 ----
 self._create_dpkg_files()
 
! if not self.do_not_build:
! # build package
! log.info("building DPKG")
! 
! build_command = [ "dpkg-buildpackage" ]
! 
! if self.gain_root_command is not None:
! build_command.append ('-r%s' % self.gain_root_command)
! 
! self.spawn(build_command)
 
 # run()
***************
*** 79,83 ****
 # I'm running out of the CVS trunk, but don't have it
 # installed as python2.4.
! ##pyversion = '2.2'
 package_name = 'python%s-%s' % (pyversion, dist.get_name().lower())
 d = {'name':dist.get_name(),
--- 92,96 ----
 # I'm running out of the CVS trunk, but don't have it
 # installed as python2.4.
! pyversion = '2.2'
 package_name = 'python%s-%s' % (pyversion, dist.get_name().lower())
 d = {'name':dist.get_name(),
***************
*** 85,89 ****
--- 98,109 ----
 'pyversion': pyversion,
 'dirlist':dirlist,
+ 'license':dist.get_license(),
 'marker':MARKER_STRING,
+ 'maintainer':dist.get_maintainer(),
+ 'maintainer_email':dist.get_maintainer_email(),
+ 'now':time.strftime ("%a, %d %b %Y %H:%M:%S %z"),
+ 'author':dist.get_author(),
+ 'author_email':dist.get_author_email(),
+ 'url':dist.get_url()
 }
 if not self._is_user_file('changelog') or True:
***************
*** 94,100 ****
 * Dummy changelog line
 
! -- %s <%s> 2003年6月11日 14:44:11 -0400
 """ % (package_name, dist.get_version(), 1, # XXX build version?
! dist.get_maintainer(), dist.get_maintainer_email()))
 output.close()
 
--- 114,120 ----
 * Dummy changelog line
 
! -- %s <%s> %s
 """ % (package_name, dist.get_version(), 1, # XXX build version?
! dist.get_maintainer(), dist.get_maintainer_email(), d['now']))
 output.close()
 
***************
*** 147,150 ****
--- 167,176 ----
 os.chmod('debian/rules', 0755)
 
+ if not self._is_user_file('copyright'):
+ log.info('writing copyright file')
+ output = self._write_file('copyright')
+ output.write(COPYRIGHT_FILE % d)
+ output.close()
+ 
 def _write_file (self, filename):
 path = os.path.join('debian', filename)
***************
*** 292,293 ****
--- 318,333 ----
 .PHONY: build clean binary-indep binary install
 """
+ 
+ COPYRIGHT_FILE = '''This package was debianized by
+ %(maintainer)s <%(maintainer_email)s> on %(now)s
+ 
+ It was downloaded from
+ 
+ %(url)s
+ 
+ Upstream Author: %(author)s <%(author_email)s>
+ 
+ Copyright:
+ 
+ %(license)s
+ '''


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /