summaryrefslogtreecommitdiff
path: root/src/stage3/stage3.sh
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-04-07 07:46:06 +0200
committerAndreas Grapentin <andreas@grapentin.org>2018-04-07 07:46:06 +0200
commit689345dd55e0ff2336910c084ebf230cf111825c (patch)
tree68feb7f0ba3a773fef5293d6d14e497a74a8359b /src/stage3/stage3.sh
parenta89111ad91782cad8792417e0e70e03448af0d06 (diff)
progress into stage4
Diffstat (limited to 'src/stage3/stage3.sh')
-rwxr-xr-xsrc/stage3/stage3.sh37
1 files changed, 18 insertions, 19 deletions
diff --git a/src/stage3/stage3.sh b/src/stage3/stage3.sh
index 0112253..3fa90bb 100755
--- a/src/stage3/stage3.sh
+++ b/src/stage3/stage3.sh
@@ -36,14 +36,16 @@ stage3_makepkg() {
sed "s#@MULTILIB@#${MULTILIB:-disable}#g" \
PKGBUILD.in > PKGBUILD
+ # prepare the pkgbuild
package_enable_arch "$CARCH"
+ echo "checkdepends=()" >> PKGBUILD
# check built dependencies
local dep
for dep in $(srcinfo_builddeps -n); do
deptree_check_depend "$1" "$dep" || return
done
- for dep in $(srcinfo_rundeps "$1"); do
+ for dep in $(srcinfo_rundeps "$pkgname"); do
deptree_check_depend "$1" "$dep" || return
done
@@ -53,9 +55,6 @@ stage3_makepkg() {
# don't rebuild if already exists
check_pkgfile "$PKGDEST" "$1" && return
- # disable checkdepends
- echo "checkdepends=()" >> PKGBUILD
-
if [ "x$1" != "x$pkgname" ]; then
# a bit of magic for -decross builds
PKGDEST=. "$BUILDDIR/libremakepkg-$CARCH.sh" -n "$CHOST"-stage3 || return
@@ -88,15 +87,16 @@ stage3_package_build() {
}
stage3_package_install() {
- local pkgfile
- pkgfile=$(find "$PKGDEST" -regex "^.*/$1-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
+ local esc pkgfile
+ esc=$(printf '%s\n' "$1" | sed 's:[][\/.^$*]:\\&:g')
+ pkgfile=$(find "$PKGPOOL" -regex "^.*/$esc-[^-]*-[^-]*-[^-]*\\.pkg\\.tar\\.xz\$" | head -n1)
[ -n "$pkgfile" ] || { error "$1: pkgfile not found"; return "$ERROR_MISSING"; }
yes | librechroot \
-n "$CHOST-stage3" \
-C "$BUILDDIR"/config/pacman.conf \
-M "$BUILDDIR"/config/makepkg.conf \
- run pacman -Udd /repos/native/"$CARCH"/"$(basename "$pkgfile")" || return
+ run pacman -U /repos/native/"$CARCH"/"$(basename "$pkgfile")" || return
yes | librechroot \
-n "$CHOST-stage3" \
-C "$BUILDDIR"/config/pacman.conf \
@@ -124,26 +124,25 @@ stage3() {
binfmt_enable
- prepare_stage3_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
- prepare_stage3_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
prepare_deptree "${groups[@]}" || die -e "$ERROR_BUILDFAIL" "failed to prepare DEPTREE"
-
local pkg
for pkg in "${decross[@]}"; do
deptree_add_entry "$pkg-decross"
done
-
echo "remaining pkges: $(wc -l < "$DEPTREE") / $(wc -l < "$DEPTREE".FULL)"
- if [ -s "$DEPTREE" ]; then
- check_exe -r librechroot libremakepkg
+ [ -s "$DEPTREE" ] || return 0
- for pkg in "${decross[@]}"; do
- package_build stage3_package_build stage3_package_install "$pkg-decross" || return
- done
+ prepare_stage3_makepkg || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH makepkg"
+ prepare_stage3_chroot || die -e "$ERROR_BUILDFAIL" "failed to prepare $CARCH chroot"
- # build packages from deptree
- packages_build_all stage3_package_build stage3_package_install || return
- fi
+ check_exe -r librechroot libremakepkg
+
+ for pkg in "${decross[@]}"; do
+ package_build stage3_package_build stage3_package_install "$pkg-decross" || return
+ done
+
+ # build packages from deptree
+ packages_build_all stage3_package_build stage3_package_install || return
# cleanup
umount_stage3_chrootdir