This repository is based on code and documentation licensed from Avery Pennarun. Original contributions are copyright (C) 2016-2020 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.
Note (January 2019): Development on apenwarr redo has started again as of October 2018.
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. -
Added a command
redo-remove
for removing dependency information about a file. This is useful, for example, if a file gets marked as generated but you later decide you want to maintain it by hand. -
Fixed bugs that caused spurious warnings about updated files on some systems.
-
Removed the deprecated "old-args" feature.
-
Refactored the code.
-
Revised the code to be Python 3 compatible.
-
Checked in the troff man pages and removed the dependence on
md2man
. It stopped working with the upgrade to Python 3.
It looks like apenwarr redo has fixed issues 1, 4, 5, 7, and 8, in part by merging code from this repository. It has also added some nice new features. It looks like 2, 3, and 6 are still not available in apenwarr redo.
TODO: Merge the new features from apenwarr redo into this repository and/or make pull requests of the features here back into apenwarr redo.
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 to build everything before installingredo
(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 3 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 all
. This step should build everything without errors. If there are any errors, fix them. -
In the top-level directory of this repository, run
./install
. Note that if you opted for a global installation in step 2, you may have to runsudo ./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
Once you have a working installation, you can upgrade your installation as follows:
-
Pull the latest version of this repository.
-
Run
redo
at the top level to build everything. -
Run
install
to re-install everything.