Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
provision
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
provision
Commits
06e49630
Commit
06e49630
authored
Jan 21, 2010
by
anarcat
Committed by
anarcat
Jan 21, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#691914
- port backup and restore to solaris backward tar implementation
parent
dc08388c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
platform/backup.provision.inc
platform/backup.provision.inc
+8
-3
provision.path.inc
provision.path.inc
+8
-2
No files found.
platform/backup.provision.inc
View file @
06e49630
...
...
@@ -54,12 +54,17 @@ function drush_provision_drupal_provision_backup($url) {
$backup_file
=
drush_get_option
(
'backup_file'
);
// Adds the site directory into the backup file
drush_log
(
dt
(
"Adding sites directory to !backup_file"
,
array
(
'!backup_file'
=>
$backup_file
)),
'backup'
);
$olddir
=
getcwd
();
// we need to do this because some retarded implementations of tar (e.g. SunOS) don't support -C
chdir
(
drush_get_option
(
'sites_path'
)
.
"/
$url
"
);
if
(
substr
(
$backup_file
,
-
2
)
==
'gz'
)
{
$command
=
"tar -C %s -p -c -z -f %s ."
;
// same as above: some do not support -z
$command
=
"tar cpf - . | gzip -c > %s"
;
}
else
{
$command
=
"tar
-C %s -p -c -
f %s ."
;
$command
=
"tar
cp
f %s ."
;
}
$result
=
provision_shell_exec
(
$command
,
drush_get_option
(
'sites_path'
)
.
"/
$url
"
,
$backup_file
);
$result
=
provision_shell_exec
(
$command
,
$backup_file
);
chdir
(
$olddir
);
if
(
!
$result
&&
!
drush_get_option
(
'force'
,
false
))
{
drush_set_error
(
'PROVISION_BACKUP_FAILED'
,
dt
(
"Could not back up sites directory for drupal"
));
...
...
provision.path.inc
View file @
06e49630
...
...
@@ -255,8 +255,14 @@ function provision_path_extract($path, &$target, &$reason) {
if
(
file_exists
(
$path
)
&&
is_readable
(
$path
))
{
if
(
is_writeable
(
dirname
(
$target
))
&&
!
file_exists
(
$target
)
&&
!
is_dir
(
$target
))
{
mkdir
(
$target
);
drush_log
(
sprintf
(
"Running: tar -zpxf %s -C %s"
,
$path
,
$target
));
$result
=
provision_shell_exec
(
"tar -zpxf %s -C %s"
,
$path
,
$target
);
$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 -'
;
drush_log
(
dt
(
'Running: %comand in %target'
,
array
(
'%command'
=>
sprintf
(
$command
,
$path
),
'%target'
=>
$target
)));
$result
=
provision_shell_exec
(
$command
,
$path
);
chdir
(
$oldcwd
);
if
(
$result
&&
is_writeable
(
dirname
(
$target
))
&&
is_readable
(
dirname
(
$target
))
&&
is_dir
(
$target
))
{
$target
=
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment