/[smecontribs]/rpms/perl-Ezmlm/contribs9/perl-Ezmlm-0.08-2-v722flags.patch
ViewVC logotype

Contents of /rpms/perl-Ezmlm/contribs9/perl-Ezmlm-0.08-2-v722flags.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Apr 22 09:13:02 2016 UTC (8 years, 7 months ago) by unnilennium
Branch: MAIN
CVS Tags: perl-Ezmlm-0_08-4_el6_sme, HEAD
Initial import

1 --- Ezmlm-0.08.2/Ezmlm.pm.saveconfig722 2016-04-19 10:12:50.000000000 -0400
2 +++ Ezmlm-0.08.2/Ezmlm.pm 2016-04-20 05:39:11.000000000 -0400
3 @@ -170,7 +170,8 @@
4 # can we actually alter this list;
5 ($self->_seterror(-1, 'must setlist() before you update()') && return 0) unless(defined($self->{'LIST_NAME'}));
6 # check for important files: 'config' (idx < v5.0) or 'flags' (idx >= 5.0)
7 - ($self->_seterror(-1, "$self->{'LIST_NAME'} does not appear to be a valid list in update()") && return 0) unless((-e "$self->{'LIST_NAME'}/config") || (-e "$self->{'LIST_NAME'}/flags"));
8 + #nomore config or flags in 7.2.2
9 + ($self->_seterror(-1, "$self->{'LIST_NAME'} does not appear to be a valid list in update()") && return 0) unless((-e "$self->{'LIST_NAME'}/config") || (-e "$self->{'LIST_NAME'}/flags") || (get_version() >= 7));
10
11 # Work out if this is a vhost.
12 open(OUTHOST, "<$self->{'LIST_NAME'}/outhost") || ($self->_seterror(-1, 'unable to read outhost in update()') && return 0);
13 @@ -205,7 +206,10 @@
14 my($options);
15
16 # Read the config file
17 - if(-e $self->{LIST_NAME} . "/flags") {
18 + if (get_version() >= 7){
19 + # there are no more flags or config file, but file/flags in directory
20 + $options = $self->_getconfig_idx7();
21 + } elsif(-e $self->{LIST_NAME} . "/flags") {
22 # this file exists since ezmlm-idx-5.0.0
23 # 'config' is not authorative anymore since that version
24 $options = $self->_getconfig_idx5();
25 @@ -860,6 +864,67 @@
26 return $options;
27 }
28
29 +
30 +# == Internal function to work out a list configuration (idx >= v7.0) ==
31 +sub _getconfig_idx7 {
32 + my($self) = @_;
33 + my ($options, %optionfiles);
34 + my ($file, $opt_num, $temp, $i);
35 + $options = '';
36 + $options .= 'a' if ((-e "$self->{'LIST_NAME'}/archived") || (-e "$self->{'LIST_NAME'}/indexed"));#v7 could be archived or indexed
37 + $options .= 'b' if (-e "$self->{'LIST_NAME'}/modgetonly");
38 + $options .= 'd' if (-e "$self->{'LIST_NAME'}/digested");
39 + $options .= 'f' if (-e "$self->{'LIST_NAME'}/prefix");
40 + $options .= 'g' if (-e "$self->{'LIST_NAME'}/subgetonly");
41 + $options .= 'h' if (-e "$self->{'LIST_NAME'}/nosubconfirm");
42 + $options .= 'i' if (-e "$self->{'LIST_NAME'}/threaded");
43 + $options .= 'j' if (-e "$self->{'LIST_NAME'}/nounsubconfirm");
44 + $options .= 'k' if (-e "$self->{'LIST_NAME'}/blacklist" || -e "$self->{'LIST_NAME'}/deny");
45 + $options .= 'l' if (-e "$self->{'LIST_NAME'}/modcanlist");
46 + $options .= 'm' if (-e "$self->{'LIST_NAME'}/modpost");# for v7 mu for noreturnposts
47 + $options .= 'n' if (-e "$self->{'LIST_NAME'}/modcanedit");
48 + $options .= 'o' if (-e "$self->{'LIST_NAME'}/modpostonly");
49 + $options .= 'p' if (-e "$self->{'LIST_NAME'}/public");
50 + $options .= 'q' ;# always on in v7
51 + $options .= 'r' if (-e "$self->{'LIST_NAME'}/remote");
52 + $options .= 's' if (-e "$self->{'LIST_NAME'}/modsub");
53 + $options .= 't' if (-e "$self->{'LIST_NAME'}/addtrailer");
54 + $options .= 'u' if (-e "$self->{'LIST_NAME'}/subpostonly");
55 + $options .= 'x' if (-e "$self->{'LIST_NAME'}/extra" || -e "$self->{'LIST_NAME'}/allow");
56 + $options .= 'y' if (-e "$self->{'LIST_NAME'}/confirmpost");
57 + # Add the unselected options too
58 + # but we will skip invalid options (any of 'cevz')
59 + foreach $i ('a' .. 'z') {
60 + $options .= uc($i) unless (('cevz' =~ /$i/) || ($options =~ /$i/i))
61 + }
62 +
63 + # values from different files
64 + # first: preset a array with "filename" and "option_number"
65 + %optionfiles = (
66 + 'sublist', 0,
67 + 'fromheader', 3,
68 + 'tstdigopts', 4,
69 + 'owner', 5,
70 + 'sql', 6,
71 + 'modpost', 7,
72 + 'modsub', 8,
73 + 'remote', 9);
74 + while (($file, $opt_num) = each(%optionfiles)) {
75 + if (-e "$self->{'LIST_NAME'}/$file") {
76 + chomp($temp = $self->getpart($file));
77 + $temp =~ m/^(.*)$/m; # take only the first line
78 + $temp = $1;
79 + # the 'owner' setting can be ignored if it is a path (starts with '/')
80 + unless (($opt_num == 5) && ($temp =~ m#^/#)) {
81 + $options .= " -$opt_num '$temp'" if ($temp =~ /\S/);
82 + }
83 + }
84 + }
85 +
86 + return $options;
87 +}
88 +
89 +
90 # == Internal function to work out a list configuration manually (idx < v5.0.0 ) ==
91 sub _getconfigmanual {
92 # use this function for strange lists without

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed