Skip to content

Commit

Permalink
Add unpackarchive tool, use it for preinstallation
Browse files Browse the repository at this point in the history
This makes builds work for non-root users or with no bsdtar installed.
  • Loading branch information
mlschroe committed Jul 16, 2021
1 parent 973e9ec commit ca5bb10
Show file tree
Hide file tree
Showing 3 changed files with 446 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ install:
spec_add_patch \
spectool \
signdummy \
unpackarchive \
unrpm \
telnet_login_wrapper \
startdockerd \
Expand Down
10 changes: 6 additions & 4 deletions init_buildsystem
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,15 @@ preinstall() {
check_exit
echo "preinstalling $PKG..."
preinstall_setup
if test -x /usr/bin/bsdtar ; then
if test "$UID" = 0 -a -x /usr/bin/bsdtar ; then
CPIO="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P --chroot -o --numeric-owner -x -f-"
TAR="/usr/bin/bsdtar --exclude .build --exclude .init_b_cache -P --chroot -o --numeric-owner -x"
else
unsafe_preinstall_check
CPIO="cpio --extract --unconditional --preserve-modification-time --make-directories --no-absolute-filenames --quiet"
TAR="tar --exclude .build --exclude .init_b_cache -x"
# unsafe_preinstall_check
# CPIO="cpio --extract --unconditional --preserve-modification-time --make-directories --no-absolute-filenames --quiet"
# TAR="tar --exclude .build --exclude .init_b_cache -x"
CPIO="$BUILD_DIR/unpackarchive --cpio ."
TAR="$BUILD_DIR/unpackarchive --tar ."
fi
pkg_preinstall
preinstall_integrate
Expand Down
Loading

0 comments on commit ca5bb10

Please sign in to comment.