[FIX] portupgrade fails if BEFOREDEINSTALL is set

Stanislav Sedov stas at FreeBSD.org
Sun Nov 21 09:45:12 UTC 2010


On Sat, 20 Nov 2010 01:33:22 -0800
Joel Ray Holveck <joelh at piquan.org> mentioned:

> In pkg_deinstall, in get_beforedeinstall_command, there's a line:
> 
>   commands.each { |cmd| cmd.sub!(/^[;\s]+/, '') if !cmd.nil }
> 
> I'm kinda out of my area here, but I'm pretty sure that method should be "nil?", not "nil".  As it stands, portupgrade fails to upgrade anything if BEFOREDEINSTALL in pkgtools.conf returns anything.  (The example in the .conf file's comments returns a command for all packages, although it frequently is an empty string.)
> 
> I've seen a couple of references to this by searching on Google, but I'm not aware of anybody having fixed it.  The primary symptom is that portupgrade will build but during the deinstall will stop working on that package with no clear error message, and the reason given in the "why the upgrades failed" summary is "undefined method `nil' for "":String". I've seen people asking about this on freebsd-questions and freebsd-ruby, but haven't really searched that hard.  (I cc'd the people I saw asking about it.)
> 
> I'm sending this to ruby at freebsd.org because that's what's listed as the maintainer for portupgrade; let me know if there's somewhere else it should go.  I don't subscribe to the ruby list, and I apologize if this has been discussed here before.
> 
> Please copy me on all replies, since I'm not on the list.

Thanks a lot for the patch, I'll look into this soon.
Sorry for delay, I was busy with my $dayjob.
Thanks!

-- 
Stanislav Sedov
ST4096-RIPE

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ruby/attachments/20101121/5d1ed23c/attachment.pgp


More information about the freebsd-ruby mailing list