diff mbox series

[2/2] build: only use fakeroot for packages if required

Message ID 20200904224636.484105-2-mail@aparcar.org
State Not Applicable
Headers show
Series [1/2] build: ipkg-build add -r option for all-root | expand

Commit Message

Paul Spooren Sept. 4, 2020, 10:46 p.m. UTC
Fakeroot was recently wrapped around the `ipkg-build` script to allow
arbitrary file modes for packages, like setting a SUID. However this
slows down the building process while most packages don't make use of
that (by defining `PKG_FILE_MODES`).

This commit only uses fakeroot if `PKG_FILE_MODES` is set. If it is not
defined the newly added *all root* option `-r` is used.

Signed-off-by: Paul Spooren <mail@aparcar.org>
---
 include/package-ipkg.mk | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index 0b7a561edc..362fa25307 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -260,7 +260,13 @@  $(_endef)
     endif
 
 	$(INSTALL_DIR) $$(PDIR_$(1))
+ifdef PKG_FILE_MODES
+	echo "Package $(1) is build with fakeroot" >&2
 	$(FAKEROOT) $(SCRIPT_DIR)/ipkg-build -m "$(PKG_FILE_MODES)" $$(IDIR_$(1)) $$(PDIR_$(1))
+else
+	echo "Package $(1) is build without fakeroot" >&2
+	$(SCRIPT_DIR)/ipkg-build -r $$(IDIR_$(1)) $$(PDIR_$(1))
+endif
 	@[ -f $$(IPKG_$(1)) ]
 
     $(1)-clean: