Commit 8bdada6e authored by gboudrias's avatar gboudrias Committed by ergonlogic

Issue #2169025 by gboudrias: Fix non-gzipped backups can't be restored.

parent bba5bd8f
......@@ -294,8 +294,16 @@ class Provision_FileSystem extends Provision_ChainedState {
$oldcwd = getcwd();
// we need to do this because some retarded implementations of tar (e.g. SunOS) don't support -C
chdir($target);
// same here: some do not support -z
$command = 'gunzip -c %s | tar pxf -';
// We need to check if the archive is gzipped and choose the command accordingly
if (substr($path, -2) == 'gz') {
// same here: some do not support -z
$command = 'gunzip -c %s | tar pxf -';
}
else {
$command = 'tar -pxf %s';
}
drush_log(dt('Running: %command in %target', array('%command' => sprintf($command, $path), '%target' => $target)));
$result = drush_shell_exec($command, $path);
chdir($oldcwd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment