Improving checks on AniNIX standards

This commit is contained in:
DarkFeather 2023-10-21 20:16:43 -05:00
parent 184c2c5915
commit c988f725fb
Signed by: DarkFeather
GPG Key ID: 1CC1E3F4ED06F296
6 changed files with 147 additions and 32 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
wiki/
pkg/ pkg/
src/ src/
*.tar.xz *.tar.xz

View File

@ -1,3 +1,19 @@
#!/bin/bash #!/bin/bash
diff -w <(curl -s 'https://aninix.net/AniNIX/Ubiqtorate/raw/branch/main/roles/Foundation/files/custom/options/license/AniNIX-WTFPL') ./LICENSE # If the package hasn't been installed yet, since we are the origin, we have to bootstrap.
if [ "$(basename "$PWD")" == 'Uniglot' ] && [ ! -f /usr/share/licenses/Uniglot/LICENSE ]; then
exit 0;
fi
diff -w /usr/share/licenses/Uniglot/LICENSE ./LICENSE;
if [ $? -ne 0 ]; then
if [ "$(basename "$PWD")" == 'Uniglot' ]; then
echo INFO: You are changing the LICENSE and need to update downstream projects.
echo INFO: You also need to redeploy AniNIX/Foundation via AniNIX/Ubiqtorate for new projects.
exit 0;
else
echo ERROR: License is out of sync with AniNIX/Uniglot or you don\'t have Uniglot locally installed.
exit 1;
fi
fi;

View File

@ -0,0 +1,21 @@
#!/bin/bash
# Enforce each of the lines
for line in compile install clean uninstall test checkperm diff reverse; do
newlinenum="$(grep -nE "^$line:" "Makefile" | cut -f 1 -d ':')"
# Case 1: Missing section
if [ -z "$newlinenum" ]; then
echo "$file" is missing "$line"
exit 1
fi
# Case 2: Line is out of order
if [ "$newlinenum" -lt "$linenum" ]; then
echo "$file" has section "$line" out of order.
exit 2
fi
linenum="$newlinenum"
done

View File

@ -0,0 +1,22 @@
#!/bin/bash
# Ensure that the following lines match the base PKGBUILD
retcode=0
(for term in pkgname replaces pkgver epoch pkgdesc url license ../LICENSE; do
current="$(grep "${term}" ./PKGBUILD)"
reference="$(grep "${term}" /opt/aninix/Uniglot/pacman/PKGBUILD)"
diff <(printf "${reference}") <(echo "${current}")S
retcode="$(( $retcode || $? ))";
done) &>/dev/null
if [ "$(basename "$0")" == 'Uniglot' ] && [ "$retcode" != 0 ]; then
if [ ! -f /opt/aninix/Uniglot/pacman/PKGBUILD ]; then
# Suppress output for this package when it isn't installed yet.
echo $0
else
echo INFO: You have introduced delta for the PKGBUILD. You may need to update downstream projects.
exit 0
fi
elif [ "$retcode" != 0 ]; then
echo ERROR: PKGBUILD is out of sync with AniNIX/Uniglot.
fi

View File

@ -0,0 +1,55 @@
#!/bin/bash
# Allow verbosity
if [ "$1" == "-v" ]; then
set -x;
shift;
fi
# Allow passing in more than just the landing README.md, but default to ./README.md
files="$@"
if [ -z "$files" ]; then
files="./README.md"
fi
# Iterate on each file.
for file in $files; do
# Reset order tracking
linenum=0
# Enforce each of the lines
for line in '^# Etymology$' '^# Relevant Files and Software$' '^# Available Clients$' '^# Equivalents or Competition$'; do
newlinenum="$(grep -nE "$line" "$file" | cut -f 1 -d ':')"
# Case 1: Missing section
if [ -z "$newlinenum" ]; then
echo "$file" is missing "$line"
exit 1
fi
# Case 2: Line is out of order
if [ "$newlinenum" -lt "$linenum" ]; then
echo "$file" has section "$line" out of order.
exit 2
fi
linenum="$newlinenum"
done
# Case 3: Spelling errors are present
spellerrors="$(cat "$file" | aspell -p <(echo personal_ws-1.1 en 0; cat ~/.vim/spell/en.utf-8.add) list)"
if [ `echo "$spellerrors" | wc -l` -ne 1 ]; then
echo "$file" has spelling errors.
echo "$spellerrors"
exit 3
fi
done
# Wiki documentation is procedurally generated in its own repo.
if ! grep -E ^wiki/ .gitignore 1>/dev/null; then
echo The wiki folder needs to be ignored.
exit 4
fi

62
LICENSE
View File

@ -1,31 +1,31 @@
# http://www.wtfpl.net/about/ # http://www.wtfpl.net/about/
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004 Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long copies of this license document, and changing it is allowed as long
as the name is changed. as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO. 0. You just DO WHAT THE FUCK YOU WANT TO.
ANINIX ADDENDUM ANINIX ADDENDUM
Trademark 2017 (https://aninix.net/) Trademark 2017 (https://aninix.net/)
The "AniNIX" name and |> logo are trademarked as of 2017/11/21. The "AniNIX" name and |> logo are trademarked as of 2017/11/21.
AniNIX materials may be reproduced and re-used (though you must AniNIX materials may be reproduced and re-used (though you must
contact the admins of the network to get written permission to use contact the admins of the network to get written permission to use
the AniNIX name or logo) so long as such reproduction or re-use the AniNIX name or logo) so long as such reproduction or re-use
does not inhibit the original AniNIX use of the same. does not inhibit the original AniNIX use of the same.
Attribution is appreciated for other materials but not legally Attribution is appreciated for other materials but not legally
required or necessary. required or necessary.
"AniNIX" trademark serial: 87177883 "AniNIX" trademark serial: 87177883
|> Logo trademark serial: 87177887 |> Logo trademark serial: 87177887