[v3,02/16] deb-dl-dir: export without root privileges

Message ID 20260407142310.2327696-3-felix.moessbauer@siemens.com
State New
Headers show
Series add support to build isar unprivileged | expand

Commit Message

Felix Moessbauer April 7, 2026, 2:22 p.m. UTC
The archive is world readable, so we can access it without root
privileges. By that, the files in the download dir are also owned by the
calling user, making the additional chown obsolete.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/deb-dl-dir.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/classes-recipe/deb-dl-dir.bbclass b/meta/classes-recipe/deb-dl-dir.bbclass
index 27d1fb24..3ea75996 100644
--- a/meta/classes-recipe/deb-dl-dir.bbclass
+++ b/meta/classes-recipe/deb-dl-dir.bbclass
@@ -153,7 +153,7 @@  deb_dl_dir_export() {
     isar_debs="$(${SCRIPTSDIR}/lockrun.py -r -f '${REPO_ISAR_DIR}/isar.lock' -c \
     "find '${REPO_ISAR_DIR}/${DISTRO}' -name '*.deb' -print")"
 
-    flock "${pc}".lock sudo -Es << 'EOSUDO'
+    flock "${pc}".lock /bin/bash -s << 'EOF'
         set -e
         printenv | grep -q BB_VERBOSE_LOGS && set -x
 
@@ -170,6 +170,5 @@  deb_dl_dir_export() {
             ln -Pf "${p}" "${pc}" 2>/dev/null ||
                 cp -n "${p}" "${pc}"
         done
-        chown -R ${owner} "${pc}"
-EOSUDO
+EOF
 }