Move PORTSDIR setting ahead of NO_STAGE check.