1#!/bin/bash
2
3if [ $# -lt 1 ]; then
4	echo "usage: $0 <recipe> [sysroot-stage number]"
5	echo "Enters a haikuporter bootstrap chroot."
6	echo "Optionally, specify the sysroot-stage (default 1)"
7	exit 1
8fi
9
10STAGE="stage1"
11if [ $# -eq 2 ]; then
12	STAGE=stage$2
13fi
14
15export GENERATED=$WORKPATH/generated.$TARGET_ARCH
16export LD_LIBRARY_PATH=$GENERATED/objects/linux/lib/:$LD_LIBRARY_PATH
17
18# A hack to fix haikuport chroot not liking Debian's fancy PS1
19export PS1='\u@\h:\w\$'
20
21echo "Entering chroot with $STAGE chroot..."
22
23$WORKPATH/src/haikuporter/haikuporter \
24	--config=$GENERATED/objects/haiku/$TARGET_ARCH/packaging/repositories/HaikuPortsCross-build/haikuports.conf \
25	--cross-devel-package $GENERATED/objects/haiku/$TARGET_ARCH/packaging/packages/haiku_cross_devel_sysroot_${STAGE}_$TARGET_ARCH.hpkg \
26	--enter-chroot $1
27