Merge lp:~lifeless/bzr-builddeb/2.0 into lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old
- 2.0
- Merge into trunk-old
Status: | Rejected |
---|---|
Rejected by: | James Westby |
Proposed branch: | lp:~lifeless/bzr-builddeb/2.0 |
Merge into: | lp:~bzr-builddeb-hackers/bzr-builddeb/trunk-old |
Diff against target: |
442 lines (+52/-52) 7 files modified
builder.py (+5/-5) changes.py (+1/-1) cmds.py (+21/-21) directory.py (+5/-5) hooks.py (+2/-2) import_dsc.py (+2/-2) upstream.py (+16/-16) |
To merge this branch: | bzr merge lp:~lifeless/bzr-builddeb/2.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby | Disapprove | ||
Review via email:
|
Commit message
Description of the change
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Robert Collins (lifeless) wrote : | # |
- 381. By Robert Collins
-
Import commands more safely.
- 382. By Robert Collins
-
Merge bug fixes from Aaron. Note that these are untested and show untested parts of bzr-builddeb.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
James Westby (james-w) wrote : | # |
Hi,
Thanks for working on this, but merging this gives an empty diff
from my current tree for a few reasons, so I reject.
The info->note changes were fixed by https:/
50 -import commands
51 import os
52
53 from debian_bundle import deb822
54
55 from bzrlib.trace import mutter
56
57 +from bzrlib.
58 from bzrlib.
There's no bzrlib.
commands module is what is being used, so I think this shouldn't
change.
167 - db.upstream_
168 + db.upstream_
That's not right, the API doesn't let us distinguish the two types of
version very well, but I had already fixed this properly (last_version.
in a recent revision.
170 - last_version)
171 + last_version.
That had also been fixed in a recent revision.
Thanks,
James
Unmerged revisions
Preview Diff
1 | === modified file 'builder.py' | |||
2 | --- builder.py 2009-07-15 20:48:37 +0000 | |||
3 | +++ builder.py 2009-11-22 03:20:24 +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-22 03:20:24 +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-09-16 12:47:18 +0000 | |||
64 | +++ cmds.py 2009-11-22 03:20:24 +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 | @@ -224,7 +224,7 @@ | |||
75 | 224 | 224 | ||
76 | 225 | def _get_build_tree(self, revision, tree, branch): | 225 | def _get_build_tree(self, revision, tree, branch): |
77 | 226 | if revision is None and tree is not None: | 226 | if revision is None and tree is not None: |
79 | 227 | info("Building using working tree") | 227 | note("Building using working tree") |
80 | 228 | working_tree = True | 228 | working_tree = True |
81 | 229 | else: | 229 | else: |
82 | 230 | if revision is None: | 230 | if revision is None: |
83 | @@ -234,7 +234,7 @@ | |||
84 | 234 | else: | 234 | else: |
85 | 235 | raise BzrCommandError('bzr builddeb --revision takes exactly one ' | 235 | raise BzrCommandError('bzr builddeb --revision takes exactly one ' |
86 | 236 | 'revision specifier.') | 236 | 'revision specifier.') |
88 | 237 | info("Building branch from revision %s", revid) | 237 | note("Building branch from revision %s", revid) |
89 | 238 | tree = branch.repository.revision_tree(revid) | 238 | tree = branch.repository.revision_tree(revid) |
90 | 239 | working_tree = False | 239 | working_tree = False |
91 | 240 | return tree, working_tree | 240 | return tree, working_tree |
92 | @@ -243,20 +243,20 @@ | |||
93 | 243 | if not merge: | 243 | if not merge: |
94 | 244 | merge = config.merge | 244 | merge = config.merge |
95 | 245 | if merge: | 245 | if merge: |
97 | 246 | info("Running in merge mode") | 246 | note("Running in merge mode") |
98 | 247 | native = False | 247 | native = False |
99 | 248 | split = False | 248 | split = False |
100 | 249 | else: | 249 | else: |
101 | 250 | if not native: | 250 | if not native: |
102 | 251 | native = config.native | 251 | native = config.native |
103 | 252 | if native: | 252 | if native: |
105 | 253 | info("Running in native mode") | 253 | note("Running in native mode") |
106 | 254 | split = False | 254 | split = False |
107 | 255 | else: | 255 | else: |
108 | 256 | if not split: | 256 | if not split: |
109 | 257 | split = config.split | 257 | split = config.split |
110 | 258 | if split: | 258 | if split: |
112 | 259 | info("Running in split mode") | 259 | note("Running in split mode") |
113 | 260 | return merge, native, split | 260 | return merge, native, split |
114 | 261 | 261 | ||
115 | 262 | def _get_build_command(self, config, builder, quick, build_options): | 262 | def _get_build_command(self, config, builder, quick, build_options): |
116 | @@ -368,7 +368,7 @@ | |||
117 | 368 | try: | 368 | try: |
118 | 369 | config = debuild_config(tree, working_tree, no_user_config) | 369 | config = debuild_config(tree, working_tree, no_user_config) |
119 | 370 | if reuse: | 370 | if reuse: |
121 | 371 | info("Reusing existing build dir") | 371 | note("Reusing existing build dir") |
122 | 372 | dont_purge = True | 372 | dont_purge = True |
123 | 373 | use_existing = True | 373 | use_existing = True |
124 | 374 | merge, native, split = self._build_type(config, merge, native, split) | 374 | merge, native, split = self._build_type(config, merge, native, split) |
125 | @@ -533,11 +533,11 @@ | |||
126 | 533 | if distribution is None: | 533 | if distribution is None: |
127 | 534 | distribution = find_last_distribution(changelog) | 534 | distribution = find_last_distribution(changelog) |
128 | 535 | if distribution is not None: | 535 | if distribution is not None: |
130 | 536 | info("Using distribution %s" % distribution) | 536 | note("Using distribution %s" % distribution) |
131 | 537 | except MissingChangelogError: | 537 | except MissingChangelogError: |
132 | 538 | current_version = None | 538 | current_version = None |
133 | 539 | if distribution is None: | 539 | if distribution is None: |
135 | 540 | info("No distribution specified, and no changelog, " | 540 | note("No distribution specified, and no changelog, " |
136 | 541 | "assuming 'debian'") | 541 | "assuming 'debian'") |
137 | 542 | distribution = "debian" | 542 | distribution = "debian" |
138 | 543 | 543 | ||
139 | @@ -581,7 +581,7 @@ | |||
140 | 581 | version = upstream_branch_version(upstream_branch, | 581 | version = upstream_branch_version(upstream_branch, |
141 | 582 | upstream_revision, package, | 582 | upstream_revision, package, |
142 | 583 | current_version.upstream_version) | 583 | current_version.upstream_version) |
144 | 584 | info("Using version string %s for upstream branch." % (version)) | 584 | note("Using version string %s for upstream branch." % (version)) |
145 | 585 | else: | 585 | else: |
146 | 586 | raise BzrCommandError("You must specify the " | 586 | raise BzrCommandError("You must specify the " |
147 | 587 | "version number using --version.") | 587 | "version number using --version.") |
148 | @@ -620,11 +620,11 @@ | |||
149 | 620 | package) | 620 | package) |
150 | 621 | finally: | 621 | finally: |
151 | 622 | tree.unlock() | 622 | tree.unlock() |
153 | 623 | info("The new upstream version has been imported.") | 623 | note("The new upstream version has been imported.") |
154 | 624 | if conflicts: | 624 | if conflicts: |
156 | 625 | info("You should now resolve the conflicts, review the changes, and then commit.") | 625 | note("You should now resolve the conflicts, review the changes, and then commit.") |
157 | 626 | else: | 626 | else: |
159 | 627 | info("You should now review the changes and then commit.") | 627 | note("You should now review the changes and then commit.") |
160 | 628 | 628 | ||
161 | 629 | 629 | ||
162 | 630 | class cmd_import_dsc(Command): | 630 | class cmd_import_dsc(Command): |
163 | @@ -729,9 +729,9 @@ | |||
164 | 729 | raise BzrCommandError("Unable to find the tag for " | 729 | raise BzrCommandError("Unable to find the tag for " |
165 | 730 | "the previous upstream version, %s, in the " | 730 | "the previous upstream version, %s, in the " |
166 | 731 | "branch: %s" % (last_version, | 731 | "branch: %s" % (last_version, |
168 | 732 | db.upstream_tag_name(last_version))) | 732 | db.upstream_tag_name(str(last_version)))) |
169 | 733 | upstream_tip = db.revid_of_upstream_version_from_branch( | 733 | upstream_tip = db.revid_of_upstream_version_from_branch( |
171 | 734 | last_version) | 734 | last_version.upstream_version) |
172 | 735 | db.extract_upstream_tree(upstream_tip, tempdir) | 735 | db.extract_upstream_tree(upstream_tip, tempdir) |
173 | 736 | else: | 736 | else: |
174 | 737 | db._create_empty_upstream_tree(tempdir) | 737 | db._create_empty_upstream_tree(tempdir) |
175 | @@ -808,16 +808,16 @@ | |||
176 | 808 | builder.prepare() | 808 | builder.prepare() |
177 | 809 | run_hook(t, 'pre-export', config) | 809 | run_hook(t, 'pre-export', config) |
178 | 810 | builder.export() | 810 | builder.export() |
180 | 811 | info('Running "%s" in the exported directory.' % (command)) | 811 | note('Running "%s" in the exported directory.' % (command)) |
181 | 812 | if give_instruction: | 812 | if give_instruction: |
183 | 813 | info('If you want to cancel your changes then exit with a non-zero ' | 813 | note('If you want to cancel your changes then exit with a non-zero ' |
184 | 814 | 'exit code, e.g. run "exit 1".') | 814 | 'exit code, e.g. run "exit 1".') |
185 | 815 | try: | 815 | try: |
186 | 816 | builder.build() | 816 | builder.build() |
187 | 817 | except BuildFailedError: | 817 | except BuildFailedError: |
188 | 818 | raise BzrCommandError('Not updating the working tree as the ' | 818 | raise BzrCommandError('Not updating the working tree as the ' |
189 | 819 | 'command failed.') | 819 | 'command failed.') |
191 | 820 | info("Copying debian/ back") | 820 | note("Copying debian/ back") |
192 | 821 | if larstiq: | 821 | if larstiq: |
193 | 822 | destination = '' | 822 | destination = '' |
194 | 823 | else: | 823 | else: |
195 | @@ -832,7 +832,7 @@ | |||
196 | 832 | if proc.returncode != 0: | 832 | if proc.returncode != 0: |
197 | 833 | raise BzrCommandError('Copying back debian/ failed') | 833 | raise BzrCommandError('Copying back debian/ failed') |
198 | 834 | builder.clean() | 834 | builder.clean() |
200 | 835 | info('If any files were added or removed you should run "bzr add" or ' | 835 | note('If any files were added or removed you should run "bzr add" or ' |
201 | 836 | '"bzr rm" as appropriate.') | 836 | '"bzr rm" as appropriate.') |
202 | 837 | 837 | ||
203 | 838 | 838 | ||
204 | @@ -913,10 +913,10 @@ | |||
205 | 913 | # Merge source packaging branch in to the target packaging branch. | 913 | # Merge source packaging branch in to the target packaging branch. |
206 | 914 | conflicts = tree.merge_from_branch(source_branch) | 914 | conflicts = tree.merge_from_branch(source_branch) |
207 | 915 | if conflicts > 0: | 915 | if conflicts > 0: |
209 | 916 | info('The merge resulted in %s conflicts. Please resolve these ' | 916 | note('The merge resulted in %s conflicts. Please resolve these ' |
210 | 917 | 'and commit the changes with "bzr commit".' % conflicts) | 917 | 'and commit the changes with "bzr commit".' % conflicts) |
211 | 918 | else: | 918 | else: |
213 | 919 | info('The merge resulted in no conflicts. You may commit the ' | 919 | note('The merge resulted in no conflicts. You may commit the ' |
214 | 920 | 'changes by running "bzr commit".') | 920 | 'changes by running "bzr commit".') |
215 | 921 | 921 | ||
216 | 922 | 922 | ||
217 | 923 | 923 | ||
218 | === modified file 'directory.py' | |||
219 | --- directory.py 2009-04-16 10:42:12 +0000 | |||
220 | +++ directory.py 2009-11-22 03:20:24 +0000 | |||
221 | @@ -19,7 +19,7 @@ | |||
222 | 19 | # | 19 | # |
223 | 20 | 20 | ||
224 | 21 | from bzrlib import errors | 21 | from bzrlib import errors |
226 | 22 | from bzrlib.trace import info | 22 | from bzrlib.trace import note |
227 | 23 | 23 | ||
228 | 24 | import apt_pkg | 24 | import apt_pkg |
229 | 25 | 25 | ||
230 | @@ -61,7 +61,7 @@ | |||
231 | 61 | raise errors.InvalidURL(path=url, | 61 | raise errors.InvalidURL(path=url, |
232 | 62 | extra='version %s not found' % version) | 62 | extra='version %s not found' % version) |
233 | 63 | 63 | ||
235 | 64 | info("Retrieving Vcs locating from %s Debian version %s", name, version) | 64 | note("Retrieving Vcs locating from %s Debian version %s", name, version) |
236 | 65 | 65 | ||
237 | 66 | if "Bzr" in urls[version]: | 66 | if "Bzr" in urls[version]: |
238 | 67 | return urls[version]["Bzr"] | 67 | return urls[version]["Bzr"] |
239 | @@ -70,7 +70,7 @@ | |||
240 | 70 | try: | 70 | try: |
241 | 71 | import bzrlib.plugins.svn | 71 | import bzrlib.plugins.svn |
242 | 72 | except ImportError: | 72 | except ImportError: |
244 | 73 | info("This package uses subversion. If you would like to " | 73 | note("This package uses subversion. If you would like to " |
245 | 74 | "access it with bzr then please install bzr-svn " | 74 | "access it with bzr then please install bzr-svn " |
246 | 75 | "and re-run the command.") | 75 | "and re-run the command.") |
247 | 76 | else: | 76 | else: |
248 | @@ -80,7 +80,7 @@ | |||
249 | 80 | try: | 80 | try: |
250 | 81 | import bzrlib.plugins.git | 81 | import bzrlib.plugins.git |
251 | 82 | except ImportError: | 82 | except ImportError: |
253 | 83 | info("This package uses git. If you would like to " | 83 | note("This package uses git. If you would like to " |
254 | 84 | "access it with bzr then please install bzr-git " | 84 | "access it with bzr then please install bzr-git " |
255 | 85 | "and re-run the command.") | 85 | "and re-run the command.") |
256 | 86 | else: | 86 | else: |
257 | @@ -90,7 +90,7 @@ | |||
258 | 90 | try: | 90 | try: |
259 | 91 | import bzrlib.plugins.hg | 91 | import bzrlib.plugins.hg |
260 | 92 | except ImportError: | 92 | except ImportError: |
262 | 93 | info("This package uses hg. If you would like to " | 93 | note("This package uses hg. If you would like to " |
263 | 94 | "access it with bzr then please install bzr-hg" | 94 | "access it with bzr then please install bzr-hg" |
264 | 95 | "and re-run the command.") | 95 | "and re-run the command.") |
265 | 96 | else: | 96 | else: |
266 | 97 | 97 | ||
267 | === modified file 'hooks.py' | |||
268 | --- hooks.py 2008-05-18 00:04:21 +0000 | |||
269 | +++ hooks.py 2009-11-22 03:20:24 +0000 | |||
270 | @@ -20,7 +20,7 @@ | |||
271 | 20 | 20 | ||
272 | 21 | import subprocess | 21 | import subprocess |
273 | 22 | 22 | ||
275 | 23 | from bzrlib.trace import info | 23 | from bzrlib.trace import note |
276 | 24 | 24 | ||
277 | 25 | from bzrlib.plugins.builddeb.errors import HookFailedError | 25 | from bzrlib.plugins.builddeb.errors import HookFailedError |
278 | 26 | 26 | ||
279 | @@ -29,7 +29,7 @@ | |||
280 | 29 | hook = config.get_hook(hook_name) | 29 | hook = config.get_hook(hook_name) |
281 | 30 | if hook is None: | 30 | if hook is None: |
282 | 31 | return | 31 | return |
284 | 32 | info("Running %s as %s hook" % (hook, hook_name)) | 32 | note("Running %s as %s hook" % (hook, hook_name)) |
285 | 33 | proc = subprocess.Popen(hook, shell=True, | 33 | proc = subprocess.Popen(hook, shell=True, |
286 | 34 | cwd=tree.abspath(wd)) | 34 | cwd=tree.abspath(wd)) |
287 | 35 | proc.wait() | 35 | proc.wait() |
288 | 36 | 36 | ||
289 | === modified file 'import_dsc.py' | |||
290 | --- import_dsc.py 2009-09-16 14:52:14 +0000 | |||
291 | +++ import_dsc.py 2009-11-22 03:20:24 +0000 | |||
292 | @@ -59,7 +59,7 @@ | |||
293 | 59 | from bzrlib.osutils import file_iterator, isdir, basename, splitpath | 59 | from bzrlib.osutils import file_iterator, isdir, basename, splitpath |
294 | 60 | from bzrlib.revisionspec import RevisionSpec | 60 | from bzrlib.revisionspec import RevisionSpec |
295 | 61 | from bzrlib.revision import NULL_REVISION | 61 | from bzrlib.revision import NULL_REVISION |
297 | 62 | from bzrlib.trace import warning, info, mutter | 62 | from bzrlib.trace import warning, note, mutter |
298 | 63 | from bzrlib.transform import TreeTransform, cook_conflicts, resolve_conflicts | 63 | from bzrlib.transform import TreeTransform, cook_conflicts, resolve_conflicts |
299 | 64 | from bzrlib.transport import ( | 64 | from bzrlib.transport import ( |
300 | 65 | get_transport, | 65 | get_transport, |
301 | @@ -1728,7 +1728,7 @@ | |||
302 | 1728 | finally: | 1728 | finally: |
303 | 1729 | tree.unlock() | 1729 | tree.unlock() |
304 | 1730 | command = ["/usr/bin/pristine-tar", "gendelta", tarball_path, "-"] | 1730 | command = ["/usr/bin/pristine-tar", "gendelta", tarball_path, "-"] |
306 | 1731 | info(" ".join(command)) | 1731 | note(" ".join(command)) |
307 | 1732 | proc = Popen(command, stdout=PIPE, cwd=dest) | 1732 | proc = Popen(command, stdout=PIPE, cwd=dest) |
308 | 1733 | (stdout, stderr) = proc.communicate() | 1733 | (stdout, stderr) = proc.communicate() |
309 | 1734 | if proc.returncode != 0: | 1734 | if proc.returncode != 0: |
310 | 1735 | 1735 | ||
311 | === modified file 'upstream.py' | |||
312 | --- upstream.py 2009-09-14 15:38:18 +0000 | |||
313 | +++ upstream.py 2009-11-22 03:20:24 +0000 | |||
314 | @@ -28,7 +28,7 @@ | |||
315 | 28 | 28 | ||
316 | 29 | from bzrlib.export import export | 29 | from bzrlib.export import export |
317 | 30 | from bzrlib.revisionspec import RevisionSpec | 30 | from bzrlib.revisionspec import RevisionSpec |
319 | 31 | from bzrlib.trace import info | 31 | from bzrlib.trace import note |
320 | 32 | 32 | ||
321 | 33 | from bzrlib.plugins.builddeb.errors import ( | 33 | from bzrlib.plugins.builddeb.errors import ( |
322 | 34 | MissingUpstreamTarball, | 34 | MissingUpstreamTarball, |
323 | @@ -83,7 +83,7 @@ | |||
324 | 83 | revid = db.revid_of_upstream_version_from_branch(version) | 83 | revid = db.revid_of_upstream_version_from_branch(version) |
325 | 84 | if not db.has_pristine_tar_delta(revid): | 84 | if not db.has_pristine_tar_delta(revid): |
326 | 85 | raise PackageVersionNotPresent(package, version, self) | 85 | raise PackageVersionNotPresent(package, version, self) |
328 | 86 | info("Using pristine-tar to reconstruct the needed tarball.") | 86 | note("Using pristine-tar to reconstruct the needed tarball.") |
329 | 87 | try: | 87 | try: |
330 | 88 | db.reconstruct_pristine_tar(revid, package, version, target_filename) | 88 | db.reconstruct_pristine_tar(revid, package, version, target_filename) |
331 | 89 | except PristineTarError: | 89 | except PristineTarError: |
332 | @@ -109,14 +109,14 @@ | |||
333 | 109 | raise PackageVersionNotPresent(package, upstream_version, self) | 109 | raise PackageVersionNotPresent(package, upstream_version, self) |
334 | 110 | 110 | ||
335 | 111 | sources.Restart() | 111 | sources.Restart() |
337 | 112 | info("Using apt to look for the upstream tarball.") | 112 | note("Using apt to look for the upstream tarball.") |
338 | 113 | while sources.Lookup(package): | 113 | while sources.Lookup(package): |
339 | 114 | if upstream_version \ | 114 | if upstream_version \ |
340 | 115 | == Version(sources.Version).upstream_version: | 115 | == Version(sources.Version).upstream_version: |
341 | 116 | if self._run_apt_source(package, sources.Version, target_dir): | 116 | if self._run_apt_source(package, sources.Version, target_dir): |
342 | 117 | return | 117 | return |
343 | 118 | break | 118 | break |
345 | 119 | info("apt could not find the needed tarball.") | 119 | note("apt could not find the needed tarball.") |
346 | 120 | raise PackageVersionNotPresent(package, upstream_version, self) | 120 | raise PackageVersionNotPresent(package, upstream_version, self) |
347 | 121 | 121 | ||
348 | 122 | def _get_command(self, package, version_str): | 122 | def _get_command(self, package, version_str): |
349 | @@ -157,7 +157,7 @@ | |||
350 | 157 | self.upstream_branch.lock_read() | 157 | self.upstream_branch.lock_read() |
351 | 158 | try: | 158 | try: |
352 | 159 | revid = self._get_revision_id(version) | 159 | revid = self._get_revision_id(version) |
354 | 160 | info("Exporting upstream branch revision %s to create the tarball", | 160 | note("Exporting upstream branch revision %s to create the tarball", |
355 | 161 | revid) | 161 | revid) |
356 | 162 | target_filename = self._tarball_path(package, version, target_dir) | 162 | target_filename = self._tarball_path(package, version, target_dir) |
357 | 163 | tarball_base = "%s-%s" % (package, version) | 163 | tarball_base = "%s-%s" % (package, version) |
358 | @@ -176,16 +176,16 @@ | |||
359 | 176 | 176 | ||
360 | 177 | def _get_orig_source(self, source_dir, desired_tarball_name, | 177 | def _get_orig_source(self, source_dir, desired_tarball_name, |
361 | 178 | target_dir): | 178 | target_dir): |
363 | 179 | info("Trying to use get-orig-source to retrieve needed tarball.") | 179 | note("Trying to use get-orig-source to retrieve needed tarball.") |
364 | 180 | command = ["/usr/bin/make", "-f", "debian/rules", "get-orig-source"] | 180 | command = ["/usr/bin/make", "-f", "debian/rules", "get-orig-source"] |
365 | 181 | proc = subprocess.Popen(command, cwd=source_dir) | 181 | proc = subprocess.Popen(command, cwd=source_dir) |
366 | 182 | ret = proc.wait() | 182 | ret = proc.wait() |
367 | 183 | if ret != 0: | 183 | if ret != 0: |
369 | 184 | info("Trying to run get-orig-source rule failed") | 184 | note("Trying to run get-orig-source rule failed") |
370 | 185 | return False | 185 | return False |
371 | 186 | fetched_tarball = os.path.join(source_dir, desired_tarball_name) | 186 | fetched_tarball = os.path.join(source_dir, desired_tarball_name) |
372 | 187 | if not os.path.exists(fetched_tarball): | 187 | if not os.path.exists(fetched_tarball): |
374 | 188 | info("get-orig-source did not create %s", desired_tarball_name) | 188 | note("get-orig-source did not create %s", desired_tarball_name) |
375 | 189 | return False | 189 | return False |
376 | 190 | repack_tarball(fetched_tarball, desired_tarball_name, | 190 | repack_tarball(fetched_tarball, desired_tarball_name, |
377 | 191 | target_dir=target_dir) | 191 | target_dir=target_dir) |
378 | @@ -213,7 +213,7 @@ | |||
379 | 213 | return | 213 | return |
380 | 214 | finally: | 214 | finally: |
381 | 215 | shutil.rmtree(tmpdir) | 215 | shutil.rmtree(tmpdir) |
383 | 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") |
384 | 217 | raise PackageVersionNotPresent(package, version, self) | 217 | raise PackageVersionNotPresent(package, version, self) |
385 | 218 | 218 | ||
386 | 219 | 219 | ||
387 | @@ -225,14 +225,14 @@ | |||
388 | 225 | self.larstiq = larstiq | 225 | self.larstiq = larstiq |
389 | 226 | 226 | ||
390 | 227 | def _uscan(self, package, upstream_version, watch_file, target_dir): | 227 | def _uscan(self, package, upstream_version, watch_file, target_dir): |
392 | 228 | info("Using uscan to look for the upstream tarball.") | 228 | note("Using uscan to look for the upstream tarball.") |
393 | 229 | r = os.system("uscan --upstream-version %s --force-download --rename " | 229 | r = os.system("uscan --upstream-version %s --force-download --rename " |
394 | 230 | "--package %s --watchfile %s --check-dirname-level 0 " | 230 | "--package %s --watchfile %s --check-dirname-level 0 " |
395 | 231 | "--download --repack --destdir %s --download-version %s" % | 231 | "--download --repack --destdir %s --download-version %s" % |
396 | 232 | (upstream_version, package, watch_file, target_dir, | 232 | (upstream_version, package, watch_file, target_dir, |
397 | 233 | upstream_version)) | 233 | upstream_version)) |
398 | 234 | if r != 0: | 234 | if r != 0: |
400 | 235 | info("uscan could not find the needed tarball.") | 235 | note("uscan could not find the needed tarball.") |
401 | 236 | return False | 236 | return False |
402 | 237 | return True | 237 | return True |
403 | 238 | 238 | ||
404 | @@ -243,7 +243,7 @@ | |||
405 | 243 | watchfile = 'debian/watch' | 243 | watchfile = 'debian/watch' |
406 | 244 | watch_id = self.tree.path2id(watchfile) | 244 | watch_id = self.tree.path2id(watchfile) |
407 | 245 | if watch_id is None: | 245 | if watch_id is None: |
409 | 246 | info("No watch file to use to retrieve upstream tarball.") | 246 | note("No watch file to use to retrieve upstream tarball.") |
410 | 247 | return None | 247 | return None |
411 | 248 | (tmp, tempfilename) = tempfile.mkstemp() | 248 | (tmp, tempfilename) = tempfile.mkstemp() |
412 | 249 | try: | 249 | try: |
413 | @@ -287,7 +287,7 @@ | |||
414 | 287 | shutil.rmtree(tmpdir) | 287 | shutil.rmtree(tmpdir) |
415 | 288 | 288 | ||
416 | 289 | def get_specific_version(self, package, version, target_dir): | 289 | def get_specific_version(self, package, version, target_dir): |
418 | 290 | info("Using the current branch without the 'debian' directory " | 290 | note("Using the current branch without the 'debian' directory " |
419 | 291 | "to create the tarball") | 291 | "to create the tarball") |
420 | 292 | self._split(package, version, | 292 | self._split(package, version, |
421 | 293 | self._tarball_path(package, version, target_dir)) | 293 | self._tarball_path(package, version, target_dir)) |
422 | @@ -387,9 +387,9 @@ | |||
423 | 387 | :param target_dir: The directory to place the tarball in. | 387 | :param target_dir: The directory to place the tarball in. |
424 | 388 | :return: The path to the tarball. | 388 | :return: The path to the tarball. |
425 | 389 | """ | 389 | """ |
427 | 390 | info("Looking for a way to retrieve the upstream tarball") | 390 | note("Looking for a way to retrieve the upstream tarball") |
428 | 391 | if self.already_exists_in_target(target_dir): | 391 | if self.already_exists_in_target(target_dir): |
430 | 392 | info("Upstream tarball already exists in build directory, " | 392 | note("Upstream tarball already exists in build directory, " |
431 | 393 | "using that") | 393 | "using that") |
432 | 394 | return os.path.join(target_dir, self._tarball_name()) | 394 | return os.path.join(target_dir, self._tarball_name()) |
433 | 395 | if not self.already_exists_in_store(): | 395 | if not self.already_exists_in_store(): |
434 | @@ -401,7 +401,7 @@ | |||
435 | 401 | except PackageVersionNotPresent: | 401 | except PackageVersionNotPresent: |
436 | 402 | raise MissingUpstreamTarball(self._tarball_name()) | 402 | raise MissingUpstreamTarball(self._tarball_name()) |
437 | 403 | else: | 403 | else: |
439 | 404 | info("Using the upstream tarball that is present in " | 404 | note("Using the upstream tarball that is present in " |
440 | 405 | "%s" % self.store_dir) | 405 | "%s" % self.store_dir) |
441 | 406 | assert self.provide_from_store_dir(target_dir) | 406 | assert self.provide_from_store_dir(target_dir) |
442 | 407 | return os.path.join(target_dir, self._tarball_name()) | 407 | return os.path.join(target_dir, self._tarball_name()) |
Fix up tests for bzr 2.1