[OS-BUILD PATCH 4/6] Move the sed to clear the patch templating outside of conditionals