Commit 32f3fce8 authored by Natanael Copa's avatar Natanael Copa

abuild: implement pkgusers/pkggroups

parent 5108c978
......@@ -26,7 +26,7 @@ BUILD_BASE="build-base"
SUDO=${SUDO:-"sudo"}
default_cmds="sanitycheck builddeps clean fetch unpack rootpkg apkcache"
default_cmds="sanitycheck builddeps clean fetch unpack mkusers rootpkg apkcache"
# read config
ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
......@@ -264,7 +264,24 @@ cleanoldpkg() {
done
return 0
}
mkusers() {
local i
for i in $pkgusers; do
if ! getent passwd $i >/dev/null; then
msg "Creating user $i"
$SUDO adduser -D -H $i || return 1
fi
done
for i in $pkggroups; do
if ! getent group $i >/dev/null; then
msg "Creating group $i"
$SUDO addgroup $i || return 1
fi
done
}
runpart() {
local part=$1
[ -n "$DEBUG" ] && msg "$part"
......@@ -488,7 +505,8 @@ create_apks() {
apkcache() {
if ! apk_up2date || [ -n "$force" ]; then
sanitycheck && builddeps && clean && fetch && unpack && rootpkg || return 1
sanitycheck && builddeps && clean && fetch && unpack \
&& mkusers && rootpkg || return 1
fi
local apk
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment