dot

packages and services management
Log | Files | Refs | README

commit dc1821346753ea5452bc3f71fba22bbfe842b954
parent edf69db54605a52239ca8699a289c7bcad57f44a
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat,  5 Jan 2019 19:41:44 +0100

Merge branch 'master' of git.josuah.net:dot

Diffstat:
Mbin/mail-filter | 22++++++++++------------
Mbin/menu-mail | 6+++---
Metc/git/default/hooks/post-receive | 5+++--
Metc/git/default/hooks/pre-receive | 5+++--
Metc/git/default/hooks/update | 6++++--
Detc/git/public/hooks/post-receive.d/git-hook-stagit | 40----------------------------------------
Aetc/git/public/hooks/post-receive.d/stagit | 39+++++++++++++++++++++++++++++++++++++++
Mhome/.config/open/protocol/git | 15++++++++-------
8 files changed, 70 insertions(+), 68 deletions(-)

diff --git a/bin/mail-filter b/bin/mail-filter @@ -1,33 +1,31 @@ #!/usr/bin/env execlineb +elgetpositionals backtick -n x { whoami } -importas USER x +importas user x -backtick -n x { homeof $USER } -importas HOME x +backtick -n x { homeof ${user} } +importas home x multisubstitute { - importas -D ${HOME}/.mblaze MBLAZE MBLAZE - importas -D INBOX INBOX 1 - importas -D ${HOME}/mail MAILDIR MAILDIR + importas -D ${home}/.mblaze mblaze MBLAZE + importas -D ${home}/mail maildir MAILDIR } -cd $MAILDIR +cd ${maildir} fdmove -c 1 2 -if { pipeline { glob -0 x * minc ${x} } mseq -S } - -forbacktickx -n x { ls ${MBLAZE}/sort } +forbacktickx -n x { ls ${mblaze}/sort } importas target x if { printf " %-35s " ${target} } if { mkdir -p -m 0700 ${target}/cur ${target}/new ${target}/tmp } -backtick -n x { redirfd -r 0 ${MBLAZE}/sort/${target} tr "\n" " " } +backtick -n x { redirfd -r 0 ${mblaze}/sort/${target} tr "\n" " " } importas rule x -forbacktickx -n x { mpick -v -t ${rule} } +forbacktickx -n x { mpick -v -t ${rule} ${@} } importas file x if { test ${file} != ${target}/new } diff --git a/bin/menu-mail b/bin/menu-mail @@ -2,9 +2,9 @@ backtick -n x { whoami } importas user x backtick -n x { homeof $user } importas home x multisubstitute { - importas -D ${home}/.mblaze mblaze MBLAZE - importas -D INBOX inbox 1 - importas -D ${home}/mail maildir MAILDIR + importas -D ${home}/.mblaze mblaze MBLAZE + importas -D INBOX inbox 1 + importas -D ${home}/mail maildir MAILDIR } backtick -n x { pipeline { ls $maildir } menu } importas dir x diff --git a/etc/git/default/hooks/post-receive b/etc/git/default/hooks/post-receive @@ -1,6 +1,7 @@ #!/usr/bin/env execlineb -elglob -0 x hooks/post-receive.d/* -forx x { ${x} } +elglob -0 x hooks/post-receive.d/* forx x { ${x} } importas script x + +if { echo ${script} } ${script} diff --git a/etc/git/default/hooks/pre-receive b/etc/git/default/hooks/pre-receive @@ -1,6 +1,7 @@ #!/usr/bin/env execlineb -elglob -0 x hooks/pre-receive.d/* -forx x { ${x} } +elglob -0 x hooks/pre-receive.d/* forx x { ${x} } importas script x + +if { echo ${script} } ${script} diff --git a/etc/git/default/hooks/update b/etc/git/default/hooks/update @@ -1,5 +1,7 @@ #!/usr/bin/env execlineb -elglob -0 x hooks/update.d/* -forx x { ${x} } + +elglob -0 x hooks/update.d/* forx x { ${x} } importas script x + +if { echo ${script} } ${script} diff --git a/etc/git/public/hooks/post-receive.d/git-hook-stagit b/etc/git/public/hooks/post-receive.d/git-hook-stagit @@ -1,40 +0,0 @@ -#!/usr/bin/env execlineb - -s6-envdir env -importas -D 0 target PATH_WWW - -backtick -n x { basename ${target} } -importas domain x - -backtick -n x { pwd } -importas gitdir x - -backtick -n x { heredoc 0 ${gitdir} sed -r "s,.*/,," } -importas repo x - -if { echo "stagit: ${repo}" } - -if { mkdir -p ${target}/${repo} stagit } -if { - cd ${target}/${repo} - stagit-gopher -b /git/${repo} -c ${gitdir}/stagit/cache-gopher ${gitdir} -} -if { - cd ${target}/${repo} - stagit ${gitdir} -c ${gitdir}/stagit/cache -} -if { ln -sf ../style.css ${target}/${repo}/style.css } - -elglob -0 x ../*/git-daemon-export-ok -backtick x { pipeline { printf "%s\n" ${x} } sed "s/[^/]*$//" } -importas -s -d "\n" repolist x - -if { - redirfd -w 1 ${target}/index.html - stagit-index ${repolist} -} - -if { - redirfd -w 1 ${target}/index.gph - stagit-gopher-index -b /git ${repolist} -} diff --git a/etc/git/public/hooks/post-receive.d/stagit b/etc/git/public/hooks/post-receive.d/stagit @@ -0,0 +1,39 @@ +#!/usr/bin/env execlineb + +s6-envdir env +importas -D 0 www PATH_WWW + +backtick -n x { pwd } +importas git x + +backtick -n x { heredoc 0 ${git} sed -r "s,.*/,," } +importas name x + +redirfd -w 1 stagit/log +redirfd -w 2 stagit/log +background -d { + if { mkdir -p ${www}/${name} stagit } + + backtick x { + elglob -0 x ../*/git-daemon-export-ok + pipeline { printf "%s\n" ${x} } + sed "s/[^/]*$//" + } + importas -s -d "\n" repolist x + + if { + redirfd -w 1 ${www}/index.gph + stagit-gopher-index -b /git ${repolist} + } + + if { ln -sf ../style.css ${www}/${name}/style.css } + if { + redirfd -w 1 ${www}/index.html + stagit-index ${repolist} + } + + cd ${www}/${name} + + if { stagit-gopher -b /git/${name} -c ${git}/stagit/cache-gopher ${git} } + if { stagit ${git} -c ${git}/stagit/cache-html } +} diff --git a/home/.config/open/protocol/git b/home/.config/open/protocol/git @@ -9,15 +9,16 @@ multisubstitute { } backtick -n x { whoami } -importas USER x +importas u x -backtick -n x { homeof ${USER} } -importas HOME x +backtick -n x { homeof ${u} } +importas home x -backtick -n x { dirname ${HOME}/git/${host}/${path} } +if { printf "\"%s\"\n" ${host} ${path} } +backtick -n x { dirname ${home}/git/${host}/${path} } importas dir x -if { mkdir -p $dir } cd $dir -if { echo $dir } +if { mkdir -p ${dir} } cd ${dir} +if { echo ${dir} } -git clone $uri +git clone ${uri}