Commit 5efc742d authored by gboudrias's avatar gboudrias Committed by ergonlogic

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

parent f126e6ce
......@@ -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
// 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);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment