aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2022-04-19 20:02:59 +0200
committerPaul Spooren <mail@aparcar.org>2022-04-19 22:59:50 +0200
commit7a732213322d9aa6d8743beffb185ca6f53a5bea (patch)
tree53a8ad0313f006f5f8734add4271d32e0f33678b /scripts
parent0b5a3234369395e886c2902d4b6a490c4ea91634 (diff)
downloadupstream-7a732213322d9aa6d8743beffb185ca6f53a5bea.tar.gz
upstream-7a732213322d9aa6d8743beffb185ca6f53a5bea.tar.bz2
upstream-7a732213322d9aa6d8743beffb185ca6f53a5bea.zip
build: use numeric-owner in ipkg-build
To create packages the `ipkg-build` script is used which double packs `control.tar.gz` and `data.tar.gz` to a single package. By default it's using a verbose username instead of a numeric value for files. Official OpenWrt images (artifacts) are created within docker containers which do not seem to contain those verbose usernames and instead defaults to numeric values. This becomes a problem when rebuilding public artifacts because other build environments may offer verbose usernames and there the created packages is different from the official ones. With this commit `ipkg-build` always uses numeric values for user/group and thereby making it easier to reproduce official artifacts. Signed-off-by: Paul Spooren <mail@aparcar.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/ipkg-build6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index 19df621048..122cca2cb4 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -179,20 +179,20 @@ for file_mode in $file_modes; do
chown "$uid:$gid" "$pkg_dir/$path"
chmod "$mode" "$pkg_dir/$path"
done
-$TAR -X "$tmp_dir"/tarX --format=gnu --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz
+$TAR -X "$tmp_dir"/tarX --format=gnu --numeric-owner --sort=name -cpf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/data.tar.gz
installed_size=$(stat -c "%s" "$tmp_dir"/data.tar.gz)
sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
"$pkg_dir"/$CONTROL/control
-( cd "$pkg_dir"/$CONTROL && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/control.tar.gz )
+( cd "$pkg_dir"/$CONTROL && $TAR --format=gnu --numeric-owner --sort=name -cf - --mtime="$TIMESTAMP" . | gzip -n - > "$tmp_dir"/control.tar.gz )
rm "$tmp_dir"/tarX
echo "2.0" > "$tmp_dir"/debian-binary
pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
rm -f "$pkg_file"
-( cd "$tmp_dir" && $TAR --format=gnu --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | gzip -n - > "$pkg_file" )
+( cd "$tmp_dir" && $TAR --format=gnu --numeric-owner --sort=name -cf - --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz | gzip -n - > "$pkg_file" )
rm "$tmp_dir"/debian-binary "$tmp_dir"/data.tar.gz "$tmp_dir"/control.tar.gz
rmdir "$tmp_dir"