X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=configure.pl;h=28c4b8661f007dc309e8d3870b6a1144c8e001be;hp=f2a475b84ff8b61f0e3adaff6b08cf0bf87e5219;hb=dcde0725fd46cdfe126eb385a1eb356df636bbec;hpb=4cdaa6b8a9f5161ee2da4371d68cbbad41248ea0 diff --git a/configure.pl b/configure.pl index f2a475b..28c4b86 100755 --- a/configure.pl +++ b/configure.pl @@ -1,4 +1,4 @@ -#!/bin/perl +#!/usr/bin/env perl #============================================================= -*-perl-*- # # configure.pl: Configuration and installation program for BackupPC @@ -19,7 +19,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2006 Craig Barratt +# Copyright (C) 2001-2010 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ # #======================================================================== # -# Version 3.0.0alpha, released 8 Jul 2006. +# Version 3.1.0beta0, released 3 Sep 2007. # # See http://backuppc.sourceforge.net. # @@ -47,6 +47,15 @@ use strict; no utf8; use vars qw(%Conf %OrigConf); use lib "./lib"; +use Encode; + +my $EncodeVersion = eval($Encode::VERSION); +if ( $EncodeVersion < 1.99 ) { + print("Error: you need to upgrade perl's Encode package.\n" + . "I found $EncodeVersion and BackupPC needs >= 1.99\n" + . "Please go to www.cpan.org or use the cpan command.\n"); + exit(1); +} my @Packages = qw(File::Path File::Spec File::Copy DirHandle Digest::MD5 Data::Dumper Getopt::Std Getopt::Long Pod::Usage @@ -58,7 +67,8 @@ foreach my $pkg ( @Packages ) { if ( $pkg =~ /BackupPC/ ) { die < 0, -verbose => 2) if $opts{man}; my $DestDir = $opts{"dest-dir"}; +$DestDir = "" if ( $DestDir eq "/" ); if ( !$opts{"uid-ignore"} && $< != 0 ) { print <{$param}) ) { + printf("Unkown config parameter %s in --config-override\n", $param); + exit(1); + } + $newConf->[$newVars->{$param}]{text} = $opts{"config-override"}{$param}; +} + # # Now backup and write the config file # @@ -833,6 +880,8 @@ will need to do: - Verify that the CGI script BackupPC_Admin runs correctly. You might need to change the permissions or group ownership of BackupPC_Admin. + If this is an upgrade and you are using mod_perl, you will need + to restart Apache. Otherwise it will have stale code. - BackupPC should be ready to start. Don't forget to run it as user $Conf{BackupPCUser}! The installation also contains an @@ -859,9 +908,9 @@ EOF } eval "use File::RsyncP;"; -if ( !$@ && $File::RsyncP::VERSION < 0.52 ) { +if ( !$@ && $File::RsyncP::VERSION < 0.68 ) { print("\nWarning: you need to upgrade File::RsyncP;" - . " I found $File::RsyncP::VERSION and BackupPC needs 0.52\n"); + . " I found $File::RsyncP::VERSION and BackupPC needs 0.68\n"); } exit(0); @@ -902,6 +951,8 @@ sub InstallFile if ( $prog =~ /Lib.pm/ ); s/__BACKUPPCUSER__/$Conf{BackupPCUser}/g; s/__CGIDIR__/$Conf{CgiDir}/g; + s/__IMAGEDIR__/$Conf{CgiImageDir}/g; + s/__IMAGEDIRURL__/$Conf{CgiImageDirURL}/g; if ( $first && /^#.*bin\/perl/ ) { # # Fill in correct path to perl (no taint for >= 2.0.1). @@ -1163,7 +1214,7 @@ final locations. Use locations specified by the Filesystem Hierarchy Standard for installing BackupPC. This is enabled by default for new -installatios. To use the pre-3.0 installation locations, +installations. To use the pre-3.0 installation locations, specify --no-fhs. =item B<--help|?> @@ -1184,7 +1235,7 @@ specified for a batch new install. Example: - --html-dir /usr/local/apache/htdocs/BackupPC + --html-dir /var/www/htdocs/BackupPC =item B<--html-dir-url URL> @@ -1258,7 +1309,7 @@ Craig Barratt =head1 COPYRIGHT -Copyright (C) 2001-2006 Craig Barratt. +Copyright (C) 2001-2010 Craig Barratt. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by