Skip to content

Commit 9f87a66

Browse files
solemnwarningprobonopdTheAssassin
authored
Fix issues when building via the chroot_build.sh script. (AppImage#80)
- Remove dependency on sudo when already running as root - not available in all environments. - Remove unnecessary use of `find` to copy build artifacts as build-runtime.sh already puts them in a known place and the find command chokes under the current Ubuntu kernel while iterating over the /proc/ filesystem. Co-authored-by: probonopd <[email protected]> Co-authored-by: TheAssassin <[email protected]>
1 parent 9a4ccf1 commit 9f87a66

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/chroot/chroot_build.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ if [ -z "${ALPINE_ARCH}" ]; then
88
exit 2
99
fi
1010

11+
if [ "$(whoami)" = "root" ]; then
12+
alias sudo=
13+
fi
14+
1115
# build in a temporary directory
1216
# this makes sure that subsequent runs do not influence each other
1317
# also makes cleaning up easier: just dump the entire directory
@@ -89,5 +93,5 @@ esac
8993

9094
cd "$repo_root_dir"
9195
mkdir -p ./out/
92-
sudo find "$tempdir"/miniroot/ -type f -executable -name "runtime-${appimage_arch}" -exec cp {} "out/runtime-${appimage_arch}" \;
93-
sudo find "$tempdir"/miniroot/ -type f -executable -name "runtime-${appimage_arch}.debug" -exec cp {} "out/runtime-${appimage_arch}.debug" \;
96+
cp "${tempdir}/miniroot/out/runtime-${appimage_arch}" out/
97+
cp "${tempdir}/miniroot/out/runtime-${appimage_arch}.debug" out/

0 commit comments

Comments
 (0)