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
redoseems 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
.doscript 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
redoprints an error message and halts instead of hanging when it encounters a cyclic build dependence. -
Added a command
redo-removefor 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:bashcompletion rules forredo. -
bin: Rules for generating the "binary files" of theredotool 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.dofiles on systems whereredois not available. In particular, you rundoon the build system in this repository to build everything before installingredo(see below). -
lib: The "library files" for theredotool suite (they are python files). -
man: Man pages for theredotool suite. -
shell: Rules for finding a good shell for running.dofiles. -
tests: Tests for theredotools. -
version: Rules for computing theredoversion 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
.dofiles 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.exampletodefs/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 theredotools. -
LIBDIR: The directory for installing the library files for theredotools.
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
$BINDIRin 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
redoinstallation: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
redoat the top level to build everything. -
Run
installto re-install everything.