aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtpnotify246
1 files changed, 123 insertions, 123 deletions
diff --git a/tpnotify b/tpnotify
index 698c182..732e732 100755
--- a/tpnotify
+++ b/tpnotify
@@ -79,7 +79,7 @@ our $archive_file; # Archive file name
our $topdir; # Toplevel directory from the archive
our $package_name; # Package name;
our $package_tarname; # Package archive name
-our $package_version; # Package version number
+our $package_version; # Package version number
our $package_base; # Package base name
our $release_type; # Package type (alpha or stable)
@@ -237,7 +237,7 @@ EOT
$package_tarname = $package_name;
$package_tarname =~ s/GNU\s+//;
$package_tarname = lc $package_tarname; # FIXME: this is not always right,
- # perhaps
+ # perhaps
info("package $package_name, tarname $package_tarname, version $package_version") if $verbose;
$package_base = "$package_tarname-$package_version";
@@ -277,7 +277,7 @@ sub po_header {
foreach my $s (split /\\n/, $h) {
if ($s =~ /^(.+?):\s*(.*)$/) {
$ret{lc $1}=$2;
- }
+ }
}
\%ret;
}
@@ -344,17 +344,17 @@ sub read_signature {
# Returns the expanded text. Abends on failure.
sub expand_template {
my $cpt = new Safe;
-
+
$cpt->share(qw($sender
- $fullname
- $localdomain
- $recipient
- $archive_file
- $archive_url
- $package_name
- $package_version
- $package_base
- $release_type
+ $fullname
+ $localdomain
+ $recipient
+ $archive_file
+ $archive_url
+ $package_name
+ $package_version
+ $package_base
+ $release_type
$topdir
$signature));
chomp(${$cpt->varglob('signature')} = read_signature);
@@ -380,7 +380,7 @@ sub read_mh_path {
} else {
last if defined($prev) && $prev =~ /^Path:/;
$prev = $_;
- }
+ }
}
close $fd;
return $prev if $prev =~ s/^Path:\s+//;
@@ -398,7 +398,7 @@ sub notify {
$msg->head()->add($hdr);
}
$msg->head()->add("X-Mailer: $progname $VERSION");
-
+
if ($verbose) {
info("message to send");
$msg->print();
@@ -449,7 +449,7 @@ sub mail_box_manager_refile {
$args{type} = 'maildir';
$args{folder} = $folder;
} else {
- abend(EX_DATAERR, "unrecognized Fcc folder: $folder");
+ abend(EX_DATAERR, "unrecognized Fcc folder: $folder");
}
my $mgr = Mail::Box::Manager->new();
@@ -501,10 +501,10 @@ sub movemail_refile {
my %refile_tab = (
'movemail' => { supported => \&movemail_supported,
refile => \&movemail_refile,
- priority => 10 },
+ priority => 10 },
'perl' => { supported => \&mail_box_manager_supported,
refile => \&mail_box_manager_refile,
- priority => 0 }
+ priority => 0 }
);
sub refile {
@@ -525,7 +525,7 @@ sub refile {
info("using $refile_method for refiling");
&{$refile_tab{$refile_method}{refile}}(@_);
}
-
+
END {
chdir("/");
@@ -559,9 +559,9 @@ sub set_mailer {
} else {
err("unknown mailer spec", prefix => $locus);
return 0;
- }
+ }
return 1;
-}
+}
sub read_template_file {
my ($file, $locus) = @_;
@@ -575,7 +575,7 @@ sub read_template_file {
return 0;
}
}
-
+
my %kw = (
keep => \$keep,
'template-file' => \&read_template_file,
@@ -618,11 +618,11 @@ sub read_config {
s/\s+$//;
s/#.*//;
next if ($_ eq "");
-
+
if (/^(.*?)\s*=\s*(.*)/) {
$key = $1;
$val = $2;
-
+
if ($val =~ /<<(\w+)\s*$/) {
$heredoc = $1;
$heredoc_line = $line;
@@ -770,39 +770,39 @@ B<tpnotify>
[B<-m> I<SPEC>]
[B<-s> I<FILE>]
[B<-t> I<FILE>]
-[B<--add=>I<HDR>:I<VAL>]
+[B<--add=>I<HDR>:I<VAL>]
[B<--alpha>]
[B<--config=>I<FILE>]
[B<--debug>]
[B<--domain=>I<DOMAIN>]
[B<--dry-run>]
-[B<--force>]
+[B<--force>]
[B<--from=>I<EMAIL>]
[B<--fullname=>I<NAME>]
[B<--keep>]
[B<--mailer=>I<SPEC>]
[B<--no-config>]
[B<--no-signature>]
-[B<--refile-method=>B<perl> | B<mailutils>]
+[B<--refile-method=>B<perl> | B<mailutils>]
[B<--signature=>I<FILE>]
[B<--stable>]
[B<--template=>I<FILE>]
[B<--to=>I<EMAIL>]
[B<--verbose>]
I<URL>
-
+
B<tpnotify>
[B<-h>]
[B<--help>]
-[B<--usage>]
+[B<--usage>]
=head1 DESCRIPTION
Notifies the coordinator of the I<Translation Project> about new
POT file available at I<URL>. The URL must point to a tarball of
-a package registered at TP (I<http://translationproject.org/domain/>).
+a package registered at TP (I<http://translationproject.org/domain/>).
The tool works as follows:
-
+
First of all, the indicated I<URL> is downloaded to a temporary location
on disk. The contents of the retrieved tarball is inspected. It must
contain the file F<configure.ac> in the project toplevel directory and
@@ -829,8 +829,8 @@ to be a mailbox in traditional B<UNIX> format (relative pathnames are
expanded relative to the user home directory). Otherwise, it is a B<folder
url>:
-=over 8
-
+=over 8
+
=item B<mbox:>[B<//>]I<PATHNAME>
UNIX mailbox located at I<PATHNAME> (relative or absolute).
@@ -854,12 +854,12 @@ which uses GNU mailutils. By default, B<tpnotify> attempts to use B<perl>,
and falls back to B<mailutils> if that's not possible. If the latter is not
available as well, it issues an error message and terminates. The user can
select the refiling method using the B<--refile-method> option. See the
-B<BUGS> section for details.
+B<BUGS> section for details.
Additional configuration is supplied in configuration file and command line.
The latter overrides the former. See the section B<CONFIGURATION> for a
-detailed discussion of the configuration file format.
-
+detailed discussion of the configuration file format.
+
The B<-v> (B<--verbose>) command line option instructs the tool to verbosely
list each step being executed. Additionally, the B<-d> (B<--debug>) option
enables a detailed printout of debugging information describing the mail
@@ -867,7 +867,7 @@ sending process.
The B<-n> (B<--dry-run>) option causes the program to verbosely print what
is being done (as ig given the B<--verbose> option), but not actually send
-the constructed message.
+the constructed message.
=head1 CONFIGURATION
@@ -894,10 +894,10 @@ the line (no leading whitespace allowed). However, whitespace is allowed
between the word and end of line. For example
template = <<EOF
- To: <coordinator@translationproject.org>
- Subject: $package_base.pot
+ To: <coordinator@translationproject.org>
+ Subject: $package_base.pot
- $archive_url
+ $archive_url
EOF
The valid statements are as follows:
@@ -907,9 +907,9 @@ The valid statements are as follows:
=item B<keep=>B<1> | B<0>
If an error occurs, don't remove the temporary directory. This allows the
-user to get more insight into the reasons of the failure.
+user to get more insight into the reasons of the failure.
-See also the B<--keep> option.
+See also the B<--keep> option.
=item B<template-file=>I<FILE>
@@ -919,42 +919,42 @@ line option.
=item B<template=>I<TEXT>
Template for the message. The I<TEXT> is normally a here-document.
-See the B<TEMPLATE> section for a description of its format.
-
+See the B<TEMPLATE> section for a description of its format.
+
=item B<signature-file=>I<FILE>
Read signature from the given file. See also the B<--signature> command line
-option.
-
+option.
+
=item B<mailer=>I<SPEC>
Sets mailer. The argument is a mailer specification as discussed in the
-description of the B<--mailer> command line option below.
-
+description of the B<--mailer> command line option below.
+
=item B<sender=>I<EMAIL>
Sets the sender email address. See also the B<--sender> option.
-
+
=item B<fullname=>I<STRING>
Sets the real name of the recipient. See the B<--fullname> command
-line option.
-
+line option.
+
=item B<domain=>I<DOMAIN>
Sets the sender domain name. This is used when creating the
sender email address to be used in the B<From:> header. See also the
-B<--domain> command line option.
-
+B<--domain> command line option.
+
=item B<to=>I<EMAIL>
Sets the recipient address to be used instead of the emails from
-B<To:>, B<Cc:>, and B<Bcc:> headers of the constructed message.
+B<To:>, B<Cc:>, and B<Bcc:> headers of the constructed message.
=item B<add=>I<HDR>B<:>I<VAL>
Adds the given header to the message. See also the B<--add> command line
-option.
+option.
=item B<refile-method=>B<perl> | B<mailutils>
@@ -964,9 +964,9 @@ The value B<mailutils> means to use the B<movemail> program from B<GNU
mailutils> (L<https://mailutils.org>).
By default, the first available method is used. See the
-B<BUGS> section for possible reasons to use this setting.
-
-=back
+B<BUGS> section for possible reasons to use this setting.
+
+=back
An example of the configuration file follows:
@@ -1000,67 +1000,67 @@ the invoking user, the B<@> sign, and the local host name. If the B<--domain>
command line option, or B<domain> configuration statement is used, its value
is substituted instead of the local host name. If the B<--from> option or
B<sender> configuration statement is used, its value overrides the constructed
-one.
-
+one.
+
=item $fullname
Full real name of the sender. It can be supplied by the B<--fullname> command
line option or B<fullname> configuration statement. If neither of these is
present, the name is obtained from the B<Gecos> line in the B<passwd> entry of
-the invoking user.
-
+the invoking user.
+
=item $localdomain
Local domain name. It is the value of the command line option B<--domain>. If
not present, the value of the configuration statemeot B<domain> is used. If
-that is not present either, then the local host name is used instead.
-
+that is not present either, then the local host name is used instead.
+
=item $signature
Contents of the I<signature file> with the final newline character removed.
The file location is given by the command line option B<--signature> or the
-configuration statement B<--signature-file>.
-
+configuration statement B<--signature-file>.
+
=item $archive_url
I<URL> of the tarball as supplied in the command line.
-
+
=item $archive_file
Name of the tarball. It is the last pathname component from I<URL>.
-
+
=item $topdir
Project toplevel directory as seen in the downloaded tarball.
-
+
=item $package_name;
Full package name. E.g. B<GNU dico>.
-
+
=item $package_tarname
Package I<tarname>. It is the B<$package_name> value with the eventual
-B<GNU> prefix stripped off.
+B<GNU> prefix stripped off.
=item $package_version
Package version number.
-
+
=item $package_base
Package base name, constructed as a concatenation of values of the
B<$package_tarname> and B<$package_version>, separated by a dash.
-
+
=item $release_type
Package type: B<alpha>, or B<stable>. Unless supplied with the corresponding
command line option, it is determined by analyzing B<$package_number>. The
type is B<alpha>, if the number contains three numeric parts, separated by
dots, and the value of the last part is greater than or equal to 90. Otherwise,
-the type is B<stable>.
+the type is B<stable>.
=back
-
+
=head1 OPTIONS
=over 8
@@ -1068,22 +1068,22 @@ the type is B<stable>.
=item B<--force>
Force submitting the message even if the downloaded POT file does not pass
-checks.
-
+checks.
+
=item B<--no-config>
Don't read configuration file.
-
+
=item B<--no-signature>
Don't read signature file. The B<$signature> template variable will be
undefined.
-
+
=item B<--to=>I<EMAIL>
Send message to I<EMAIL>, instead of the addresses specified in the message
-itself.
-
+itself.
+
=item B<-A>, B<--alpha>
Assume I<URL> is an alpha release.
@@ -1093,42 +1093,42 @@ Assume I<URL> is an alpha release.
Use I<DOMAIN> as the sender domain. This is used when creating the
sender email address to be used in the B<From:> header. It is constructed
by concatenating the login name of the invoking user, the B<@> sign, and the
-local host name (or I<DOMAIN>, if set).
-
+local host name (or I<DOMAIN>, if set).
+
=item B<-F>, B<--fullname=>I<NAME>
Set the full real name of the sender. It is used to construct the B<From:>
header. When using B<sendmail> mailer, it will also be passed with the B<-F>
-option to B<sendmail>.
-
+option to B<sendmail>.
+
=item B<-S>, B<--stable>
Assume I<URL> is a stable release.
-
+
=item B<-a>, B<--add=>I<HDR>B<:>I<VAL>
-Append the given header to the message.
-
+Append the given header to the message.
+
=item B<-c>, B<--config=>I<FILE>
Read configuration from I<FILE>, instead of F<~/.tpnotify>.
=item B<-d>, B<--debug>
-Debug the mail sending transaction.
-
+Debug the mail sending transaction.
+
=item B<-f>, B<--from=>I<EMAIL>
Sets the sender email address. Unless this option is supplied, the email
address of the sender of the message will be constructed by concatenating
the login name of the invoking user, the B<@> sign, and the
local host name (or the local domain, if set via the B<--domain> option).
-
+
=item B<-k>, B<--keep>
If an error occurs, don't remove the temporary directory. This allows the
-user to get more insight into the reasons of the failure.
-
+user to get more insight into the reasons of the failure.
+
=item B<-m>, B<--mailer=>I<SPEC>
Sets the mailer. The I<SPEC> is one of the following:
@@ -1151,62 +1151,62 @@ relay to use. I<PORT>, if supplied, is the port number to use instead of the
default 25. Optional I<USER> and I<PASS> provide credentials, if the relay
requires authentication.
-=back
-
+=back
+
=item B<-n>, B<--dry-run>
Don't actually send the message. Verbosely print what is being done (see
the B<--verbose> option) and display the content of the message that whould
-have been sent.
+have been sent.
=item B<--refile-method=>B<perl> | B<mailutils>
Select the method to implement B<Fcc>. Refer to the description of
the B<refile-method> setting in the B<CONFIGURATION> chapter for a
-detailed discussion.
-
+detailed discussion.
+
=item B<-s>, B<--signature=>I<FILE>
Read signature from I<FILE>. The content of the file is available as the
value of the B<$signature> template variable.
-
+
=item B<-t>, B<--template=>I<FILE>
-Read template from I<FILE>. See the section B<TEMPLATE> for its format.
-
+Read template from I<FILE>. See the section B<TEMPLATE> for its format.
+
=item B<-v>, B<--verbose>
-Verbosely print what is being done.
-
-=back
-
+Verbosely print what is being done.
+
+=back
+
The following options are informative. They cause the program to print
the required piece of information and exit. The remaining options and
-arguments are silently ignored.
-
+arguments are silently ignored.
+
=over 8
=item B<-h>
Produce a short help summary.
-
+
=item B<--help>
Print a detailed manual.
-
+
=item B<--usage>
Display a short command line usage summary.
-
-=back
+
+=back
=head1 EXIT CODE
=over 4
=item B<0>
-
-Success
+
+Success
=item B<64>
@@ -1215,9 +1215,9 @@ Command line usage error.
=item B<65>
Downloaded archive contains invalid data. See the error messages for details.
-
+
=item B<66>
-
+
Required input file cannot be opened.
=item B<69>
@@ -1226,17 +1226,17 @@ Subprocess exited with error status or on signal.
=item B<71>
-Failed to run subprocess, or failed to change the directory.
-
+Failed to run subprocess, or failed to change the directory.
+
=item B<73>
-
+
Required output file cannot be created or written.
=item B<78>
-
+
Configuration error.
-=back
+=back
=head1 BUGS
@@ -1249,14 +1249,14 @@ This is not a B<tpnotify> bug, but a bug of B<Mail::Box::Manager>. It has
been reported (see L<https://rt.cpan.org/Public/Bug/Display.html?id=130193>)
and hopefully it will be fixed in one of the future versions of
B<Mail::Box::Manager>.
-
+
This is only a warning and can safely be ignored. If it does bother you,
you can switch to GNU mailutils for refiling the message. To do so, first
install movemail from GNU mailutils (the exact instructions vary depending
on the distro you are using), and then use the
B<--refile-method=mailutils> option or B<refile-method=mailutils> statement
-in your F<~/.tpnotify> configuration file.
-
+in your F<~/.tpnotify> configuration file.
+
=head1 AUTHOR
Sergey Poznyakoff <gray@gnu.org>

Return to:

Send suggestions and report system problems to the System administrator.