@@ -, +, @@ --- opengl.eselect | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) --- a/opengl.eselect +++ a/opengl.eselect @@ -196,9 +196,6 @@ set_new_implementation() { fi echo -n "Switching to ${gl_implem} OpenGL interface..." - if [[ -f ${ENV_FILE} ]] ; then - rm -f "${ENV_FILE}" || die -q "Failed to remove ${ENV_FILE}" - fi for libdir in $(list_libdirs); do # Set libdir correctly to EROOT @@ -269,8 +266,10 @@ set_new_implementation() { fi done - store_config ${ENV_FILE} LDPATH "${ldpath}" - store_config ${ENV_FILE} OPENGL_PROFILE "${gl_implem}" + # Update the file atomically. #508708 + store_config "${ENV_FILE}~" LDPATH "${ldpath}" + store_config "${ENV_FILE}~" OPENGL_PROFILE "${gl_implem}" + mv -f "${ENV_FILE}~" "${ENV_FILE}" || die -q "could not update ${ENV_FILE}" do_action env update &> /dev/null --