This repository is based on code and documentation licensed from Avery Pennarun. Original contributions are copyright (C) 2016 by Rob Bocchino.
This repository is a fork of
Avery Pennarun's implementation of redo
("apenwarr redo
").
redo
is a suite of simple but powerful tools that let you write build
rules as shell scripts (called ".do
files") with dynamic dependency tracking.
For more information about apenwarr redo
, see
this README file.
My goals for this repository are as follows:
-
To be backwards compatible with, and provide a drop-in replacement for, apenwarr
redo
. -
As development on apenwarr
redo
seems to have stopped, to continue development, including code refactoring, enhancements, and bug fixes.
To date, I have made the following improvements to apenwarr redo
:
-
Improved the installation procedure.
-
Fixed the problem of multiple inconsistent .redo directories.
-
Improved the behavior when running a
.do
script would clobber an existing directory. -
Improved the error reporting when a remove or rename operation fails (e.g., when attempting to create a target in a directory that doesn't exist).
-
Added cycle detection, so that
redo
prints an error message and halts instead of hanging when it encounters a cyclic build dependence. -
Fixed bugs that caused spurious warnings about updated files on some systems.
-
Removed the deprecated "old-args" feature.
-
Refactored the code.
This repository contains the following items:
-
bash_completion.d
:bash
completion rules forredo
. -
bin
: Rules for generating the "binary files" of theredo
tool suite (really, they are executable python files). -
defs
: Definitions used by the build system in this repository, including system-specific configuration. -
do
: A minimal implementation ofredo
, written in shell, that builds everything without tracking any dependencies. It is useful for running.do
files on systems whereredo
is not available. In particular, you rundo
on the build system in this repository when you installredo
(see below). -
lib
: The "library files" for theredo
tool suite (they are python files). -
man
: Man pages for theredo
tool suite. -
shell
: Rules for finding a good shell for running.do
files. -
tests
: Tests for theredo
tools. -
version
: Rules for computing theredo
version from information provided bygit
.
To use this software, you need the following:
-
A Unix environment.
-
A working python 2 installation.
-
A shell capable of running the
.do
files in this repository (e.g.,bash
). Any modern Unix system should have such a shell, and the installation procedure should find it (see below).
To install the software, carry out the following steps:
-
Clone this repository to your computer.
-
Copy
defs/config.sh.example
todefs/config.sh
. Edit the file so the following variables have the desired values:
-
INSTALL
: The command to use for installation. -
MANDIR
: The directory for installing man pages. -
BINDIR
: The directory for installing the "binary files" for theredo
tools. -
LIBDIR
: The directory for installing the library files for theredo
tools.
If you don't change anything, the installation will go into subdirectories
of $REDO_ROOT/installdir
, where REDO_ROOT
is the top-level directory
of this repository.
To install redo
globally, change $REDO_ROOT/installdir
to something like /usr
.
-
In the top-level directory of this repository, run
./do install
. Note that if you opted for a global installation in step 2, you may have to run the command withsudo
permission (i.e.,sudo ./do install
). -
If the directory that you picked for
$BINDIR
in step 2 is not already in your UnixPATH
, then add it now. It's best to do this in the startup configuration file for your shell (e.g.,.bashrc
). -
Check that you have a good
redo
installation:which redo
.
Once you have a working installation, you should be able to run redo
on
any of the .do
files in this repository. For example:
redo clean # To clean everything
redo all # To build everything
redo tests/test # To run all the tests in the tests directory