apm_extract_tarball (public)

 apm_extract_tarball version_id dir

Defined in packages/acs-tcl/tcl/apm-file-procs.tcl

Extracts a distribution tarball into a particular directory, overwriting any existing files. DCW - 2001-05-03, modified to extract tarball from content repository.

Parameters:
version_id
dir

Partial Call Graph (max 5 caller/called nodes):
%3 ad_tmpnam ad_tmpnam (public) apm_dev_null apm_dev_null (private) apm_gzip_cmd apm_gzip_cmd (public) apm_tar_cmd apm_tar_cmd (public) db_blob_get_file db_blob_get_file (public) apm_extract_tarball apm_extract_tarball apm_extract_tarball->ad_tmpnam apm_extract_tarball->apm_dev_null apm_extract_tarball->apm_gzip_cmd apm_extract_tarball->apm_tar_cmd apm_extract_tarball->db_blob_get_file

Testcases:
No testcase defined.
Source code:

    set apm_file [ad_tmpnam]

    db_blob_get_file distribution_tar_ball_select {
        select content
        from cr_revisions
        where revision_id = (select content_item.get_latest_revision(item_id)
                             from apm_package_versions
                             where version_id = :version_id)
    } $apm_file

    file mkdir $dir
    # avoid chdir
    #ns_log notice "exec sh -c 'cd $dir ; [apm_gzip_cmd] -d -q -c $apm_file | [apm_tar_cmd] xf - 2>/dev/null'"
    exec [apm_gzip_cmd] -d -q -c -S .apm $apm_file | [apm_tar_cmd] -xf - -C $dir 2> [apm_dev_null]

    file delete -- $apm_file
Generic XQL file:
packages/acs-tcl/tcl/apm-file-procs.xql

PostgreSQL XQL file:
<fullquery name="apm_extract_tarball.distribution_tar_ball_select">
    <querytext>

   select '[cr_fs_path]' || r.content as content, i.storage_type
     from cr_revisions r, cr_items i
    where r.item_id = i.item_id
      and r.revision_id = (select content_item__get_latest_revision(item_id)
                             from apm_package_versions 
                            where version_id = :version_id)

      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-file-procs-postgresql.xql

Oracle XQL file:
<fullquery name="apm_extract_tarball.distribution_tar_ball_select">
    <querytext>

   select  '[cr_fs_path]' || r.filename as content, i.storage_type
     from cr_revisions r, cr_items i
    where r.item_id = i.item_id
      and r.revision_id = (select content_item.get_latest_revision(item_id)
                           from apm_package_versions 
                          where version_id = :version_id)

      </querytext>
</fullquery>
packages/acs-tcl/tcl/apm-file-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: