use include 1337.mk to hold 1337 hacker rulz
Updated 1337 hacker rulz to version 7. Added `1337.mk` to contain the updated 1337 hacker rulz (v7). We use an optional include of `1337.mk` (or `../1337.mk`, or `../../1337.mk`) to include the 1337 hacker rulz. Changed `make deep_magic` to `make more_magic`. Changed `bin/tar-entry.sh` VERSION from "1.3.7 2024-07-22" to "1.3.8 2024-07-23". Changed `bin/tar-year.sh` VERSION from "1.2.5 2024-07-22" to "1.2.6 2024-07-23". Add `make new_entry` to `YYYY/Makefile` and `template/Makefile.year`. Change `make new_year` to use `sort -n -u`. Made minor debug message fixes to `bin/new-year.sh`. Changed `bin/new-year.sh` VERSION from "1.3 2024-07-23" to "1.3.1 2024-07-23". Improved `bin/add-dir.sh` to update `YYYY/Makefile` with the new entry directory name. Changed `bin/add-dir.sh` VERSION from "1.0 2024-07-21" to "1.1 2024-07-23". Performed `make www` to accomplish the above and to test under macOS.
This commit is contained in:
1 parent
16c33c5f2f
commit
dbf6921b3a
355 files changed
+2153
-24306
No files matched your search
+106
-2
@@ -88,7 +88,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="1.0 2024-07-21"
|
||||
export VERSION="1.1 2024-07-23"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -308,6 +308,28 @@ if [[ ! -w $YYYY_DIR ]]; then
|
||||
exit 7
|
||||
fi
|
||||
|
||||
|
||||
# verify we have a non-empty readable Makefile
|
||||
#
|
||||
export MAKE_FILE="$YEAR_DIR/Makefile"
|
||||
if [[ ! -e $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: Makefile does not exist: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: Makefile is not a regular file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: Makefile is not an readable file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: Makefile is not a non-empty readable file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
|
||||
|
||||
# print running info if verbose
|
||||
#
|
||||
# If -v 3 or higher, print exported variables in order that they were exported.
|
||||
@@ -332,6 +354,7 @@ if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: ENTRY_ID=$ENTRY_ID" 1>&2
|
||||
echo "$0: debug[3]: DOT_YEAR=$DOT_YEAR" 1>&2
|
||||
echo "$0: debug[3]: YYYY_DIR=$YYYY_DIR" 1>&2
|
||||
echo "$0: debug[3]: MAKE_FILE=$MAKE_FILE" 1>&2
|
||||
fi
|
||||
|
||||
# -N stops early before any processing is performed
|
||||
@@ -385,7 +408,7 @@ if [[ -z $NOOP ]]; then
|
||||
fi
|
||||
else
|
||||
echo "$0: ERROR: failed to add YYYY_DIR: $YYYY_DIR to: $DOT_YEAR" 1>&2
|
||||
exit 11
|
||||
exit 12
|
||||
fi
|
||||
|
||||
# case: with -n
|
||||
@@ -395,6 +418,87 @@ elif [[ $V_FLAG -ge 3 ]]; then
|
||||
fi
|
||||
|
||||
|
||||
# create a temporary Makefile
|
||||
#
|
||||
export TMP_MAKEFILE=".tmp.$NAME.MAKEFILE.$$.tmp"
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
fi
|
||||
trap 'rm -f $TMP_MAKEFILE; exit' 0 1 2 3 15
|
||||
rm -f "$TMP_MAKEFILE"
|
||||
if [[ -e $TMP_MAKEFILE ]]; then
|
||||
echo "$0: ERROR: cannot remove temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
exit 13
|
||||
fi
|
||||
touch "$TMP_MAKEFILE"
|
||||
if [[ ! -e $TMP_MAKEFILE ]]; then
|
||||
echo "$0: ERROR: cannot create temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
exit 14
|
||||
fi
|
||||
|
||||
|
||||
# form the temporary Makefile with the added year
|
||||
#
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: forming temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
fi
|
||||
sed -n -e '1,/^# BEGIN - DO NOT REMOVE THIS LINE - make new_entry uses this line #/p' "$MAKE_FILE" > "$TMP_MAKEFILE"
|
||||
make -C "$YEAR_DIR" new_entry NEW_ENTRY="$ENTRY_DIR" >> "$TMP_MAKEFILE"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR: make -C $YEAR_DIR new_entry NEW_ENTRY=\"$ENTRY_DIR\" >> \"$TMP_MAKEFILE\" failed," \
|
||||
"error code: $status" 1>&2
|
||||
exit 15
|
||||
fi
|
||||
sed -n -e '/^# END - DO NOT REMOVE THIS LINE - make new_entry also uses this #/,$p' "$MAKE_FILE" >> "$TMP_MAKEFILE"
|
||||
|
||||
|
||||
# Update Makefile if is changes and not -n
|
||||
#
|
||||
if [[ -z $NOOP ]]; then
|
||||
|
||||
if cmp -s "$TMP_MAKEFILE" "$MAKE_FILE"; then
|
||||
|
||||
# case: Makefile did not change
|
||||
#
|
||||
if [[ $V_FLAG -ge 5 ]]; then
|
||||
echo "$0: debug[5]: Makefile file did not change: $MAKE_FILE" 1>&2
|
||||
fi
|
||||
|
||||
else
|
||||
|
||||
# case: Makefile file changed, update the file
|
||||
#
|
||||
if [[ $V_FLAG -ge 5 ]]; then
|
||||
echo "$0: debug[5]: about to: mv -f -- $TMP_MAKEFILE $MAKE_FILE" 1>&2
|
||||
fi
|
||||
if [[ $V_FLAG -ge 3 ]]; then
|
||||
mv -f -v -- "$TMP_MAKEFILE" "$MAKE_FILE"
|
||||
status="$?"
|
||||
else
|
||||
mv -f -- "$TMP_MAKEFILE" "$MAKE_FILE"
|
||||
status="$?"
|
||||
fi
|
||||
if [[ $status -ne 0 ]]; then
|
||||
echo "$0: ERROR: mv -f -- $TMP_MAKEFILE $MAKE_FILE filed," \
|
||||
"error code: $status" 1>&2
|
||||
exit 16
|
||||
elif [[ $V_FLAG -ge 1 ]]; then
|
||||
echo "$0: debug[1]: updated Makefile: $MAKE_FILE" 1>&2
|
||||
fi
|
||||
if [[ ! -s $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: not a non-empty Makefile: $MAKE_FILE" 1>&2
|
||||
exit 17
|
||||
fi
|
||||
fi
|
||||
|
||||
# case: with -n
|
||||
#
|
||||
elif [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: -n disabled updating: $MAKE_FILE" 1>&2
|
||||
fi
|
||||
|
||||
|
||||
# All Done!!! All Done!!! -- Jessica Noll, Age 2
|
||||
#
|
||||
exit 0
|
||||
+6
-7
@@ -87,7 +87,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="1.3 2024-07-23"
|
||||
export VERSION="1.3.1 2024-07-23"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -358,19 +358,19 @@ fi
|
||||
#
|
||||
export MAKE_FILE="Makefile"
|
||||
if [[ ! -e $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: .top does not exist: $MAKE_FILE" 1>&2
|
||||
echo "$0: ERROR: Makefile does not exist: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: .top is not a regular file: $MAKE_FILE" 1>&2
|
||||
echo "$0: ERROR: Makefile is not a regular file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: .top is not an readable file: $MAKE_FILE" 1>&2
|
||||
echo "$0: ERROR: Makefile is not an readable file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $MAKE_FILE ]]; then
|
||||
echo "$0: ERROR: .top is not a non-empty readable file: $MAKE_FILE" 1>&2
|
||||
echo "$0: ERROR: Makefile is not a non-empty readable file: $MAKE_FILE" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
|
||||
@@ -536,8 +536,7 @@ if [[ -e $TMP_MAKEFILE ]]; then
|
||||
echo "$0: ERROR: cannot remove temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
exit 18
|
||||
fi
|
||||
echo '# author_handle,entry_id,entry_id,entry_id,…,,,,,,,,,,,,,,,' > \
|
||||
"$TMP_MAKEFILE"
|
||||
touch "$TMP_MAKEFILE"
|
||||
if [[ ! -e $TMP_MAKEFILE ]]; then
|
||||
echo "$0: ERROR: cannot create temporary Makefile: $TMP_MAKEFILE" 1>&2
|
||||
exit 19
|
||||
|
||||
+24
-2
@@ -83,7 +83,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="1.3.7 2024-07-22"
|
||||
export VERSION="1.3.8 2024-07-23"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -379,7 +379,7 @@ if [[ ! -s $IOCCC_CSS ]]; then
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# verify we have non-empty readable ioccc.css file
|
||||
# verify we have non-empty readable var.mk file
|
||||
#
|
||||
export VAR_MK="var.mk"
|
||||
if [[ ! -e $VAR_MK ]]; then
|
||||
@@ -399,6 +399,26 @@ if [[ ! -s $VAR_MK ]]; then
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# verify we have non-empty readable 1337.mk
|
||||
#
|
||||
export LEET_MK="1337.mk"
|
||||
if [[ ! -e $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk does not exist: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a readable file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a not a non-empty readable file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# determine the name of our tarball
|
||||
#
|
||||
# TARBALL - the same of the compressed tarball to verify and if needed re-build
|
||||
@@ -437,6 +457,7 @@ if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: FILELIST_ENTRY_JSON_AWK=$FILELIST_ENTRY_JSON_AWK" 1>&2
|
||||
echo "$0: debug[3]: IOCCC_CSS=$IOCCC_CSS" 1>&2
|
||||
echo "$0: debug[3]: VAR_MK=$VAR_MK" 1>&2
|
||||
echo "$0: debug[3]: LEET_MK=$LEET_MK" 1>&2
|
||||
echo "$0: debug[3]: TARBALL=$TARBALL" 1>&2
|
||||
echo "$0: debug[3]: REBUILD_TARBALL=$REBUILD_TARBALL" 1>&2
|
||||
fi
|
||||
@@ -563,6 +584,7 @@ if [[ -z $NOOP ]]; then
|
||||
fi
|
||||
echo "$IOCCC_CSS" >> "$TMP_MANIFEST_LIST"
|
||||
echo "$VAR_MK" >> "$TMP_MANIFEST_LIST"
|
||||
echo "$LEET_MK" >> "$TMP_MANIFEST_LIST"
|
||||
LC_ALL=C sort -d "$TMP_MANIFEST_LIST" -o "$TMP_MANIFEST_LIST"
|
||||
status="$?"
|
||||
if [[ $status -ne 0 ]]; then
|
||||
|
||||
+24
-2
@@ -82,8 +82,8 @@ shopt -u extglob # enable extended globbing patterns
|
||||
shopt -s globstar # enable ** to match all files and zero or more directories and subdirectories
|
||||
|
||||
# set variables referenced in the usage message
|
||||
#
|
||||
export VERSION="1.2.5 2024-07-22"
|
||||
|
||||
export VERSION="1.2.6 2024-07-23"
|
||||
NAME=$(basename "$0")
|
||||
export NAME
|
||||
export V_FLAG=0
|
||||
@@ -326,6 +326,26 @@ if [[ ! -s $VAR_MK ]]; then
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# verify we have non-empty readable 1337.mk
|
||||
#
|
||||
export LEET_MK="1337.mk"
|
||||
if [[ ! -e $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk does not exist: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -f $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -r $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a readable file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
if [[ ! -s $LEET_MK ]]; then
|
||||
echo "$0: ERROR: 1337.mk is not a not a non-empty readable file: $LEET_MK" 1>&2
|
||||
exit 6
|
||||
fi
|
||||
|
||||
# verify we have non-empty readable year level .filelist file
|
||||
#
|
||||
export FILELIST="$YYYY/.filelist"
|
||||
@@ -377,6 +397,7 @@ if [[ $V_FLAG -ge 3 ]]; then
|
||||
echo "$0: debug[3]: FILELIST_ENTRY_JSON_AWK=$FILELIST_ENTRY_JSON_AWK" 1>&2
|
||||
echo "$0: debug[3]: IOCCC_CSS=$IOCCC_CSS" 1>&2
|
||||
echo "$0: debug[3]: VAR_MK=$VAR_MK" 1>&2
|
||||
echo "$0: debug[3]: LEET_MK=$LEET_MK" 1>&2
|
||||
echo "$0: debug[3]: FILELIST=$FILELIST" 1>&2
|
||||
echo "$0: debug[3]: TARBALL=$TARBALL" 1>&2
|
||||
echo "$0: debug[3]: REBUILD_TARBALL=$REBUILD_TARBALL" 1>&2
|
||||
@@ -503,6 +524,7 @@ if [[ -z $NOOP ]]; then
|
||||
grep -F -v "$TARBALL" "$FILELIST"
|
||||
echo "$IOCCC_CSS"
|
||||
echo "$VAR_MK"
|
||||
echo "$LEET_MK"
|
||||
} >> "$TMP_MANIFEST_LIST"
|
||||
|
||||
# verify that YYYY is a readable directory
|
||||
|
||||
Reference in new issue
Block a user