diff --git a/maat b/maat index 23c054a..3df645c 100755 --- a/maat +++ b/maat @@ -138,6 +138,20 @@ function UpdateLocalRepo() { set +x } +### Clean source tracking +function CleanSrcTracking() { + searchbase="${homedir}/src" + for path in `find "$searchbase" -maxdepth 1 -mindepth 1 -type d`; do + cd "$path" + giturl="$(git config remote.origin.url)" + if ! grep "$giturl" "$aurconf"; then + cd "$searchbase" + rm -Rf "$path" + fi + done +} + + # Clear variables aurconf='/usr/local/etc/Maat/aur.list' baseurl='https://aninix.net/AniNIX' @@ -210,7 +224,8 @@ SeedWebFile if [ -n "$MAATTESTINGVAR" ]; then BuildRepo "$baseurl"/HelloWorld else - for AniNIXrepo in `curl -s "$baseurl" | grep 'class="name"' | cut -f 4 -d \" | sed "s#^#https://$(echo "$baseurl" | cut -f 3 -d /)#" | sed 's/$/.git/'`; do + CleanSrcTracking + for AniNIXrepo in `curl -s "$baseurl" | grep 'class="text primary name"' | cut -f 4 -d \" | sed "s#^#https://$(echo "$baseurl" | cut -f 3 -d /)#" | sed 's/$/.git/'`; do BuildRepo "$AniNIXrepo" '.' done fi