diff options
-rwxr-xr-x | compare-my-ports-to-others | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/compare-my-ports-to-others b/compare-my-ports-to-others index cab06b1..6dc2df6 100755 --- a/compare-my-ports-to-others +++ b/compare-my-ports-to-others @@ -14,6 +14,8 @@ do grep -q '<td><a href="?a=repo&q=' \ || continue + minNum=-1 + minPrint='' for pkgfile in $( \ echo "${inhalt}" | \ tr '\n' ' ' | \ @@ -42,19 +44,24 @@ do ) | \ grep -c '^[<>]' \ ) - [ ${numLinesDiff} -ge 10 ] && echo "${pkg}: ${numLinesDiff}" && continue - echo "${pkg} gibt es noch mal so ähnlich: ${pkgfile}" - diff -u3 \ - <( \ - echo "${remPkgCont}" | \ - grep -v '^#' | \ - sed 's|^\s\+| |' \ - ) \ - <( \ - curl "https://crux.eckner.net/${pkg}/Pkgfile" 2> /dev/null | \ - grep -v '^#' | \ - sed 's|^\s\+| |' \ - ) + [ ${minNum} -ge 0 ] && [ ${minNum} -le ${numLinesDiff} ] && continue + minNum=${numLinesDiff} + [ ${numLinesDiff} -ge 10 ] && minPrint="${pkg}: ${numLinesDiff}" && continue + minPrint="$( + echo "${pkg} gibt es noch mal so ähnlich: ${pkgfile}" + diff -u3 \ + <( \ + echo "${remPkgCont}" | \ + grep -v '^#' | \ + sed 's|^\s\+| |' \ + ) \ + <( \ + curl "https://crux.eckner.net/${pkg}/Pkgfile" 2> /dev/null | \ + grep -v '^#' | \ + sed 's|^\s\+| |' \ + ) + )" done + [ ${minNum} -ge 0 ] && echo "${minPrint}" done |