Compare commits

...

2 Commits

1 changed files with 5 additions and 5 deletions

10
maat
View File

@ -16,7 +16,7 @@ pkgExt=".pkg.tar.zst"
deprivuser="maat"
### Printing defaults
passCell="<td style='color:green;'>PASS</td>";
passCell="<td style='color:#72ff72;'>PASS</td>";
failCell="<td style='color:red;'>FAIL</td>";
warnCell="<td style='color:yellow;'>N/A</td>";
tableHead="<table style='text-align: left;'>\n<tr><th>Package</th><th>Testing Status</th><th>Build Status</th><th>Latest Build</th><th>Time and Log of Run</th></tr>";
@ -34,7 +34,7 @@ function Usage() {
### Put the initial content in the webfile
function SeedWebFile() {
printf '<html>\n<head>\n<title>AniNIX/Maat -- Build Results</title>\n<link rel="icon" type="image/png" href="/MaatIcon.png" />\n<link rel="icon" type="image/png" href="/MaatIcon.png">\n<meta name="apple-mobile-web-app-capable" content="yes" />\n<link rel="stylesheet" type="text/css" href="https://aninix.net/assets/css/theme-aninix.css">\n<link rel="apple-touch-icon" sizes="180x180" href="/MaatIcon.png" />\n</head>\n<body>\n<h1>AniNIX/Maat -- Build Status</h1>\nWEBSTATSGOHERE\n<h2>AnINIX Packages</h2>\n<p>These are packages written by the AniNIX. Their source is in <a href="https://aninix.net/" alt=AniNIX/Foundation>AniNIX/Foundation</a>.</p>\n' > "$webfile"
printf '<html lang="en">\n<head>\n<title>AniNIX/Maat -- Build Results</title>\n<link rel="icon" type="image/png" href="/MaatIcon.png" />\n<link rel="icon" type="image/png" href="/MaatIcon.png">\n<meta name="apple-mobile-web-app-capable" content="yes" />\n<link rel="stylesheet" type="text/css" href="https://aninix.net/assets/css/theme-aninix.css">\n<link rel="apple-touch-icon" sizes="180x180" href="/MaatIcon.png" />\n</head>\n<body>\n<h1>AniNIX/Maat -- Build Status</h1>\nWEBSTATSGOHERE\n<h2>AnINIX Packages</h2>\n<p>These are packages written by the AniNIX. Their source is in <a href="https://aninix.net/" alt=AniNIX/Foundation>AniNIX/Foundation</a>.</p>\n' > "$webfile"
printf "$tableHead" >> "$webfile"
}
@ -61,6 +61,7 @@ function BuildPackage() {
for pkg in `find . -type f | grep -E "${pkgExt}""\$"`; do
printf "<a href=\"/$suffix/$pkg\">$pkg</a><br/>" >> "$webfile"
pkgname="$(basename "$pkg" | cut -f 1 -d '.' | sed 's/-[[:digit:]]\+$//')"
# Remove old copies
find "${pkgdir}/${suffix}/" -name "${pkgname}-[0-9]*" -exec rm {} \;
mv "$pkg" "$pkgdir"/"$suffix";
mv "$pkg"".sig" "$pkgdir"/"$suffix";
@ -95,11 +96,11 @@ function BuildRepo() {
for pkgbuild in `find . -type f -name PKGBUILD`; do
cd "$(dirname "$pkgbuild")"
# Tell the status file about it.
printf '<tr style="border: 1px solid #FFF;"><td>'"<a href='$repo'>$repodir</a> -- $pkgbuild"'</td>' >> "$webfile"
printf '<tr style="border: 1px solid #FFF;"><td>'"<a href='$(echo "$repo" | sed 's#aur.archlinux.org#aur.archlinux.org/packages#' | sed 's/.git//')'>$repodir</a> -- $pkgbuild"'</td>' >> "$webfile"
if [ -f Makefile ] && [ `grep -E -c '^test:' Makefile` -ge 1 ]; then
# Have to try to install dependencies first
for dep in $(grep makedepends PKGBUILD | cut -f 2 -d '(' | cut -f 1 -d ')' | sed "s/'//g"); do
pacman -Sy "$dep" --noconfirm --needed
pacman -S "$dep" --noconfirm --needed
done
# Check test status.
timeout --preserve-status "$timeout" sudo -u "$deprivuser" /bin/bash -l -c "cd $PWD; make test" &>> "$pkgdir"/"$repodir".txt
@ -129,7 +130,6 @@ function UpdateLocalRepo() {
set -x
cd "$pkgdir"
chown -R "$deprivuser": .
# TODO Add deduplication of updated files -- keep latest 3 versions.
rm -Rf AniNIX.[db,files]*
sudo -u "$deprivuser" repo-add --sign ./AniNIX.db.tar.zst `ls -1 *"${pkgExt}"`
cd aur/