* Commit for 2.1.0.
[BackupPC.git] / bin / BackupPC_link
index 85a9388..c7e925d 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/perl -T
+#!/bin/perl
 #============================================================= -*-perl-*-
 #
 # BackupPC_link: link new backup into pool
 #============================================================= -*-perl-*-
 #
 # BackupPC_link: link new backup into pool
@@ -21,7 +21,7 @@
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
 #   Craig Barratt  <cbarratt@users.sourceforge.net>
 #
 # COPYRIGHT
-#   Copyright (C) 2001  Craig Barratt
+#   Copyright (C) 2001-2003  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
 #
 #   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
 #
 #========================================================================
 #
 #
 #========================================================================
 #
-# Version 1.5.0, released 2 Aug 2002.
+# Version 2.1.0, released 20 Jun 2004.
 #
 # See http://backuppc.sourceforge.net.
 #
 #========================================================================
 
 use strict;
 #
 # See http://backuppc.sourceforge.net.
 #
 #========================================================================
 
 use strict;
-use lib "__INSTALLDIR__/lib";
+no  utf8;
+use lib "/usr/local/BackupPC/lib";
 use BackupPC::Lib;
 use BackupPC::Attrib;
 use BackupPC::PoolWrite;
 use BackupPC::Lib;
 use BackupPC::Attrib;
 use BackupPC::PoolWrite;
@@ -70,7 +71,7 @@ if ( @ARGV != 1 ) {
     print("usage: $0 <host>\n");
     exit(1);
 }
     print("usage: $0 <host>\n");
     exit(1);
 }
-if ( $ARGV[0] !~ /^([\w\.-]+)$/ ) {
+if ( $ARGV[0] !~ /^([\w\.\s-]+)$/ ) {
     print("$0: bad host name '$ARGV[0]'\n");
     exit(1);
 }
     print("$0: bad host name '$ARGV[0]'\n");
     exit(1);
 }
@@ -105,7 +106,8 @@ while ( 1 ) {
     #
     $CurrDumpDir = "$Dir/$Backups[$num]{num}";
     $Compress = $Backups[$num]{compress};
     #
     $CurrDumpDir = "$Dir/$Backups[$num]{num}";
     $Compress = $Backups[$num]{compress};
-    if ( open(NEW, "$Dir/NewFileList.$Backups[$num]{num}") ) {
+    if ( open(NEW, "<", "$Dir/NewFileList.$Backups[$num]{num}") ) {
+       binmode(NEW);
         while ( <NEW> ) {
             chomp;
             next if ( !/(\w+) (\d+) (.*)/ );
         while ( <NEW> ) {
             chomp;
             next if ( !/(\w+) (\d+) (.*)/ );
@@ -126,7 +128,7 @@ while ( 1 ) {
     #
     my $noFill = 1;
     my $fillFromNum;
     #
     my $noFill = 1;
     my $fillFromNum;
-    if ( $Backups[$num]{type} eq "full" ) {
+    if ( $Backups[$num]{type} ne "incr" ) {
         $noFill = 0
     } elsif ( $Conf{IncrFill} ) {
         my $i;
         $noFill = 0
     } elsif ( $Conf{IncrFill} ) {
         my $i;