summaryrefslogtreecommitdiff
path: root/src/stage3/stage3.sh
diff options
context:
space:
mode:
authorAndreas Grapentin <andreas@grapentin.org>2018-03-08 19:33:06 +0100
committerAndreas Grapentin <andreas@grapentin.org>2018-03-08 19:33:06 +0100
commit0d8a614a4a04cee03a98857a9e5694c2ce2d7590 (patch)
tree111b1ec4b4980b9dfd187f40b72b62586ed24fd5 /src/stage3/stage3.sh
parent2bb95cbb525323af64f2af84a32336f0c9137976 (diff)
refactoring and more progress
Diffstat (limited to 'src/stage3/stage3.sh')
-rwxr-xr-xsrc/stage3/stage3.sh30
1 files changed, 9 insertions, 21 deletions
diff --git a/src/stage3/stage3.sh b/src/stage3/stage3.sh
index e3ceed0..4de99d9 100755
--- a/src/stage3/stage3.sh
+++ b/src/stage3/stage3.sh
@@ -21,6 +21,7 @@
set -euo pipefail
msg "Entering Stage 3"
+notify --text "*Bootstrap Entering Stage 3*"
# set a bunch of convenience variables
_builddir="$topbuilddir"/stage3
@@ -106,25 +107,8 @@ EOF
ln -s "$_pkgdest"/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz \
"$_makepkgdir"/$_pkgname/$_pkgname-$_pkgver-$_pkgarch.pkg.tar.xz
else
- # acquire the pkgbuild and auxiliary files
- _libre=https://www.parabola.nu/packages/libre/x86_64/$_pkgname/
- _core=https://www.archlinux.org/packages/core/x86_64/$_pkgname/
- _extra=https://www.archlinux.org/packages/extra/x86_64/$_pkgname/
- _community=https://www.archlinux.org/packages/community/x86_64/$_pkgname/
- for url in $_libre $_core $_extra $_community; do
- if ! curl -s $url | grep -iq 'not found'; then
- src=$(curl -s $url | grep -i 'source files' | cut -d'"' -f2 | sed 's#/tree/#/plain/#')
- for link in $(curl -sL $src | grep '^ <li><a href' | cut -d"'" -f2 \
- | sed "s#^#$(echo $src | awk -F/ '{print $3}')#"); do
- wget -q $link -O $(basename ${link%\?*});
- done
- break
- fi
- done
-
- # import keys
- keys="$(source PKGBUILD && echo "${validpgpkeys[@]}")"
- [ -z "$keys" ] || sudo -u $SUDO_USER gpg --recv-keys $keys
+ fetch_pkgfiles $_pkgname
+ import_keys
# patch if necessary
cp PKGBUILD{,.old}
@@ -146,7 +130,7 @@ EOF
# build the package
chown -R $SUDO_USER "$_makepkgdir"/$_pkgname
- libremakepkg -n $CHOST-stage3 || die "error building $_pkgname"
+ libremakepkg -n $CHOST-stage3 || failed_build
fi
popd >/dev/null
@@ -164,11 +148,15 @@ EOF
-n "$CHOST-stage3" \
-C "$_builddir"/config/pacman.conf \
-M "$_builddir"/config/makepkg.conf \
- install-file "$_pkgfile"
+ run pacman -Udd /native/$CARCH/"$(basename "$_pkgfile")"
set -o pipefail
# remove pkg from deptree
sed -i "/^$_pkgname :/d; s/ $_pkgname\b//g" "$_deptree"
+
+ full=$(cat "$_deptree".FULL | wc -l)
+ curr=$(expr $full - $(cat "$_deptree" | wc -l))
+ notify --success --text "*$curr/$full* $_pkgname"
done
# unmount