oracle8.1.6
begin
:1 := content_item.new(name => 'tarball-for-package-version-${version_id}',
creation_ip => :creation_ip
);
end;
begin
:1 := content_revision.new(title => '${package_key}-tarball',
description => 'gzipped tarfile',
text => 'not_important',
mime_type => 'application/x-compressed',
item_id => :item_id,
creation_user => :user_id,
creation_ip => :creation_ip
);
update cr_items
set live_revision = :1
where item_id = :item_id;
end;
update cr_revisions
set content = empty_blob()
where revision_id = :revision_id
returning content into :1
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)
update apm_package_versions
set distribution_tarball = empty_blob(),
distribution_uri = null,
distribution_date = sysdate
where version_id = :version_id
returning distribution_tarball into :1
begin
:1 := apm_package_version.add_file(
file_id => :file_id,
version_id => :version_id,
path => :path,
file_type => :file_type,
db_type => :db_type
);
end;
begin
apm_package_version.remove_file(
path => :path,
version_id => :version_id
);
end;