Continued pkg-plist problems

Paul Schmehl pauls at
Mon Jul 16 15:36:33 UTC 2007

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.

root at utd59514# find /usr/local/lib/perl5/ -name
root at utd59514# 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/ No such file or 
pkg_delete: post-deinstall script returned error status
root at utd59514# find /usr/local/lib/perl5/ -name

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:

root at utd59514# less files/

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

/bin/rm %%SITE_PERL%%/mach/

It's listed in the Makefile as one of the SUB_FILES, and SUB_LIST includes 

Paul Schmehl (pauls at
Senior Information Security Analyst
The University of Texas at Dallas

More information about the freebsd-ports mailing list