Commit 5cc95e43 authored by Sebastien Barre's avatar Sebastien Barre

SITE_NAME should return the most qualified name of the host. If nslookup...

SITE_NAME should return the most qualified name of the host. If nslookup works, now the domain is appended to the hostname (whereas it *replaced* the host name before)
parent 8fefb3dd
......@@ -79,7 +79,7 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
host = hostReg.match(1);
}
}
std::string siteName = host;
if(host.length())
{
......@@ -90,13 +90,14 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args)
std::string nsOutput;
cmSystemTools::RunCommand(nsCmd.c_str(),
nsOutput);
std::string RegExp = ".*Name:[ \t\n]*";
RegExp += host;
RegExp += "\\.([^ \t\n\r]*)[ \t\n\r]*Address:";
cmRegularExpression reg( RegExp.c_str() );
if(reg.find(nsOutput.c_str()))
{
siteName = cmSystemTools::LowerCase(reg.match(1));
siteName += '.' + cmSystemTools::LowerCase(reg.match(1));
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment