Skip to content

Instantly share code, notes, and snippets.

@mat813
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mat813/8cbc9194973b25b48ea3 to your computer and use it in GitHub Desktop.
Save mat813/8cbc9194973b25b48ea3 to your computer and use it in GitHub Desktop.
Build the FreeBSD docs
#!/bin/sh
# Needs sysutils/watchman, textproc/jq
set -e
BUILD_OBJ=/usr/home/mat/work/freebsd/doc-obj
watchman watch ${PWD} > /dev/null
# Subscribe to changes in $PWD, don't care about anything it returns,
# so trim the fields.
search='[
"subscribe",
"'${PWD}'",
"doc2-'$$'",
{
"expression": [
"allof",
[ "type", "f" ],
[ "not", [ "match", ".git/*", "wholename" ] ]
],
"fields": [ "name" ]
}
]'
# First two lines are ignored
echo "$search" | stdbuf -o L watchman -j -p --no-pretty | stdbuf -o L sed -u '1d;2d' | while read foo
do
[ -x run-this.sh ] && ./run-this.sh && chmod -x run-this.sh
for i in `git diff-index --name-only trunk -- *_*|cut -d / -f 1,2,3|sort -u`
do
(
cd $i
current_branch=$(git rev-parse --abbrev-ref HEAD)
export WRKDIRPREFIX=${BUILD_OBJ}/${current_branch}
export MAKEOBJDIRPREFIX=${WRKDIRPREFIX}/obj
make obj && make objlink && make -k "$@" || :
echo $foo|jq '.files[]'
echo -n "BUILT $i at "
LANG=C date
)
done
done
Alias /d2 /usr/home/mat/work/freebsd/doc2/
<Directory /usr/home/mat/work/freebsd/doc2/>
Options +Indexes +FollowSymLinks
AllowOverride FileInfo
Require all granted
RewriteEngine on
LogLevel alert rewrite:trace6
RewriteBase /d2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([^/]+)/(.+) /do/$1/obj/usr/home/mat/work/freebsd/doc2/$2 [L]
</Directory>
Alias /do /usr/home/mat/work/freebsd/doc-obj/
<Directory /usr/home/mat/work/freebsd/doc-obj/>
Options +Indexes
Require all granted
</Directory>
#!/bin/sh
set -x
#git checkout buildtarget
#git checkout master_site_n
#git checkout target_options_helpers
#git checkout various_fixes
# comment this to do a rebase
exit 0
git checkout trunk
before=$(git show-ref --hash refs/heads/trunk)
git svn rebase -v
after=$(git show-ref --hash refs/heads/trunk)
if [ $before != $after ]
then
for i in $(git branch --no-merge origin/trunk)
do
git checkout $i
git rebase origin/trunk
# When creating a new branch and review, run
# git git config --local --add branch.{branch}.review DXXXX
if git config branch.${i}.review
then
arc diff --update $(git config branch.${i}.review) --message 'rebase'
else
echo ">>>>>>>> UNABLE TO UPDATE PHABRICATOR !!!! <<<<<<<<<<<"
fi
done
fi
git checkout trunk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment