~ubuntu-branches/debian/squeeze/sympa/squeeze

« back to all changes in this revision

Viewing changes to debian/doc/tulp2sympa

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Hornburg (Racke)
  • Date: 2004-04-29 01:04:22 UTC
  • Revision ID: james.westby@ubuntu.com-20040429010422-mz4bdfe39p4edznv
Tags: 3.4.4.3-6
* create system group for sympa instead of a regular one 
  (Closes: #246416, thanks to Martin Theiss <mtheiss@neo.wh-stuttgart.de>)
* updated Brazilian Portuguese debconf template translation
  (Closes: #228249, thanks to Andre Luis Lopes <andrelop@debian.org>)
* added Catalan debconf template translation (Closes: #236647, thanks to
  Aleix Badia i Bosch <abadia@ica.es>)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# I got this script from St�phane Bortzmeyer <bortz@pasteur.fr>
 
2
# You need to launch it for each list
 
3
# perl ./tulp2sympa list-name
 
4
 
 
5
# Ce script m'a �t� fourni par St�phane Bortzmeyer <bortz@pasteur.fr>
 
6
# Il faut le lancer � la main pour chaque liste :
 
7
# perl ./tulp2sympa nom_de_la_liste
 
8
 
 
9
$tulp_dir = "/home/listserv/expl";
 
10
$sympa_dir = "/var/spool/sympa/expl";
 
11
 
 
12
$list = shift (@ARGV);
 
13
 
 
14
if (! $list) {
 
15
    die "Usage: $0 list-name"
 
16
    }
 
17
 
 
18
if (! -e "$tulp_dir/$list.u") {
 
19
    die "I cannot find list $list in $tulp_dir";
 
20
}
 
21
 
 
22
open (OLD, "< $tulp_dir/$list.u") || die "Cannot open old config: $!";
 
23
mkdir ("$sympa_dir/$list", 0700) || die "Cannot mkdir in $sympa_dir: $!";
 
24
open (STATS, "> $sympa_dir/$list/stats");
 
25
open (ABONNES, "> $sympa_dir/$list/abonnes");
 
26
if (-e "$tulp_dir/$list.w") {
 
27
    open (DOTW, "< $tulp_dir/$list.w");
 
28
    open (BIENVENUE, "> $sympa_dir/$list/bienvenue");
 
29
    while (<DOTW>) {
 
30
        print BIENVENUE;
 
31
    }   
 
32
    close (DOTW);
 
33
    close (BIENVENUE);
 
34
}
 
35
open (CONFIG, "> $sympa_dir/$list/config");
 
36
open (ABONNES, "> $sympa_dir/$list/abonnes");
 
37
$in_abonnes = 0;
 
38
while (<OLD>) {
 
39
    if (/\s*#/) {
 
40
        /^\s*#\s*([a-zA-Z]+)\s*=\s*(.*)$/;
 
41
        $keyword = $1;
 
42
        $value = $2;
 
43
        if ($keyword =~ /^owner$/i) {
 
44
            print CONFIG "owner \n";
 
45
            print CONFIG "email $value\n\n";
 
46
        }
 
47
        else {
 
48
            print CONFIG "$keyword $value\n";
 
49
        }
 
50
    }
 
51
    elsif (/^\s*$/) {
 
52
        # Ignore empty lines
 
53
    }
 
54
    else {
 
55
        /^\s*([a-zA-Z0-9\.\-_@%<>\"]+)\s*(\(([^\)]*)\)|)\s*$/;
 
56
        $email = $1;
 
57
        $gecos = $2;
 
58
        if (! $email) {
 
59
            die "Strange line $_";
 
60
        }
 
61
        print ABONNES "date \n";
 
62
        print ABONNES "email $email\n";
 
63
        print ABONNES "gecos $gecos\n\n";
 
64
    }
 
65
}
 
66
close (OLD);
 
67
close (CONFIG);
 
68
close (ABONNES);
 
69
 
 
70
system "chown -R sympa.sympa $sympa_dir/$list";
 
71
 
 
72
 
 
73