Merge pull request #1671 from Jennydmz/BUG-11423

BUG 11423 Errors when restoring a ws with the Enterprise plugin enabled. SOLVED
This commit is contained in:
julceslauhub
2013-05-02 08:42:38 -07:00
2 changed files with 16 additions and 4 deletions

View File

@@ -917,6 +917,12 @@ class Archive_Tar extends PEAR
if ($v_filename == '') if ($v_filename == '')
continue; continue;
if($v_filename == $p_remove_dir.'/plugin.singleton')
continue;
if($v_filename == $p_remove_dir.'/ee')
continue;
// ----- ignore files and directories matching the ignore regular expression // ----- ignore files and directories matching the ignore regular expression
if ($this->_ignore_regexp && preg_match($this->_ignore_regexp, '/'.$v_filename)) { if ($this->_ignore_regexp && preg_match($this->_ignore_regexp, '/'.$v_filename)) {
$this->_warning("File '$v_filename' ignored"); $this->_warning("File '$v_filename' ignored");
@@ -1090,12 +1096,12 @@ class Archive_Tar extends PEAR
$v_magic = 'ustar '; $v_magic = 'ustar ';
$v_version = ' '; $v_version = ' ';
if (function_exists('posix_getpwuid')) if (function_exists('posix_getpwuid'))
{ {
$userinfo = posix_getpwuid($v_info[4]); $userinfo = posix_getpwuid($v_info[4]);
$groupinfo = posix_getgrgid($v_info[5]); $groupinfo = posix_getgrgid($v_info[5]);
$v_uname = $userinfo['name']; $v_uname = $userinfo['name'];
$v_gname = $groupinfo['name']; $v_gname = $groupinfo['name'];
} }
@@ -1179,7 +1185,7 @@ class Archive_Tar extends PEAR
{ {
$userinfo = posix_getpwuid($p_uid); $userinfo = posix_getpwuid($p_uid);
$groupinfo = posix_getgrgid($p_gid); $groupinfo = posix_getgrgid($p_gid);
$v_uname = $userinfo['name']; $v_uname = $userinfo['name'];
$v_gname = $groupinfo['name']; $v_gname = $groupinfo['name'];
} }
@@ -1188,7 +1194,7 @@ class Archive_Tar extends PEAR
$v_uname = ''; $v_uname = '';
$v_gname = ''; $v_gname = '';
} }
$v_devmajor = ''; $v_devmajor = '';
$v_devminor = ''; $v_devminor = '';

View File

@@ -1099,6 +1099,12 @@ class workspaceTools
foreach ($metadata->directories as $dir) { foreach ($metadata->directories as $dir) {
CLI::logging("+> Restoring directory '$dir'\n"); CLI::logging("+> Restoring directory '$dir'\n");
if(file_exists("$tempDirectory/$dir" . "/ee")) {
G::rm_dir("$tempDirectory/$dir" . "/ee");
}
if(file_exists("$tempDirectory/$dir" . "/plugin.singleton")) {
G::rm_dir("$tempDirectory/$dir" . "/plugin.singleton");
}
if (!rename("$tempDirectory/$dir", $workspace->path)) { if (!rename("$tempDirectory/$dir", $workspace->path)) {
throw new Exception("There was an error copying the backup files ($tempDirectory/$dir) to the workspace directory {$workspace->path}."); throw new Exception("There was an error copying the backup files ($tempDirectory/$dir) to the workspace directory {$workspace->path}.");
} }