# SPDX-License-Identifier: LGPL-2.1+
+import os
import textwrap
from collections.abc import Iterable, Sequence
from pathlib import Path
mounts: Sequence[PathString] = (),
stdout: _FILE = None,
) -> CompletedProcess:
- with finalize_source_mounts(context.config, ephemeral=context.config.build_sources_ephemeral) as sources:
+ with finalize_source_mounts(
+ context.config,
+ ephemeral=os.getuid() == 0 and context.config.build_sources_ephemeral,
+ ) as sources:
return run(
cls.cmd(context, "apt-get") + [operation, *arguments],
sandbox=(
# SPDX-License-Identifier: LGPL-2.1+
+import os
import textwrap
from collections.abc import Iterable, Sequence
from pathlib import Path
stdout: _FILE = None,
) -> CompletedProcess:
try:
- with finalize_source_mounts(context.config, ephemeral=context.config.build_sources_ephemeral) as sources:
+ with finalize_source_mounts(
+ context.config,
+ ephemeral=os.getuid() == 0 and context.config.build_sources_ephemeral,
+ ) as sources:
return run(
cls.cmd(context) + [operation,*arguments],
sandbox=(
# SPDX-License-Identifier: LGPL-2.1+
+import os
import shutil
import textwrap
from collections.abc import Iterable, Sequence
apivfs: bool = False,
stdout: _FILE = None,
) -> CompletedProcess:
- with finalize_source_mounts(context.config, ephemeral=context.config.build_sources_ephemeral) as sources:
+ with finalize_source_mounts(
+ context.config,
+ ephemeral=os.getuid() == 0 and context.config.build_sources_ephemeral,
+ ) as sources:
return run(
cls.cmd(context) + [operation, *arguments],
sandbox=(
# SPDX-License-Identifier: LGPL-2.1+
import hashlib
+import os
import textwrap
from collections.abc import Iterable, Sequence
from pathlib import Path
apivfs: bool = False,
stdout: _FILE = None,
) -> CompletedProcess:
- with finalize_source_mounts(context.config, ephemeral=context.config.build_sources_ephemeral) as sources:
+ with finalize_source_mounts(
+ context.config,
+ ephemeral=os.getuid() == 0 and context.config.build_sources_ephemeral,
+ ) as sources:
return run(
cls.cmd(context) + [operation, *arguments],
sandbox=(