------------------------------------------------------------ revno: 11693 revision-id: squid3@treenet.co.nz-20121028095440-1g2a0wfi3myi1qoo parent: squid3@treenet.co.nz-20121028094738-vhnbx56lhxlk5c6w committer: Amos Jeffries branch nick: 3.2 timestamp: Sun 2012-10-28 03:54:40 -0600 message: Remove 'Bungled' warning on missing component directives * Make Squid display a ERROR notice and ignore squid.conf directives which belong to components disabled at build time instead of throwing up 'FATAL: Bungled' message and aborting. * Polish the 'requires X' message text for better display of cases like 'requires MS Windows' and 'requires Linux' * Add 'requires X' message for --enable-auth, --enable-eui, and --enable-ssl-crtd which were missing. * Add debug 'filename' for if-none and postscriptum logging ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121028095440-1g2a0wfi3myi1qoo # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # testament_sha1: 9d9f65356129d0f2bb91aad9347aec50ee436691 # timestamp: 2012-10-31 23:03:10 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # base_revision_id: squid3@treenet.co.nz-20121028094738-\ # vhnbx56lhxlk5c6w # # Begin patch === modified file 'src/cf_gen.cc' --- src/cf_gen.cc 2012-07-28 05:38:50 +0000 +++ src/cf_gen.cc 2012-10-28 09:54:40 +0000 @@ -151,6 +151,7 @@ static void gen_free(const EntryList &, std::ostream&); static void gen_conf(const EntryList &, std::ostream&, bool verbose_output); static void gen_default_if_none(const EntryList &, std::ostream&); +static const char *available_if(const std::string &name); static void checkDepend(const std::string &directive, const char *name, const TypeList &types, const EntryList &entries) @@ -520,7 +521,9 @@ { fout << "static void" << std::endl << "defaults_if_none(void)" << std::endl << - "{" << std::endl; + "{" << std::endl << + " cfg_filename = \"Default Configuration (if absent)\";" << std::endl << + " config_lineno = 0;" << std::endl; for (EntryList::const_iterator entry = head.begin(); entry != head.end(); ++entry) { assert(entry->name.size()); @@ -548,13 +551,16 @@ fout << "#endif" << std::endl; } - fout << "}" << std::endl << std::endl; + fout << " cfg_filename = NULL;" << std::endl << + "}" << std::endl << std::endl; } void Entry::genParseAlias(const std::string &aName, std::ostream &fout) const { fout << " if (!strcmp(token, \"" << aName << "\")) {" << std::endl; + if (ifdef.size()) + fout << "#if " << ifdef << std::endl; fout << " "; if (type.compare("obsolete") == 0) { fout << "debugs(0, DBG_CRITICAL, \"ERROR: Directive '" << aName << "' is obsolete.\");\n"; @@ -569,6 +575,12 @@ fout << "parse_" << type << "(&" << loc << (array_flag ? "[0]" : "") << ");"; } fout << std::endl; + if (ifdef.size()) { + fout << + "#else" << std::endl << + " debugs(0, DBG_PARSE_NOTE(DBG_IMPORTANT), \"ERROR: '" << name << "' requires " << available_if(ifdef) << "\");" << std::endl << + "#endif" << std::endl; + } fout << " return 1;" << std::endl; fout << " };" << std::endl; } @@ -579,9 +591,6 @@ if (name.compare("comment") == 0) return; - if (ifdef.size()) - fout << "#if " << ifdef << std::endl; - // Once for the current directive name genParseAlias(name, fout); @@ -589,9 +598,6 @@ for (EntryAliasList::const_iterator a = alias.begin(); a != alias.end(); ++a) { genParseAlias(*a, fout); } - - if (ifdef.size()) - fout << "#endif\n"; } static void === modified file 'src/cf_gen_defines' --- src/cf_gen_defines 2012-01-17 08:38:32 +0000 +++ src/cf_gen_defines 2012-10-28 09:54:40 +0000 @@ -14,6 +14,7 @@ define["ICAP_CLIENT"]="--enable-icap-client" define["SQUID_SNMP"]="--enable-snmp" define["USE_ADAPTATION"]="--enable-ecap or --enable-icap-client" + define["USE_AUTH"]="--enable-auth" define["USE_CACHE_DIGESTS"]="--enable-cache-digests" define["USE_DNSHELPER"]="--disable-internal-dns" define["!USE_DNSHELPER"]="--enable-internal-dns" @@ -24,6 +25,8 @@ define["USE_IDENT"]="--enable-ident-lookups" define["USE_LOADABLE_MODULES"]="--enable-loadable-modules" define["USE_SQUID_ESI"]="--enable-esi" + define["USE_SQUID_EUI"]="--enable-eui" + define["USE_SSL_CRTD"]="--enable-ssl-crtd" define["USE_SSL"]="--enable-ssl" define["USE_UNLINKD"]="--enable-unlinkd" define["USE_WCCP"]="--enable-wccp" @@ -34,8 +37,8 @@ } /^IFDEF:/ { if (define[$2] != "") - DEFINE=define[$2] " option" - else + DEFINE=define[$2] + else DEFINE="-D" $2 " define" print "{\"" $2 "\", \"" DEFINE "\", " print "#if " $2