Merge lp:~lifeless/bzr-builddeb/trunk into lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old
- trunk
- Merge into trunk-old
Proposed by
Robert Collins
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | James Westby | ||||||||||||||||
Approved revision: | not available | ||||||||||||||||
Merge reported by: | James Westby | ||||||||||||||||
Merged at revision: | not available | ||||||||||||||||
Proposed branch: | lp:~lifeless/bzr-builddeb/trunk | ||||||||||||||||
Merge into: | lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old | ||||||||||||||||
Diff against target: |
473 lines (+64/-53) 7 files modified
builder.py (+5/-5) changes.py (+1/-1) cmds.py (+19/-19) directory.py (+5/-5) hooks.py (+2/-2) import_dsc.py (+16/-5) upstream.py (+16/-16) |
||||||||||||||||
To merge this branch: | bzr merge lp:~lifeless/bzr-builddeb/trunk | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Robert Collins (lifeless) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
James Westby (james-w) wrote : | # |
On Fri Nov 27 01:15:22 UTC 2009 Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/bzr-builddeb/trunk into
> lp:bzr-builddeb.
>
> Requested reviews:
> Bzr-builddeb-
> Related bugs:
> #486534 merge-upstream doesn't work in shared treeless repo
> https:/
>
>
> Various bits.
The stuff unique to this proposal looks fine to me.
Thanks,
James
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
James Westby (james-w) wrote : | # |
Merged, with the tweak to use subprocess not os.system.
Thanks,
James
review:
Approve
lp:~lifeless/bzr-builddeb/trunk
updated
- 385. By James Westby
-
Use bzrlib.trace.note instead of the deprecated b.t.info. Thanks Jelmer.
- 386. By James Westby
-
Clean up some unused imports.
- 387. By James Westby
-
Handle no-trees repo in merge-upstream, and subprocess_setup in more places.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'builder.py' | |||
2 | --- builder.py 2009-07-15 20:48:37 +0000 | |||
3 | +++ builder.py 2009-11-27 01:15:21 +0000 | |||
4 | @@ -23,7 +23,7 @@ | |||
5 | 23 | import subprocess | 23 | import subprocess |
6 | 24 | import os | 24 | import os |
7 | 25 | 25 | ||
9 | 26 | from bzrlib.trace import info | 26 | from bzrlib.trace import note |
10 | 27 | 27 | ||
11 | 28 | from bzrlib.plugins.builddeb.errors import ( | 28 | from bzrlib.plugins.builddeb.errors import ( |
12 | 29 | NoSourceDirError, | 29 | NoSourceDirError, |
13 | @@ -69,10 +69,10 @@ | |||
14 | 69 | os.makedirs(parent_dir) | 69 | os.makedirs(parent_dir) |
15 | 70 | if os.path.exists(self.target_dir): | 70 | if os.path.exists(self.target_dir): |
16 | 71 | if not self.use_existing: | 71 | if not self.use_existing: |
18 | 72 | info("Purging the build dir: %s", self.target_dir) | 72 | note("Purging the build dir: %s", self.target_dir) |
19 | 73 | shutil.rmtree(self.target_dir) | 73 | shutil.rmtree(self.target_dir) |
20 | 74 | else: | 74 | else: |
22 | 75 | info("Not purging build dir as requested: %s", | 75 | note("Not purging build dir as requested: %s", |
23 | 76 | self.target_dir) | 76 | self.target_dir) |
24 | 77 | else: | 77 | else: |
25 | 78 | if self.use_existing: | 78 | if self.use_existing: |
26 | @@ -83,7 +83,7 @@ | |||
27 | 83 | 83 | ||
28 | 84 | def build(self): | 84 | def build(self): |
29 | 85 | """This builds the package using the supplied command.""" | 85 | """This builds the package using the supplied command.""" |
31 | 86 | info("Building the package in %s, using %s", self.target_dir, | 86 | note("Building the package in %s, using %s", self.target_dir, |
32 | 87 | self.builder) | 87 | self.builder) |
33 | 88 | proc = subprocess.Popen(self.builder, shell=True, cwd=self.target_dir, | 88 | proc = subprocess.Popen(self.builder, shell=True, cwd=self.target_dir, |
34 | 89 | preexec_fn=subprocess_setup) | 89 | preexec_fn=subprocess_setup) |
35 | @@ -93,5 +93,5 @@ | |||
36 | 93 | 93 | ||
37 | 94 | def clean(self): | 94 | def clean(self): |
38 | 95 | """This removes the build directory.""" | 95 | """This removes the build directory.""" |
40 | 96 | info("Cleaning build dir: %s", self.target_dir) | 96 | note("Cleaning build dir: %s", self.target_dir) |
41 | 97 | shutil.rmtree(self.target_dir) | 97 | shutil.rmtree(self.target_dir) |
42 | 98 | 98 | ||
43 | === modified file 'changes.py' | |||
44 | --- changes.py 2009-03-16 15:52:52 +0000 | |||
45 | +++ changes.py 2009-11-27 01:15:21 +0000 | |||
46 | @@ -18,13 +18,13 @@ | |||
47 | 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
48 | 19 | # | 19 | # |
49 | 20 | 20 | ||
50 | 21 | import commands | ||
51 | 22 | import os | 21 | import os |
52 | 23 | 22 | ||
53 | 24 | from debian_bundle import deb822 | 23 | from debian_bundle import deb822 |
54 | 25 | 24 | ||
55 | 26 | from bzrlib.trace import mutter | 25 | from bzrlib.trace import mutter |
56 | 27 | 26 | ||
57 | 27 | from bzrlib.plugins.builddeb import commands | ||
58 | 28 | from bzrlib.plugins.builddeb.errors import DebianError, MissingChanges | 28 | from bzrlib.plugins.builddeb.errors import DebianError, MissingChanges |
59 | 29 | 29 | ||
60 | 30 | class DebianChanges(deb822.Changes): | 30 | class DebianChanges(deb822.Changes): |
61 | 31 | 31 | ||
62 | === modified file 'cmds.py' | |||
63 | --- cmds.py 2009-11-23 22:02:25 +0000 | |||
64 | +++ cmds.py 2009-11-27 01:15:21 +0000 | |||
65 | @@ -44,7 +44,7 @@ | |||
66 | 44 | from bzrlib.export import export | 44 | from bzrlib.export import export |
67 | 45 | from bzrlib.option import Option | 45 | from bzrlib.option import Option |
68 | 46 | from bzrlib.revisionspec import RevisionSpec | 46 | from bzrlib.revisionspec import RevisionSpec |
70 | 47 | from bzrlib.trace import info, warning | 47 | from bzrlib.trace import note, warning |
71 | 48 | from bzrlib.workingtree import WorkingTree | 48 | from bzrlib.workingtree import WorkingTree |
72 | 49 | 49 | ||
73 | 50 | from bzrlib.plugins.builddeb import ( | 50 | from bzrlib.plugins.builddeb import ( |
74 | @@ -223,7 +223,7 @@ | |||
75 | 223 | 223 | ||
76 | 224 | def _get_build_tree(self, revision, tree, branch): | 224 | def _get_build_tree(self, revision, tree, branch): |
77 | 225 | if revision is None and tree is not None: | 225 | if revision is None and tree is not None: |
79 | 226 | info("Building using working tree") | 226 | note("Building using working tree") |
80 | 227 | working_tree = True | 227 | working_tree = True |
81 | 228 | else: | 228 | else: |
82 | 229 | if revision is None: | 229 | if revision is None: |
83 | @@ -233,7 +233,7 @@ | |||
84 | 233 | else: | 233 | else: |
85 | 234 | raise BzrCommandError('bzr builddeb --revision takes exactly one ' | 234 | raise BzrCommandError('bzr builddeb --revision takes exactly one ' |
86 | 235 | 'revision specifier.') | 235 | 'revision specifier.') |
88 | 236 | info("Building branch from revision %s", revid) | 236 | note("Building branch from revision %s", revid) |
89 | 237 | tree = branch.repository.revision_tree(revid) | 237 | tree = branch.repository.revision_tree(revid) |
90 | 238 | working_tree = False | 238 | working_tree = False |
91 | 239 | return tree, working_tree | 239 | return tree, working_tree |
92 | @@ -242,20 +242,20 @@ | |||
93 | 242 | if not merge: | 242 | if not merge: |
94 | 243 | merge = config.merge | 243 | merge = config.merge |
95 | 244 | if merge: | 244 | if merge: |
97 | 245 | info("Running in merge mode") | 245 | note("Running in merge mode") |
98 | 246 | native = False | 246 | native = False |
99 | 247 | split = False | 247 | split = False |
100 | 248 | else: | 248 | else: |
101 | 249 | if not native: | 249 | if not native: |
102 | 250 | native = config.native | 250 | native = config.native |
103 | 251 | if native: | 251 | if native: |
105 | 252 | info("Running in native mode") | 252 | note("Running in native mode") |
106 | 253 | split = False | 253 | split = False |
107 | 254 | else: | 254 | else: |
108 | 255 | if not split: | 255 | if not split: |
109 | 256 | split = config.split | 256 | split = config.split |
110 | 257 | if split: | 257 | if split: |
112 | 258 | info("Running in split mode") | 258 | note("Running in split mode") |
113 | 259 | return merge, native, split | 259 | return merge, native, split |
114 | 260 | 260 | ||
115 | 261 | def _get_build_command(self, config, builder, quick, build_options): | 261 | def _get_build_command(self, config, builder, quick, build_options): |
116 | @@ -367,7 +367,7 @@ | |||
117 | 367 | try: | 367 | try: |
118 | 368 | config = debuild_config(tree, working_tree, no_user_config) | 368 | config = debuild_config(tree, working_tree, no_user_config) |
119 | 369 | if reuse: | 369 | if reuse: |
121 | 370 | info("Reusing existing build dir") | 370 | note("Reusing existing build dir") |
122 | 371 | dont_purge = True | 371 | dont_purge = True |
123 | 372 | use_existing = True | 372 | use_existing = True |
124 | 373 | merge, native, split = self._build_type(config, merge, native, split) | 373 | merge, native, split = self._build_type(config, merge, native, split) |
125 | @@ -535,11 +535,11 @@ | |||
126 | 535 | if distribution is None: | 535 | if distribution is None: |
127 | 536 | distribution = find_last_distribution(changelog) | 536 | distribution = find_last_distribution(changelog) |
128 | 537 | if distribution is not None: | 537 | if distribution is not None: |
130 | 538 | info("Using distribution %s" % distribution) | 538 | note("Using distribution %s" % distribution) |
131 | 539 | except MissingChangelogError: | 539 | except MissingChangelogError: |
132 | 540 | current_version = None | 540 | current_version = None |
133 | 541 | if distribution is None: | 541 | if distribution is None: |
135 | 542 | info("No distribution specified, and no changelog, " | 542 | note("No distribution specified, and no changelog, " |
136 | 543 | "assuming 'debian'") | 543 | "assuming 'debian'") |
137 | 544 | distribution = "debian" | 544 | distribution = "debian" |
138 | 545 | 545 | ||
139 | @@ -583,7 +583,7 @@ | |||
140 | 583 | version = upstream_branch_version(upstream_branch, | 583 | version = upstream_branch_version(upstream_branch, |
141 | 584 | upstream_revision, package, | 584 | upstream_revision, package, |
142 | 585 | current_version.upstream_version) | 585 | current_version.upstream_version) |
144 | 586 | info("Using version string %s for upstream branch." % (version)) | 586 | note("Using version string %s for upstream branch." % (version)) |
145 | 587 | else: | 587 | else: |
146 | 588 | raise BzrCommandError("You must specify the " | 588 | raise BzrCommandError("You must specify the " |
147 | 589 | "version number using --version.") | 589 | "version number using --version.") |
148 | @@ -622,11 +622,11 @@ | |||
149 | 622 | package) | 622 | package) |
150 | 623 | finally: | 623 | finally: |
151 | 624 | tree.unlock() | 624 | tree.unlock() |
153 | 625 | info("The new upstream version has been imported.") | 625 | note("The new upstream version has been imported.") |
154 | 626 | if conflicts: | 626 | if conflicts: |
156 | 627 | info("You should now resolve the conflicts, review the changes, and then commit.") | 627 | note("You should now resolve the conflicts, review the changes, and then commit.") |
157 | 628 | else: | 628 | else: |
159 | 629 | info("You should now review the changes and then commit.") | 629 | note("You should now review the changes and then commit.") |
160 | 630 | 630 | ||
161 | 631 | 631 | ||
162 | 632 | class cmd_import_dsc(Command): | 632 | class cmd_import_dsc(Command): |
163 | @@ -810,16 +810,16 @@ | |||
164 | 810 | builder.prepare() | 810 | builder.prepare() |
165 | 811 | run_hook(t, 'pre-export', config) | 811 | run_hook(t, 'pre-export', config) |
166 | 812 | builder.export() | 812 | builder.export() |
168 | 813 | info('Running "%s" in the exported directory.' % (command)) | 813 | note('Running "%s" in the exported directory.' % (command)) |
169 | 814 | if give_instruction: | 814 | if give_instruction: |
171 | 815 | info('If you want to cancel your changes then exit with a non-zero ' | 815 | note('If you want to cancel your changes then exit with a non-zero ' |
172 | 816 | 'exit code, e.g. run "exit 1".') | 816 | 'exit code, e.g. run "exit 1".') |
173 | 817 | try: | 817 | try: |
174 | 818 | builder.build() | 818 | builder.build() |
175 | 819 | except BuildFailedError: | 819 | except BuildFailedError: |
176 | 820 | raise BzrCommandError('Not updating the working tree as the ' | 820 | raise BzrCommandError('Not updating the working tree as the ' |
177 | 821 | 'command failed.') | 821 | 'command failed.') |
179 | 822 | info("Copying debian/ back") | 822 | note("Copying debian/ back") |
180 | 823 | if larstiq: | 823 | if larstiq: |
181 | 824 | destination = '' | 824 | destination = '' |
182 | 825 | else: | 825 | else: |
183 | @@ -834,7 +834,7 @@ | |||
184 | 834 | if proc.returncode != 0: | 834 | if proc.returncode != 0: |
185 | 835 | raise BzrCommandError('Copying back debian/ failed') | 835 | raise BzrCommandError('Copying back debian/ failed') |
186 | 836 | builder.clean() | 836 | builder.clean() |
188 | 837 | info('If any files were added or removed you should run "bzr add" or ' | 837 | note('If any files were added or removed you should run "bzr add" or ' |
189 | 838 | '"bzr rm" as appropriate.') | 838 | '"bzr rm" as appropriate.') |
190 | 839 | 839 | ||
191 | 840 | 840 | ||
192 | @@ -914,10 +914,10 @@ | |||
193 | 914 | # Merge source packaging branch in to the target packaging branch. | 914 | # Merge source packaging branch in to the target packaging branch. |
194 | 915 | conflicts = tree.merge_from_branch(source_branch) | 915 | conflicts = tree.merge_from_branch(source_branch) |
195 | 916 | if conflicts > 0: | 916 | if conflicts > 0: |
197 | 917 | info('The merge resulted in %s conflicts. Please resolve these ' | 917 | note('The merge resulted in %s conflicts. Please resolve these ' |
198 | 918 | 'and commit the changes with "bzr commit".' % conflicts) | 918 | 'and commit the changes with "bzr commit".' % conflicts) |
199 | 919 | else: | 919 | else: |
201 | 920 | info('The merge resulted in no conflicts. You may commit the ' | 920 | note('The merge resulted in no conflicts. You may commit the ' |
202 | 921 | 'changes by running "bzr commit".') | 921 | 'changes by running "bzr commit".') |
203 | 922 | 922 | ||
204 | 923 | 923 | ||
205 | 924 | 924 | ||
206 | === modified file 'directory.py' | |||
207 | --- directory.py 2009-04-16 10:42:12 +0000 | |||
208 | +++ directory.py 2009-11-27 01:15:21 +0000 | |||
209 | @@ -19,7 +19,7 @@ | |||
210 | 19 | # | 19 | # |
211 | 20 | 20 | ||
212 | 21 | from bzrlib import errors | 21 | from bzrlib import errors |
214 | 22 | from bzrlib.trace import info | 22 | from bzrlib.trace import note |
215 | 23 | 23 | ||
216 | 24 | import apt_pkg | 24 | import apt_pkg |
217 | 25 | 25 | ||
218 | @@ -61,7 +61,7 @@ | |||
219 | 61 | raise errors.InvalidURL(path=url, | 61 | raise errors.InvalidURL(path=url, |
220 | 62 | extra='version %s not found' % version) | 62 | extra='version %s not found' % version) |
221 | 63 | 63 | ||
223 | 64 | info("Retrieving Vcs locating from %s Debian version %s", name, version) | 64 | note("Retrieving Vcs locating from %s Debian version %s", name, version) |
224 | 65 | 65 | ||
225 | 66 | if "Bzr" in urls[version]: | 66 | if "Bzr" in urls[version]: |
226 | 67 | return urls[version]["Bzr"] | 67 | return urls[version]["Bzr"] |
227 | @@ -70,7 +70,7 @@ | |||
228 | 70 | try: | 70 | try: |
229 | 71 | import bzrlib.plugins.svn | 71 | import bzrlib.plugins.svn |
230 | 72 | except ImportError: | 72 | except ImportError: |
232 | 73 | info("This package uses subversion. If you would like to " | 73 | note("This package uses subversion. If you would like to " |
233 | 74 | "access it with bzr then please install bzr-svn " | 74 | "access it with bzr then please install bzr-svn " |
234 | 75 | "and re-run the command.") | 75 | "and re-run the command.") |
235 | 76 | else: | 76 | else: |
236 | @@ -80,7 +80,7 @@ | |||
237 | 80 | try: | 80 | try: |
238 | 81 | import bzrlib.plugins.git | 81 | import bzrlib.plugins.git |
239 | 82 | except ImportError: | 82 | except ImportError: |
241 | 83 | info("This package uses git. If you would like to " | 83 | note("This package uses git. If you would like to " |
242 | 84 | "access it with bzr then please install bzr-git " | 84 | "access it with bzr then please install bzr-git " |
243 | 85 | "and re-run the command.") | 85 | "and re-run the command.") |
244 | 86 | else: | 86 | else: |
245 | @@ -90,7 +90,7 @@ | |||
246 | 90 | try: | 90 | try: |
247 | 91 | import bzrlib.plugins.hg | 91 | import bzrlib.plugins.hg |
248 | 92 | except ImportError: | 92 | except ImportError: |
250 | 93 | info("This package uses hg. If you would like to " | 93 | note("This package uses hg. If you would like to " |
251 | 94 | "access it with bzr then please install bzr-hg" | 94 | "access it with bzr then please install bzr-hg" |
252 | 95 | "and re-run the command.") | 95 | "and re-run the command.") |
253 | 96 | else: | 96 | else: |
254 | 97 | 97 | ||
255 | === modified file 'hooks.py' | |||
256 | --- hooks.py 2008-05-18 00:04:21 +0000 | |||
257 | +++ hooks.py 2009-11-27 01:15:21 +0000 | |||
258 | @@ -20,7 +20,7 @@ | |||
259 | 20 | 20 | ||
260 | 21 | import subprocess | 21 | import subprocess |
261 | 22 | 22 | ||
263 | 23 | from bzrlib.trace import info | 23 | from bzrlib.trace import note |
264 | 24 | 24 | ||
265 | 25 | from bzrlib.plugins.builddeb.errors import HookFailedError | 25 | from bzrlib.plugins.builddeb.errors import HookFailedError |
266 | 26 | 26 | ||
267 | @@ -29,7 +29,7 @@ | |||
268 | 29 | hook = config.get_hook(hook_name) | 29 | hook = config.get_hook(hook_name) |
269 | 30 | if hook is None: | 30 | if hook is None: |
270 | 31 | return | 31 | return |
272 | 32 | info("Running %s as %s hook" % (hook, hook_name)) | 32 | note("Running %s as %s hook" % (hook, hook_name)) |
273 | 33 | proc = subprocess.Popen(hook, shell=True, | 33 | proc = subprocess.Popen(hook, shell=True, |
274 | 34 | cwd=tree.abspath(wd)) | 34 | cwd=tree.abspath(wd)) |
275 | 35 | proc.wait() | 35 | proc.wait() |
276 | 36 | 36 | ||
277 | === modified file 'import_dsc.py' | |||
278 | --- import_dsc.py 2009-09-16 14:52:14 +0000 | |||
279 | +++ import_dsc.py 2009-11-27 01:15:21 +0000 | |||
280 | @@ -35,6 +35,7 @@ | |||
281 | 35 | import md5 | 35 | import md5 |
282 | 36 | import os | 36 | import os |
283 | 37 | import shutil | 37 | import shutil |
284 | 38 | import signal | ||
285 | 38 | import stat | 39 | import stat |
286 | 39 | from subprocess import Popen, PIPE | 40 | from subprocess import Popen, PIPE |
287 | 40 | from StringIO import StringIO | 41 | from StringIO import StringIO |
288 | @@ -54,12 +55,13 @@ | |||
289 | 54 | AlreadyBranchError, | 55 | AlreadyBranchError, |
290 | 55 | BzrCommandError, | 56 | BzrCommandError, |
291 | 56 | NotBranchError, | 57 | NotBranchError, |
292 | 58 | NoWorkingTree, | ||
293 | 57 | ) | 59 | ) |
294 | 58 | from bzrlib.export import export | 60 | from bzrlib.export import export |
295 | 59 | from bzrlib.osutils import file_iterator, isdir, basename, splitpath | 61 | from bzrlib.osutils import file_iterator, isdir, basename, splitpath |
296 | 60 | from bzrlib.revisionspec import RevisionSpec | 62 | from bzrlib.revisionspec import RevisionSpec |
297 | 61 | from bzrlib.revision import NULL_REVISION | 63 | from bzrlib.revision import NULL_REVISION |
299 | 62 | from bzrlib.trace import warning, info, mutter | 64 | from bzrlib.trace import warning, note, mutter |
300 | 63 | from bzrlib.transform import TreeTransform, cook_conflicts, resolve_conflicts | 65 | from bzrlib.transform import TreeTransform, cook_conflicts, resolve_conflicts |
301 | 64 | from bzrlib.transport import ( | 66 | from bzrlib.transport import ( |
302 | 65 | get_transport, | 67 | get_transport, |
303 | @@ -1551,7 +1553,11 @@ | |||
304 | 1551 | dir_to = self.branch.bzrdir.sprout(to_location, | 1553 | dir_to = self.branch.bzrdir.sprout(to_location, |
305 | 1552 | revision_id=upstream_tip, | 1554 | revision_id=upstream_tip, |
306 | 1553 | accelerator_tree=self.tree) | 1555 | accelerator_tree=self.tree) |
308 | 1554 | self.upstream_tree = dir_to.open_workingtree() | 1556 | try: |
309 | 1557 | self.upstream_tree = dir_to.open_workingtree() | ||
310 | 1558 | except NoWorkingTree: | ||
311 | 1559 | # Handle shared treeless repo's. | ||
312 | 1560 | self.upstream_tree = dir_to.create_workingtree() | ||
313 | 1555 | self.upstream_branch = self.upstream_tree.branch | 1561 | self.upstream_branch = self.upstream_tree.branch |
314 | 1556 | 1562 | ||
315 | 1557 | _extract_upstream_tree = extract_upstream_tree | 1563 | _extract_upstream_tree = extract_upstream_tree |
316 | @@ -1583,8 +1589,13 @@ | |||
317 | 1583 | def _extract_tarball_to_tempdir(self, tarball_filename): | 1589 | def _extract_tarball_to_tempdir(self, tarball_filename): |
318 | 1584 | tempdir = tempfile.mkdtemp() | 1590 | tempdir = tempfile.mkdtemp() |
319 | 1585 | try: | 1591 | try: |
322 | 1586 | assert os.system("tar xzf %s -C %s --strip-components 1" | 1592 | old_sig = signal.getsignal(signal.SIGPIPE) |
323 | 1587 | % (tarball_filename, tempdir)) == 0 | 1593 | signal.signal(signal.SIGPIPE, signal.SIG_DFL) |
324 | 1594 | try: | ||
325 | 1595 | assert os.system("tar xzf %s -C %s --strip-components 1" | ||
326 | 1596 | % (tarball_filename, tempdir)) == 0 | ||
327 | 1597 | finally: | ||
328 | 1598 | signal.signal(signal.SIGPIPE, old_sig) | ||
329 | 1588 | return tempdir | 1599 | return tempdir |
330 | 1589 | except: | 1600 | except: |
331 | 1590 | shutil.rmtree(tempdir) | 1601 | shutil.rmtree(tempdir) |
332 | @@ -1728,7 +1739,7 @@ | |||
333 | 1728 | finally: | 1739 | finally: |
334 | 1729 | tree.unlock() | 1740 | tree.unlock() |
335 | 1730 | command = ["/usr/bin/pristine-tar", "gendelta", tarball_path, "-"] | 1741 | command = ["/usr/bin/pristine-tar", "gendelta", tarball_path, "-"] |
337 | 1731 | info(" ".join(command)) | 1742 | note(" ".join(command)) |
338 | 1732 | proc = Popen(command, stdout=PIPE, cwd=dest) | 1743 | proc = Popen(command, stdout=PIPE, cwd=dest) |
339 | 1733 | (stdout, stderr) = proc.communicate() | 1744 | (stdout, stderr) = proc.communicate() |
340 | 1734 | if proc.returncode != 0: | 1745 | if proc.returncode != 0: |
341 | 1735 | 1746 | ||
342 | === modified file 'upstream.py' | |||
343 | --- upstream.py 2009-09-14 15:38:18 +0000 | |||
344 | +++ upstream.py 2009-11-27 01:15:21 +0000 | |||
345 | @@ -28,7 +28,7 @@ | |||
346 | 28 | 28 | ||
347 | 29 | from bzrlib.export import export | 29 | from bzrlib.export import export |
348 | 30 | from bzrlib.revisionspec import RevisionSpec | 30 | from bzrlib.revisionspec import RevisionSpec |
350 | 31 | from bzrlib.trace import info | 31 | from bzrlib.trace import note |
351 | 32 | 32 | ||
352 | 33 | from bzrlib.plugins.builddeb.errors import ( | 33 | from bzrlib.plugins.builddeb.errors import ( |
353 | 34 | MissingUpstreamTarball, | 34 | MissingUpstreamTarball, |
354 | @@ -83,7 +83,7 @@ | |||
355 | 83 | revid = db.revid_of_upstream_version_from_branch(version) | 83 | revid = db.revid_of_upstream_version_from_branch(version) |
356 | 84 | if not db.has_pristine_tar_delta(revid): | 84 | if not db.has_pristine_tar_delta(revid): |
357 | 85 | raise PackageVersionNotPresent(package, version, self) | 85 | raise PackageVersionNotPresent(package, version, self) |
359 | 86 | info("Using pristine-tar to reconstruct the needed tarball.") | 86 | note("Using pristine-tar to reconstruct the needed tarball.") |
360 | 87 | try: | 87 | try: |
361 | 88 | db.reconstruct_pristine_tar(revid, package, version, target_filename) | 88 | db.reconstruct_pristine_tar(revid, package, version, target_filename) |
362 | 89 | except PristineTarError: | 89 | except PristineTarError: |
363 | @@ -109,14 +109,14 @@ | |||
364 | 109 | raise PackageVersionNotPresent(package, upstream_version, self) | 109 | raise PackageVersionNotPresent(package, upstream_version, self) |
365 | 110 | 110 | ||
366 | 111 | sources.Restart() | 111 | sources.Restart() |
368 | 112 | info("Using apt to look for the upstream tarball.") | 112 | note("Using apt to look for the upstream tarball.") |
369 | 113 | while sources.Lookup(package): | 113 | while sources.Lookup(package): |
370 | 114 | if upstream_version \ | 114 | if upstream_version \ |
371 | 115 | == Version(sources.Version).upstream_version: | 115 | == Version(sources.Version).upstream_version: |
372 | 116 | if self._run_apt_source(package, sources.Version, target_dir): | 116 | if self._run_apt_source(package, sources.Version, target_dir): |
373 | 117 | return | 117 | return |
374 | 118 | break | 118 | break |
376 | 119 | info("apt could not find the needed tarball.") | 119 | note("apt could not find the needed tarball.") |
377 | 120 | raise PackageVersionNotPresent(package, upstream_version, self) | 120 | raise PackageVersionNotPresent(package, upstream_version, self) |
378 | 121 | 121 | ||
379 | 122 | def _get_command(self, package, version_str): | 122 | def _get_command(self, package, version_str): |
380 | @@ -157,7 +157,7 @@ | |||
381 | 157 | self.upstream_branch.lock_read() | 157 | self.upstream_branch.lock_read() |
382 | 158 | try: | 158 | try: |
383 | 159 | revid = self._get_revision_id(version) | 159 | revid = self._get_revision_id(version) |
385 | 160 | info("Exporting upstream branch revision %s to create the tarball", | 160 | note("Exporting upstream branch revision %s to create the tarball", |
386 | 161 | revid) | 161 | revid) |
387 | 162 | target_filename = self._tarball_path(package, version, target_dir) | 162 | target_filename = self._tarball_path(package, version, target_dir) |
388 | 163 | tarball_base = "%s-%s" % (package, version) | 163 | tarball_base = "%s-%s" % (package, version) |
389 | @@ -176,16 +176,16 @@ | |||
390 | 176 | 176 | ||
391 | 177 | def _get_orig_source(self, source_dir, desired_tarball_name, | 177 | def _get_orig_source(self, source_dir, desired_tarball_name, |
392 | 178 | target_dir): | 178 | target_dir): |
394 | 179 | info("Trying to use get-orig-source to retrieve needed tarball.") | 179 | note("Trying to use get-orig-source to retrieve needed tarball.") |
395 | 180 | command = ["/usr/bin/make", "-f", "debian/rules", "get-orig-source"] | 180 | command = ["/usr/bin/make", "-f", "debian/rules", "get-orig-source"] |
396 | 181 | proc = subprocess.Popen(command, cwd=source_dir) | 181 | proc = subprocess.Popen(command, cwd=source_dir) |
397 | 182 | ret = proc.wait() | 182 | ret = proc.wait() |
398 | 183 | if ret != 0: | 183 | if ret != 0: |
400 | 184 | info("Trying to run get-orig-source rule failed") | 184 | note("Trying to run get-orig-source rule failed") |
401 | 185 | return False | 185 | return False |
402 | 186 | fetched_tarball = os.path.join(source_dir, desired_tarball_name) | 186 | fetched_tarball = os.path.join(source_dir, desired_tarball_name) |
403 | 187 | if not os.path.exists(fetched_tarball): | 187 | if not os.path.exists(fetched_tarball): |
405 | 188 | info("get-orig-source did not create %s", desired_tarball_name) | 188 | note("get-orig-source did not create %s", desired_tarball_name) |
406 | 189 | return False | 189 | return False |
407 | 190 | repack_tarball(fetched_tarball, desired_tarball_name, | 190 | repack_tarball(fetched_tarball, desired_tarball_name, |
408 | 191 | target_dir=target_dir) | 191 | target_dir=target_dir) |
409 | @@ -213,7 +213,7 @@ | |||
410 | 213 | return | 213 | return |
411 | 214 | finally: | 214 | finally: |
412 | 215 | shutil.rmtree(tmpdir) | 215 | shutil.rmtree(tmpdir) |
414 | 216 | info("No debian/rules file to try and use for a get-orig-source rule") | 216 | note("No debian/rules file to try and use for a get-orig-source rule") |
415 | 217 | raise PackageVersionNotPresent(package, version, self) | 217 | raise PackageVersionNotPresent(package, version, self) |
416 | 218 | 218 | ||
417 | 219 | 219 | ||
418 | @@ -225,14 +225,14 @@ | |||
419 | 225 | self.larstiq = larstiq | 225 | self.larstiq = larstiq |
420 | 226 | 226 | ||
421 | 227 | def _uscan(self, package, upstream_version, watch_file, target_dir): | 227 | def _uscan(self, package, upstream_version, watch_file, target_dir): |
423 | 228 | info("Using uscan to look for the upstream tarball.") | 228 | note("Using uscan to look for the upstream tarball.") |
424 | 229 | r = os.system("uscan --upstream-version %s --force-download --rename " | 229 | r = os.system("uscan --upstream-version %s --force-download --rename " |
425 | 230 | "--package %s --watchfile %s --check-dirname-level 0 " | 230 | "--package %s --watchfile %s --check-dirname-level 0 " |
426 | 231 | "--download --repack --destdir %s --download-version %s" % | 231 | "--download --repack --destdir %s --download-version %s" % |
427 | 232 | (upstream_version, package, watch_file, target_dir, | 232 | (upstream_version, package, watch_file, target_dir, |
428 | 233 | upstream_version)) | 233 | upstream_version)) |
429 | 234 | if r != 0: | 234 | if r != 0: |
431 | 235 | info("uscan could not find the needed tarball.") | 235 | note("uscan could not find the needed tarball.") |
432 | 236 | return False | 236 | return False |
433 | 237 | return True | 237 | return True |
434 | 238 | 238 | ||
435 | @@ -243,7 +243,7 @@ | |||
436 | 243 | watchfile = 'debian/watch' | 243 | watchfile = 'debian/watch' |
437 | 244 | watch_id = self.tree.path2id(watchfile) | 244 | watch_id = self.tree.path2id(watchfile) |
438 | 245 | if watch_id is None: | 245 | if watch_id is None: |
440 | 246 | info("No watch file to use to retrieve upstream tarball.") | 246 | note("No watch file to use to retrieve upstream tarball.") |
441 | 247 | return None | 247 | return None |
442 | 248 | (tmp, tempfilename) = tempfile.mkstemp() | 248 | (tmp, tempfilename) = tempfile.mkstemp() |
443 | 249 | try: | 249 | try: |
444 | @@ -287,7 +287,7 @@ | |||
445 | 287 | shutil.rmtree(tmpdir) | 287 | shutil.rmtree(tmpdir) |
446 | 288 | 288 | ||
447 | 289 | def get_specific_version(self, package, version, target_dir): | 289 | def get_specific_version(self, package, version, target_dir): |
449 | 290 | info("Using the current branch without the 'debian' directory " | 290 | note("Using the current branch without the 'debian' directory " |
450 | 291 | "to create the tarball") | 291 | "to create the tarball") |
451 | 292 | self._split(package, version, | 292 | self._split(package, version, |
452 | 293 | self._tarball_path(package, version, target_dir)) | 293 | self._tarball_path(package, version, target_dir)) |
453 | @@ -387,9 +387,9 @@ | |||
454 | 387 | :param target_dir: The directory to place the tarball in. | 387 | :param target_dir: The directory to place the tarball in. |
455 | 388 | :return: The path to the tarball. | 388 | :return: The path to the tarball. |
456 | 389 | """ | 389 | """ |
458 | 390 | info("Looking for a way to retrieve the upstream tarball") | 390 | note("Looking for a way to retrieve the upstream tarball") |
459 | 391 | if self.already_exists_in_target(target_dir): | 391 | if self.already_exists_in_target(target_dir): |
461 | 392 | info("Upstream tarball already exists in build directory, " | 392 | note("Upstream tarball already exists in build directory, " |
462 | 393 | "using that") | 393 | "using that") |
463 | 394 | return os.path.join(target_dir, self._tarball_name()) | 394 | return os.path.join(target_dir, self._tarball_name()) |
464 | 395 | if not self.already_exists_in_store(): | 395 | if not self.already_exists_in_store(): |
465 | @@ -401,7 +401,7 @@ | |||
466 | 401 | except PackageVersionNotPresent: | 401 | except PackageVersionNotPresent: |
467 | 402 | raise MissingUpstreamTarball(self._tarball_name()) | 402 | raise MissingUpstreamTarball(self._tarball_name()) |
468 | 403 | else: | 403 | else: |
470 | 404 | info("Using the upstream tarball that is present in " | 404 | note("Using the upstream tarball that is present in " |
471 | 405 | "%s" % self.store_dir) | 405 | "%s" % self.store_dir) |
472 | 406 | assert self.provide_from_store_dir(target_dir) | 406 | assert self.provide_from_store_dir(target_dir) |
473 | 407 | return os.path.join(target_dir, self._tarball_name()) | 407 | return os.path.join(target_dir, self._tarball_name()) |
Various bits.