From 2357c3481367bd8372b5716ff67cd447f7da684a Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Wed, 25 Dec 2024 18:06:24 +0100 Subject: [PATCH] Update 2024-12-25 18:06 OpenBSD/amd64-t14 --- .bin/luakit-env | 75 +++++++++++++++++++++++++++++++++++++++--- .mutt/scripts/patch.sh | 8 +++-- 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/.bin/luakit-env b/.bin/luakit-env index bef67d7..306fdc2 100755 --- a/.bin/luakit-env +++ b/.bin/luakit-env @@ -29,9 +29,34 @@ echo "luakit-$_env: perform $_action $@ (in $_dir)" | xargs # change into environment mkdir -p "$_dir" +_oldpwd="$PWD" cd "$_dir" # perform actions +if [ "$_action" == "help" ] || [ "$_action" == "h" ] +then + echo "usage: l action [args]" + echo " actions:" + echo " make - build luakit" + echo " remake - make with -j1 (for debugging)" + echo " test [test] - run luakit test suite [specific test]" + echo " debug [luakit args] - start in gdb, stop in main" + echo " pr [numbers] - show [pull] PR from luakit/luakit repo" + echo " update - update/rebase repository" + echo " reset - recreate environment ($_dir)" + echo " diff file env - diff file with other environment" + echo " update-port - update openbsd port from last commit" + echo + echo " other commands:" + echo " ledit - edit this script" + echo " ldev - switch to dev environment" + echo " ltest - switch to test environment" + echo " ltemp - switch to temp environment" + echo " lsdk - switch to sdk environment" + echo +fi + + if [ "$_action" == "test" ] then export G_ENABLE_DIAGNOSTIC=1; @@ -40,9 +65,11 @@ fi if [ "$_action" == "make" ] then + set -x gmake clean gmake options gmake -j 8 luakit + gmake tests/util.so fi if [ "$_action" == "remake" ] @@ -57,13 +84,50 @@ fi if [ "$_action" == "reset" ] then - cd /tmp - rm -rf "$_dir" - mkdir -p "$_dir" - git clone git@github.com:luakit/luakit "$_dir" - cd "$_dir" + if [ "$_env" == "sdk" ] + then + cd /tmp + rm -rf "$_dir" + git clone git@github.com:c0dev0id/luakit "$_dir" + cd "$_dir" + set -xe + git remote add upstream git@github.com:luakit/luakit + git fetch upstream + git checkout develop + git rebase upstream/develop + git switch -c patch + set +xe + else + cd /tmp + rm -rf "$_dir" + git clone git@github.com:luakit/luakit "$_dir" + cd "$_dir" + fi +fi +if [ "$_action" == "update" ] +then + set -xe + if [ "$_env" == "sdk" ] + then + git fetch --all + git checkout develop + git rebase upstream/develop --autostash + git checkout - + else + git checkout develop + git fetch --all + git rebase origin/develop + fi + set +xe fi +if [ "$_action" == "diff" ] +then + set -x + f="$(readlink -f $_oldpwd/$1)" + f="${f#$_dir}" + vimdiff "$_dir/$f" "${_dir%$_env}$2/$f" +fi if [ "$_action" == "pr" ] then @@ -87,3 +151,4 @@ then make makesum make reinstall fi + diff --git a/.mutt/scripts/patch.sh b/.mutt/scripts/patch.sh index c78c568..b094d9f 100755 --- a/.mutt/scripts/patch.sh +++ b/.mutt/scripts/patch.sh @@ -17,7 +17,12 @@ echo "ports - /usr/ports" echo "www - /usr/www" echo printf "Path [$PWD]: " -read _path < /dev/tty +read _reply < /dev/tty + +if [ -z "$_reply" ] +then + _path="$PWD" +fi # shortcuts!!! case "$_path" in @@ -34,7 +39,6 @@ then _path="$(port-jump $_path)" fi -_path=${_path:=$PWD} print "Using: $_path" if [ ! -d "$_path" ]