Index: Mk/Uses/pgsql.mk =================================================================== --- Mk/Uses/pgsql.mk (revision 388206) +++ Mk/Uses/pgsql.mk (working copy) @@ -84,17 +84,26 @@ _WANT_PGSQL_VER?= ${pgsql_ARGS} . endif -# Try to match default version, otherwise just take the first version -# that matches +# Try to match installed version, then default version, +# otherwise just take the first version that matches . if !empty(_WANT_PGSQL_VER) -. for version in ${_WANT_PGSQL_VER} -. if ${PGSQL_DEFAULT} == ${version} +. if defined(_PGSQL_VER) +. for version in ${_WANT_PGSQL_VER} +. if ${_PGSQL_VER} == ${version} PGSQL_VER= ${version} +. endif +. endfor +. if empty(PGSQL_VER) +IGNORE?= cannot install: the port wants postgresql-client version ${_WANT_PGSQL_VER} and you have version ${_PGSQL_VER} installed . endif +. endif +. if empty(PGSQL_VER) +. for version in ${_WANT_PGSQL_VER} +. if ${PGSQL_DEFAULT} == ${version} +PGSQL_VER= ${version} +. endif PGSQL_VER?= ${version} -. endfor -. if defined(_PGSQL_VER) && ${_PGSQL_VER} != ${PGSQL_VER} -IGNORE?= cannot install: the port wants postgresql-client version ${_WANT_PGSQL_VER} and you have version ${_PGSQL_VER} installed +. endfor . endif . endif