source: install/scripts/diff.archives.sympa @ 14

Revision 14, 4.7 KB checked in by anarcat, 7 years ago (diff)

[project @ alternc: changeset 2003-03-27 23:39:05 by jonathan]
Installation de la nouvelle arborescence

Original author: jonathan
Date: 2003-03-27 23:39:19

Line 
1*** archived.pl.orig    Sat Feb 23 20:25:57 2002
2--- archived.pl Sat Sep 14 15:05:49 2002
3***************
4*** 294,346 ****
5      #    chdir($wwsconf->{'arc_path'});
6     
7      if (! -d "$arcpath/$listname\@$hostname") {
8!       unless (mkdir ("$arcpath/$listname\@$hostname", 0775)) {
9            &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname");
10            return undef;
11        }
12        do_log('debug',"mkdir $arcpath/$listname\@$hostname");
13      }
14!     if (! -d "$arcpath/$listname\@$hostname/$yyyy-$mm") {
15!       unless (mkdir ("$arcpath/$listname\@$hostname/$yyyy-$mm", 0775)) {
16!           &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname/$yyyy-$mm");
17!           return undef;
18!       }
19!       do_log('debug',"mkdir $arcpath/$listname\@$hostname/$yyyy-$mm");
20!     }
21!     if (! -d "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt") {
22!       unless (mkdir ("$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt", 0775)) {
23!           &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
24!           return undef;
25!       }
26!       do_log('debug',"mkdir $arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
27!     }
28!     
29!     ## copy the file in the arctxt and in "mhonarc -add"
30!     opendir (DIR, "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
31!     my @files = (sort { $a <=> $b;}  readdir(DIR)) ;
32!     $files[$#files]+=1;
33!     my $newfile = $files[$#files];
34! #    my $newfile = $files[$#files]+=1;
35     
36      my $mhonarc_ressources = &get_ressources ($listname . '@' . $hostname) ;
37     
38      do_log ('debug',"calling $wwsconf->{'mhonarc'} for list $listname\@$hostname" ) ;
39!     my $cmd = "$wwsconf->{'mhonarc'} -add -rcfile $mhonarc_ressources -outdir $arcpath/$listname\@$hostname/$yyyy-$mm  -definevars \"listname='$listname' hostname=$hostname yyyy=$yyyy mois=$mm yyyymm=$yyyy-$mm wdir=$wwsconf->{'arc_path'} base=$Conf{'wwsympa_url'}/arc \" -umask $Conf{'umask'} < $queue/$file";
40!     
41      my $exitcode = system($cmd);
42      if ($exitcode) {
43             do_log('debug',"Command $cmd failed with exit code $exitcode");
44      }
45 
46     
47-     open (ORIG, "$queue/$file") || fatal_err("couldn't open file $queue/$file");
48-     open (DEST, ">$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt/$newfile") || fatal_err("couldn't open file $newfile");
49-     while (<ORIG>) {
50-         print DEST $_ ;
51-     }
52-     
53-     close ORIG; 
54-     close DEST;
55  }
56 
57  sub get_ressources {
58--- 294,345 ----
59      #    chdir($wwsconf->{'arc_path'});
60     
61      if (! -d "$arcpath/$listname\@$hostname") {
62!       unless (system("/data/exec/wmkdir $arcpath/$listname\@$hostname 0775")) {
63            &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname");
64            return undef;
65        }
66        do_log('debug',"mkdir $arcpath/$listname\@$hostname");
67      }
68! #    if (! -d "$arcpath/$listname\@$hostname/$yyyy-$mm") {
69! #     unless (system("/data/exec/wmkdir $arcpath/$listname\@$hostname/$yyyy-$mm 0775")) {
70! #         &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname/$yyyy-$mm");
71! #         return undef;
72! #     }
73! #     do_log('debug',"mkdir $arcpath/$listname\@$hostname/$yyyy-$mm");
74! #    }
75! #    if (! -d "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt") {
76! #     unless (system("/data/exec/wmkdir $arcpath/$listname\@$hostname/$yyyy-$mm/arctxt 0775")) {
77! #         &do_log('notice', 'Cannot create directory %s', "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
78! #         return undef;
79! #     }
80! #     do_log('debug',"mkdir $arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
81! #    }
82!     
83! #    ## copy the file in the arctxt and in "mhonarc -add"
84! #    opendir (DIR, "$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt");
85! #    my @files = (sort { $a <=> $b;}  readdir(DIR)) ;
86! #    $files[$#files]+=1;
87! #    my $newfile = $files[$#files];
88! ##    my $newfile = $files[$#files]+=1;
89     
90      my $mhonarc_ressources = &get_ressources ($listname . '@' . $hostname) ;
91     
92      do_log ('debug',"calling $wwsconf->{'mhonarc'} for list $listname\@$hostname" ) ;
93!     my $cmd = "$wwsconf->{'mhonarc'} -add -rcfile $mhonarc_ressources -outdir $arcpath/$listname\@$hostname/ -definevars \"listname='$listname' hostname=$hostname yyyy=$yyyy mois=$mm yyyymm=$yyyy-$mm wdir=$wwsconf->{'arc_path'} base=$Conf{'wwsympa_url'}/arc \" -umask $Conf{'umask'} < $queue/$file";
94      my $exitcode = system($cmd);
95      if ($exitcode) {
96             do_log('debug',"Command $cmd failed with exit code $exitcode");
97      }
98 
99+ #    open (ORIG, "$queue/$file") || fatal_err("couldn't open file $queue/$file");
100+ #    open (DEST, ">$arcpath/$listname\@$hostname/$yyyy-$mm/arctxt/$newfile") || fatal_err("couldn't open file $newfile");
101+ #    while (<ORIG>) {
102+ #        print DEST $_ ;
103+ #    }
104+ #   
105+ #    close ORIG; 
106+ #    close DEST;
107     
108  }
109 
110  sub get_ressources {
Note: See TracBrowser for help on using the repository browser.