Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README-scripts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Requirements:
python-psycopg2
postgresql

After initial checkout:
(1) run setup.sh to setup the git-disk repo
(2) edit psqldb-env.sh to suit your environment
Expand Down Expand Up @@ -30,7 +34,3 @@ and rerun update.sh.
The creation of the tmpfs mounts is for both speed and to reduce SSD wear.
The mounts are not strictly needed and the scripts can easily be hacked to avoid
requiring them.




3 changes: 2 additions & 1 deletion doit.pl
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env perl
use Data::Dumper;
use Cwd;

Expand Down Expand Up @@ -62,7 +63,7 @@
}

#
# Read existing entires.
# Read existing entries.
# If option A and `newId` is defined is used the commit will be assumed done.
# If option B is used and `cached` is defined the commit messages
# will be re-done, but the contents will not be re-done.
Expand Down
17 changes: 8 additions & 9 deletions init-psqldb.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
. ./psqldb-env.sh
#!/usr/bin/env bash
set -euo pipefail

set -e
# Create the psql database

# create the psql database
. ./psqldb-env.sh

if findmnt psqldb
then
pgctl stop
sudo umount psqldb
if findmnt psqldb && [[ -e ${PGDIR} ]]; then
pgctl stop
sudo umount psqldb
fi

mkdir -p psqldb
Expand All @@ -28,7 +28,6 @@ max_wal_size = 512MB
EOF
pgctl start

createdb $DBNAME
createdb "$DBNAME"
psql scowl -f comp/util-fun.sql
psql scowl -f comp/comp-init.sql

8 changes: 3 additions & 5 deletions init.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# create the tmp git repo

set -e
#!/usr/bin/env bash
set -euo pipefail

mkdir -p git
sudo mount -t tmpfs -o size=512M none git
cd git
ln -s ../git-disk/.git

ln -s ../git-disk/.git .
11 changes: 6 additions & 5 deletions psqldb-env.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# set this to the absolute path of the root directly you are running the
# scripts from.
ROOTDIR=/home/kevina/wordlist/diff/
ROOTDIR="${HOME}/wordlist/diff/"

export DBNAME=scowl

export PGVER=11
export PGBINDIR=/usr/lib/postgresql/11/bin
export PGVER=18
export PGBINDIR=/usr/lib/postgresql/18/bin

export PATH="$PGBINDIR":"$PATH"

Expand All @@ -15,7 +15,8 @@ export PGDIR="$DBROOT"/scowl
export PGHOST="$DBROOT"
export PGPORT=${PGPORT:-5437}

alias psql=`which psql`
alias psql=$(command -v psql)

pgctl () {
pg_ctl -D "$PGDIR" -l "$PGDIR"/log "$@"
pg_ctl -D "$PGDIR" -l "$PGDIR"/log "$@"
}
6 changes: 4 additions & 2 deletions push.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
git push diff diff \
$( for f in `git tag -l | fgrep diff/`; do echo $f:`basename $f`; done )
#!/usr/bin/env bash
set -euo pipefail

git push diff diff $( for f in $(git tag -l | grep -F diff/); do echo $f:$(basename $f); done )
8 changes: 5 additions & 3 deletions setup.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# setup the git-disk repo
#!/usr/bin/env bash
set -euo pipefail

set -e
# Setup the git-disk repo

rm -rf git-disk
git init git-disk
cd git-disk
git remote add src git@github.com:en-wl/wordlist.git
#git remote add src /home/kevina/wordlist/v2-pub
#git remote add src "${HOME}/wordlist/v2-pub"
git remote add diff git@github.com:en-wl/wordlist-diff.git
git fetch src v1
git fetch src
Expand Down
16 changes: 8 additions & 8 deletions update.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/sh
#!/usr/bin/env bash
set -euo pipefail

# this will update an already populated git-disk

set -ex
# This will update an already populated git-disk

: ${SCOWL_BRANCH:=v2}
export SCOWL_BRANCH
: ${DIFF_BRANCH:=diff}
export DIFF_BRANCH
ROOTDIR="$PWD"

cd git-disk

git reset --hard
Expand All @@ -23,9 +21,11 @@ git reset --hard src/"$SCOWL_BRANCH"

cd ..

if ! mountpoint -q git; then sh init.sh; fi
if ! mountpoint -q git; then
./init.sh
fi

cd git
PATH="$ROOTDIR/bin:$PATH" perl ../doit.pl
PATH="$ROOTDIR/bin:$PATH" ../doit.pl

echo 'now do: cd git; sh ../push.sh'
echo 'now do: cd git; ../push.sh'