Merge lp:~jelmer/ubuntu-dev-tools/lptools-migration into lp:~ubuntu-dev/ubuntu-dev-tools/trunk
- lptools-migration
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1123 | ||||
Proposed branch: | lp:~jelmer/ubuntu-dev-tools/lptools-migration | ||||
Merge into: | lp:~ubuntu-dev/ubuntu-dev-tools/trunk | ||||
Diff against target: |
1227 lines (+30/-1005) 18 files modified
debian/NEWS (+18/-0) debian/changelog (+12/-1) debian/control (+0/-7) debian/copyright (+0/-14) doc/get-branches.1 (+0/-47) doc/grab-attachments.1 (+0/-57) doc/lp-list-bugs.1 (+0/-27) doc/lp-project-upload.1 (+0/-24) doc/lp-set-dup.1 (+0/-56) doc/lp-shell.1 (+0/-52) get-branches (+0/-118) grab-attachments (+0/-107) lp-list-bugs (+0/-63) lp-project-upload (+0/-178) lp-set-dup (+0/-134) lp-shell (+0/-112) setup.py (+0/-6) ubuntutools/test/test_help.py (+0/-2) |
||||
To merge this branch: | bzr merge lp:~jelmer/ubuntu-dev-tools/lptools-migration | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stefano Rivera | Approve | ||
Review via email: mp+71847@code.launchpad.net |
Commit message
Description of the change
Remove lp-set-dup, lp-list-bugs and lp-project-upload, which have been migrated to lptools.
Stefano Rivera (stefanor) wrote : | # |
- 1121. By Jelmer Vernooij
-
Also remove manual pages, entries in copyright.
Jelmer Vernooij (jelmer) wrote : | # |
> Please also update the package description, debian/copyright, and
> ubuntutools/
Good point. I've updated the branch.
- 1122. By Jelmer Vernooij
-
Update test-help
Stefano Rivera (stefanor) wrote : | # |
I'm happy. Are you going to add a Breaks+Replaces in lptools?
Benjamin Drung (bdrung) wrote : | # |
Before we can merge this branch, we need to be assured that lptools will be upload to Debian.
Please refer to bug #708886.
Shouldn't get-branches, grab-attachments, and lp-shell moved to lptools too?
Benjamin Drung (bdrung) wrote : | # |
You added lptools to Recommends. Are there any tools in ubuntu-dev-tools that use one of the three scripts? Otherwise I think we should drop it and add lptools to packaging-dev instead.
Stefano Rivera (stefanor) wrote : | # |
Benjamin: Good catch, re getting lptools into Debian.
No, nothing else in u-d-t uses these scripts
Benjamin Drung (bdrung) wrote : | # |
Jelmer answered:
> I added it mainly to make the upgrade smoother for people who have
> ubuntu-dev-tools installed at the moment and use lp-set-dup,
> lp-list-bugs or lp-upload-project.
> Adding it as a recommends for packaging-dev works for me too. Just let
> me know which one you prefer.
I prefer dropping lptools from u-d-t Recommends and add it to packaging-dev. Other thoughts?
Stefano Rivera (stefanor) wrote : | # |
I think lptools should probably be in Debian (as a Debian user, I'd appreciate it).
And I agree with the packaging-dev solution to this problem.
- 1123. By Jelmer Vernooij
-
remove grab-attachments, too.
- 1124. By Jelmer Vernooij
-
Remove lp-shell, too.
- 1125. By Jelmer Vernooij
-
get-branches is in lptools now, too.
- 1126. By Jelmer Vernooij
-
merge trunk.
Jelmer Vernooij (jelmer) wrote : | # |
I've got a lptools upload ready for Debian, but I'm not sure what version of ubuntu-dev-tools to use in Breaks/Replaces yet. Would 0.129 be a safe bet?
Benjamin Drung (bdrung) wrote : | # |
0.129 will be a safe bet. I am going to merge this branch.
Can you drop lptools from Recommends?
Can you document in the changelog which tools where renamed?
Maybe a NEWS file entry would be useful.
Can you check if some names can be removed in the d/copyright file?
- 1127. By Jelmer Vernooij
-
Update changelog.
Jelmer Vernooij (jelmer) wrote : | # |
> 0.129 will be a safe bet. I am going to merge this branch.
>
> Can you drop lptools from Recommends?
Done.
> Can you document in the changelog which tools where renamed?
Done.
> Maybe a NEWS file entry would be useful.
Done.
> Can you check if some names can be removed in the d/copyright file?
As far as I can tell Dustin is the only one who no longer has copyright on any of the ubuntu-dev-tools; updated copyright accordingly.
I've uploaded a new lptools (with Breaks/Replaces for ubuntu-dev-tools << 0.129) to sid.
- 1128. By Jelmer Vernooij
-
Drop lptools from recommends.
- 1129. By Jelmer Vernooij
-
NEWS entry.
- 1130. By Jelmer Vernooij
-
Update copyright file.
Preview Diff
1 | === modified file 'debian/NEWS' |
2 | --- debian/NEWS 2011-03-01 13:03:32 +0000 |
3 | +++ debian/NEWS 2011-09-02 11:53:47 +0000 |
4 | @@ -1,3 +1,21 @@ |
5 | +ubuntu-dev-tools (0.129) unstable; urgency=low |
6 | + |
7 | + Several tools that worked against Launchpad but were not specific to Ubuntu |
8 | + have been migrated to the "lptools" project. |
9 | + |
10 | + The following tools have moved: |
11 | + - get-branches (renamed to lp-get-branches) |
12 | + - grab-attachments (renamed to lp-grab-attachments) |
13 | + - lp-project-upload |
14 | + - lp-list-bugs |
15 | + - lp-set-dup |
16 | + - lp-shell |
17 | + |
18 | + They can now be found in the lptools package (version 0.0.1~bzr28-1 or |
19 | + later). |
20 | + |
21 | + -- Jelmer Vernooij <jelmer@debian.org> Fri, 02 Sep 2011 13:43:34 +0200 |
22 | + |
23 | ubuntu-dev-tools (0.119) unstable; urgency=low |
24 | |
25 | launchpadlib 1.9 will cause some issues, as it uses the GNOME Keyring / KDE |
26 | |
27 | === modified file 'debian/changelog' |
28 | --- debian/changelog 2011-08-16 18:56:38 +0000 |
29 | +++ debian/changelog 2011-09-02 11:53:47 +0000 |
30 | @@ -1,10 +1,21 @@ |
31 | ubuntu-dev-tools (0.129) UNRELEASED; urgency=low |
32 | |
33 | + [ Colin Watson ] |
34 | * syncpackage: Convert to new LP API, with --no-lp available for the old |
35 | style of operation. |
36 | * syncpackage: Require -f/--force option to overwrite Ubuntu changes. |
37 | |
38 | - -- Colin Watson <cjwatson@ubuntu.com> Tue, 16 Aug 2011 16:40:22 +0100 |
39 | + [ Jelmer Vernooij ] |
40 | + * Remove several tools not specific to Ubuntu that have been migrated to |
41 | + lptools (LP: #708886): |
42 | + - get-branches (renamed to lp-get-branches) |
43 | + - grab-attachments (renamed to lp-grab-attachments) |
44 | + - lp-project-upload |
45 | + - lp-list-bugs |
46 | + - lp-set-dup |
47 | + - lp-shell |
48 | + |
49 | + -- Jelmer Vernooij <jelmer@debian.org> Thu, 01 Sep 2011 19:38:53 +0200 |
50 | |
51 | ubuntu-dev-tools (0.128) unstable; urgency=low |
52 | |
53 | |
54 | === modified file 'debian/control' |
55 | --- debian/control 2011-08-14 15:07:42 +0000 |
56 | +++ debian/control 2011-09-02 11:53:47 +0000 |
57 | @@ -75,21 +75,14 @@ |
58 | - debian-distro-info - provides information about Debian's distributions. |
59 | - dgetlp - download a source package from the Launchpad library. |
60 | - distro-info - provides information about the distributions' releases. |
61 | - - get-branches - used to branch/checkout all the bzr branches in a Launchpad |
62 | - team. |
63 | - get-build-deps - install the build dependencies needed for a package |
64 | reading debian/control. |
65 | - - grab-attachments - download all bug attachments from a Launchpad bug |
66 | - report. |
67 | - grab-merge - grabs a merge from merges.ubuntu.com easily. |
68 | - grep-merges - search for pending merges from Debian. |
69 | - harvest - grabs information about development opportunities from |
70 | http://harvest.ubuntu.com |
71 | - hugdaylist - compile HugDay lists from bug list URLs. |
72 | - import-bug-from-debian - copy a bug from the Debian BTS to Launchpad |
73 | - - lp-list-bugs - briefly list status of Launchpad bugs. |
74 | - - lp-project-upload - upload a release tarball to a Launchpad project |
75 | - - lp-set-dup - sets the "duplicate of" bug of a bug and its dups. |
76 | - massfile - fill multiple bugs using a template. |
77 | - merge-changelog - manually merges two Debian changelogs with the same base |
78 | version. |
79 | |
80 | === modified file 'debian/copyright' |
81 | --- debian/copyright 2011-06-25 15:53:44 +0000 |
82 | +++ debian/copyright 2011-09-02 11:53:47 +0000 |
83 | @@ -11,7 +11,6 @@ |
84 | doc/check-symbols.1 |
85 | doc/requestsync.1 |
86 | doc/ubuntu-iso.1 |
87 | - lp-shell |
88 | requestsync |
89 | setup.py |
90 | ubuntu-iso |
91 | @@ -22,7 +21,6 @@ |
92 | 2010, Benjamin Drung <bdrung@ubuntu.com> |
93 | 2007-2010, Canonical Ltd. |
94 | 2006-2007, Daniel Holbach <daniel.holbach@ubuntu.com> |
95 | - 2010, Dustin Kirkland <kirkland@ubuntu.com> |
96 | 2010, Evan Broder <evan@ebroder.net> |
97 | 2006-2007, Luke Yelavich <themuso@ubuntu.com> |
98 | 2009-2010, Michael Bienia <geser@ubuntu.com> |
99 | @@ -47,16 +45,11 @@ |
100 | doc/404main.1 |
101 | doc/dgetlp.1 |
102 | doc/import-bug-from-debian.1 |
103 | - doc/lp-project-upload.1 |
104 | - doc/lp-set-dup.1 |
105 | - doc/lp-shell.1 |
106 | doc/pbuilder-dist-simple.1 |
107 | doc/pbuilder-dist.1 |
108 | doc/reverse-build-depends.1 |
109 | doc/submittodebian.1 |
110 | import-bug-from-debian |
111 | - lp-project-upload |
112 | - lp-set-dup |
113 | pbuilder-dist |
114 | pbuilder-dist-simple |
115 | reverse-build-depends |
116 | @@ -87,8 +80,6 @@ |
117 | |
118 | Files: ack-sync |
119 | doc/bitesize.1 |
120 | - doc/get-branches.1 |
121 | - doc/grab-attachments.1 |
122 | doc/grab-merge.1 |
123 | doc/harvest.1 |
124 | doc/hugdaylist.1 |
125 | @@ -97,8 +88,6 @@ |
126 | doc/setup-packaging-environment.1 |
127 | doc/syncpackage.1 |
128 | bitesize |
129 | - get-branches |
130 | - grab-attachments |
131 | grab-merge |
132 | harvest |
133 | hugdaylist |
134 | @@ -108,7 +97,6 @@ |
135 | syncpackage |
136 | Copyright: 2010, Benjamin Drung <bdrung@ubuntu.com> |
137 | 2007-2011, Canonical Ltd. |
138 | - 2010, Dustin Kirkland <kirkland@ubuntu.com> |
139 | 2008, Jonathan Patrick Davies <jpds@ubuntu.com> |
140 | 2008-2010, Martin Pitt <martin.pitt@canonical.com> |
141 | 2009, Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> |
142 | @@ -130,14 +118,12 @@ |
143 | doc/dch-repeat.1 |
144 | doc/get-build-deps.1 |
145 | doc/grep-merges.1 |
146 | - doc/lp-list-bugs.1 |
147 | doc/mk-sbuild.1 |
148 | doc/pull-lp-source.1 |
149 | doc/pull-revu-source.1 |
150 | doc/ubuntu-build.1 |
151 | get-build-deps |
152 | grep-merges |
153 | - lp-list-bugs |
154 | mk-sbuild |
155 | pull-lp-source |
156 | pull-revu-source |
157 | |
158 | === removed file 'doc/get-branches.1' |
159 | --- doc/get-branches.1 2010-12-02 23:06:43 +0000 |
160 | +++ doc/get-branches.1 1970-01-01 00:00:00 +0000 |
161 | @@ -1,47 +0,0 @@ |
162 | -.TH get\-branches "1" "11 August 2008" "ubuntu-dev-tools" |
163 | -.SH NAME |
164 | -get\-branches - downloads all branches related to a Launchpad team or person |
165 | - |
166 | -.SH SYNOPSIS |
167 | -.B get\-branches |
168 | -.RB [ \-d |
169 | -.IR directory ] |
170 | -.RB [ \-o |
171 | -.BR branch | checkout ] |
172 | -.B \-t |
173 | -.I team |
174 | -.br |
175 | -.B get\-branches |
176 | -.I team |
177 | -.br |
178 | -.B get\-branches \-\-help |
179 | - |
180 | -.SH DESCRIPTION |
181 | -\fBget\-branches\fR uses the LP API to get a list of branches for a person or |
182 | -team and calls Bazaar to download all branches. |
183 | - |
184 | -.SH OPTIONS |
185 | -Listed below are the command line options for \fBget\-branches\fR: |
186 | -.TP |
187 | -.BR \-h ", " \-\-help |
188 | -Display a help message and exit. |
189 | -.TP |
190 | -.BR \-d ", " \-\-directory |
191 | -Download branches to a directory other than the current directory. |
192 | -.TP |
193 | -.BR \-o ", " \-\-operation |
194 | -Specifies which Bazaar operation to use when downloading the branches; may be |
195 | -either \fIbranch\fR or \fIcheckout\fR. |
196 | -.TP |
197 | -.BR \-t ", " \-\-team |
198 | -Specifies which Launchpad team/person to download branches from. |
199 | -This option is required. |
200 | - |
201 | -.SH AUTHORS |
202 | -\fBget\-branches\fR was written by Daniel Holbach <daniel.holbach@ubuntu.com>, |
203 | -and this manual page was written by Jonathan Patrick Davies <jpds@ubuntu.com>. |
204 | -.PP |
205 | -Both are released under the terms of the GNU General Public License, version 3. |
206 | - |
207 | -.SH SEE ALSO |
208 | -.B bzr(1) |
209 | |
210 | === removed file 'doc/grab-attachments.1' |
211 | --- doc/grab-attachments.1 2011-06-16 19:02:04 +0000 |
212 | +++ doc/grab-attachments.1 1970-01-01 00:00:00 +0000 |
213 | @@ -1,57 +0,0 @@ |
214 | -.TH GRAB\-ATTACHMENTS "1" "10 August 2008" "ubuntu-dev-tools" |
215 | -.SH NAME |
216 | -grab\-attachments \- downloads attachments from a Launchpad bug |
217 | -.SH SYNOPSIS |
218 | -.B grab\-attachments\fR [\fIoptions\fR] \fIbug-number\fR... |
219 | -.br |
220 | -.B grab\-attachments \-h |
221 | -.SH DESCRIPTION |
222 | -\fBgrab\-attachments\fR is a script to download all attachments from a |
223 | -Launchpad bug report or bug reports with a source package task into |
224 | -a directory named after the bug e.g. bug-1. |
225 | - |
226 | -.SH OPTIONS |
227 | -Listed below are the command line options for grab\-attachments: |
228 | -.TP |
229 | -.I bug-number |
230 | -Specifies the Launchpad bug number that the script should download |
231 | -attachments from. |
232 | -.TP |
233 | -.BR \-h ", " \-\-help |
234 | -Display a help message and exit. |
235 | -.TP |
236 | -.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR |
237 | -Use the specified instance of Launchpad (e.g. "staging"), instead of |
238 | -the default of "production". |
239 | -.TP |
240 | -.B \-\-no\-conf |
241 | -Do not read any configuration files, or configuration from environment |
242 | -variables. |
243 | -.TP |
244 | -.BR \-d ", " \-\-duplicates |
245 | -Download attachments from duplicates too. |
246 | -.TP |
247 | -.B \-p \fISRCPACKAGE\fR, \fB\-\-package\fR=\fISRCPACKAGE\fR |
248 | -Download attachments from all bugs with a task for this source |
249 | -package. |
250 | -.SH ENVIRONMENT |
251 | -All of the \fBCONFIGURATION VARIABLES\fR below are also supported as |
252 | -environment variables. |
253 | -Variables in the environment take precedence to those in configuration |
254 | -files. |
255 | -.SH CONFIGURATION VARIABLES |
256 | -The following variables can be set in the environment or in |
257 | -.BR ubuntu\-dev\-tools (5) |
258 | -configuration files. |
259 | -In each case, the script\-specific variable takes precedence over the |
260 | -package\-wide variable. |
261 | -.TP |
262 | -.BR GRAB_ATTACHMENTS_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE |
263 | -The default value for \fB--lpinstance\fR. |
264 | -.SH SEE ALSO |
265 | -.BR ubuntu\-dev\-tools (5) |
266 | -.SH AUTHOR |
267 | -\fBgrab\-attachments\fR was written by Daniel Holbach and this manual page |
268 | -was written by Jonathan Patrick Davies. |
269 | -.PP |
270 | -Both are released under the GNU General Public License, version 2. |
271 | |
272 | === removed file 'doc/lp-list-bugs.1' |
273 | --- doc/lp-list-bugs.1 2010-09-17 11:45:52 +0000 |
274 | +++ doc/lp-list-bugs.1 1970-01-01 00:00:00 +0000 |
275 | @@ -1,27 +0,0 @@ |
276 | -.TH lp\-list\-bugs 1 2010-09-17 ubuntu-dev-tools |
277 | -.SH NAME |
278 | -lp\-list\-bugs \- briefly list status of Launchpad bugs |
279 | -.SH DESCRIPTION |
280 | -.B lp\-list\-bugs |
281 | -takes one or more Launchpad bug numbers, and lists the status of each bug in a |
282 | -concise format. |
283 | -For example: |
284 | -.PP |
285 | -.RS |
286 | -.nf |
287 | -$ lp\-list\-bugs 3 |
288 | -Bug 3: Custom information for each translation team |
289 | - rosetta: Fix Released |
290 | - ubuntu: Invalid |
291 | - mono (Ubuntu): Invalid |
292 | -.fi |
293 | -.RE |
294 | -.SH OPTIONS |
295 | -.TP |
296 | -.BR \-h ", " \-\-help |
297 | -Display a help message and exit. |
298 | -.SH AUTHORS |
299 | -.B lp\-list\-bugs |
300 | -and this manual page were written by Colin Watson <cjwatson@ubuntu.com>. |
301 | -Both are released under the terms of the GNU General Public License, version |
302 | -3 or later. |
303 | |
304 | === removed file 'doc/lp-project-upload.1' |
305 | --- doc/lp-project-upload.1 2011-06-02 22:30:20 +0000 |
306 | +++ doc/lp-project-upload.1 1970-01-01 00:00:00 +0000 |
307 | @@ -1,24 +0,0 @@ |
308 | -.TH lp-project-upload "1" "05 September 2009" "ubuntu-dev-tools" |
309 | -.SH NAME |
310 | -lp\-project\-upload \- Upload a release tarball to a Launchpad project. |
311 | - |
312 | -.SH SYNOPSIS |
313 | -.B lp\-project\-upload |
314 | -.I <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file] |
315 | - |
316 | -.SH DESCRIPTION |
317 | -\fBlp\-project\-upload\fR uploads a tarball release of a project to Launchpad. |
318 | -It can create milestones and releases on the fly after confirmation. |
319 | - |
320 | -If there is a file \fItarball\fB.asc\fR, it is uploaded as the signature of the |
321 | -tarball. |
322 | - |
323 | -You can optionally provide the name of the next milestone, which will be created if specified. |
324 | - |
325 | -You can optionally provide filename(s) specifying the changelog and release notes entries for this release. Note that these might be /dev/null, if you do not want to provide changelog or release notes information. If these are not specified, an interactive editor will allow you to compose these. |
326 | - |
327 | -.SH AUTHORS |
328 | -\fBlp\-project\-upload\fR was written by Martin Pitt <martin.pitt@ubuntu.com> and enhanced by Dustin Kirkland <kirkland@ubuntu.com>. |
329 | -.PP |
330 | -It is released under the terms of the GNU General Public License, version 2 |
331 | -or (at your option) any later version. |
332 | |
333 | === removed file 'doc/lp-set-dup.1' |
334 | --- doc/lp-set-dup.1 2010-12-22 20:57:02 +0000 |
335 | +++ doc/lp-set-dup.1 1970-01-01 00:00:00 +0000 |
336 | @@ -1,56 +0,0 @@ |
337 | -.TH lp\-set\-dup "1" "March 6 2010" "ubuntu-dev-tools" |
338 | -.SH NAME |
339 | -lp\-set\-dup \- mark one or more bugs as duplicate of another bug |
340 | - |
341 | -.SH SYNOPSIS |
342 | -.B lp\-set\-dup \fR[\fB\-f\fR] <\fImain bug\fR> <\fIduplicate bug\fR> |
343 | -[<\fIduplicate bug\fR> ...] |
344 | -.br |
345 | -.B lp\-set\-dup \-\-help |
346 | - |
347 | -.SH DESCRIPTION |
348 | -\fBlp\-set\-dup\fR allow to easily mark one or more bug as duplicate of |
349 | -another bug. It checks for permission to operate on a given bug first, |
350 | -then perform required tasks on Launchpad. |
351 | - |
352 | -.SH OPTIONS |
353 | -Listed below are the command line options for \fBlp\-set\-dup\fR: |
354 | -.TP |
355 | -.BR \-h ", " \-\-help |
356 | -Display a help message and exit. |
357 | -.TP |
358 | -.B \-f |
359 | -Skip confirmation prompt. |
360 | -.TP |
361 | -.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR |
362 | -Use the specified instance of Launchpad (e.g. "staging"), instead of |
363 | -the default of "production". |
364 | -.TP |
365 | -.B \-\-no\-conf |
366 | -Do not read any configuration files, or configuration from environment |
367 | -variables. |
368 | - |
369 | -.SH ENVIRONMENT |
370 | -All of the \fBCONFIGURATION VARIABLES\fR below are also supported as |
371 | -environment variables. |
372 | -Variables in the environment take precedence to those in configuration |
373 | -files. |
374 | - |
375 | -.SH CONFIGURATION VARIABLES |
376 | -The following variables can be set in the environment or in |
377 | -.BR ubuntu\-dev\-tools (5) |
378 | -configuration files. |
379 | -In each case, the script\-specific variable takes precedence over the |
380 | -package\-wide variable. |
381 | -.TP |
382 | -.BR LP_SET_DUP_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE |
383 | -The default value for \fB--lpinstance\fR. |
384 | - |
385 | -.SH SEE ALSO |
386 | -.BR ubuntu\-dev\-tools (5) |
387 | - |
388 | -.SH AUTHORS |
389 | -\fBlp\-set\-dup\fR was written by Loïc Minier <lool@dooz.org>, |
390 | -and this manual page was written by Luca Falavigna <dktrkranz@debian.org>. |
391 | -.PP |
392 | -Both are released under the terms of the GNU General Public License, version 2. |
393 | |
394 | === removed file 'doc/lp-shell.1' |
395 | --- doc/lp-shell.1 2011-08-14 16:54:53 +0000 |
396 | +++ doc/lp-shell.1 1970-01-01 00:00:00 +0000 |
397 | @@ -1,52 +0,0 @@ |
398 | -.TH lp-shell "1" "27 March 2010" "ubuntu-dev-tools" |
399 | -.SH NAME |
400 | -lp\-shell \- Open an interactive launchpadlib shell. |
401 | - |
402 | -.SH SYNOPSIS |
403 | -.B lp\-shell |
404 | -.RB [ \-a ] |
405 | -.RB [ \-\-python ] |
406 | -.RB [ \-\-ipython ] |
407 | -.RI [ service ] |
408 | -.RI [ "LP API version" ] |
409 | - |
410 | -.SH DESCRIPTION |
411 | -.B lp\-shell |
412 | -opens an interactive Python shell with a launchpadlib.Launchpad object "lp" |
413 | -which is ready for use. |
414 | - |
415 | -It authenticates against Launchpad with the consumer name "udt-lp-shell". When |
416 | -using \fBlp\-shell\fR with the \fB\-a\fR option it will use the anonymous login |
417 | -from launchpadlib.Launchpad. |
418 | - |
419 | -By default \fBlp\-shell\fR connects to the "\fIproduction\fR" Launchpad service |
420 | -using the "\fI1.0\fR" LP API version. |
421 | - |
422 | -If you want to connect to another Launchpad service, call \fBlp\-shell\fR with |
423 | -the service name as the second argument. \fBlp\-shell\fR supports all services |
424 | -known by launchpadlib Python module. |
425 | -Currently known are (list can be incomplete or outdated): "production", |
426 | -"staging", "dogfood". |
427 | - |
428 | -A different LP API version can be selected by passing the API version to use as |
429 | -the third argument. Current supported are: "beta", "1.0" and "devel". |
430 | - |
431 | -.SH OPTIONS |
432 | -.TP |
433 | -.B \-a |
434 | -Login anonymously into Launchpad. |
435 | - |
436 | -.TP |
437 | -.B \-\-ipython |
438 | -Use an ipython shell if available (default). |
439 | - |
440 | -.TP |
441 | -.B \-\-python |
442 | -Use a regular python shell. |
443 | - |
444 | -.SH AUTHORS |
445 | -.B lp\-shell |
446 | -was written by Martin Pitt <martin.pitt@ubuntu.com>. |
447 | -.PP |
448 | -It is released under the terms of the GNU General Public License, version 2 |
449 | -or (at your option) any later version. |
450 | |
451 | === removed file 'get-branches' |
452 | --- get-branches 2011-05-24 18:22:37 +0000 |
453 | +++ get-branches 1970-01-01 00:00:00 +0000 |
454 | @@ -1,118 +0,0 @@ |
455 | -#!/usr/bin/python |
456 | -# -*- coding: utf-8 -*- |
457 | -# |
458 | -# Copyright (C) 2007 Canonical Ltd. |
459 | -# Created by Daniel Holbach <daniel.holbach@ubuntu.com> |
460 | -# Modified by Jonathan Patrick Davies <jpds@ubuntu.com> |
461 | -# |
462 | -# ################################################################## |
463 | -# |
464 | -# This program is free software; you can redistribute it and/or |
465 | -# modify it under the terms of the GNU General Public License |
466 | -# as published by the Free Software Foundation; version 3. |
467 | -# |
468 | -# This program is distributed in the hope that it will be useful, |
469 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
470 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
471 | -# GNU General Public License for more details. |
472 | -# |
473 | -# See file /usr/share/common-licenses/GPL-3 for more details. |
474 | -# |
475 | -# ################################################################## |
476 | -# |
477 | -# This script is used to checkout or branch all the Bazaar branches |
478 | -# of a Launchpad team. |
479 | -# |
480 | - |
481 | -import os |
482 | -import sys |
483 | -from optparse import OptionParser |
484 | -from ubuntutools.lp.lpapicache import PersonTeam |
485 | -from ubuntutools import subprocess |
486 | - |
487 | -def main(): |
488 | - usage = "Usage: %prog [-d <directory>] -t <team> [-o <operation>]" |
489 | - usage += "\nUsage: %prog <team>" |
490 | - opt_parser = OptionParser(usage) |
491 | - |
492 | - # Our options. |
493 | - opt_parser.add_option("-d", "--directory", action="store", type="string", |
494 | - dest="directory", default=os.getcwd(), |
495 | - help="Directory to download branches to.") |
496 | - opt_parser.add_option("-t", "--team", action="store", type="string", |
497 | - dest="lpteam", |
498 | - help="Launchpad team to download branches from.") |
499 | - opt_parser.add_option("-o", "--operation", action="store", type="string", |
500 | - dest="operation", default="branch", |
501 | - help="Whether to branch or checkout the Bazaar " |
502 | - "branches. May be either 'branch' or " |
503 | - "'checkout'.") |
504 | - |
505 | - (options, args) = opt_parser.parse_args() |
506 | - |
507 | - # Fetch our current directory to return to later. |
508 | - pwd = os.getcwd() |
509 | - |
510 | - # Parse our options. |
511 | - if len(args) != 1 and options.lpteam == None: |
512 | - opt_parser.error("No team has been specified.") |
513 | - |
514 | - # Dictionary settings. |
515 | - directory = options.directory |
516 | - if not os.path.isdir(directory): # Check that it is a directory. |
517 | - opt_parser.error("%s is not a valid directory." % directory) |
518 | - os.chdir(directory) |
519 | - |
520 | - # Type of Bazaar operation to perform. |
521 | - operation_type = options.operation.lower() |
522 | - if operation_type not in ("branch", "checkout"): |
523 | - opt_parser.error("Invalid operation '%s' for '-o' flag." % \ |
524 | - operation_type) |
525 | - |
526 | - # Launchpad team setting. |
527 | - if options.lpteam: |
528 | - team = options.lpteam.lower() |
529 | - if args: |
530 | - team = args[0].lower() |
531 | - try: |
532 | - team = PersonTeam(team) |
533 | - except KeyError: |
534 | - print >> sys.stderr, "E: The team '%s' doesn't exist." % team |
535 | - |
536 | - # Get a list of branches |
537 | - branches = team.getBranches() |
538 | - |
539 | - print "Downloading all branches for the '%s' team. This may take some " \ |
540 | - "time." % team.display_name |
541 | - |
542 | - try: |
543 | - os.makedirs(team.name) |
544 | - except: |
545 | - pass |
546 | - |
547 | - os.chdir(team.name) |
548 | - |
549 | - for branch in branches: |
550 | - project_name = branch.project.name |
551 | - if not os.path.exists(project_name): |
552 | - os.makedirs(project_name) |
553 | - os.chdir(project_name) |
554 | - |
555 | - if not os.path.exists(branch.name): |
556 | - print "Branching %s ..." % branch.display_name |
557 | - cmd = ["bzr", operation_type, branch.bzr_identity, branch.name] |
558 | - subprocess.call(cmd) |
559 | - else: |
560 | - print "Merging %s ..." % branch.display_name |
561 | - os.chdir(branch.name) |
562 | - subprocess.call(["bzr", "merge", "--pull", "--remember"]) |
563 | - os.chdir(os.path.join(directory, team.name)) |
564 | - |
565 | - os.chdir(pwd) |
566 | - sys.exit(0) |
567 | - |
568 | -if __name__ == "__main__": |
569 | - try: |
570 | - main() |
571 | - except KeyboardInterrupt: |
572 | - print "Operation was interrupted by user." |
573 | |
574 | === removed file 'grab-attachments' |
575 | --- grab-attachments 2011-06-21 16:25:15 +0000 |
576 | +++ grab-attachments 1970-01-01 00:00:00 +0000 |
577 | @@ -1,107 +0,0 @@ |
578 | -#!/usr/bin/python |
579 | -# |
580 | -# Copyright (C) 2007, Canonical Ltd. |
581 | -# Written by Daniel Holbach, |
582 | -# Stefano Rivera, |
583 | -# Brian Murray |
584 | -# |
585 | -# ################################################################## |
586 | -# |
587 | -# This program is free software; you can redistribute it and/or |
588 | -# modify it under the terms of the GNU General Public License |
589 | -# as published by the Free Software Foundation; version 3. |
590 | -# |
591 | -# This program is distributed in the hope that it will be useful, |
592 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
593 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
594 | -# GNU General Public License for more details. |
595 | -# |
596 | -# See file /usr/share/common-licenses/GPL-3 for more details. |
597 | -# |
598 | -# ################################################################## |
599 | - |
600 | -from optparse import OptionParser |
601 | -import errno |
602 | -import os |
603 | -import sys |
604 | - |
605 | -from launchpadlib.launchpad import Launchpad |
606 | - |
607 | -from ubuntutools.config import UDTConfig |
608 | - |
609 | -USAGE = "grab-attachments <bug numbers>" |
610 | - |
611 | - |
612 | -def download_attachments(bug): |
613 | - |
614 | - bug_folder_name = 'bug-%s' % bug.id |
615 | - |
616 | - try: |
617 | - os.mkdir(bug_folder_name) |
618 | - except OSError, error: |
619 | - if error.errno == errno.EEXIST: |
620 | - return |
621 | - |
622 | - for attachment in bug.attachments: |
623 | - f = attachment.data.open() |
624 | - filename = os.path.join(os.getcwd(), bug_folder_name, f.filename) |
625 | - local_file = open(filename, "w") |
626 | - local_file.write(f.read()) |
627 | - f.close() |
628 | - local_file.close() |
629 | - |
630 | - |
631 | -def main(): |
632 | - parser = OptionParser('Usage: %prog [options] <bug numbers>') |
633 | - parser.add_option('-l', '--lpinstance', metavar='INSTANCE', |
634 | - dest='lpinstance', default=None, |
635 | - help='Launchpad instance to connect to ' |
636 | - '(default: production)') |
637 | - parser.add_option('--no-conf', |
638 | - dest='no_conf', default=False, action='store_true', |
639 | - help="Don't read config files or environment variables") |
640 | - parser.add_option('-d', '--duplicates', default=False, |
641 | - action='store_true', |
642 | - help='Download attachments from duplicates too') |
643 | - parser.add_option('-p', '--package', |
644 | - help='Download attachments from all bugs with a ' |
645 | - 'task for this source package') |
646 | - |
647 | - opts, args = parser.parse_args() |
648 | - if len(args) < 1 and not opts.package: |
649 | - parser.error('No bug numbers provided') |
650 | - config = UDTConfig(opts.no_conf) |
651 | - if opts.lpinstance is None: |
652 | - opts.lpinstance = config.get_value('LPINSTANCE') |
653 | - |
654 | - try: |
655 | - launchpad = Launchpad.login_with("ubuntu-dev-tools", opts.lpinstance) |
656 | - |
657 | - if opts.package: |
658 | - ubuntu = launchpad.projects['ubuntu'] |
659 | - src_package = ubuntu.getSourcePackage(name=opts.package) |
660 | - if src_package is None: |
661 | - parser.error('Unable to find package %s' % opts.package) |
662 | - for task in src_package.searchTasks(): |
663 | - args.append(task.bug.id) |
664 | - |
665 | - for arg in args: |
666 | - try: |
667 | - bug_number = int(arg) |
668 | - except ValueError: |
669 | - parser.error("'%s' is not a valid bug number." % arg) |
670 | - |
671 | - bug = launchpad.bugs[bug_number] |
672 | - download_attachments(bug) |
673 | - |
674 | - if opts.duplicates is True: |
675 | - for bug in bug.duplicates: |
676 | - download_attachments(bug) |
677 | - |
678 | - # no LP credentials |
679 | - except IOError, error: |
680 | - print error |
681 | - sys.exit(1) |
682 | - |
683 | -if __name__ == '__main__': |
684 | - main() |
685 | |
686 | === removed file 'lp-list-bugs' |
687 | --- lp-list-bugs 2011-02-28 22:30:54 +0000 |
688 | +++ lp-list-bugs 1970-01-01 00:00:00 +0000 |
689 | @@ -1,63 +0,0 @@ |
690 | -#! /usr/bin/python |
691 | -# -*- coding: UTF-8 -*- |
692 | -"""Briefly list status of Launchpad bugs.""" |
693 | - |
694 | -# Copyright (c) 2010 Canonical Ltd. |
695 | -# |
696 | -# lp-set-dup is free software; you can redistribute it and/or modify it |
697 | -# under the terms of the GNU General Public License as published by the |
698 | -# Free Software Foundation; either version 3, or (at your option) any |
699 | -# later version. |
700 | -# |
701 | -# lp-set-dup is distributed in the hope that it will be useful, but |
702 | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
703 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
704 | -# General Public License for more details. |
705 | -# |
706 | -# You should have received a copy of the GNU General Public License |
707 | -# along with lp-set-dup; see the file COPYING. If not, write to the Free |
708 | -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
709 | -# 02110-1301, USA. |
710 | -# |
711 | -# Authors: |
712 | -# Colin Watson <cjwatson@ubuntu.com> |
713 | - |
714 | -import sys |
715 | -from optparse import OptionParser |
716 | - |
717 | -from launchpadlib.launchpad import Launchpad |
718 | -from launchpadlib.errors import HTTPError |
719 | - |
720 | -def main(): |
721 | - usage = "Usage: %prog <bug> [...]" |
722 | - parser = OptionParser(usage) |
723 | - args = parser.parse_args()[1] |
724 | - if len(args) < 1: |
725 | - parser.error("Need at least one bug number") |
726 | - |
727 | - try: |
728 | - launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production') |
729 | - except Exception, error: |
730 | - print >> sys.stderr, 'Could not connect to Launchpad:', str(error) |
731 | - sys.exit(2) |
732 | - |
733 | - for bugnum in args: |
734 | - try: |
735 | - bug = launchpad.bugs[bugnum] |
736 | - print "Bug %s: %s" % (bugnum, bug.title) |
737 | - for task in bug.bug_tasks: |
738 | - print " %s: %s" % (task.bug_target_name, task.status) |
739 | - except HTTPError, error: |
740 | - if error.response.status == 401: |
741 | - print >> sys.stderr, \ |
742 | - ("E: Don't have enough permissions to access bug %s" % |
743 | - bugnum) |
744 | - print >> sys.stderr, error.content |
745 | - continue |
746 | - elif error.response.status == 404: |
747 | - print >> sys.stderr, "E: Bug %s not found" % bugnum |
748 | - else: |
749 | - raise |
750 | - |
751 | -if __name__ == '__main__': |
752 | - main() |
753 | |
754 | === removed file 'lp-project-upload' |
755 | --- lp-project-upload 2011-06-24 14:32:07 +0000 |
756 | +++ lp-project-upload 1970-01-01 00:00:00 +0000 |
757 | @@ -1,178 +0,0 @@ |
758 | -#!/usr/bin/python |
759 | - |
760 | -# Copyright (c) 2009 Canonical Ltd. |
761 | -# |
762 | -# This program is free software; you can redistribute it and/or modify it |
763 | -# under the terms of the GNU General Public License as published by the |
764 | -# Free Software Foundation; either version 2, or (at your option) any |
765 | -# later version. |
766 | -# |
767 | -# lp-project-upload is distributed in the hope that it will be useful, but |
768 | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
769 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
770 | -# General Public License for more details. |
771 | - |
772 | -# Authors: |
773 | -# Martin Pitt <martin.pitt@ubuntu.com>, based on |
774 | -# http://blog.launchpad.net/api/recipe-for-uploading-files-via-the-api |
775 | -# Dustin Kirkland <kirkland@ubuntu.com> |
776 | -# - support files for changelog and release notes |
777 | - |
778 | -'''Upload a release tarball to a Launchpad project.''' |
779 | - |
780 | -import datetime |
781 | -import os |
782 | -import sys |
783 | -import tempfile |
784 | - |
785 | -from launchpadlib.launchpad import Launchpad |
786 | -from launchpadlib.errors import HTTPError |
787 | - |
788 | -from ubuntutools import subprocess |
789 | - |
790 | -def create_release(project, version): |
791 | - '''Create new release and milestone for LP project.''' |
792 | - |
793 | - print 'Release %s could not be found for project. Create it? (Y/n)' % \ |
794 | - version |
795 | - answer = sys.stdin.readline().strip() |
796 | - if answer.startswith('n'): |
797 | - sys.exit(0) |
798 | - |
799 | - n_series = len(project.series) |
800 | - if n_series == 1: |
801 | - series = project.series[0] |
802 | - elif n_series > 1: |
803 | - msg = 'More than one series exist. Which one would you like to ' \ |
804 | - 'upload to? Possible series are (listed as index, name):' |
805 | - print msg |
806 | - for idx, serie in enumerate(project.series): |
807 | - print '\t%i - %s' % (idx, serie.name) |
808 | - print 'Enter series index: ' |
809 | - answer = sys.stdin.readline().strip() |
810 | - try: |
811 | - series = project.series[int(answer)] |
812 | - except (ValueError, IndexError): |
813 | - print >> sys.stderr, 'The series index is invalid (%s).' % answer |
814 | - sys.exit(3) |
815 | - else: |
816 | - print "Using series named '%s'" % series.name |
817 | - else: |
818 | - print >> sys.stderr, ('Does not support creating releases if no ' |
819 | - 'series exists.') |
820 | - sys.exit(3) |
821 | - |
822 | - release_date = datetime.date.today().strftime('%Y-%m-%d') |
823 | - milestone = series.newMilestone(name=version, |
824 | - date_targeted=release_date) |
825 | - return milestone.createProductRelease(date_released=release_date) |
826 | - |
827 | -def edit_file(prefix, description): |
828 | - (fd, f) = tempfile.mkstemp(prefix=prefix+'.') |
829 | - os.write(fd, '\n\n#------\n# Please enter the %s here. ' |
830 | - 'Lines which start with "#" are ignored.\n' % description) |
831 | - os.close(fd) |
832 | - subprocess.call(['sensible-editor', f]) |
833 | - return cat_file(f) |
834 | - |
835 | -def cat_file(f): |
836 | - content = '' |
837 | - for line in open(f): |
838 | - if line.startswith('#'): |
839 | - continue |
840 | - content += line |
841 | - return content.strip() |
842 | - |
843 | -def main(): |
844 | - if len(sys.argv) < 4 or len(sys.argv) > 7: |
845 | - print >> sys.stderr, '''Upload a release tarball to a Launchpad project. |
846 | - |
847 | - Usage: %s <project name> <version> <tarball> [new milestone] [changelog file] [releasenotes file]''' % sys.argv[0] |
848 | - sys.exit(1) |
849 | - |
850 | - new_milestone = None |
851 | - changelog_file = None |
852 | - releasenotes_file = None |
853 | - if len(sys.argv) == 4: |
854 | - (project, version, tarball) = sys.argv[1:] |
855 | - elif len(sys.argv) == 5: |
856 | - (project, version, tarball, new_milestone) = sys.argv[1:] |
857 | - elif len(sys.argv) == 6: |
858 | - (project, version, tarball, new_milestone, changelog_file) = sys.argv[1:] |
859 | - elif len(sys.argv) == 7: |
860 | - (project, version, tarball, new_milestone, changelog_file, releasenotes_file) = sys.argv[1:] |
861 | - |
862 | - try: |
863 | - launchpad = Launchpad.login_with('ubuntu-dev-tools', 'production') |
864 | - except Exception, error: |
865 | - print >> sys.stderr, 'Could not connect to Launchpad:', str(error) |
866 | - sys.exit(2) |
867 | - |
868 | - try: |
869 | - # Look up the project using the Launchpad instance. |
870 | - proj = launchpad.projects[project] |
871 | - # Find the release in the project's releases collection. |
872 | - release = None |
873 | - for rel in proj.releases: |
874 | - if rel.version == version: |
875 | - release = rel |
876 | - break |
877 | - if not release: |
878 | - for milestone in proj.all_milestones: |
879 | - if milestone.name == version: |
880 | - today = datetime.date.today().strftime('%Y-%m-%d') |
881 | - release = milestone.createProductRelease(date_released=today) |
882 | - if not release: |
883 | - release = create_release(proj, version) |
884 | - |
885 | - # Get the file contents. |
886 | - file_content = open(tarball, 'r').read() |
887 | - # Get the signature, if available. |
888 | - signature = tarball + '.asc' |
889 | - if not os.path.exists(signature): |
890 | - print 'Calling GPG to create tarball signature...' |
891 | - cmd = ['gpg', '--armor', '--sign', '--detach-sig', tarball] |
892 | - if subprocess.call(cmd) != 0: |
893 | - print >> sys.stderr, 'gpg failed, aborting' |
894 | - |
895 | - if os.path.exists(signature): |
896 | - signature_content = open(signature, 'r').read() |
897 | - else: |
898 | - signature_content = None |
899 | - |
900 | - # Create a new product release file. |
901 | - filename = os.path.basename(tarball) |
902 | - release.add_file(filename=filename, description='release tarball', |
903 | - file_content=file_content, content_type='appplication/x-gzip', |
904 | - file_type='Code Release Tarball', signature_filename=signature, |
905 | - signature_content=signature_content) |
906 | - |
907 | - if changelog_file is not None: |
908 | - changelog = cat_file(changelog_file) |
909 | - else: |
910 | - changelog = edit_file('changelog', 'changelog') |
911 | - if changelog: |
912 | - release.changelog = changelog |
913 | - |
914 | - if releasenotes_file is not None: |
915 | - release_notes = cat_file(releasenotes_file) |
916 | - else: |
917 | - release_notes = edit_file('releasenotes', 'release notes') |
918 | - if release_notes: |
919 | - release.release_notes = release_notes |
920 | - |
921 | - release.lp_save() |
922 | - |
923 | - # Create a new milestone if requested |
924 | - if new_milestone is not None: |
925 | - mil = release.milestone |
926 | - for series in proj.series: |
927 | - if mil.name in [milestone.name for milestone in series.all_milestones]: |
928 | - series.newMilestone(name=new_milestone) |
929 | - |
930 | - except HTTPError, error: |
931 | - print 'An error happened in the upload:', error.content |
932 | - sys.exit(1) |
933 | - |
934 | -if __name__ == '__main__': |
935 | - main() |
936 | |
937 | === removed file 'lp-set-dup' |
938 | --- lp-set-dup 2011-02-28 22:30:54 +0000 |
939 | +++ lp-set-dup 1970-01-01 00:00:00 +0000 |
940 | @@ -1,134 +0,0 @@ |
941 | -#!/usr/bin/python |
942 | -# -*- coding: UTF-8 -*- |
943 | -"""Sets the "duplicate of" bug of a bug and its dups.""" |
944 | - |
945 | -# Copyright (c) 2009 Canonical Ltd. |
946 | -# |
947 | -# lp-set-dup is free software; you can redistribute it and/or modify it |
948 | -# under the terms of the GNU General Public License as published by the |
949 | -# Free Software Foundation; either version 2, or (at your option) any |
950 | -# later version. |
951 | -# |
952 | -# lp-set-dup is distributed in the hope that it will be useful, but |
953 | -# WITHOUT ANY WARRANTY; without even the implied warranty of |
954 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
955 | -# General Public License for more details. |
956 | -# |
957 | -# You should have received a copy of the GNU General Public License |
958 | -# along with lp-set-dup; see the file COPYING. If not, write to the Free |
959 | -# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
960 | -# 02110-1301, USA. |
961 | -# |
962 | -# Authors: |
963 | -# Loïc Minier <lool@dooz.org> |
964 | - |
965 | -import sys |
966 | -from optparse import OptionParser |
967 | - |
968 | -from launchpadlib.launchpad import Launchpad |
969 | -from launchpadlib.errors import HTTPError |
970 | - |
971 | -from ubuntutools.config import UDTConfig |
972 | - |
973 | -def die(message): |
974 | - print >> sys.stderr, "Fatal: " + message |
975 | - sys.exit(1) |
976 | - |
977 | -def main(): |
978 | - usage = "Usage: %prog [-f] <new main bug> <bug to dup> [<bug to dup>...]" |
979 | - opt_parser = OptionParser(usage) |
980 | - opt_parser.add_option("-f", |
981 | - help="Skip confirmation prompt", |
982 | - dest="force", default=False, action="store_true") |
983 | - opt_parser.add_option("-l", "--lpinstance", metavar="INSTANCE", |
984 | - help="Launchpad instance to connect to " |
985 | - "(default: production)", |
986 | - dest="lpinstance", default=None) |
987 | - opt_parser.add_option("--no-conf", |
988 | - help="Don't read config files or " |
989 | - "environment variables.", |
990 | - dest="no_conf", default=False, action="store_true") |
991 | - (options, args) = opt_parser.parse_args() |
992 | - |
993 | - if len(args) < 2: |
994 | - opt_parser.error("Need at least a new main bug and a bug to dup") |
995 | - |
996 | - config = UDTConfig(options.no_conf) |
997 | - if options.lpinstance is None: |
998 | - options.lpinstance = config.get_value("LPINSTANCE") |
999 | - |
1000 | - launchpad = None |
1001 | - try: |
1002 | - print "Setting up Launchpad" |
1003 | - launchpad = Launchpad.login_with("ubuntu-dev-tools", options.lpinstance) |
1004 | - print "Launchpad setup complete" |
1005 | - except ImportError: |
1006 | - suggestion = "check whether python-launchpadlib is installed" |
1007 | - if launchpad is None: |
1008 | - die("Couldn't setup Launchpad for the ubuntu-dev-tools consumer; %s" % \ |
1009 | - (suggestion, )) |
1010 | - |
1011 | - # check that the new main bug isn't a duplicate |
1012 | - try: |
1013 | - new_main_bug = launchpad.bugs[args[0]] |
1014 | - except HTTPError, error: |
1015 | - if error.response.status == 401: |
1016 | - print >> sys.stderr, ("E: Don't have enough permissions to access " |
1017 | - "bug %s") % (args[0]) |
1018 | - die(error.content) |
1019 | - else: |
1020 | - raise |
1021 | - new_main_dup_of = new_main_bug.duplicate_of |
1022 | - if new_main_dup_of is not None: |
1023 | - answer = None |
1024 | - try: |
1025 | - answer = raw_input("Bug %s is a duplicate of %s; would you like to " |
1026 | - "use %s as the new main bug instead? [y/N]" % \ |
1027 | - (new_main_bug.id, new_main_dup_of.id, |
1028 | - new_main_dup_of.id)) |
1029 | - except: |
1030 | - die("Aborted") |
1031 | - if answer.lower() not in ("y", "yes"): |
1032 | - die("User aborted") |
1033 | - new_main_bug = new_main_dup_of |
1034 | - |
1035 | - # build list of bugs to process, first the dups then the bug |
1036 | - bugs_to_process = [] |
1037 | - for bug_number in args[1:]: |
1038 | - print "Processing %s" % (bug_number) |
1039 | - try: |
1040 | - bug = launchpad.bugs[bug_number] |
1041 | - except HTTPError, error: |
1042 | - if error.response.status == 401: |
1043 | - print >> sys.stderr, ("W: Don't have enough permissions to " |
1044 | - "access bug %s") % (bug_number) |
1045 | - print >> sys.stderr, "W: %s" % (error.content) |
1046 | - continue |
1047 | - else: |
1048 | - raise |
1049 | - dups = bug.duplicates |
1050 | - if dups is not None: |
1051 | - bugs_to_process.extend(dups) |
1052 | - print "Found %i dups for %s" % (len(dups), bug_number) |
1053 | - bugs_to_process.append(bug) |
1054 | - |
1055 | - # process dups first, then their main bug |
1056 | - print "Would set the following bugs as duplicates of %s: %s" % \ |
1057 | - (new_main_bug.id, " ".join([str(b.id) for b in bugs_to_process])) |
1058 | - |
1059 | - if not options.force: |
1060 | - answer = None |
1061 | - try: |
1062 | - answer = raw_input("Proceed? [y/N]") |
1063 | - except: |
1064 | - die("Aborted") |
1065 | - if answer.lower() not in ("y", "yes"): |
1066 | - die("User aborted") |
1067 | - |
1068 | - for bug in bugs_to_process: |
1069 | - print "Marking bug %s as a duplicate of %s" % (bug.id, new_main_bug.id) |
1070 | - bug.duplicate_of = new_main_bug |
1071 | - bug.lp_save() |
1072 | - |
1073 | -if __name__ == '__main__': |
1074 | - main() |
1075 | |
1076 | === removed file 'lp-shell' |
1077 | --- lp-shell 2011-08-20 09:31:02 +0000 |
1078 | +++ lp-shell 1970-01-01 00:00:00 +0000 |
1079 | @@ -1,112 +0,0 @@ |
1080 | -#!/usr/bin/python |
1081 | - |
1082 | -# Open an interactive launchpadlib Python shell. |
1083 | -# It supports all known LP service instances and API versions. The login |
1084 | -# can optionally happen anonymously. |
1085 | - |
1086 | -# Author: Martin Pitt <martin.pitt@ubuntu.com> |
1087 | -# Copyright: (C) 2010 Canonical Ltd. |
1088 | -# |
1089 | -# This package is free software; you can redistribute it and/or modify |
1090 | -# it under the terms of the GNU General Public License as published by |
1091 | -# the Free Software Foundation, at version 2. |
1092 | -# |
1093 | -# This package is distributed in the hope that it will be useful, |
1094 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1095 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1096 | -# GNU General Public License for more details. |
1097 | - |
1098 | -import sys |
1099 | -import code |
1100 | -from optparse import OptionParser |
1101 | - |
1102 | -from launchpadlib.launchpad import Launchpad |
1103 | -from launchpadlib.uris import lookup_service_root |
1104 | - |
1105 | -def main(): |
1106 | - instance = 'production' |
1107 | - valid_api_versions = ('beta', '1.0', 'devel') |
1108 | - api_version = '1.0' |
1109 | - |
1110 | - usage = 'Usage: %prog [-a] [instance] [LP API version]' |
1111 | - opt_parser = OptionParser(usage) |
1112 | - opt_parser.add_option('-a', action='store_true', |
1113 | - dest='anonymous', default=False, |
1114 | - help='Login anonymously into LP.') |
1115 | - opt_parser.add_option('--ipython', action='store_const', |
1116 | - dest='shell', const='ipython', default="ipython", |
1117 | - help='Use ipython shell (default).') |
1118 | - opt_parser.add_option('--python', action='store_const', |
1119 | - dest='shell', const='python', |
1120 | - help='Use python shell.') |
1121 | - |
1122 | - |
1123 | - (options, args) = opt_parser.parse_args() |
1124 | - |
1125 | - if len(args) >= 1: |
1126 | - try: |
1127 | - instance = lookup_service_root(args[0]) |
1128 | - except ValueError, err: |
1129 | - print 'E: %s' % (err) |
1130 | - print 'I: Falling back to "production".' |
1131 | - |
1132 | - if len(args) >= 2: |
1133 | - if args[1] in valid_api_versions: |
1134 | - api_version = args[1] |
1135 | - else: |
1136 | - print 'E: "%s" is not a valid LP API version.' % (args[1]) |
1137 | - print 'I: Falling back to "1.0".' |
1138 | - |
1139 | - if options.anonymous: |
1140 | - launchpad = Launchpad.login_anonymously('udt-lp-shell', instance, |
1141 | - version=api_version) |
1142 | - banner = ('Connected anonymously to LP service "%s" with API version ' |
1143 | - '"%s":' % (instance, api_version)) |
1144 | - else: |
1145 | - launchpad = Launchpad.login_with('udt-lp-shell', instance, |
1146 | - version=api_version) |
1147 | - banner = 'Connected to LP service "%s" with API version "%s":' % \ |
1148 | - (instance, api_version) |
1149 | - |
1150 | - banner += '\nNote: LP can be accessed through the "lp" object.' |
1151 | - |
1152 | - sh = None |
1153 | - if options.shell == "ipython": |
1154 | - try: |
1155 | - try: # ipython >= 0.11 |
1156 | - from IPython.frontend.terminal.embed import InteractiveShellEmbed |
1157 | - sh = InteractiveShellEmbed(banner2=banner, user_ns={'lp': launchpad}) |
1158 | - except ImportError: # ipython < 0.11 |
1159 | - # pylint does not handle nested try-except, disable import error |
1160 | - # pylint: disable-msg=E0611 |
1161 | - from IPython.Shell import IPShellEmbed |
1162 | - sh = IPShellEmbed(argv=[], user_ns={'lp': launchpad}) |
1163 | - sh.set_banner(sh.IP.BANNER + '\n' + banner) |
1164 | - sh.excepthook = sys.__excepthook__ |
1165 | - except ImportError: |
1166 | - print "E: ipython not available. Using normal python shell." |
1167 | - |
1168 | - if sh: |
1169 | - sh() |
1170 | - else: |
1171 | - class CompleterConsole(code.InteractiveConsole): |
1172 | - def __init__(self): |
1173 | - local = {'lp': launchpad} |
1174 | - code.InteractiveConsole.__init__(self, locals=local) |
1175 | - try: |
1176 | - import readline |
1177 | - except ImportError: |
1178 | - print 'I: readline module not available.' |
1179 | - else: |
1180 | - import rlcompleter |
1181 | - readline.parse_and_bind("tab: complete") |
1182 | - |
1183 | - # Disable default apport hook, as lp-shell is intended for interactive use |
1184 | - # and thus exceptions often bubble up to the top level. |
1185 | - sys.excepthook = sys.__excepthook__ |
1186 | - |
1187 | - console = CompleterConsole() |
1188 | - console.interact(banner) |
1189 | - |
1190 | -if __name__ == '__main__': |
1191 | - main() |
1192 | |
1193 | === modified file 'setup.py' |
1194 | --- setup.py 2011-07-01 20:07:08 +0000 |
1195 | +++ setup.py 2011-09-02 11:53:47 +0000 |
1196 | @@ -20,18 +20,12 @@ |
1197 | 'check-symbols', |
1198 | 'dch-repeat', |
1199 | 'dgetlp', |
1200 | - 'get-branches', |
1201 | 'get-build-deps', |
1202 | - 'grab-attachments', |
1203 | 'grab-merge', |
1204 | 'grep-merges', |
1205 | 'harvest', |
1206 | 'hugdaylist', |
1207 | 'import-bug-from-debian', |
1208 | - 'lp-list-bugs', |
1209 | - 'lp-project-upload', |
1210 | - 'lp-set-dup', |
1211 | - 'lp-shell', |
1212 | 'massfile', |
1213 | 'merge-changelog', |
1214 | 'mk-sbuild', |
1215 | |
1216 | === modified file 'ubuntutools/test/test_help.py' |
1217 | --- ubuntutools/test/test_help.py 2011-05-24 18:22:37 +0000 |
1218 | +++ ubuntutools/test/test_help.py 2011-09-02 11:53:47 +0000 |
1219 | @@ -29,8 +29,6 @@ |
1220 | 'check-symbols': 'No Help', |
1221 | 'get-build-deps': 'No Help, runs sudo', |
1222 | 'grep-merges': 'No Help', |
1223 | - 'lp-project-upload': 'Returns non-zero after help. ' |
1224 | - 'Leaving u-d-t in LP: #524680', |
1225 | 'pbuilder-dist-simple': 'No Help', |
1226 | 'setup-packaging-environment': 'Throws Error', |
1227 | 'submittodebian': 'No Help', |
Please also update the package description, debian/copyright, and test/test_ help.py. And remove the manpages.
ubuntutools/