diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-11-25 19:05:53 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-11-25 19:05:53 +0100 |
commit | 88a00e08e0394c95f65836be043da75fa2a131f1 (patch) | |
tree | 618dccfe5206b8e6c2496c94478a1e9f3493c0a8 /cron-jobs | |
parent | b9dea6f306df1ffb051f0c7239f416a34f93a71a (diff) | |
download | dbscripts-88a00e08e0394c95f65836be043da75fa2a131f1.tar.gz dbscripts-88a00e08e0394c95f65836be043da75fa2a131f1.tar.xz |
create-filelists: Improve performance by reading package list from db instead from fs
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/create-filelists | 9 |
1 files 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 |