From 5c552e11578b1ef56807bf2f471a67d039a1149b Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 24 Apr 2020 12:27:31 +0100 Subject: [PATCH] Fix repo page generation script for multi-size packages Signed-off-by: falkTX --- repo/generate-repo-page.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repo/generate-repo-page.sh b/repo/generate-repo-page.sh index 2706d3f..79a376e 100755 --- a/repo/generate-repo-page.sh +++ b/repo/generate-repo-page.sh @@ -106,7 +106,7 @@ for PACKAGE in ${PACKAGES[@]}; do continue fi - PACKAGE_LINESTART=$(cat Packages | grep -x -n "Package: ${PACKAGE}" | cut -d ':' -f 1) + PACKAGE_LINESTART=$(cat Packages | grep -x -n "Package: ${PACKAGE}" | cut -d ':' -f 1 | sort | tail -n 1) PACKAGE_NUMLINES=$(cat Packages | tail -n +$((${PACKAGE_LINESTART} + 1)) | grep -n "Package: " | head -n 1 | cut -d ':' -f 1) if [ -n "${PACKAGE_NUMLINES}" ]; then PACKAGE_DETAILS=$(cat Packages | tail -n +${PACKAGE_LINESTART} | head -n ${PACKAGE_NUMLINES}) @@ -177,7 +177,7 @@ for PACKAGE in ${PACKAGES[@]}; do echo "$((${PACKAGE_SIZE} / 1024))Kb" fi if [ -n "${PACKAGE_DATA}" ]; then - PACKAGE_DATA_LINESTART=$(cat Packages | grep -x -n "Package: ${PACKAGE_DATA}" | cut -d ':' -f 1) + PACKAGE_DATA_LINESTART=$(cat Packages | grep -x -n "Package: ${PACKAGE_DATA}" | cut -d ':' -f 1 | sort | tail -n 1) PACKAGE_DATA_NUMLINES=$(cat Packages | tail -n +$((${PACKAGE_DATA_LINESTART} + 1)) | grep -n "Package: " | head -n 1 | cut -d ':' -f 1) if [ -n "${PACKAGE_DATA_NUMLINES}" ]; then PACKAGE_DATA_DETAILS=$(cat Packages | tail -n +${PACKAGE_DATA_LINESTART} | head -n ${PACKAGE_DATA_NUMLINES})