Making links to repos browser-viewable, not just git-clone targets

This commit is contained in:
DarkFeather 2024-04-07 23:39:27 -05:00
parent 5a28cc9b52
commit e4b0c55cd8
Signed by: DarkFeather
GPG Key ID: 1CC1E3F4ED06F296
1 changed files with 3 additions and 3 deletions

6
maat
View File

@ -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/