portupgrade fails with quoted options

Naram Qashat cyberbotx at cyberbotx.com
Mon Sep 1 17:46:37 UTC 2008


When I try to upgrade a port that has quoted options (an example is 
www/apache22, where I opted to retain the old WITH_MODULES line I had before) in 
pkgtools.conf, portupgrade fails to quote the option and causes the port to fail 
to build or even causes portupgrade itself to bomb.  Strangely enough, if I use 
the following script that uses the same tools as portupgrade:

require "pkgtools"
require "optparse"
load_config
opts = OptionParser.new
opts.order(ARGV) do |arg|
   make_args = config_make_args(arg)
   puts "#{arg}:#{make_args}"
end

It shows the correct options if I run it for www/apache22.  I get the following 
with the above script:

www/apache22:WITHOUT_APACHE_OPTIONS=yes WITHOUT_IPV6=yes WITH_MYSQL=yes 
WITH_BDB=yes WITH_SUEXEC=yes SUEXEC_LOGFILE=/var/log/www/httpd-suexec.log 
WITH_MODULES="actions alias auth_basic auth_digest authn_dbd authn_dbd 
authn_default authz_default authz_host authz_user autoindex cgi dav dav_fs dbd 
deflate dir echo env expires filter headers ident imagemap include info 
log_config log_forensic logio mime mime_magic negotiation rewrite setenvif ssl 
status suexec unique_id userdir version vhost_alias" BATCH=yes WITH_OPENSSL=yes 
WITH_OPENSSL_PORT=yes WITHOUT_X11=yes WITH_BDB_VER=43 WITH_MYSQL_VER=50

But when I use portupgrade itself, I get the following as the make arguments 
instead:

--->  Building '/usr/ports/www/apache22' with make flags: 
WITHOUT_APACHE_OPTIONS=yes WITHOUT_IPV6=yes WITH_MYSQL=yes WITH_BDB=yes 
WITH_SUEXEC=yes SUEXEC_LOGFILE=/var/log/www/httpd-suexec.log 
"WITH_MODULES=\"actions alias auth_basic auth_digest authn_dbd authn_dbd 
authn_default authz_default authz_host authz_user autoindex cgi dav dav_fs dbd 
deflate dir echo env expires filter headers ident imagemap include info 
log_config log_forensic logio mime mime_magic negotiation rewrite setenvif ssl 
status suexec unique_id userdir version vhost_alias\"" BATCH=yes 
WITH_OPENSSL=yes WITH_OPENSSL_PORT=yes WITHOUT_X11=yes WITH_BDB_VER=43 
WITH_MYSQL_VER=50

Notice how WITH_MODULES has quotes around it and then escaped quotes inside it? 
  It shouldn't be doing things like that.  I don't know ruby (I only made that 
above script from looking at some parts of portupgrade, but I have almost no 
understanding of ruby), so I can't give a fix for this.

Thanks,
Naram Qashat


More information about the freebsd-ports mailing list