From 3804bcf95a19bcc8fdc914754fa03750137cd99e Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Mon, 1 Aug 2022 16:09:18 -0400 Subject: [PATCH] Apply #18, #19, and #20 --- site/index.html | 138 ++++++++++++++++++++++++++++++++++++++++++++---- tools/bin/td | 31 ++++++----- 2 files changed, 146 insertions(+), 23 deletions(-) diff --git a/site/index.html b/site/index.html index 995fedc..bfde38d 100644 --- a/site/index.html +++ b/site/index.html @@ -231,15 +231,15 @@ should compile on almost any compiler and operating system with minimal effort, but the following compilers and operating systems are known to work: Other compilers should work as well, but you may have to play with the -flags in make.sh. +flags.
  • POSIX base utilities, including find, stat, @@ -383,7 +383,7 @@ on my list for that:
  • Make a note in Getting The Code that the password for the anoncvs account is just anoncvs.
  • Add Contributors list
  • -
  • Add list of make.sh recipes, and what they do
  • +
  • Add list of make.sh recipes, and what they do
  • Rationale

    @@ -659,6 +659,121 @@ create the MXID, and reads the password database to get your configured display name. It also uses vi as the default editor, which may not be suitable for all developers.

    +

    +You can invoke td recipes with the following syntax: +

    +
    +$ td <recipe> ... +
    +

    +Multiple recipes can be invoked in a single run of td. +At the moment, recipes are run unconditionally; that is, even if parts +of a recipe fail, all following recipes still run. +

    +

    +Here is a complete list of recipes currently supported by +td, and a description of what they do. Some recipes can +alter their behavior based on certain environment variables. Those +variables are also documented here. +

    + +

    +Any environment variables noted above that td recipes +use can be specified in a .env file in the root of the +Telodendria directory. This saves you from constantly +having to set the environment variables in your shell, as well as +from having to pollute your user environment with Telodendria +variables. td will automatically include the +.env file on every run. +

    +
    +td will source the .env file, which means +it executes it like a shell script. Any shell code inside of +.env will be executed every time td is +run. +

    Submitting Patches

    Telodendria aims at remaining as minimal as possible. This doesn't @@ -702,13 +817,14 @@ Date: Fri Jul 29 03:21:21 PM EDT 2022 Subject: Document Patch Procedure

    -As much information as possible should be filled out for you, such as the -date. An attempt to fill out the From header was also made, -but the information there can be made more accurate by setting -MXID to your Matrix ID, and DISPLAY_NAME to your -real name. The Subject should very briefly describe what -the patch is about. Below these headers, write a more in-depth -description of the patch. +As much information as possible should be filled out for you, such as +the date. An attempt to fill out the From header was also +made, but the information there can be made more accurate by setting +MXID to your Matrix ID, and DISPLAY_NAME to +your real name in your environment, or the .env file. +The Subject should very briefly describe what the patch +is about. Below these headers, write a more in-depth description of +the patch.

    Then, send the resulting patch file to diff --git a/tools/bin/td b/tools/bin/td index c34be28..5f40a03 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -11,15 +11,6 @@ # handle building the code, it also handles formatting it, as well # as generating patch files. -# If a .env file exists in the current directory, we load it. -# As Telodendria's build infrastructure relies heavily on -# environment variables, we allow users to specify their -# Telodendria-specific variables in a dedicated .env so they don't -# have to pollute their environment. -if [ -f "$(pwd)/.env" ]; then - . "$(pwd)/.env" -fi - # # Set variables # @@ -31,14 +22,23 @@ fi : "${TELODENDRIA_VERSION:=0.0.0}" : "${CVS_TAG:=Telodendria-$(echo $TELODENDRIA_VERSION | sed 's/\./_/g')}" -: "${HEADERS:=-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" +: "${DEFINES:=-D_POSIX_C_SOURCE=199506L -DTELODENDRIA_VERSION=\"$TELODENDRIA_VERSION\"}" : "${INCLUDES:=-Isrc/include}" : "${CC:=cc}" -: "${CFLAGS:=-Wall -Wextra -pedantic -ansi -std=c89 -O3 $HEADERS $INCLUDES}" +: "${CFLAGS:=-Wall -Wextra -pedantic -ansi -std=c89 -O3 $DEFINES $INCLUDES}" : "${LDFLAGS:=-static -flto -fdata-sections -ffunction-sections -s -Wl,-static -Wl,-gc-sections}" : "${PROG:=telodendria}" +# If a .env file exists in the current directory, we load it. +# As Telodendria's build infrastructure relies heavily on +# environment variables, we allow users to specify their +# Telodendria-specific variables in a dedicated .env so they don't +# have to pollute their environment. +if [ -f "$(pwd)/.env" ]; then + . "$(pwd)/.env" +fi + # Check the modificiation time of a file. This is used to do # incremental builds; we only want to rebuild files that have # have changed. @@ -208,7 +208,14 @@ recipe_patch() { } recipe_diff() { - cvs -q diff -uNp | less + tmp_patch="/tmp/telodendria-$(date +%s).patch" + cvs -q diff -uNp $PATCHSET > "$tmp_patch" + if [ -z "$PAGER" ]; then + PAGER="less -F" + fi + + $PAGER "$tmp_patch" + rm "$tmp_patch" } # Execute the user-specified recipes.