Skip to content
Snippets Groups Projects
Commit 641c368a authored by Tom Lane's avatar Tom Lane
Browse files

Change configure.in to note that since we are using expr(1)'s regex match

command, the entries in template/.similar can really be regular
expressions.  This isn't a new feature, just an observation of what the
code already did.
parent b1788658
No related branches found
No related tags found
No related merge requests found
...@@ -96,14 +96,13 @@ host="`echo $host | tr '[[A-Z]]' '[[a-z]]'`" ...@@ -96,14 +96,13 @@ host="`echo $host | tr '[[A-Z]]' '[[a-z]]'`"
if test -f "template/$host" if test -f "template/$host"
then TEMPLATE="$host" then TEMPLATE="$host"
else else
# Next try for an exact match to a .similar entry. # Scan template/.similar for a rule that tells us which template to use.
# There shouldn't be multiple matches, but take the last if there are. # The format of each line of the file is
GUESS=`grep "^$host=" template/.similar | sed 's/^.*=//' | tail -1` # hostnamepattern=templatefilename
if test "$GUESS" # where the hostnamepattern is evaluated per the rules of expr(1) ---
then TEMPLATE="$GUESS" # namely, it is a standard regular expression with an implicit ^ at the
else # start. If multiple lines match, we will end up using the last match.
# Next look for a .similar entry that is a prefix of $host. GUESS=""
# If there are multiple matches, take the last one.
exec 4<template/.similar exec 4<template/.similar
while read LINE <&4 while read LINE <&4
do do
...@@ -121,7 +120,6 @@ else ...@@ -121,7 +120,6 @@ else
TEMPLATE=`uname -s | tr '[[A-Z]]' '[[a-z]]'` TEMPLATE=`uname -s | tr '[[A-Z]]' '[[a-z]]'`
fi fi
fi fi
fi
]) ])
AC_MSG_RESULT($TEMPLATE) AC_MSG_RESULT($TEMPLATE)
...@@ -130,7 +128,7 @@ if test ! -f "template/$TEMPLATE"; then ...@@ -130,7 +128,7 @@ if test ! -f "template/$TEMPLATE"; then
echo "" echo ""
echo "$TEMPLATE does not exist" echo "$TEMPLATE does not exist"
echo "" echo ""
echo "Available Templates (set using --with-template):" echo "Available Templates (select one using --with-template):"
echo "" echo ""
ls template ls template
echo "" echo ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment