Przeglądaj źródła

* supress output when /var/cache/apt/archives is empty; break when min-age is reached

Michael Vogt 21 lat temu
rodzic
commit
3408b58cbf
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      debian/apt.cron.daily

+ 2 - 2
debian/apt.cron.daily

@@ -110,7 +110,7 @@ check_size_constraints()
 	MinAge=$(($MinAge*24*60*60))
 	MinAge=$(($MinAge*24*60*60))
 
 
 	# reverse-sort by mtime
 	# reverse-sort by mtime
-	for file in $(ls -rt $Cache/*.deb); do 
+	for file in $(ls -rt $Cache/*.deb 2>/dev/null); do 
 	    du=$(du -s $Cache)
 	    du=$(du -s $Cache)
 	    size=${du%%/*}
 	    size=${du%%/*}
 	    # check if the cache is small enough
 	    # check if the cache is small enough
@@ -125,7 +125,7 @@ check_size_constraints()
 		#echo "$file ($delta), $MinAge"
 		#echo "$file ($delta), $MinAge"
 		if [ $delta -le $MinAge ]; then
 		if [ $delta -le $MinAge ]; then
 		    #echo "Skiping $file (delta=$delta)"
 		    #echo "Skiping $file (delta=$delta)"
-		    continue
+		    break
 		fi
 		fi
 	    fi
 	    fi