#! /usr/bin/perl -w # mass-bug: mass-file a bug report against a list of packages # For options, see the usage message below. # # Copyright 2006 by Joey Hess # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA =head1 NAME mass-bug - mass-file a bug report against a list of packages =head1 SYNOPSIS mass-bug [options] --subject="bug subject" template package-list =head1 DESCRIPTION mass-bug assists in filing a mass bug report in the Debian BTS on a set of packages. For each package in the package-list file (which should list one package per line), it fills out the template, adds BTS pseudo-headers, and either displays or sends the bug report. Warning: Some care has been taken to avoid unpleasant and common mistakes, but this is still a power tool that can generate massive amounts of bug report mails. Use it with care, and read the documentation in the Developer's Reference about mass filing of bug reports first. =head1 TEMPLATE The template file is the body of the message that will be sent for each bug report, excluding the BTS pseudo-headers. In the template, #PACKAGE# is replaced with the name of the package. Note that text in the template will be automatically word-wrapped to 70 columns. =head1 OPTIONS B examines the B configuration files as described below. Command line options override the configuration file settings, though. =over 4 =item --display Fill out the templates for each package and display them all for verification. This is the default behavior. =item --send Actually send the bug reports. =item --subject="bug subject" Specify the subject of the bug report. The subject will be automatically prefixed with the name of the package that the bug is filed against. =item --sendmail=SENDMAILCMD Specify the sendmail command. The command will be split on white space and will not be passed to a shell. Default is '/usr/sbin/sendmail'. =item --no-conf, --noconf Do not read any configuration files. This can only be used as the first option given on the command-line. =item --help Provide a usage message. =item --version Display version information. =over 4 =back =head1 ENVIRONMENT DEBEMAIL and EMAIL can be set in the environment to control the email address that the bugs are sent from. =head1 CONFIGURATION VARIABLES The two configuration files F and F<~/.devscripts> are sourced by a shell in that order to set configuration variables. Command line options can be used to override configuration file settings. Environment variable settings are ignored for this purpose. The currently recognised variables are: =over 4 =item BTS_SENDMAIL_COMMAND If this is set, specifies a sendmail command to use instead of /usr/sbin/sendmail. Same as the --sendmail command line option. =back =cut use strict; use Getopt::Long; use Text::Wrap; use File::Basename; my $progname = basename($0); $Text::Wrap::columns=70; my $submission_email="maintonly\@bugs.debian.org"; my $sendmailcmd='/usr/sbin/sendmail'; my $modified_conf_msg; sub usageerror { die "Usage: $progname [options] --subject=\"bug subject\"