Reword the copyright notices to match what's suggested in GPLv3.
[automake/plouj.git] / lib / Automake / General.pm
bloba155943e99a71cca9074f6c7ed0d39467fc29f38
1 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3, or (at your option)
6 # any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 package Automake::General;
18 use 5.005;
19 use strict;
20 use Exporter;
21 use File::Basename;
23 use vars qw (@ISA @EXPORT);
25 @ISA = qw (Exporter);
26 @EXPORT = qw (&uniq $me);
28 # Variable we share with the main package. Be sure to have a single
29 # copy of them: using `my' together with multiple inclusion of this
30 # package would introduce several copies.
31 use vars qw ($me);
32 $me = basename ($0);
34 # END
35 # ---
36 # Exit nonzero whenever closing STDOUT fails.
37 sub END
39 # This is required if the code might send any output to stdout
40 # E.g., even --version or --help. So it's best to do it unconditionally.
41 if (! close STDOUT)
43 print STDERR "$me: closing standard output: $!\n";
44 $? = 74; # EX_IOERR
45 return;
50 # @RES
51 # uniq (@LIST)
52 # ------------
53 # Return LIST with no duplicates.
54 sub uniq (@)
56 my @res = ();
57 my %seen = ();
58 foreach my $item (@_)
60 if (! exists $seen{$item})
62 $seen{$item} = 1;
63 push (@res, $item);
66 return wantarray ? @res : "@res";
70 1; # for require
72 ### Setup "GNU" style for perl-mode and cperl-mode.
73 ## Local Variables:
74 ## perl-indent-level: 2
75 ## perl-continued-statement-offset: 2
76 ## perl-continued-brace-offset: 0
77 ## perl-brace-offset: 0
78 ## perl-brace-imaginary-offset: 0
79 ## perl-label-offset: -2
80 ## cperl-indent-level: 2
81 ## cperl-brace-offset: 0
82 ## cperl-continued-brace-offset: 0
83 ## cperl-label-offset: -2
84 ## cperl-extra-newline-before-brace: t
85 ## cperl-merge-trailing-else: nil
86 ## cperl-continued-statement-offset: 2
87 ## End: