mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-05 05:51:29 +00:00
Add option parsing to massfile, for lpinstance, correct manpage's view on file locations
This commit is contained in:
parent
2de4aecc4f
commit
86b7ff977c
@ -3,15 +3,25 @@
|
|||||||
\fBmassfile\fR \- script for massfiling bugs against Ubuntu packages
|
\fBmassfile\fR \- script for massfiling bugs against Ubuntu packages
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fBmassfile\fR <path to instructions file> <path to list file>
|
\fBmassfile\fR [\fIoptions\fR]
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBmassfile\fR is a script for massfiling bugs against Ubuntu packages in Launchpad. It requires an instructions file describing the contents of the bug report and a list file which lists the packages which the bug will be filed against.
|
\fBmassfile\fR is a script for massfiling bugs against Ubuntu packages in Launchpad. It requires an instructions file describing the contents of the bug report and a list file which lists the packages which the bug will be filed against.
|
||||||
|
|
||||||
Templates for both files can be found in /usr/share/doc/ubuntu-dev-tools/examples.
|
Templates for both files can be found in /usr/share/doc/ubuntu-dev-tools/examples.
|
||||||
|
|
||||||
|
.SH OPTIONS
|
||||||
|
.TP
|
||||||
|
.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
|
||||||
|
Use the specified instance of Launchpad (e.g. "staging"), instead of
|
||||||
|
the default of "production".
|
||||||
|
.TP
|
||||||
|
.B \-\-no\-conf
|
||||||
|
Do not read any configuration files, or configuration from environment
|
||||||
|
variables.
|
||||||
|
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
\fBmassfile.instructions\fR - file designating the contents of the bug report
|
\fBinstructions\fR - file designating the contents of the bug report
|
||||||
|
|
||||||
subject: [UNMETDEPS] $pack has unmet dependencies
|
subject: [UNMETDEPS] $pack has unmet dependencies
|
||||||
assignee:
|
assignee:
|
||||||
@ -30,13 +40,29 @@ Templates for both files can be found in /usr/share/doc/ubuntu-dev-tools/example
|
|||||||
.
|
.
|
||||||
Please have a look and make sure it's installable again.
|
Please have a look and make sure it's installable again.
|
||||||
|
|
||||||
\fBmassfile.list\fR - file designating the packages affected
|
\fBlist\fR - file designating the packages affected
|
||||||
|
|
||||||
Each package should be listed on a new line as follows:
|
Each package should be listed on a new line as follows:
|
||||||
|
|
||||||
z88dk
|
z88dk
|
||||||
zope-quotafolder
|
zope-quotafolder
|
||||||
|
|
||||||
|
.SH ENVIRONMENT
|
||||||
|
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
|
||||||
|
environment variables.
|
||||||
|
Variables in the environment take precedence to those in configuration
|
||||||
|
files.
|
||||||
|
|
||||||
|
.SH CONFIGURATION VARIABLES
|
||||||
|
The following variables can be set in the environment or in
|
||||||
|
.BR ubuntu\-dev\-tools (5)
|
||||||
|
configuration files.
|
||||||
|
In each case, the script\-specific variable takes precedence over the
|
||||||
|
package\-wide variable.
|
||||||
|
.TP
|
||||||
|
.BR MASSFILE_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
|
||||||
|
The default value for \fB--lpinstance\fR.
|
||||||
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
\fBmassfile\fR was written by Iain Lane <iain@orangesquash.org.uk>, Daniel Hahler <ubuntu@thequod.de>. and Markus Korn <thekorn@gmx.de>.
|
\fBmassfile\fR was written by Iain Lane <iain@orangesquash.org.uk>, Daniel Hahler <ubuntu@thequod.de>. and Markus Korn <thekorn@gmx.de>.
|
||||||
|
|
||||||
|
30
massfile
30
massfile
@ -23,10 +23,12 @@
|
|||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
|
|
||||||
|
import optparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import email
|
import email
|
||||||
|
|
||||||
|
from ubuntutools.config import UDTConfig
|
||||||
from ubuntutools.lp.libsupport import get_launchpad, translate_api_web, translate_web_api
|
from ubuntutools.lp.libsupport import get_launchpad, translate_api_web, translate_web_api
|
||||||
|
|
||||||
def read_config():
|
def read_config():
|
||||||
@ -77,9 +79,7 @@ def check_configfiles():
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def file_bug(config):
|
def file_bug(config, launchpad):
|
||||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
summary = config["subject"].replace("$pack", config["sourcepackage"])
|
summary = config["subject"].replace("$pack", config["sourcepackage"])
|
||||||
description = config["text"].replace("$pack", config["sourcepackage"])
|
description = config["text"].replace("$pack", config["sourcepackage"])
|
||||||
@ -113,7 +113,7 @@ def file_bug(config):
|
|||||||
except:
|
except:
|
||||||
"Bug for '%s' was not filed." % config["sourcepackage"]
|
"Bug for '%s' was not filed." % config["sourcepackage"]
|
||||||
|
|
||||||
def read_buglist(url):
|
def read_buglist(url, launchpad):
|
||||||
if not url:
|
if not url:
|
||||||
return set()
|
return set()
|
||||||
|
|
||||||
@ -122,7 +122,6 @@ def read_buglist(url):
|
|||||||
print >> sys.stderr, "Options in url are not supported, url: %s" %url
|
print >> sys.stderr, "Options in url are not supported, url: %s" %url
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
launchpad = get_launchpad("ubuntu-dev-tools")
|
|
||||||
packages = set()
|
packages = set()
|
||||||
|
|
||||||
api_url = translate_web_api(url, launchpad)
|
api_url = translate_web_api(url, launchpad)
|
||||||
@ -138,17 +137,34 @@ def read_buglist(url):
|
|||||||
return packages
|
return packages
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
p = optparse.OptionParser(description=
|
||||||
|
'Files bugs against multiple packages in Ubuntu. '
|
||||||
|
'Reads the bug from "instructions" and files them against '
|
||||||
|
'packages listed in "list". '
|
||||||
|
"If these files aren't preset they are created.")
|
||||||
|
p.add_option('-l', '--lpinstance', metavar='INSTANCE',
|
||||||
|
dest='lpinstance', default=None,
|
||||||
|
help='Launchpad instance to connect to (default: production)')
|
||||||
|
p.add_option('--no-conf',
|
||||||
|
dest='no_conf', default=False, action='store_true',
|
||||||
|
help="Don't read config files or environment variables")
|
||||||
|
opts, args = p.parse_args()
|
||||||
|
udtconfig = UDTConfig(options.no_conf)
|
||||||
|
if options.lpinstance is None:
|
||||||
|
options.lpinstance = udtconfig.get_value('LPINSTANCE')
|
||||||
|
|
||||||
if not check_configfiles():
|
if not check_configfiles():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
launchpad = get_launchpad('ubuntu-dev-tools' server=options.lpinstance)
|
||||||
config = read_config()
|
config = read_config()
|
||||||
pack_list = read_list()
|
pack_list = read_list()
|
||||||
buglist = read_buglist(config["buglist-url"])
|
buglist = read_buglist(config["buglist-url"], launchpad)
|
||||||
|
|
||||||
for pack in pack_list:
|
for pack in pack_list:
|
||||||
if pack not in buglist:
|
if pack not in buglist:
|
||||||
config["sourcepackage"] = pack
|
config["sourcepackage"] = pack
|
||||||
file_bug(config)
|
file_bug(config, launchpad)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
@ -30,7 +30,6 @@ BLACKLIST = {
|
|||||||
'get-build-deps': 'No Help, runs sudo',
|
'get-build-deps': 'No Help, runs sudo',
|
||||||
'grep-merges': 'No Help',
|
'grep-merges': 'No Help',
|
||||||
'lp-project-upload': 'Returns non-zero after help. Leaving u-d-t in LP: #524680',
|
'lp-project-upload': 'Returns non-zero after help. Leaving u-d-t in LP: #524680',
|
||||||
'massfile': 'No Help. Leaves files in .',
|
|
||||||
'mk-sbuild': 'Fires up apt-get before showing help',
|
'mk-sbuild': 'Fires up apt-get before showing help',
|
||||||
'pbuilder-dist-simple': 'No Help',
|
'pbuilder-dist-simple': 'No Help',
|
||||||
'setup-packaging-environment': 'Throws Error',
|
'setup-packaging-environment': 'Throws Error',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user