From a64b0be23127cc06ad2aa41c608b8f4ea15deb97 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 12 Jun 2017 20:42:32 +0200 Subject: do not delete cached package meta data (yet) --- bin/get-package-updates | 77 +++---------------------------------------------- 1 file changed, 4 insertions(+), 73 deletions(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index c3b49a7..9fb1759 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -189,79 +189,7 @@ mkdir -p "${work_dir}/package-infos" while read -r package git_revision mod_git_revision repository; do - file_prefix="${work_dir}/package-infos/${package}.${git_revision}.${mod_git_revision}" - - # extract infos from PKGBUILD if not existent yet - if [ ! -e "${file_prefix}.builds" ] || \ - [ ! -e "${file_prefix}.depends" ] || \ - [ ! -e "${file_prefix}.needs" ] || \ - [ ! -e "${file_prefix}.packages" ]; then - # delete cached values of old versions of this PKGBUILD - ls -1 "${file_prefix%.*.*}."* 2> /dev/null | \ - sed 's|^.*/||' | \ - grep "^${package//./\\.}"'\.\([0-9a-f]\{40\}\.\)\{2\}\(builds\|depends\|needs\|packages\|SRCINFO\)$' | \ - while read file; do - rm "${work_dir}/package-infos/${file}" - done - - PKGBUILD="$(find_pkgbuild "${package}" "${repository}")" - - if [ ! -r "${PKGBUILD}" ]; then - echo "can't find PKGBUILD to package '${package}' from repository '${repository}': '${PKGBUILD}'" - exit 1 - fi - - ( - cd "${PKGBUILD%/*}" - apply_package_customizations - grep -q '\$CARCH' 'PKGBUILD' && \ - CARCH=i686 makepkg --printsrcinfo > \ - "${file_prefix}.SRCINFO" || \ - mksrcinfo -o "${file_prefix}.SRCINFO" - ) - - # otherwise this just calls for trouble - sed -i '/=\s*$/d' "${file_prefix}.SRCINFO" - - # extract "builds" = provides \cup pkgname - grep '^\('$'\t''provides\|pkgname\) = ' "${file_prefix}.SRCINFO" | \ - cut -d= -f2 | \ - sed 's|^\s\+||; s|[<>]$||' | \ - sort -u > \ - "${file_prefix}.builds" - - # extract "packages" = pkgname - grep '^pkgname = ' "${file_prefix}.SRCINFO" | \ - cut -d= -f2 | \ - sed 's|^\s\+||; s|[<>]$||' | \ - sort -u > \ - "${file_prefix}.packages" - - # extract "needs" = ( makedepends \cup checkdepends ) \setminus "builds" - ( - grep '^'$'\t''\(makedepends\|checkdepends\) = ' "${file_prefix}.SRCINFO" | \ - cut -d= -f2 | \ - sed 's|^\s\+||; s|[<>]$||' | \ - sort -u - sed 'p' "${file_prefix}.builds" - ) | \ - sort | \ - uniq -u > \ - "${file_prefix}.needs" - - # extract "depends" = makedepends \cup checkdepends \cup depends - ( - sed -n '/^pkgname = /q;/^'$'\t''depends = /p' "${file_prefix}.SRCINFO" - grep '^'$'\t''\(makedepends\|checkdepends\) = ' "${file_prefix}.SRCINFO" - ) | \ - cut -d= -f2 | \ - sed 's|^\s\+||; s|[<>]$||' | \ - sort -u > \ - "${file_prefix}.depends" - - rm "${file_prefix}.SRCINFO" - - fi + generate_package_metadata "${package}" "${git_revision}" "${mod_git_revision}" "${repository}" done < "${work_dir}/build-list.new" @@ -390,6 +318,9 @@ rm -rf --one-file-system "${work_dir}/build-list.loops" mv "${work_dir}/${file}.new" "${work_dir}/${file}" done +# Delete old package meta data +delete_old_metadata + # Remove the lock file rm -f "${build_list_lock_file}" -- cgit v1.2.3-70-g09d2