X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjo-overlay.git;a=blobdiff_plain;f=eclass%2Fsys-user.eclass;h=e14cdfb733ec1a5947f8f681f1ef341b449c917d;hp=56e7bc43bfa3e56407ab8f0d66f77d9d708adfdc;hb=ad88c75318cc9173a5959ca329ccf16f2ac73553;hpb=38d15277464dc08b2f7bbb47008400ab7f141a3c diff --git a/eclass/sys-user.eclass b/eclass/sys-user.eclass index 56e7bc4..e14cdfb 100644 --- a/eclass/sys-user.eclass +++ b/eclass/sys-user.eclass @@ -16,6 +16,7 @@ EXPORT_FUNCTIONS pkg_pretend src_unpack src_configure src_compile src_install sr : ${HOMEPAGE:="https://wiki.gentoo.org/wiki/User:Mjo/GLEP:User_packages"} : ${DESCRIPTION:="The ${PN} system user"} +: ${LICENSE="GPL-2"} # If you want a different username, use a different package name. This # prevents different people from claiming the same username. @@ -270,11 +271,16 @@ sys-user_pkg_prerm() { # We have successfully done nothing. ewarn "Tried to remove nonexistent user ${SYS_USER_NAME}." elif [[ -z "${REPLACING_VERSIONS}" ]]; then - # The user to remove exists, and this is not an upgrade, so - # we really do remove him. - userdel "${SYS_USER_NAME}" || \ - die "failed to remove user ${SYS_USER_NAME}" - einfo "Removed user ${SYS_USER_NAME} from the system." + # The user to remove exists, and this is not an upgrade. For + # Phase 1, we maintain the status quo and simply refuse to + # remove him (unless you know what you are doing). + if [[ "${I_KNOW_WHAT_I_AM_DOING}" == "yes" ]]; then + userdel "${SYS_USER_NAME}" || \ + die "failed to remove user ${SYS_USER_NAME}" + einfo "Removed user ${SYS_USER_NAME} from the system." + else + die "refusing to remove package for system user ${SYS_USER_NAME}" + fi # The missing case: if the user exists and this is an upgrade, # we leave the user alone to be modified in