scripts/mkcompile_h: don't test for hardcoded paths

Don't test for /bin/{dnsdomainname,domainname}, simply try to execute
the command and check if it returned something.

Reported-by: Glenn Sommer <glemsom@gmail.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Tested-by: Glenn Sommer <glemsom@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
Michal Marek 2010-01-27 09:46:23 +01:00
parent e66f25d7d1
commit d4987bd7ae
1 changed files with 2 additions and 3 deletions

View File

@ -67,9 +67,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
echo \#define LINUX_COMPILE_BY \"`whoami`\"
echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
if [ -x /bin/dnsdomainname ]; then
domain=`dnsdomainname 2> /dev/null`
elif [ -x /bin/domainname ]; then
if [ -z "$domain" ]; then
domain=`domainname 2> /dev/null`
fi