From 88a00e08e0394c95f65836be043da75fa2a131f1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 25 Nov 2010 19:05:53 +0100 Subject: create-filelists: Improve performance by reading package list from db instead from fs --- cron-jobs/create-filelists | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cron-jobs/create-filelists b/cron-jobs/create-filelists index c3e7d72..8bcfc0b 100755 --- a/cron-jobs/create-filelists +++ b/cron-jobs/create-filelists @@ -25,17 +25,16 @@ for repo in ${PKGREPOS[@]}; do # get a list of package files defined in the repo db mkdir -p "${WORKDIR}/db-dir-${repo}-${arch}" bsdtar -xf "${repodb}" -C "${WORKDIR}/db-dir-${repo}-${arch}" - find "${WORKDIR}/db-dir-${repo}-${arch}" -name 'desc' \ - -exec awk '/^%FILENAME%/{getline;print}' {} \; | sort > "${WORKDIR}/db-${repo}-${arch}" + # This should actualy be faster than reading all the just extracted files + bsdtar -xOf "${repodb}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/db-${repo}-${arch}" # get a list of package files defined in the files db mkdir -p "${WORKDIR}/files-current-dir-${repo}-${arch}" if [ ! -f "${filedb}" ]; then - echo > "${WORKDIR}/files-${repo}-${arch}" + touch "${WORKDIR}/files-${repo}-${arch}" else bsdtar -xf "${filedb}" -C "${WORKDIR}/files-current-dir-${repo}-${arch}" - find "${WORKDIR}/files-current-dir-${repo}-${arch}" -name 'desc' \ - -exec awk '/^%FILENAME%/{getline;print}' {} \; | sort > "${WORKDIR}/files-${repo}-${arch}" + bsdtar -xOf "${filedb}" | awk '/^%FILENAME%/{getline;print}' | sort > "${WORKDIR}/files-${repo}-${arch}" fi done done -- cgit v1.2.3-24-g4f1b