mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-01-15 19:06:17 +00:00
is_root_owned
This commit is contained in:
@@ -66,6 +66,21 @@ echo_if_fail() {
|
||||
return ${retval}
|
||||
}
|
||||
|
||||
is_root_owned() {
|
||||
local path=$1
|
||||
local uid
|
||||
|
||||
if stat --version >/dev/null 2>&1; then
|
||||
# GNU coreutils (Linux)
|
||||
uid=$(stat -c '%u' "$path")
|
||||
else
|
||||
# BSD/macOS
|
||||
uid=$(stat -f '%u' "$path")
|
||||
fi
|
||||
|
||||
test "$uid" -eq 0
|
||||
}
|
||||
|
||||
dump_arr() {
|
||||
arr_name="$1"
|
||||
declare -n arr
|
||||
|
||||
@@ -87,6 +87,17 @@ docker_build_image() {
|
||||
# specific file for evaluated package manager info
|
||||
distroPkgMgr="${DOCKER_DIR}/${distro}-pkg_mgr"
|
||||
# get package manager info
|
||||
|
||||
# TODO REMOVE
|
||||
if is_root_owned "${IGN_DIR}"; then
|
||||
docker run \
|
||||
--rm \
|
||||
-v "${REPO_DIR}:${DOCKER_WORKDIR}" \
|
||||
-w "${DOCKER_WORKDIR}" \
|
||||
"${dockerDistro}" \
|
||||
rm -rf "${DOCKER_WORKDIR}"/gitignore
|
||||
fi
|
||||
|
||||
docker run \
|
||||
"${DOCKER_RUN_FLAGS[@]}" \
|
||||
"${dockerDistro}" \
|
||||
|
||||
Reference in New Issue
Block a user