Merge lp://staging/~johnf-inodes/autoppa/johnf into lp://staging/autoppa

Proposed by John Ferlito
Status: Superseded
Proposed branch: lp://staging/~johnf-inodes/autoppa/johnf
Merge into: lp://staging/autoppa
Diff against target: 396 lines
9 files modified
.bzrignore (+1/-0)
README (+6/-6)
autoppa/target.py (+59/-72)
debian/changelog (+16/-0)
debian/control (+7/-5)
debian/control.autoppa (+8/-6)
debian/pycompat (+1/-0)
debian/rules (+1/-1)
debian/watch (+2/-0)
To merge this branch: bzr merge lp://staging/~johnf-inodes/autoppa/johnf
Reviewer Review Type Date Requested Status
AutoPPA Team Pending
Review via email: mp+12973@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2009-10-17.

To post a comment you must log in.
Revision history for this message
John Ferlito (johnf-inodes) wrote :

Hi,

This branch has a couple of patches in it. Let me know if you need me to break them up.

r29 - Use sensible-editor as a fallback for EDITOR and VISUAL
r30 - Be conformant with PPA policy and use ~hardy instead of 8.04
r31..33 Use bzrlib and builddeb builds off jelmers branch
r34..39 Improve debian packing

Cheers,
John

40. By John Ferlito

make sure source is included in the .changes we generate

Unmerged revisions

40. By John Ferlito

make sure source is included in the .changes we generate

39. By John Ferlito

Improve description

38. By John Ferlito

* debian/control
* debian/rules
  + Install into /usr instead of /usr/local

37. By John Ferlito

[John Ferlito]
* debian/rules
  + Added ${misc:Depends}
  + Added version to debhelper
  + Bumped standards to 3.8.3
* Added debian/pycompat

36. By John Ferlito

Added debian/watch file.

35. By John Ferlito

Add python dependencies to debian/control

34. By John Ferlito

only commit changelog and remove files correctly

33. By John Ferlito

I branch from debian when using autoppa. So I do something like

    bzr mv rules rules.autoppa

So just before we bzr-builddeb we need to

    rm rules
    bzr mv rules.autoppa rules

to ensure we have no autoppa file in the diff and the permissions are
correct on the file.

32. By John Ferlito

Fix for new cmd_buildeb API

31. By Jelmer Vernooij

Manually merge in Jelmer's build-deb branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-09-20 18:42:28 +0000
+++ .bzrignore 2009-10-17 01:06:09 +0000
@@ -3,3 +3,4 @@
3apidocs3apidocs
4dist4dist
5MANIFEST5MANIFEST
6./pipes
67
=== modified file 'README'
--- README 2009-09-21 03:13:54 +0000
+++ README 2009-10-17 01:06:09 +0000
@@ -104,17 +104,17 @@
104---------------104---------------
105105
106AutoPPA automatically inserts a release version into package version106AutoPPA automatically inserts a release version into package version
107numbers. The conventions specified by Ubuntu's SRU [1] policy107numbers. The conventions specified by the PPA Build manual [1]
108should be followed when generating version numbers. In the above108should be followed when generating version numbers. In the above
109example, the smart-0.51-landscape12 would build packages with the109example, the smart-0.51-landscape12 would build packages with the
110following versions:110following versions:
111111
1120.51-landscape12.6.061120.51-landscape12~dapper
1130.51-landscape12.6.101130.51-landscape12~edgy
1140.51-landscape12.7.041140.51-landscape12~feisty
1150.51-landscape12.7.101150.51-landscape12~gutsy
116116
117[1] https://wiki.ubuntu.com/MOTU/SRU117[1] https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage#versioning
118118
119119
120Special file processing120Special file processing
121121
=== modified file 'autoppa/target.py'
--- autoppa/target.py 2009-09-21 01:35:24 +0000
+++ autoppa/target.py 2009-10-17 01:06:09 +0000
@@ -1,6 +1,7 @@
1# Copyright (C) 2007-2009 Canonical1# Copyright (C) 2007-2009 Canonical
2#2#
3# Written by Jamshed Kakar <jkakar@kakar.ca>3# Written by Jamshed Kakar <jkakar@kakar.ca>
4# Jelmer Vernooij <jelmer@ubuntu.com>
4#5#
5# This file is part of AutoPPA.6# This file is part of AutoPPA.
6#7#
@@ -20,9 +21,14 @@
20from datetime import datetime21from datetime import datetime
21import tempfile22import tempfile
22import os23import os
24import shutil
2325
24import pexpect26import pexpect
2527
28from bzrlib import osutils
29from bzrlib.branch import Branch
30from bzrlib.plugins.builddeb.cmds import cmd_builddeb
31
26from autoppa.errors import ChangelogError, EditorError32from autoppa.errors import ChangelogError, EditorError
27from autoppa.file import ReleaseSpecificInclude, VersionReplacement33from autoppa.file import ReleaseSpecificInclude, VersionReplacement
28from autoppa.path import match_path_except, match_path_if34from autoppa.path import match_path_except, match_path_if
@@ -73,6 +79,7 @@
73 self.system = system79 self.system = system
74 self.version_replacement = True80 self.version_replacement = True
75 self._prepared_files = set()81 self._prepared_files = set()
82 self._branch = None
7683
77 def _log_info(self, message):84 def _log_info(self, message):
78 """Write C{message} the log, if one is present."""85 """Write C{message} the log, if one is present."""
@@ -99,6 +106,8 @@
99 editor = os.environ["VISUAL"]106 editor = os.environ["VISUAL"]
100 elif "EDITOR" in os.environ:107 elif "EDITOR" in os.environ:
101 editor = os.environ["EDITOR"]108 editor = os.environ["EDITOR"]
109 elif os.path.exists("/usr/bin/sensible-editor"):
110 editor = "/usr/bin/sensible-editor"
102 else:111 else:
103 raise EditorError("The VISUAL or EDITOR environment variable must "112 raise EditorError("The VISUAL or EDITOR environment variable must "
104 "be set to prepare the changelog.")113 "be set to prepare the changelog.")
@@ -152,15 +161,18 @@
152 def prepare_working_tree(self):161 def prepare_working_tree(self):
153 """Prepare a working tree for the new release."""162 """Prepare a working tree for the new release."""
154 self._log_info("== Preparing working tree for %s ==" % self.name)163 self._log_info("== Preparing working tree for %s ==" % self.name)
155 self.expect.run("mkdir -p %s" % self.repository, logfile=self.log_file)164 tree_path = os.path.join(self.repository, self._get_working_tree())
156 self.working_tree = "%s/%s" % (self.repository,165 to_dir = self._get_branch().bzrdir.sprout(tree_path)
157 self._get_working_tree())166 self.working_tree = to_dir.open_workingtree()
158 self.expect.run("bzr branch %s %s" % (self.branch, self.working_tree),
159 logfile=self.log_file, timeout=None)
160167
161 def _get_working_tree(self):168 def _get_working_tree(self):
162 return "%s_%s" % (self.name, self.version)169 return "%s_%s" % (self.name, self.version)
163170
171 def _get_branch(self):
172 if self._branch is None:
173 self._branch = Branch.open(self.branch)
174 return self._branch
175
164 def prepare_custom_files(self, release, datetime_factory=None):176 def prepare_custom_files(self, release, datetime_factory=None):
165 """Prepare the release-specific files for the new release.177 """Prepare the release-specific files for the new release.
166178
@@ -196,26 +208,35 @@
196208
197 def _prepare_custom_autoppa_files(self, release):209 def _prepare_custom_autoppa_files(self, release):
198 include = ReleaseSpecificInclude(release)210 include = ReleaseSpecificInclude(release)
199 for path in match_path_if(self.working_tree, ".*\.autoppa"):211 for path in match_path_if(self.working_tree.basedir, ".*\.autoppa"):
200 start = len(self.working_tree)+1212 start = len(self.working_tree.basedir)+1
201 end = -(len(".autoppa"))213 end = -(len(".autoppa"))
202 self._prepared_files.add(path[start:end])214 self._prepared_files.add(path[start:end])
215
216 # Read in the template
217 file = open(path, "r")
218 try:
219 lines = [line for line in file]
220 finally:
221 file.close()
222
223 # Sometimes we might have a rules.autoppa and no rules file.
224 # We bzr mv .autoppa in place so as to keep perms right
225 self.working_tree.remove(path[:-len(".autoppa")])
226 self.working_tree.rename_one(path[start:end] + '.autoppa', path[start:end])
227
203 file = open(path[:-len(".autoppa")], "w")228 file = open(path[:-len(".autoppa")], "w")
204 try:229 try:
205 template = open(path, "r")230 for i, line in enumerate(lines):
206 try:231 line = include.process(line, path, i+1)
207 for i, line in enumerate(template):232 if line is not None:
208 line = include.process(line, path, i+1)233 file.write(line)
209 if line is not None:
210 file.write(line)
211 finally:
212 template.close()
213 finally:234 finally:
214 file.close()235 file.close()
215236
216 def _prepare_custom_autoppa_version(self, release):237 def _prepare_custom_autoppa_version(self, release):
217 version = VersionReplacement(self._get_version(release))238 version = VersionReplacement(self._get_version(release))
218 for path in match_path_except(self.working_tree, ".*\.autoppa"):239 for path in match_path_except(self.working_tree.basedir, ".*\.autoppa"):
219 start = len(self.working_tree)+1240 start = len(self.working_tree)+1
220 self._prepared_files.add(path[start:])241 self._prepared_files.add(path[start:])
221 file = open(path, "r")242 file = open(path, "r")
@@ -232,20 +253,13 @@
232 finally:253 finally:
233 file.close()254 file.close()
234255
235 def _get_release_number(self, release_name):
236 numbers = {"dapper": "6.06", "edgy": "6.10", "feisty": "7.04",
237 "gutsy": "7.10", "hardy": "8.04", "intrepid": "8.10",
238 "jaunty": "9.04", "karmic": "9.10"}
239 return numbers[release_name]
240
241 def _get_version(self, release):256 def _get_version(self, release):
242 parts = self.version.split("-", 1)257 parts = self.version.split("-", 1)
243 return "%s-%s.%s" % (parts[0], parts[1],258 return "%s-%s~%s" % (parts[0], parts[1], release)
244 self._get_release_number(release))
245259
246 def _prepare_custom_changelog(self, release, datetime_factory):260 def _prepare_custom_changelog(self, release, datetime_factory):
247 try:261 try:
248 path = os.path.join(self.working_tree, "debian/changelog")262 path = os.path.join(self.working_tree.basedir, "debian/changelog")
249 file = open(path, "r")263 file = open(path, "r")
250 try:264 try:
251 old_changelog = file.read()265 old_changelog = file.read()
@@ -279,13 +293,8 @@
279 """Prepare signed source files that can be uploaded to a PPA."""293 """Prepare signed source files that can be uploaded to a PPA."""
280 self._log_info("== Preparing signed sources for %s on %s =="294 self._log_info("== Preparing signed sources for %s on %s =="
281 % (self.name, release))295 % (self.name, release))
282 working_directory = os.getcwd()296 self._log_info(self.working_tree.basedir)
283 os.chdir(self.working_tree)297 cmd_builddeb().run([self.working_tree.basedir], ['-sa'], source=True)
284 try:
285 self.expect.run("debuild --no-tgz-check -S", logfile=self.log_file,
286 timeout=None)
287 finally:
288 os.chdir(working_directory)
289298
290 def commit_changes(self, release):299 def commit_changes(self, release):
291 """Commit changes made to the working tree for C{release}."""300 """Commit changes made to the working tree for C{release}."""
@@ -294,19 +303,15 @@
294 % (self.name, release))303 % (self.name, release))
295 message = "Updated files for %s_%s." % (self.name,304 message = "Updated files for %s_%s." % (self.name,
296 self._get_version(release))305 self._get_version(release))
297 working_directory = os.getcwd()306 # We only want the changlog commited
298 os.chdir(self.working_tree)307 self.working_tree.revert(self._prepared_files)
299 try:308 self.working_tree.commit(message=message)
300 self.expect.run('bzr commit -m "%s"' % message,
301 logfile=self.log_file, timeout=None)
302 finally:
303 os.chdir(working_directory)
304309
305 def upload_signed_sources(self, release):310 def upload_signed_sources(self, release):
306 """Upload signed sources to PPA for C{release}."""311 """Upload signed sources to PPA for C{release}."""
307 self._log_info("== Uploading signed sources for %s on %s =="312 self._log_info("== Uploading signed sources for %s on %s =="
308 % (self.name, release))313 % (self.name, release))
309 path = "/".join(self.working_tree.split("/")[:-1])314 path = "/".join(self.working_tree.basedir.split("/")[:-1])
310 filename = "%s_%s_source.changes" % (self.name,315 filename = "%s_%s_source.changes" % (self.name,
311 self._get_version(release))316 self._get_version(release))
312317
@@ -319,61 +324,43 @@
319 finally:324 finally:
320 os.chdir(working_directory)325 os.chdir(working_directory)
321326
322 def merge_changes(self, filename=None):327 def merge_changes(self):
323 """Merge changes from the working tree back into the source branch.328 """Merge changes from the working tree back into the source branch.
324329
325 @param filename: Optionally, the temporary file the merge330 @param filename: Optionally, the temporary file the merge
326 commit message is written to.331 commit message is written to.
327 """332 """
328 self._log_info("== Merging changes for %s ==" % self.name)333 self._log_info("== Merging changes for %s ==" % self.name)
329 if not filename:
330 filename = tempfile.mktemp()
331 changelog = """\334 changelog = """\
332Merged %s [a=autoppa].335Merged %s [a=autoppa].
333336
334%s337%s
335""" % (self._get_working_tree(), self.changelog)338""" % (self._get_working_tree(), self.changelog)
336 file = open(filename, "w")339 # TODO: This merge doesn't make any sense...
337 try:340 branch_wt = self._get_branch().bzrdir.open_workingtree()
338 file.write(changelog)341 branch_wt.add_pending_merge(self.working_tree.last_revision())
339 finally:342 branch_wt.commit(message=changelog, specific_files=[],
340 file.close()343 allow_pointless=True)
341
342 working_directory = os.getcwd()
343 os.chdir(self.branch)
344 try:
345 self.expect.run("bzr merge %s" % self.working_tree,
346 logfile=self.log_file, timeout=None)
347 for path in self._prepared_files:
348 self.expect.run("bzr revert %s" % path)
349 self.expect.run("bzr commit -F %s" % filename,
350 logfile=self.log_file, timeout=None)
351 finally:
352 os.chdir(working_directory)
353344
354 def tag_changes(self):345 def tag_changes(self):
355 """Tag the source branch revision with the merged changes."""346 """Tag the source branch revision with the merged changes."""
356 self._log_info("== Tagging changes for %s ==" % self.name)347 self._log_info("== Tagging changes for %s ==" % self.name)
357 working_directory = os.getcwd()348 self._get_branch().tags.set_tag(self.version, self._get_branch().last_revision())
358 os.chdir(self.branch)
359 try:
360 self.expect.run("bzr tag %s" % self.version,
361 logfile=self.log_file, timeout=None)
362 finally:
363 os.chdir(working_directory)
364349
365 def cleanup(self):350 def cleanup(self):
366 """Cleanup signed sources and the release branch."""351 """Cleanup signed sources and the release branch."""
367 self._log_info("== Cleaning up signed sources and build branch "352 self._log_info("== Cleaning up signed sources and build branch "
368 "for %s ==" % self.name)353 "for %s ==" % self.name)
369 self.expect.run("rm -rf %s" % self.working_tree,354 osutils.rmtree(self.working_tree.basedir)
370 logfile=self.log_file, timeout=None)
371355
372 for release in self.releases:356 for release in self.releases:
373 version = self._get_version(release)357 version = self._get_version(release)
374 for end in [".dsc", ".tar.gz",358 for end in [".dsc", ".tar.gz", ".diff.gz",
375 "_source.build", "_source.changes", "_source.upload"]:359 "_source.build", "_source.changes", "_source.upload"]:
376 filename = "%s_%s%s" % (self.name, version, end)360 filename = "%s_%s%s" % (self.name, version, end)
377 path = os.path.join(self.repository, filename)361 path = os.path.join(self.repository, filename)
378 self.expect.run("rm '%s'" % path,362 try:
379 logfile=self.log_file, timeout=None)363 os.remove(path)
364 except OSError:
365 pass
366
380367
=== modified file 'debian/changelog'
--- debian/changelog 2009-09-20 18:21:25 +0000
+++ debian/changelog 2009-10-17 01:06:09 +0000
@@ -1,3 +1,19 @@
1autoppa (0.0.6-2) karmic; urgency=low
2
3 [John Ferlito]
4 * Added debian/watch file.
5 * debian/control
6 + Added ${misc:Depends}
7 + Added version to debhelper
8 + Bumped standards to 3.8.3
9 + Improve description
10 * Added debian/pycompat
11 * debian/rules
12 + Install into /usr instead of /usr/local
13
14
15 -- Jamshed Kakar <jkakar@kakar.ca> Mon, 05 Oct 2009 00:40:50 +1100
16
1autoppa (0.0.6-1~autoppa1.9.10) karmic; urgency=low17autoppa (0.0.6-1~autoppa1.9.10) karmic; urgency=low
218
3 * A new tool 'autoppa-switch' allows for easy ad hoc switching of19 * A new tool 'autoppa-switch' allows for easy ad hoc switching of
420
=== modified file 'debian/control'
--- debian/control 2009-09-20 18:21:58 +0000
+++ debian/control 2009-10-17 01:06:09 +0000
@@ -2,15 +2,17 @@
2Section: universe/devel2Section: universe/devel
3Priority: optional3Priority: optional
4Maintainer: Jamshed Kakar <jamshed.kakar@canonical.com>4Maintainer: Jamshed Kakar <jamshed.kakar@canonical.com>
5Build-Depends: debhelper, python-central, lsb-release5Build-Depends: debhelper (>= 5), python-central, lsb-release
6Standards-Version: 3.7.26Standards-Version: 3.7.2
7XS-Python-Version: current7XS-Python-Version: current
88
9Package: autoppa9Package: autoppa
10Architecture: any10Architecture: any
11Depends: ${python:Depends}, ${shlibs:Depends}11Depends: ${python:Depends}, ${shlibs:Depends}, python-pexpect, ${misc:Depends}, python-commandant, bzr-builddeb
12Provides: ${python:Provides}12Provides: ${python:Provides}
13XB-Python-Version: ${python:Versions}13XB-Python-Version: ${python:Versions}
14Description: A tool that automates generating and uploading signed14Description: A tool to automate PPA uploading for multiple releases.
15 source files to Launchpad's PPA service for projects stored in Bazaar15 Automates generating and uploading signed source files to Launchpad's PPA
16 branches.16 service for projects stored in Bazaar branches. Supports automatically making
17 small changes for different releases. eg python-support vs python-central for
18 dapper vs intrepid.
1719
=== modified file 'debian/control.autoppa'
--- debian/control.autoppa 2009-09-20 17:28:46 +0000
+++ debian/control.autoppa 2009-10-17 01:06:09 +0000
@@ -2,16 +2,18 @@
2Section: universe/devel2Section: universe/devel
3Priority: optional3Priority: optional
4Maintainer: Jamu Kakar <jkakar@canonical.com>4Maintainer: Jamu Kakar <jkakar@canonical.com>
5AUTOPPA_INCLUDE(dapper):Build-Depends: debhelper, python-support, lsb-release5AUTOPPA_INCLUDE(dapper):Build-Depends: debhelper (>= 5), python-support, lsb-release
6AUTOPPA_INCLUDE(hardy,intrepid,jaunty,karmic):Build-Depends: debhelper, python-central, lsb-release6AUTOPPA_INCLUDE(hardy,intrepid,jaunty,karmic):Build-Depends: debhelper (>= 5), python-central, lsb-release
7Standards-Version: 3.7.27Standards-Version: 3.7.2
8XS-Python-Version: current8XS-Python-Version: current
99
10Package: autoppa10Package: autoppa
11Architecture: any11Architecture: any
12Depends: ${python:Depends}, ${shlibs:Depends}, python-pexpect12Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}, python-pexpect, python-commandant, bzr-builddeb
13Provides: ${python:Provides}13Provides: ${python:Provides}
14XB-Python-Version: ${python:Versions}14XB-Python-Version: ${python:Versions}
15Description: A tool that automates generating and uploading signed15Description: A tool to automate PPA uploading for multiple releases.
16 source files to Launchpad's PPA service for projects stored in Bazaar16 Automates generating and uploading signed source files to Launchpad's PPA
17 branches.17 service for projects stored in Bazaar branches. Supports automatically making
18 small changes for different releases. eg python-support vs python-central for
19 dapper vs intrepid.
1820
=== added file 'debian/pycompat'
--- debian/pycompat 1970-01-01 00:00:00 +0000
+++ debian/pycompat 2009-10-17 01:06:09 +0000
@@ -0,0 +1,1 @@
12
02
=== modified file 'debian/rules'
--- debian/rules 2007-09-27 22:59:02 +0000
+++ debian/rules 2009-10-17 01:06:09 +0000
@@ -25,7 +25,7 @@
25 dh_testdir25 dh_testdir
26 dh_testroot26 dh_testroot
27 dh_clean -k27 dh_clean -k
28 python setup.py install --root $(root_dir)28 python setup.py install --root $(root_dir) --install-layout=deb
2929
30binary-indep: build install30binary-indep: build install
3131
3232
=== added file 'debian/watch'
--- debian/watch 1970-01-01 00:00:00 +0000
+++ debian/watch 2009-10-17 01:06:09 +0000
@@ -0,0 +1,2 @@
1version=3
2https://launchpad.net/autoppa/+download http://launchpad.net/autoppa/.*/AutoPPA-(.+).tar.bz2

Subscribers

People subscribed via source and target branches

to all changes: