builder: component: user.py: gid fallback to uid when user is not found

Signed-off-by: BigfootACA <bigfoot@classfun.cn>
This commit is contained in:
BigfootACA 2024-05-31 18:20:57 +08:00
parent be0624f947
commit 9b621831c4

View File

@ -71,8 +71,5 @@ def parse_user_from(
gid = parse_usergroup_from(ctx, node, True, gid)
if gid == -1:
user = ctx.passwd.lookup_uid(uid)
if user is None: raise ArchBuilderConfigError(
f"user {user} not found"
)
gid = user.gid
gid = user.gid if user else uid
return uid, gid