Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 27 Apr 2001 17:39:16 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs-postgresql.xql 4 May 2001 06:04:28 -0000 1.8 @@ -3,22 +3,85 @@ postgresql7.1 - - + - FIX ME LOB (DRB - *all* large objects should be handled by the content - repository so I'm leaving this wart for now. - 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 - + +select content_item__new( + 'tarball-for-package-version-${version_id}', + null, + null, + null, + now(), + null, + null, + :creation_ip, + 'content_item', + 'content_revision', + null, + null, + 'text/plain', + null, + null, + 'file' + ) + + + + + declare + v_revision_id integer; + begin + + v_revision_id := content_revision__new( + '${package_key}-tarball', + 'gzipped tarfile', + now(), + 'text/plain', + null, + 'not_important', + :item_id, + null, + now(), + :user_id, + :creation_ip + ); + + update cr_items + set live_revision = v_revision_id + where item_id = :item_id; + + return v_revision_id; + + end; + + + + + + + + update cr_revisions + set content = '[cr_create_content_file $item_id $revision_id $tmpfile]' + where revision_id = :revision_id + + + + + + + select '[cr_fs_path]' || content + from cr_revisions + where revision_id = (select content_item__get_latest_revision(item_id) + from apm_package_versions + where version_id = :version_id) + + + +