Only run the cleanup when updating ports.

This commit is contained in:
Tom Alexander 2023-09-04 11:09:24 -04:00
parent 955f3cd329
commit 8744f8f547
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 3 additions and 3 deletions

View File

@ -97,14 +97,14 @@ function cmd_start {
portshaker -U
portshaker -M
PORTUPDATE=$(date +%s)
# Cleanup old unused dist files
poudriere distclean -y -p "$PORTS" -f /usr/local/etc/poudriere.d/$JAIL-$PORTS-$SET-pkglist
poudriere logclean -y "$LOG_RETENTION_DAYS"
fi
if [ $((now - LASTBUILD)) -gt "$BUILD_SECONDS" ]; then
log "Building ports for $JAIL-$PORTS-$SET"
build -j "$JAIL" -p "$PORTS" -z "$SET" -f /usr/local/etc/poudriere.d/$JAIL-$PORTS-$SET-pkglist
LASTBUILD=$(date +%s)
# Cleanup old unused dist files
poudriere distclean -y -p "$PORTS" -f /usr/local/etc/poudriere.d/$JAIL-$PORTS-$SET-pkglist
poudriere logclean -y "$LOG_RETENTION_DAYS"
fi
cat > "$TIMES_FILE" <<EOF