Permalink
Browse files

***Version .16-beta changes***

* Fixed a critical issue where the conf/ and hooks/ directories were not
being restored to the correct path.
  • Loading branch information...
Chris O'Halloran Chris O'Halloran
Chris O'Halloran authored and Chris O'Halloran committed Feb 1, 2015
1 parent d0f8c76 commit 49affdc8296e099b52a346d9f3d7fbe257f8ddda
Showing with 21 additions and 6 deletions.
  1. +4 −0 README.md
  2. +6 −2 svnbackup.pl
  3. +11 −4 svnrestore.pl
@@ -44,6 +44,10 @@ svnrestore.pl BACKUPDIR REPODIR

# Version History

***Version .16-beta changes***

* Fixed a critical issue where the conf/ and hooks/ directories were not being restored to the correct path.

***Version .15-beta changes***

* Fixed an issue where moving the backup directory would cause
@@ -1,7 +1,7 @@
#!/usr/bin/perl

#############################################################################
# svnbackup.pl version .15-beta #
# svnbackup.pl version .16-beta #
# #
# History and information: #
# http://www.ghostwheel.com/merlin/Personal/notes/svnbackuppl/ #
@@ -31,6 +31,10 @@
# #
#############################################################################
# #
# Version .16-beta changes #
# - Fixed a critical issue where the conf/ and hooks/ directories were not #
# being restored to the correct path. #
# #
# Version .15-beta changes #
# - Fixed an issue where moving the backup directory would cause #
# svnrestore.pl to see the backup as invalid. #
@@ -97,7 +101,7 @@
use Archive::Tar;
use Time::localtime;

$VERSION="Version 0.13-Beta";
$VERSION="Version 0.16-Beta";

## Change to 1 if you want debugging messages.
$DEBUG=0;
@@ -1,7 +1,7 @@
#!/usr/bin/perl

#############################################################################
# svnrestore.pl version .15-beta #
# svnrestore.pl version .16-beta #
# #
# History and information: #
# http://www.ghostwheel.com/merlin/Personal/notes/svnbackuppl/ #
@@ -34,6 +34,10 @@
# #
#############################################################################
# #
# Version .16-beta changes #
# - Fixed a critical issue where the conf/ and hooks/ directories were not #
# being restored to the correct path. #
# #
# Version .15-beta changes #
# - Fixed an issue where moving the backup directory would cause #
# svnrestore.pl to see the backup as invalid. #
@@ -96,7 +100,7 @@
use Archive::Tar;
use Time::localtime;

$VERSION="Version 0.13-Beta";
$VERSION="Version 0.16-Beta";

## Change to 1 if you want debugging messages.
$DEBUG=1;
@@ -243,30 +247,33 @@
}
}


## Load the ld repository information for final restoration tasks
open(BACKUPID, "$BACKUPDIR/svnbackup.id");
($OLDREPODIR = <BACKUPID>) =~ s/[\n\r]//g;
($OLDPERMS = <BACKUPID>) =~ s/[\n\r]//g;
close(BACKUPID);



## Restore the config/ and hooks/ directories to the Repository
foreach $SpecialSubDirectory ( ('hooks', 'conf') ) {
if ( -f "$BACKUPDIR/$SpecialSubDirectory.tgz" ) {
($StartingPath = "$OLDREPODIR") =~ s/^\///;
($StartingPath = "$OLDREPODIR") =~ s/(^\/|\/$)//g;
my $tar = Archive::Tar->new;
$tar->read("$BACKUPDIR/$SpecialSubDirectory.tgz") || die ("Unable to open $BACKUPDIR/$SpecialSubDirectory.tgz \n");
@TarredUp = $tar->list_files;
foreach $TarFileFullPath ( @TarredUp ) {
if ( $TarFileFullPath ne "$StartingPath/$SpecialSubDirectory") {
my $DestPath = '';
($DestPath = $TarFileFullPath) =~ s/$StartingPath/$REPODIR/xe;
$tar->extract_file( $TarFileFullPath, $DestPath );

}
}
}
}




## Restore the original ownership of the repository

0 comments on commit 49affdc

Please sign in to comment.