Merged.

Pascal J. Bourguignon [2018-11-21 10:30]
Merged.
Filename
common-lisp/unix/group.lisp
common-lisp/unix/passwd.lisp
diff --git a/common-lisp/unix/group.lisp b/common-lisp/unix/group.lisp
index 414d429..f2067a9 100644
--- a/common-lisp/unix/group.lisp
+++ b/common-lisp/unix/group.lisp
@@ -17,7 +17,7 @@
 ;;;;LEGAL
 ;;;;    AGPL3
 ;;;;
-;;;;    Copyright Pascal J. Bourguignon 2004 - 2016
+;;;;    Copyright Pascal J. Bourguignon 2004 - 2018
 ;;;;
 ;;;;    This program is free software: you can redistribute it and/or modify
 ;;;;    it under the terms of the GNU Affero General Public License as published by
@@ -38,10 +38,9 @@
   (:use "COMMON-LISP"
         "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STRING"
         "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STREAM")
-
-  (:export "GROUP" "GROUP-GID" "GROUP-PASSWD"
+  (:export "GROUP" "GROUP-NAME" "GROUP-GID" "GROUP-PASSWD"
            "GROUP-USERS" "READ-GROUP")
-
+  (:export "MAKE-GROUP")
   (:documentation
    "

@@ -108,11 +107,12 @@ DO:                 Read the group file.
 GROUP-FILE-PATH:    The pathname to the group file; default: \"/etc/group\"
 RETURN:             A list of group GROUP structures.
 "
-  (mapcar (function parse-group)
-          (with-open-file (in group-file-path
-                              :direction :input
-                              :if-does-not-exist :error)
-            (stream-to-string-list in))))
+  (delete nil
+          (mapcar (function parse-group)
+                  (with-open-file (in group-file-path
+                                      :direction :input
+                                      :if-does-not-exist :error)
+                    (stream-to-string-list in)))))


 ;;;; THE END ;;;
diff --git a/common-lisp/unix/passwd.lisp b/common-lisp/unix/passwd.lisp
index 6adbe2a..c590193 100644
--- a/common-lisp/unix/passwd.lisp
+++ b/common-lisp/unix/passwd.lisp
@@ -17,7 +17,7 @@
 ;;;;LEGAL
 ;;;;    AGPL3
 ;;;;
-;;;;    Copyright Pascal J. Bourguignon 2004 - 2016
+;;;;    Copyright Pascal J. Bourguignon 2004 - 2018
 ;;;;
 ;;;;    This program is free software: you can redistribute it and/or modify
 ;;;;    it under the terms of the GNU Affero General Public License as published by
@@ -40,6 +40,7 @@
         "COM.INFORMATIMAGO.COMMON-LISP.CESARUM.STREAM")
   (:export "USER-SHELL" "USER-HOME" "USER-GECOS" "USER-GID"
            "USER-UID" "USER-PASSWD" "USER-LOGIN" "USER" "READ-PASSWD")
+  (:export "MAKE-USER")
   (:documentation
    "
 This package exports a function to read unix passwd files.
@@ -68,10 +69,8 @@ License:
 "))
 (in-package "COM.INFORMATIMAGO.COMMON-LISP.UNIX.PASSWD")

-
 ;; pwent ::= login ':' passwd ':' uid ':' gid ':' gecos ':' home ':' shell

-
 (defstruct user
   "A unix /etc/passwd USER."
   (login  "" :type string)
@@ -121,11 +120,12 @@ DO:                 Read a passwd file.
 PASSWD-FILE-PATH:   The pathname of the passwd file. Default: \"/etc/passwd\".
 RETURN:             A list of passwd USER structures.
 "
-  (mapcar (function parse-passwd)
-          (with-open-file (in passwd-file-path
-                              :direction :input
-                              :if-does-not-exist :error)
-            (stream-to-string-list in))))
+  (delete nil
+          (mapcar (function parse-passwd)
+                  (with-open-file (in passwd-file-path
+                                      :direction :input
+                                      :if-does-not-exist :error)
+                    (stream-to-string-list in)))))


 ;;;; THE END ;;;;
ViewGit