Skip to content

Commit

Permalink
Move code pointers from SF to github.com
Browse files Browse the repository at this point in the history
Update documentation and tooling to reference github.com instead of
sourceforge.net.
  • Loading branch information
cpeel committed Feb 24, 2018
1 parent 006b456 commit e9b8323
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 174 deletions.
39 changes: 29 additions & 10 deletions README.md
@@ -1,29 +1,48 @@
# Distributed Proofreaders

Preserving history, one page at a time.
_Preserving history, one page at a time._

This repository contains the code that powers http://www.pgdp.net and other
sister DP sites world-wide.

The master repository is hosted on SourceForge at:
https://sourceforge.net/p/dproofreaders/git/
## About

Distributed Proofreaders is a web application (written in PHP and backed by a
MySQL database) that is intended to ease the process of converting public
domain books and other printed materials into e-texts.
The main site is at http://www.pgdp.net

By breaking the work into individual pages, many proofreaders can be working
on the same book at the same time. This significantly speeds up the
proofreading/E-Text creation process.

When a proofer elects to proofread a page for a particular project, the text
and image file are displayed on a single webpage. This allows the text file
to be easily reviewed and compared to the image file, thus assisting the
proofreading of the text file. The edited text is then submitted back to the
site via the same webpage that it was edited on.

Once all pages for a particular book have been processed, a concatenated text
file is made available for final clean-up and submitted to a
[Project Gutenberg](https://en.wikipedia.org/wiki/Project_Gutenberg#Affiliated_projects)
site.

## Installation

See `SETUP/installation.txt` for information on system pre-requisites and
installation instructions. This file also has information on upgrading from
an earlier release of the code.
See the [installation guide](SETUP/installation.txt) for information on system
pre-requisites and installation instructions. This file also has information on
upgrading from an earlier release of the code.

If you need assistance with the code, inquire within the
[DP Site Code](http://www.pgdp.net/phpBB3/viewforum.php?f=32) forum at pgdp.net.
[DP Site Code](https://www.pgdp.net/phpBB3/viewforum.php?f=32) forum at pgdp.net.

## Code development

To get involved with development on this code base, see
[DP Code Development](http://www.pgdp.net/wiki/DP_Code_Development) in the
[DP Code Development](https://www.pgdp.net/wiki/DP_Code_Development) in the
pgdp.net wiki.

## License

All source code published here is available under the terms of the GNU General
Public License, version 2. See `license.txt` for more information.
All source code published here is available under the terms of the
[GNU General Public License, version 2](license.txt).
2 changes: 1 addition & 1 deletion SETUP/check_db_schema.template
Expand Up @@ -63,7 +63,7 @@ echo "
" > $testing_dir/config.sh

echo "Getting a test copy of the '$curr_tag' code..."
$setup_dir/update_from_sf $testing_dir/config.sh
$setup_dir/update_from_github $testing_dir/config.sh

echo ""
echo "Getting db_schema.sql from the '$prev_tag' release..."
Expand Down
2 changes: 1 addition & 1 deletion SETUP/configuration.sh
Expand Up @@ -16,7 +16,7 @@
# particular, don't put it (or leave it) under your server's doc root.

# This file (or rather, your edited copy of it) is sourced by the scripts
# 'update_from_sf' and 'configure'. Those are Bourne Shell scripts,
# 'update_from_github' and 'configure'. Those are Bourne Shell scripts,
# so you can use any syntax that /bin/bash allows. However, in typical
# usage, you would merely assign literal values to shell variables.

Expand Down
12 changes: 6 additions & 6 deletions SETUP/get_git_clone
Expand Up @@ -2,7 +2,7 @@

# usage: get_git_clone <TAG> <GROUP> <root_dir>
#
# Get a clone of the DP code from SourceForge:
# Get a clone of the DP code from github.com:
# 1) Create $root_dir
# 2) Clone the git repo
# 3) Check out the $TAG code (be it a tag or a branch)
Expand Down Expand Up @@ -48,15 +48,15 @@ fi
# ------------------------------------------------------------------------------
# Extract the latest source from the git repository.

sf_userid=`cat ~/.sourceforge_id 2>/dev/null`
if [ "$sf_userid" != "" ]; then
echo "~/.sourceforge_id says you are $sf_userid at SourceForge"
github_userid=`cat ~/.github_id 2>/dev/null`
if [ "$github_userid" != "" ]; then
echo "~/.github_id says you are $github_userid at github.com"
echo "(If this is incorrect, please abort and edit the file.)"
echo "Getting read-write git clone via SSH"
clone_location=ssh://$sf_userid@git.code.sf.net/p/dproofreaders/git
clone_location=ssh://git@github.com:$github_userid/dproofreaders.git
else
echo "Getting read-only git clone"
clone_location=git://git.code.sf.net/p/dproofreaders/git
clone_location=https://github.com/DistributedProofreaders/dproofreaders.git
fi

git clone $clone_location $root_dir
Expand Down
4 changes: 2 additions & 2 deletions SETUP/installation.txt
@@ -1,8 +1,8 @@
Instructions for installing/upgrading the Distributed Proofreaders website code

The instructions in this file assume that you're using a release tarball from
DP's Project Page on SourceForge:
http://sourceforge.net/projects/dproofreaders/
DP's Project Page on github.com:
https://github.com/DistributedProofreaders/dproofreaders
If you're installing/upgrading from source control, it's trickier.

In case of problems, please post to the "DP Site Code" forum at the primary
Expand Down
148 changes: 148 additions & 0 deletions SETUP/update_from_github
@@ -0,0 +1,148 @@
#!/bin/sh

if [ $# != 1 ]; then
echo 'usage: update_from_github <path-to-site-config-file>'
exit 1
fi

this_script_file=$0
site_config_file=$1

script_dir=`dirname $this_script_file`

# ------------------------------------------------------------------------------

# Overview of this script:
# ------------------------
#
# The code snapshot will be installed at
# $_CODE_DIR.new
# (i.e., that directory will contain pinc, tools, etc.)
#
# If $SHIFT_TO_LIVE (defined in the config file) is 'yes',
# or it's 'prompt' and the user answers 'y',
# then $_CODE_DIR.new will be moved to $_CODE_DIR.
# If that directory already exists, it will first be renamed as
# $_CODE_DIR.bak
# and if *that* directory already exists, it will be REMOVED.
#
# So if this script is being invoked periodically, any "manual"
# changes you make within the snapshot hierarchy will soon disappear.
# Basically, you should treat it as read-only (although I've
# occasionally made quick changes to test some code that I'm
# working on at home).
#
# In order to make the resulting site functional, this script
# makes a few tweaks to the snapshot, replacing certain
# patterns in certain files with site-specific strings.

# ------------------------------------------------------------------------------

check()
{
status=$?
blurb=$1
if [ $status != 0 ]; then
echo "'$blurb' returned status $status, so exiting"
exit 1
fi
}

# ------------------------------------------------------------------------------

# Set _CODE_DIR
. $site_config_file

abort=/bin/false
if [ "$TAG" = "" ]; then
echo "Error: config file did not define TAG."
abort=/bin/true
fi
if [ "$_CODE_DIR" = "" ]; then
echo "Error: config file did not define _CODE_DIR."
abort=/bin/true
fi
if [ "$GROUP" = "" ]; then
echo "Error: config file did not define GROUP."
abort=/bin/true
fi
if [ "$SHIFT_TO_LIVE" = "" ]; then
echo "Error: config file did not define SHIFT_TO_LIVE."
abort=/bin/true
fi

if $abort; then
echo "Aborting due to config errors."
exit 1
fi

# just as an early warning/reassurance...
echo "Note: SHIFT_TO_LIVE = $SHIFT_TO_LIVE"
echo


# ------------------------------------------------------------------------------
# Get snapshot of code from github.com

$script_dir/get_git_clone $TAG $GROUP $_CODE_DIR.new
check "get_git_clone"

# ------------------------------------------------------------------------------
# Install site-specific info.

configure_script_file=$script_dir/configure
$configure_script_file $site_config_file $_CODE_DIR.new

# ------------------------------------------------------------------------------

echo ""
$script_dir/diff_rq $_CODE_DIR $_CODE_DIR.new
echo ""

echo "NOTE: using TAG = $TAG"
echo ""

if [ $SHIFT_TO_LIVE = yes ]; then
# fine
:

elif [ $SHIFT_TO_LIVE = no ]; then
echo "SHIFT_TO_LIVE is 'no', so exiting without an install"
exit 1

elif [ $SHIFT_TO_LIVE = prompt ]; then
echo -n "Install $_CODE_DIR.new? [yn] "
read response
echo -n "Your response was '$response', so "
if [ "$response" != y ]; then
echo "exiting."
exit 1
fi
echo "continuing..."

else
echo "Error: unexpected value for SHIFT_TO_LIVE: '$SHIFT_TO_LIVE'."
echo "Assuming SHIFT_TO_LIVE='no', so exiting without an install."
exit 1
fi

# ------------------------------------------------------------------------------

# "Install" the new hierarchy.
echo "installing the new hierarchy..."

if [ -d $_CODE_DIR.bak ]; then
rm -rf $_CODE_DIR.bak
check "rm $_CODE_DIR.bak"
fi

if [ -d $_CODE_DIR ]; then
mv $_CODE_DIR $_CODE_DIR.bak
check "mv $_CODE_DIR $_CODE_DIR.bak"
fi

mv $_CODE_DIR.new $_CODE_DIR
check "mv $_CODE_DIR.new $_CODE_DIR"

# ------------------------------------------------------------------------------
# vim: ai sw=4 ts=100

0 comments on commit e9b8323

Please sign in to comment.