Lines 1-6
Link Here
|
1 |
--- ./update.pl.orig 2014-08-19 15:02:15.000000000 +0400 |
1 |
--- ./update.pl.orig 2014-09-03 13:36:33.000000000 +0400 |
2 |
+++ ./update.pl 2014-08-19 15:03:11.000000000 +0400 |
2 |
+++ ./update.pl 2014-09-03 13:56:16.000000000 +0400 |
3 |
@@ -204,7 +204,7 @@ |
3 |
@@ -222,7 +222,7 @@ |
4 |
if ( $ConfigPath ne "" && -r $ConfigPath ) { |
4 |
if ( $ConfigPath ne "" && -r $ConfigPath ) { |
5 |
(my $confDir = $ConfigPath) =~ s{/[^/]+$}{}; |
5 |
(my $confDir = $ConfigPath) =~ s{/[^/]+$}{}; |
6 |
die("BackupPC::Lib->new failed\n") |
6 |
die("BackupPC::Lib->new failed\n") |
Lines 9-15
Link Here
|
9 |
%Conf = $bpc->Conf(); |
9 |
%Conf = $bpc->Conf(); |
10 |
%OrigConf = %Conf; |
10 |
%OrigConf = %Conf; |
11 |
if ( !$opts{fhs} ) { |
11 |
if ( !$opts{fhs} ) { |
12 |
@@ -507,198 +507,14 @@ |
12 |
@@ -494,239 +494,21 @@ |
13 |
|
13 |
|
14 |
print <<EOF; |
14 |
print <<EOF; |
15 |
|
15 |
|
Lines 25-34
Link Here
|
25 |
|
25 |
|
26 |
exit unless prompt("--> Do you want to continue?", "y") =~ /y/i; |
26 |
exit unless prompt("--> Do you want to continue?", "y") =~ /y/i; |
27 |
|
27 |
|
28 |
-# |
28 |
# |
29 |
-# Create install directories |
29 |
-# Create install directories |
30 |
-# |
30 |
-# |
31 |
-foreach my $dir ( qw(bin doc |
31 |
-foreach my $dir ( qw(bin share/doc/BackupPC |
32 |
- lib/BackupPC/CGI |
32 |
- lib/BackupPC/CGI |
33 |
- lib/BackupPC/Config |
33 |
- lib/BackupPC/Config |
34 |
- lib/BackupPC/Lang |
34 |
- lib/BackupPC/Lang |
Lines 68-76
Link Here
|
68 |
- "$Conf{TopDir}/pool", |
68 |
- "$Conf{TopDir}/pool", |
69 |
- "$Conf{TopDir}/cpool", |
69 |
- "$Conf{TopDir}/cpool", |
70 |
- "$Conf{TopDir}/pc", |
70 |
- "$Conf{TopDir}/pc", |
71 |
- "$Conf{TopDir}/trash", |
|
|
72 |
- "$Conf{ConfDir}", |
71 |
- "$Conf{ConfDir}", |
73 |
- "$Conf{LogDir}", |
72 |
- "$Conf{LogDir}", |
|
|
73 |
- "$Conf{RunDir}", |
74 |
- ) ) { |
74 |
- ) ) { |
75 |
- mkpath("$DestDir$dir", 0, 0750) if ( !-d "$DestDir$dir" ); |
75 |
- mkpath("$DestDir$dir", 0, 0750) if ( !-d "$DestDir$dir" ); |
76 |
- if ( !-d "$DestDir$dir" |
76 |
- if ( !-d "$DestDir$dir" |
Lines 84-119
Link Here
|
84 |
-printf("Installing binaries in $DestDir$Conf{InstallDir}/bin\n"); |
84 |
-printf("Installing binaries in $DestDir$Conf{InstallDir}/bin\n"); |
85 |
-foreach my $prog ( qw( |
85 |
-foreach my $prog ( qw( |
86 |
- bin/BackupPC |
86 |
- bin/BackupPC |
|
|
87 |
- bin/BackupPC_Admin_SCGI |
87 |
- bin/BackupPC_archive |
88 |
- bin/BackupPC_archive |
88 |
- bin/BackupPC_archiveHost |
89 |
- bin/BackupPC_archiveHost |
89 |
- bin/BackupPC_archiveStart |
90 |
- bin/BackupPC_archiveStart |
90 |
- bin/BackupPC_attribPrint |
91 |
- bin/BackupPC_attribPrint |
|
|
92 |
- bin/BackupPC_backupDelete |
93 |
- bin/BackupPC_backupDuplicate |
91 |
- bin/BackupPC_dump |
94 |
- bin/BackupPC_dump |
92 |
- bin/BackupPC_fixupBackupSummary |
95 |
- bin/BackupPC_fixupBackupSummary |
93 |
- bin/BackupPC_link |
96 |
- bin/BackupPC_fsck |
|
|
97 |
- bin/BackupPC_ls |
94 |
- bin/BackupPC_nightly |
98 |
- bin/BackupPC_nightly |
|
|
99 |
- bin/BackupPC_poolCntPrint |
100 |
- bin/BackupPC_refCountUpdate |
95 |
- bin/BackupPC_restore |
101 |
- bin/BackupPC_restore |
|
|
102 |
- bin/BackupPC_rrdUpdate |
96 |
- bin/BackupPC_sendEmail |
103 |
- bin/BackupPC_sendEmail |
97 |
- bin/BackupPC_serverMesg |
104 |
- bin/BackupPC_serverMesg |
98 |
- bin/BackupPC_trashClean |
|
|
99 |
- bin/BackupPC_tarExtract |
100 |
- bin/BackupPC_tarCreate |
105 |
- bin/BackupPC_tarCreate |
101 |
- bin/BackupPC_tarPCCopy |
106 |
- bin/BackupPC_tarExtract |
102 |
- bin/BackupPC_zipCreate |
|
|
103 |
- bin/BackupPC_zcat |
107 |
- bin/BackupPC_zcat |
|
|
108 |
- bin/BackupPC_zipCreate |
104 |
- ) ) { |
109 |
- ) ) { |
105 |
- InstallFile($prog, "$DestDir$Conf{InstallDir}/$prog", 0555); |
110 |
- InstallFile($prog, "$DestDir$Conf{InstallDir}/$prog", 0555); |
106 |
-} |
111 |
-} |
107 |
- |
112 |
- |
|
|
113 |
-# |
114 |
-# remove old pre-v4 programs |
115 |
-# |
116 |
-foreach my $prog ( qw( |
117 |
- bin/BackupPC_link |
118 |
- bin/BackupPC_tarPCCopy |
119 |
- bin/BackupPC_trashClean |
120 |
- bin/BackupPC_compressPool |
121 |
- ) ) { |
122 |
- unlink("$DestDir$Conf{InstallDir}/$prog"); |
123 |
-} |
124 |
- |
108 |
-printf("Installing library in $DestDir$Conf{InstallDir}/lib\n"); |
125 |
-printf("Installing library in $DestDir$Conf{InstallDir}/lib\n"); |
109 |
-foreach my $lib ( qw( |
126 |
-foreach my $lib ( qw( |
110 |
- lib/BackupPC/Attrib.pm |
127 |
- lib/BackupPC/Config/Meta.pm |
111 |
- lib/BackupPC/Config.pm |
128 |
- lib/BackupPC/DirOps.pm |
112 |
- lib/BackupPC/FileZIO.pm |
|
|
113 |
- lib/BackupPC/Lib.pm |
129 |
- lib/BackupPC/Lib.pm |
114 |
- lib/BackupPC/PoolWrite.pm |
|
|
115 |
- lib/BackupPC/Storage.pm |
130 |
- lib/BackupPC/Storage.pm |
116 |
- lib/BackupPC/View.pm |
131 |
- lib/BackupPC/View.pm |
|
|
132 |
- lib/BackupPC/Xfer/Archive.pm |
133 |
- lib/BackupPC/Xfer/Ftp.pm |
134 |
- lib/BackupPC/Xfer/Protocol.pm |
135 |
- lib/BackupPC/Xfer/Rsync.pm |
136 |
- lib/BackupPC/Xfer/Smb.pm |
137 |
- lib/BackupPC/Xfer/Tar.pm |
138 |
- lib/BackupPC/Xfer.pm |
139 |
- lib/BackupPC/Zip/FileMember.pm |
140 |
- lib/Net/FTP/AutoReconnect.pm |
141 |
- lib/Net/FTP/RetrHandle.pm |
117 |
- lib/BackupPC/CGI/AdminOptions.pm |
142 |
- lib/BackupPC/CGI/AdminOptions.pm |
118 |
- lib/BackupPC/CGI/Archive.pm |
143 |
- lib/BackupPC/CGI/Archive.pm |
119 |
- lib/BackupPC/CGI/ArchiveInfo.pm |
144 |
- lib/BackupPC/CGI/ArchiveInfo.pm |
Lines 127-142
Link Here
|
127 |
- lib/BackupPC/CGI/LOGlist.pm |
152 |
- lib/BackupPC/CGI/LOGlist.pm |
128 |
- lib/BackupPC/CGI/Queue.pm |
153 |
- lib/BackupPC/CGI/Queue.pm |
129 |
- lib/BackupPC/CGI/ReloadServer.pm |
154 |
- lib/BackupPC/CGI/ReloadServer.pm |
|
|
155 |
- lib/BackupPC/CGI/Restore.pm |
130 |
- lib/BackupPC/CGI/RestoreFile.pm |
156 |
- lib/BackupPC/CGI/RestoreFile.pm |
131 |
- lib/BackupPC/CGI/RestoreInfo.pm |
157 |
- lib/BackupPC/CGI/RestoreInfo.pm |
132 |
- lib/BackupPC/CGI/Restore.pm |
|
|
133 |
- lib/BackupPC/CGI/RSS.pm |
158 |
- lib/BackupPC/CGI/RSS.pm |
134 |
- lib/BackupPC/CGI/StartServer.pm |
159 |
- lib/BackupPC/CGI/StartServer.pm |
135 |
- lib/BackupPC/CGI/StartStopBackup.pm |
160 |
- lib/BackupPC/CGI/StartStopBackup.pm |
136 |
- lib/BackupPC/CGI/StopServer.pm |
161 |
- lib/BackupPC/CGI/StopServer.pm |
137 |
- lib/BackupPC/CGI/Summary.pm |
162 |
- lib/BackupPC/CGI/Summary.pm |
138 |
- lib/BackupPC/CGI/View.pm |
163 |
- lib/BackupPC/CGI/View.pm |
139 |
- lib/BackupPC/Config/Meta.pm |
|
|
140 |
- lib/BackupPC/Lang/cz.pm |
164 |
- lib/BackupPC/Lang/cz.pm |
141 |
- lib/BackupPC/Lang/de.pm |
165 |
- lib/BackupPC/Lang/de.pm |
142 |
- lib/BackupPC/Lang/en.pm |
166 |
- lib/BackupPC/Lang/en.pm |
Lines 151-172
Link Here
|
151 |
- lib/BackupPC/Lang/uk.pm |
175 |
- lib/BackupPC/Lang/uk.pm |
152 |
- lib/BackupPC/Lang/zh_CN.pm |
176 |
- lib/BackupPC/Lang/zh_CN.pm |
153 |
- lib/BackupPC/Storage/Text.pm |
177 |
- lib/BackupPC/Storage/Text.pm |
154 |
- lib/BackupPC/Xfer.pm |
178 |
- ) ) { |
155 |
- lib/BackupPC/Xfer/Archive.pm |
179 |
- InstallFile($lib, "$DestDir$Conf{InstallDir}/$lib", 0444); |
156 |
- lib/BackupPC/Xfer/Ftp.pm |
180 |
-} |
157 |
- lib/BackupPC/Xfer/Protocol.pm |
181 |
- |
158 |
- lib/BackupPC/Xfer/Rsync.pm |
182 |
-# |
|
|
183 |
-# remove old pre-v4 libraries |
184 |
-# |
185 |
-foreach my $lib ( qw( |
186 |
- lib/BackupPC/Attrib.pm |
187 |
- lib/BackupPC/Config.pm |
188 |
- lib/BackupPC/FileZIO.pm |
189 |
- lib/BackupPC/PoolWrite.pm |
159 |
- lib/BackupPC/Xfer/RsyncDigest.pm |
190 |
- lib/BackupPC/Xfer/RsyncDigest.pm |
160 |
- lib/BackupPC/Xfer/RsyncFileIO.pm |
191 |
- lib/BackupPC/Xfer/RsyncFileIO.pm |
161 |
- lib/BackupPC/Xfer/Smb.pm |
|
|
162 |
- lib/BackupPC/Xfer/Tar.pm |
163 |
- lib/BackupPC/Zip/FileMember.pm |
164 |
- lib/Net/FTP/AutoReconnect.pm |
165 |
- lib/Net/FTP/RetrHandle.pm |
166 |
- ) ) { |
192 |
- ) ) { |
167 |
- InstallFile($lib, "$DestDir$Conf{InstallDir}/$lib", 0444); |
193 |
- unlink("$DestDir$Conf{InstallDir}/$lib"); |
168 |
-} |
194 |
-} |
169 |
- |
195 |
- |
|
|
196 |
-# |
197 |
# clean pid and sock files from old location (they are now in $Conf{RunDir}, and they |
198 |
# get re-created each time BackupPC starts, so it's ok if RunDir eq LogDir). |
199 |
# |
200 |
unlink("$DestDir$Conf{LogDir}/BackupPC.pid") if ( -f "$DestDir$Conf{LogDir}/BackupPC.pid" ); |
201 |
unlink("$DestDir$Conf{LogDir}/BackupPC.sock") if ( -e "$DestDir$Conf{LogDir}/BackupPC.sock" ); |
202 |
|
170 |
-if ( $Conf{CgiImageDir} ne "" ) { |
203 |
-if ( $Conf{CgiImageDir} ne "" ) { |
171 |
- printf("Installing images in $DestDir$Conf{CgiImageDir}\n"); |
204 |
- printf("Installing images in $DestDir$Conf{CgiImageDir}\n"); |
172 |
- foreach my $img ( <images/*> ) { |
205 |
- foreach my $img ( <images/*> ) { |
Lines 177-183
Link Here
|
177 |
- # |
210 |
- # |
178 |
- # Install new CSS file, making a backup copy if necessary |
211 |
- # Install new CSS file, making a backup copy if necessary |
179 |
- # |
212 |
- # |
180 |
- my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-3.3.0"; |
213 |
- my $cssBackup = "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css.pre-4.0.0alpha3"; |
181 |
- if ( -f "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css" && !-f $cssBackup ) { |
214 |
- if ( -f "$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css" && !-f $cssBackup ) { |
182 |
- rename("$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css", $cssBackup); |
215 |
- rename("$DestDir$Conf{CgiImageDir}/BackupPC_stnd.css", $cssBackup); |
183 |
- } |
216 |
- } |
Lines 199-208
Link Here
|
199 |
-printf("Making Apache configuration file for suid-perl\n"); |
232 |
-printf("Making Apache configuration file for suid-perl\n"); |
200 |
-InstallFile("httpd/src/BackupPC.conf", "httpd/BackupPC.conf", 0644); |
233 |
-InstallFile("httpd/src/BackupPC.conf", "httpd/BackupPC.conf", 0644); |
201 |
- |
234 |
- |
202 |
-printf("Installing docs in $DestDir$Conf{InstallDir}/doc\n"); |
235 |
-printf("Installing docs in $DestDir$Conf{InstallDir}/share/doc/BackupPC\n"); |
203 |
-foreach my $doc ( qw(BackupPC.pod BackupPC.html) ) { |
236 |
-foreach my $doc ( qw(BackupPC.pod BackupPC.html) ) { |
204 |
- InstallFile("doc/$doc", "$DestDir$Conf{InstallDir}/doc/$doc", 0444); |
237 |
- InstallFile("doc/$doc", "$DestDir$Conf{InstallDir}/share/doc/BackupPC/$doc", 0444); |
|
|
238 |
- # |
239 |
- # clean up files from old directory |
240 |
- # |
241 |
- unlink("$DestDir$Conf{InstallDir}/doc/$doc") if ( -f "$DestDir$Conf{InstallDir}/doc/$doc" ); |
205 |
-} |
242 |
-} |
|
|
243 |
-# |
244 |
-# clean up old directory (ok if it quietly fails if there are other files in that directory) |
245 |
-# |
246 |
-rmdir("$DestDir$Conf{InstallDir}/doc") if ( -d "$DestDir$Conf{InstallDir}/doc" ); |
206 |
- |
247 |
- |
207 |
printf("Installing config.pl and hosts in $DestDir$Conf{ConfDir}\n"); |
248 |
printf("Installing config.pl and hosts in $DestDir$Conf{ConfDir}\n"); |
208 |
-InstallFile("conf/hosts", "$DestDir$Conf{ConfDir}/hosts", 0644) |
249 |
-InstallFile("conf/hosts", "$DestDir$Conf{ConfDir}/hosts", 0644) |
Lines 210-216
Link Here
|
210 |
if ( !-f "$DestDir$Conf{ConfDir}/hosts" ); |
251 |
if ( !-f "$DestDir$Conf{ConfDir}/hosts" ); |
211 |
|
252 |
|
212 |
# |
253 |
# |
213 |
@@ -707,7 +523,7 @@ |
254 |
@@ -735,7 +517,7 @@ |
214 |
# parameters and deleting ones that are no longer needed. |
255 |
# parameters and deleting ones that are no longer needed. |
215 |
# |
256 |
# |
216 |
my $dest = "$DestDir$Conf{ConfDir}/config.pl"; |
257 |
my $dest = "$DestDir$Conf{ConfDir}/config.pl"; |
Lines 219-225
Link Here
|
219 |
my ($oldConf, $oldVars); |
260 |
my ($oldConf, $oldVars); |
220 |
my ($newConf, $newVars) = ($distConf, $distVars); |
261 |
my ($newConf, $newVars) = ($distConf, $distVars); |
221 |
if ( -f $dest ) { |
262 |
if ( -f $dest ) { |
222 |
@@ -928,13 +744,6 @@ |
263 |
@@ -974,13 +756,6 @@ |
223 |
die("can't chown $Uid, $Gid $dest\n") unless my_chown($Uid, $Gid, $dest); |
264 |
die("can't chown $Uid, $Gid $dest\n") unless my_chown($Uid, $Gid, $dest); |
224 |
} |
265 |
} |
225 |
|
266 |
|