]> gitweb.michael.orlitzky.com - mjo-overlay.git/blobdiff - eclass/sys-user.eclass
sys-user.eclass: die if sys-user_getuid gets the wrong number of args.
[mjo-overlay.git] / eclass / sys-user.eclass
index 35d20ed050a5ce48a4390c1e3c5663e570c62cda..92c782974da8897a2a347ba3b0ceb325d56fd465 100644 (file)
@@ -9,6 +9,7 @@
 # This eclass does most of the work for the sys-user/ packages that
 # supply system user accounts.
 
+# Needed for egetshell and egethome
 inherit user
 
 EXPORT_FUNCTIONS pkg_pretend src_unpack src_configure src_compile src_install src_test pkg_preinst pkg_postinst pkg_prerm
@@ -76,6 +77,8 @@ sys-user_src_compile() { :; }
 sys-user_src_test() { :; }
 
 sys-user_getuid() {
+       [[ $# -eq 1 ]] || die "usage: sys-user_getuid <username>"
+
        # Output the real UID of the given user, or the empty string if the
        # user does not exist on the system.
        echo $(id --real --user "${1}")
@@ -173,11 +176,13 @@ sys-user_src_install() {
        # be possible.
        #
        # Beware, this only works if SYS_USER_UID is guaranteed to have a
-       # real UID and not, for example, -1. That is taken care of in
-       # src_configure() for now.
-       touch "${T}/${SYS_USER_UID}" || die
-       insinto "/var/lib/sys-user"
-       doins "${T}/${SYS_USER_UID}"
+       # real UID and not, for example, -1.
+       #
+       # TODO: this is a problem now!
+       #
+       #touch "${T}/${SYS_USER_UID}" || die
+       #insinto "/var/lib/sys-user"
+       #doins "${T}/${SYS_USER_UID}"
 }
 
 sys-user_pkg_preinst() {