+++ /dev/null
-#!/bin/bash
-# I, Ian Kelling, follow the GNU license recommendations at
-# https://www.gnu.org/licenses/license-recommendations.en.html. They
-# recommend that small programs, < 300 lines, be licensed under the
-# Apache License 2.0. This file contains or is part of one or more small
-# programs. If a small program grows beyond 300 lines, I plan to switch
-# its license to GPL.
-
-# Copyright 2024 Ian Kelling
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source /a/bin/bash-bear-trap/bash-bear
-source /a/bin/distro-functions/src/package-manager-abstractions
-
-
-pi cmake pkg-config libfreetype6-dev libfontconfig1-dev libxcb-xfixes0-dev libxkbcommon-dev python3
-cd /a/opt/alacritty
-cargo build --release
-sudo mkdir -p /usr/local/share/man/man1
-gzip -c extra/alacritty.man | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
-sudo rsync -at /a/opt/alacritty/target/release/alacritty /usr/local/bin
s virsh dumpxml ubuntu20.04-clone-bbb | gr mac
# use mac
-virsh net-update default add ip-dhcp-host "<host mac='52:54:00:8e:c3:55' name='i.b8.nz' ip='192.168.122.17' />" --live --config
+virsh net-update default add ip-dhcp-host "<host mac='52:54:00:8e:c3:55' name='b8.nz' ip='192.168.122.17' />" --live --config
virsh start ubuntu20.04-clone-bbb
EOF
-wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s i.b8.nz -e letsencrypt@b8.nz -a -g
+wget -qO- https://ubuntu.bigbluebutton.org/bbb-install-2.5.sh | bash -sxe -- -v focal-250 -s b8.nz -e letsencrypt@b8.nz -a -g
rev=$(cat $last_build 2>/dev/null) ||:
head=$(git rev-parse HEAD)
if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then
- echo "already compiled, exiting"
- exit 0
+ echo "already compiled"
+ installed_info=$(file $(readlink -f $(type -P emacs)))
+ build_info=$(file $dir/src/emacs)
+ if [[ $installed_info == "$build_info" ]]; then
+ echo "already installed exiting"
+ # this isn't perfect, because install could partially fail or the
+ # command after it could
+ exit 0
+ fi
fi
if [[ $rev != "$head" ]]; then
bootstrap=true
if ! $force; then
yesterday=$(( $(date +%s) - 60*60*24 ))
+ fetch_mtime=$(stat -c %Y FETCH_HEAD)
+ if [[ ! $fetch_mtime ]]; then
+ err failed to get output from stat -c %Y FETCH_HEAD
+ exit 1
+ fi
# no need to check for updates on go more than once a day
- if (( $(stat -c %Y FETCH_HEAD) > yesterday )); then
+ if (( fetch_mtime > yesterday )); then
up=false
fi
+++ /dev/null
-#!/bin/bash
-# I, Ian Kelling, follow the GNU license recommendations at
-# https://www.gnu.org/licenses/license-recommendations.en.html. They
-# recommend that small programs, < 300 lines, be licensed under the
-# Apache License 2.0. This file contains or is part of one or more small
-# programs. If a small program grows beyond 300 lines, I plan to switch
-# its license to GPL.
-
-# Copyright 2024 Ian Kelling
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-# http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-source /a/bin/bash-bear-trap/bash-bear
-
-if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi
-
-rebuild=false
-case $1 in
- -r) rebuild=true ;;
-esac
-
-# https://sw.kovidgoyal.net/kitty/build/
-deps=(
- libdbus-1-dev
- libxcursor-dev
- libxrandr-dev
- libxi-dev
- libxinerama-dev
- libgl1-mesa-dev
- libxkbcommon-x11-dev
- libfontconfig-dev
- libx11-xcb-dev
- liblcms2-dev
- libpython3-dev
- librsync-dev
-)
-
-pi ${deps[@]}
-
-last_build=/a/opt/kitty-build-info/last-build
-cd /a/opt/kitty
-rev=$(cat $last_build 2>/dev/null) ||:
-head=$(sudo -u zu git rev-parse HEAD)
-if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then
- :
-fi
-
-
-# built it on one machine, the others it dies with the error illegal
-# instruction. building is pretty quick, so just detect if our version
-# works, and if not, rebuild and install.
-# I had an idea to test the failure like so:
-# timeout 5 kitty /bin/true, but that doesn't work over ssh
-if ! $rebuild && ! /bin/true; then
- rebuild=true
-fi
-
-err-cleanup() {
- if mountpoint -q /usr/local/src/kitty; then
- s umount /usr/local/src/kitty
- fi
-}
-
-if $rebuild; then
- s mkdir -p /usr/local/src/kitty
- s mount -o bind /a/opt/kitty /usr/local/src/kitty
-
- s install -o zu -g zu -d /usr/local/src/kitty
- s chown -hR zu.zu /usr/local/src/kitty
- cd /usr/local/src/kitty
- # default plus go
- p=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/go/bin
- gp=/usr/local/src/kitty/go
- m sudo -u zu bash -c 'PATH=$PATH:/usr/local/go/bin; export GOPATH=/usr/local/src/kitty/go; go mod download -x'
- m sudo -u zu firejail --read-write=/usr/local/src/kitty --profile=makekitty env PATH=$p make clean
- m sudo -u zu firejail --read-write=/usr/local/src/kitty --profile=makekitty env PATH=$p GOPATH=$gp make
- cd /
- s umount /usr/local/src/kitty
- s chown -hR iank.iank /a/opt/kitty
-fi
-
-cd /a/opt/kitty
-s rsync -ar --chown root:root --delete __main__.py kitty logo kittens /usr/local/src/kitty
-s rsync -ar --chown root:root ./terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty
-s ln -sf -T /usr/local/src/kitty/kitty/launcher/kitty /usr/local/bin/kitty
-
-echo $head >$last_build
rev=$(cat $last_build 2>/dev/null) ||:
head=$(git rev-parse HEAD)
if ! $recompile && ! $bootstrap && [[ $rev == "$head" ]]; then
- echo "already compiled, exiting"
- exit 0
+ echo "already compiled"
+ installed_info=$(file $(readlink -f $(type -P mu)))
+ build_info=$(file $dir/build/mu/mu)
+ if [[ $installed_info == "$build_info" ]]; then
+ echo "already installed exiting"
+ # this isn't perfect, because install could partially fail or the
+ # command after it could
+ exit 0
+ fi
fi
echo rev=$rev head=$head
if [[ $rev != "$head" ]]; then