lkml.org 
[lkml]   [2020]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 7/7] builddeb: Try to get the user full name from the GECOS field
Date
The GECOS field might contain the full name for the username, try to
use that and fallback to using the username if that is empty.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
---
scripts/package/mkdebian | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index ed77d0948fa3..e3d0b7ac9057 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -113,7 +113,8 @@ if echo $email | grep -q '<.*>'; then
else
# or construct the maintainer string
user=${KBUILD_BUILD_USER-$(id -nu)}
- name=${DEBFULLNAME-$user}
+ name=${DEBFULLNAME-$(getent passwd $user | cut -d: -f5 | cut -d, -f1)}
+ : "${name:=$user}"
if [ -z "$email" ]; then
buildhost=${KBUILD_BUILD_HOST-$(hostname -f 2>/dev/null || hostname)}
email="$user@$buildhost"
--
2.28.0.297.g1956fa8f8d
\
 
 \ /
  Last update: 2020-09-21 00:49    [W:0.076 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site