function make_tar

8.0.x make_tar($build_path)
6.x make_tar($build_path)
7.x make_tar($build_path)
5.x make_tar($build_path)
master make_tar($build_path)

@todo drush_archive_dump() also makes a tar. Consolidate?

1 call to make_tar()
drush_make in commands/make/
Drush callback; make based on the makefile.


commands/make/, line 507
General utility functions for Drush Make.


function make_tar($build_path) {
  $tmp_path = make_tmp();

  $filename = basename($build_path);
  $dirname = basename($build_path, '.tar.gz');
  // Move the build directory to a more human-friendly name, so that tar will
  // use it instead.
  drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . '__build__', $tmp_path . DIRECTORY_SEPARATOR . $dirname, TRUE);
  // Only move the tar file to it's final location if it's been built
  // successfully.
  if (drush_shell_exec("%s -C %s -Pczf %s %s", drush_get_tar_executable(), $tmp_path, $tmp_path . '/' . $filename, $dirname)) {
    drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . $filename, $build_path, TRUE);
  // Move the build directory back to it's original location for consistency.
  drush_move_dir($tmp_path . DIRECTORY_SEPARATOR . $dirname, $tmp_path . DIRECTORY_SEPARATOR . '__build__');