I'm working on an upgrade to security/bro. The new version is requires that I install a perl module in SITE_PERL so that the configuration script will run correctly. When I tried to add the module to pkg-plist, the deletion of the file failed because deinstall was prepending PREFIX to SITE_PERL, making the path invalid.

To get around this problem I wrote a one line pkg-deinstall script that deletes the file. The script does what you would expect, but then it returns an error.

[EMAIL PROTECTED] find /usr/local/lib/perl5/ -name IP4.pm
/usr/local/lib/perl5/site_perl/5.8.8/mach/IP4.pm
[EMAIL PROTECTED] make deinstall PREFIX=/var/tmp/$(make -V PORTNAME)
===>  Deinstalling for security/bro
===>   Deinstalling bro-1.1d
rm: /usr/local/lib/perl5/site_perl/5.8.8/mach/IP4.pm: No such file or directory
pkg_delete: post-deinstall script returned error status
[EMAIL PROTECTED] find /usr/local/lib/perl5/ -name IP4.pm

As you can see, the file was removed, but the script returns an error. If I manually copy the module to SITE_PERL and then manually run pkg-deinstall, the module is removed with no errors.

What the heck is causing this error message?

Here's the pkg-deinstall script:

[EMAIL PROTECTED] less files/pkg-deinstall.in
#!/bin/sh

# Since pkg-plist prepends PREFIX to SITE_PERL,
# we can't remove this file in the normal way

/bin/rm %%SITE_PERL%%/mach/IP4.pm

It's listed in the Makefile as one of the SUB_FILES, and SUB_LIST includes SITE_PERL=${SITE_PERL).

--
Paul Schmehl ([EMAIL PROTECTED])
Senior Information Security Analyst
The University of Texas at Dallas
http://www.utdallas.edu/ir/security/

Reply via email to