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

View File

@ -97,14 +97,14 @@ function cmd_start {
portshaker -U portshaker -U
portshaker -M portshaker -M
PORTUPDATE=$(date +%s) 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 fi
if [ $((now - LASTBUILD)) -gt "$BUILD_SECONDS" ]; then if [ $((now - LASTBUILD)) -gt "$BUILD_SECONDS" ]; then
log "Building ports for $JAIL-$PORTS-$SET" log "Building ports for $JAIL-$PORTS-$SET"
build -j "$JAIL" -p "$PORTS" -z "$SET" -f /usr/local/etc/poudriere.d/$JAIL-$PORTS-$SET-pkglist build -j "$JAIL" -p "$PORTS" -z "$SET" -f /usr/local/etc/poudriere.d/$JAIL-$PORTS-$SET-pkglist
LASTBUILD=$(date +%s) 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 fi
cat > "$TIMES_FILE" <<EOF cat > "$TIMES_FILE" <<EOF