The `ipkg-build` script create installable `ipk` packages. The newly
added `-r` option attaches the `--owner=0 --group=0` to the `tar`
command, allowing to run without a `fakeroot` context and still result
in root-owned package contents. This approach is much faster than
wrapping the packaging script with `fakeroot`.

Signed-off-by: Paul Spooren <m...@aparcar.org>
---
 scripts/ipkg-build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index e3a9a882cf..38149c4432 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+set -x
+
 # ipkg-build -- construct a .ipk from a directory
 # Carl Worth <cwo...@east.isi.edu>
 # based on a script by Steve Redler IV, st...@sr-tech.com 5-21-2001
@@ -72,13 +74,14 @@ pkg_appears_sane() {
 # ipkg-build "main"
 ###
 file_modes=""
-usage="Usage: $0 [-v] [-h] [-m] <pkg_directory> [<destination_directory>]"
-while getopts "hvm:" opt; do
+usage="Usage: $0 [-v] [-h] [-r] [-m] <pkg_directory> [<destination_directory>]"
+while getopts "hvrm:" opt; do
     case $opt in
        v ) echo $version
            exit 0
            ;;
        h )     echo $usage  >&2 ;;
+       r )     TAR="$TAR --owner=0 --group=0" ;;
        m )     file_modes=$OPTARG ;;
        \? )    echo $usage  >&2
        esac
-- 
2.25.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to