lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 434cf61 4/4: Set up chroot development enviro


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 434cf61 4/4: Set up chroot development environment
Date: Sun, 10 Sep 2017 18:17:13 -0400 (EDT)

branch: master
commit 434cf61c1716b42d5fa6df2f97921c520dd39ef4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Set up chroot development environment
---
 README.schroot        |  3 +++
 tabs/1/startup_script | 17 +++++++++++++++
 tabs/2/startup_script | 32 ++++++++++++++++++++++++++++
 tabs/3/startup_script | 32 ++++++++++++++++++++++++++++
 tabs/4/startup_script | 24 +++++++++++++++++++++
 tabs/5/startup_script | 17 +++++++++++++++
 tabs/konsole_tabs     | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 183 insertions(+)

diff --git a/README.schroot b/README.schroot
index 548160b..3d42efe 100644
--- a/README.schroot
+++ b/README.schroot
@@ -171,6 +171,9 @@ setopt HIST_IGNORE_DUPS
 
 autoload -U compinit
 compinit -u
+
+# This alias is explained in 'tabs/konsole_tabs'.
+alias asdf='. ./startup_script'
 EOF
 
 # Repair /usr/share/libtool/.../ltmain.sh as indicated here:
diff --git a/tabs/1/startup_script b/tabs/1/startup_script
new file mode 100755
index 0000000..881a94b
--- /dev/null
+++ b/tabs/1/startup_script
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+a='schroot --chroot=cross-lmi'
+
+b='cd /opt/lmi/free/src/lmi'
+c='git remote -v update'
+d='git pull'
+
+print -rs $b ; echo $b ; eval $b
+print -rs $c ; echo $c ; eval $c
+print -rs $d ; echo $d ;
+
+unset a
+unset b
+unset c
+unset d
+
diff --git a/tabs/2/startup_script b/tabs/2/startup_script
new file mode 100755
index 0000000..613d771
--- /dev/null
+++ b/tabs/2/startup_script
@@ -0,0 +1,32 @@
+#!/bin/zsh
+
+a='schroot --chroot=cross-lmi'
+
+b='cd /opt/lmi/src/lmi'
+c='git ls-files --deleted | xargs git checkout --'
+u='eval `ssh-agent`'
+v='ssh-agent $SHELL'
+w='ssh-add ~/.ssh/id_rsa'
+x='ssh-add -D'
+y='ssh-agent -k > /dev/null 2>&1'
+
+print -rs $b ; echo $b ; eval $b
+print -rs $c ; echo $c
+# 'ssh-agent' not presently used in chroot:
+#print -rs $u ; echo $u ; eval $u
+#echo $w >/dev/clipboard
+#print -rs $v ; echo $v ; eval $v
+# This wouldn't affect the spawned shell:
+#print -rs $w ; echo $w ; eval $w
+#print -rs $x ; echo $x ; eval $x
+#print -rs $y ; echo $y ; eval $y
+
+unset a
+unset b
+unset c
+unset u
+unset v
+unset w
+unset x
+unset y
+
diff --git a/tabs/3/startup_script b/tabs/3/startup_script
new file mode 100755
index 0000000..7b9d491
--- /dev/null
+++ b/tabs/3/startup_script
@@ -0,0 +1,32 @@
+#!/bin/zsh
+
+a='schroot --chroot=cross-lmi'
+
+b='cd /opt/lmi/src/lmi'
+c='make $coefficiency install check_physical_closure 2>&1 |less -S'
+d='make $coefficiency cgi_tests cli_tests 2>&1 |less -S'
+e='make $coefficiency system_test 2>&1 |less -S'
+f="make \$coefficiency unit_tests 2>&1 | tee >(grep '\*\*\*') >(grep '????') 
>(grep '!!!!' --count | xargs printf '%d tests succeeded\n') >../log"
+g='make $coefficiency all build_type=so_test USE_SO_ATTRIBUTES=1 2>&1 |less -S'
+h='make $coefficiency cgi_tests cli_tests build_type=safestdlib  2>&1 |less -S'
+i="make \$coefficiency unit_tests build_type=safestdlib 2>&1 | tee >(grep 
'\*\*\*') >(grep '????') >(grep '!!!!' --count | xargs printf '%d tests 
succeeded\n') >../log"
+
+print -rs $b ; echo $b ; eval $b
+print -rs $c ; echo $c
+print -rs $d ; echo $d
+print -rs $e ; echo $e
+print -rs $f ; echo $f
+print -rs $g ; echo $g
+print -rs $h ; echo $h
+print -rs $i ; echo $i
+
+unset a
+unset b
+unset c
+unset d
+unset e
+unset f
+unset g
+unset h
+unset i
+
diff --git a/tabs/4/startup_script b/tabs/4/startup_script
new file mode 100755
index 0000000..cbcd15f
--- /dev/null
+++ b/tabs/4/startup_script
@@ -0,0 +1,24 @@
+#!/bin/zsh
+
+a='schroot --chroot=cross-lmi'
+
+b='cd /opt/lmi/src/lmi'
+c='date -u +"%Y%m%dT%H%MZ" |tr -d "\\n" >/dev/clipboard'
+d='make $coefficiency check_concinnity 2>&1 |less -S -N'
+e='sed -f diagnostics.sed ../log 2>&1 |less -S'
+f='pushd /tmp; /opt/lmi/src/lmi/test_schemata.sh 2>&1 |less; popd'
+
+print -rs $b ; echo $b ; eval $b
+# '/dev/clipboard' is a cygwinism.
+#print -rs $c ; echo $c
+print -rs $d ; echo $d
+print -rs $e ; echo $e
+print -rs $f ; echo $f
+
+unset a
+unset b
+unset c
+unset d
+unset e
+unset f
+
diff --git a/tabs/5/startup_script b/tabs/5/startup_script
new file mode 100755
index 0000000..ba5c14e
--- /dev/null
+++ b/tabs/5/startup_script
@@ -0,0 +1,17 @@
+#!/bin/zsh
+
+a='schroot --chroot=cross-lmi'
+
+b='cd /opt/lmi/bin'
+c='wine ./lmi_wx_shared --ash_nazg --data_path=/opt/lmi/data'
+d='wine ./wx_test --ash_nazg --data_path=/opt/lmi/data'
+
+print -rs $b ; echo $b ; eval $b
+print -rs $c ; echo $c
+print -rs $d ; echo $d
+
+unset a
+unset b
+unset c
+unset d
+
diff --git a/tabs/konsole_tabs b/tabs/konsole_tabs
new file mode 100644
index 0000000..2abc747
--- /dev/null
+++ b/tabs/konsole_tabs
@@ -0,0 +1,58 @@
+# Set up the environment I use for lmi development.
+#
+# It is my custom to keep a number of terminals open, using each one
+# for running a few related commands in a particular directory in a
+# chroot. This file automates recreating that environment by opening
+# tabbed terminals in directories that each contain a single zsh
+# script. Each script, when sourced, runs certain commands and places
+# other commands in history: for example, a script might change to a
+# source directory, run 'git remote -v update' on startup, and push
+# discretionary commands like 'git pull' onto the history stack. This
+# automates my earlier practice of keeping 'gwc/develop1.txt' open
+# and cutting and pasting routine commands codified therein into a
+# terminal.
+#
+# Scripts are arranged in a directory tree because schroot makes it
+# hard to pass a single environment variable ('--preserve-environment'
+# passes them all, unnecessarily weakening security), but easy to
+# specify a directory, which in effect can serve as an environment
+# variable.
+#
+# Scripting is done in zsh because, while terminal emulators generally
+# offer some sort of scripting facilities, each is dysfunctional in
+# its own way. For example, konsole-4.8.4 (debian 7) ignores 'workdir'
+# in 'konsole_tabs', and prints an "Application may misbehave" D-Bus
+# warning on startup, which konsole-16.12.0 (debian 9) opens an extra
+# tab that was not specified in 'konsole_tabs'.
+#
+# The zsh scripts are to be sourced rather than executed because they
+# use 'print -s' to push commands into history.
+#
+# Invocation:
+#   $konsole --tabs-from-file ~/konsole_tabs &
+# Navigate to each tab and source the script in its startup directory.
+# To make this easy, all scripts have the same name, 'startup_script'.
+# To make it even easier, I've added this line:
+#   alias asdf='. ./startup_script'
+# to the chroot's '~/.zshrc' because "asdf" can readily be typed and
+# is unlikely to be used for any other purpose. Although admittedly
+# quirky, this one small dab of silly glue binds these tools together
+# robustly without the complexity of, say, D-Bus.
+#
+# Original motivation: I put this together when I was developing for
+# msw with cygwin in a VM that crashed every few hours, and found it
+# annoying to spend several minutes recreating my working environment.
+#
+# Alternatives: A multiplexer like 'screen' or 'tmux' might be used
+# instead, but this lightweight solution fulfills all my needs simply;
+# I cannot comfortably read more than about 30 x 100 characters at
+# full-screen resolution, and therefore have little use for multiple
+# panes. Having figured out how to start various terminals with tabbed
+# sessions, I do wonder whether I should have used 'expect'.
+#
+title: ONE   ;; profile: Shell ;; command: schroot --chroot=cross-lmi 
--directory=/opt/lmi/src/lmi/tabs/1
+title: TWO   ;; profile: Shell ;; command: schroot --chroot=cross-lmi 
--directory=/opt/lmi/src/lmi/tabs/2
+title: THREE ;; profile: Shell ;; command: schroot --chroot=cross-lmi 
--directory=/opt/lmi/src/lmi/tabs/3
+title: FOUR  ;; profile: Shell ;; command: schroot --chroot=cross-lmi 
--directory=/opt/lmi/src/lmi/tabs/4
+title: FIVE  ;; profile: Shell ;; command: schroot --chroot=cross-lmi 
--directory=/opt/lmi/src/lmi/tabs/5
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]