post-pkg failing

Paulo Moura pmoura at di.ubi.pt
Sun May 27 18:55:24 PDT 2012


Hi Joshua,

Thanks for your quick reply.

On 28/05/2012, at 02:12, Joshua Root wrote:

> (moving to -dev since this involves writing a portfile)
> 
> On 2012-5-28 10:43 , Paulo Moura wrote:
>> Hi,
>> 
>> I'm using the latest versions of MacPorts, Xcode, and PackageMaker. I have a portfile where I define:
>> 
>> post-pkg {
>> 	set resources ${workpath}/${name}-${version}.pkg/Contents/Resources/
>> 	file copy -force -- ${workpath}/${worksrcdir}/scripts/macosx/License.html ${resources}
>> 	file copy -force -- ${workpath}/${worksrcdir}/scripts/macosx/ReadMe.html ${resources}
>> 	file copy -force -- ${workpath}/${worksrcdir}/scripts/macosx/Welcome.html ${resources}
>> 	file copy -force -- ${workpath}/${worksrcdir}/scripts/macosx/postflight ${resources}
>> }
>> 
>> Trying to create a package fails with the error:
>> 
>> Error: org.macports.pkg for port logtalk returned: error copying "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_logtalk/logtalk/work/lgt2441/scripts/macosx/License.html" to "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_logtalk/logtalk/work/logtalk-2.44.1.pkg/Contents/Resources/": not a directory
>> 
>> This worked before so I guess something change in the latest MacPorts and/or PackageMaker versions. Any hints?
> 
> MacPorts 2.1 will build flat packages by default on 10.6+. This means
> you can't just copy files into the resources dir, since it's now inside
> a xar archive.
> 
> You can get the old behaviour back by setting 'package.flat no'.

Adding that setting to the portfile indeed solved the problem. Thanks!

> To make
> this work with flat packages, you should instead copy the html files to
> ${package.resources} in pre-pkg, and the postflight script to
> ${package.scripts}/postinstall. (Flat packages apparently don't support
> postflight scripts as such. Apple tends to simulate them by adding a
> dummy package that only contains a postinstall script to the enclosing
> Distribution package.)


I will look into it (I do have a postflight script). I have several portfiles that use post-pkg to update.

Cheers,

Paulo


-----------------------------------------------------------------
Paulo Jorge Lopes de Moura, PhD
Assistant Professor
Dep. of Computer Science, University of Beira Interior
6201-001 Covilhã, Portugal

Office 3.18  Ext. 3276
Phone: +351 275 242081 Fax: +351 275 319899
Email: <mailto:pmoura at di.ubi.pt>

Home page: <http://www.di.ubi.pt/~pmoura>
Research:  <http://logtalk.org/> Blog: <http://blog.logtalk.org/>
-----------------------------------------------------------------










More information about the macports-users mailing list