From 2f04174266c375f5b4803f1dd346b61de0b63a64 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 19 Jul 2017 16:56:16 +0200 Subject: bin/show-dependencies: rely on metadata instead of calling "git archive" --- bin/show-dependencies | 53 ++++++++++----------------------------------------- 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/bin/show-dependencies b/bin/show-dependencies index bb3f247..b144936 100755 --- a/bin/show-dependencies +++ b/bin/show-dependencies @@ -31,59 +31,26 @@ sort -u "${work_dir}/build-order" | \ sort -u | \ sponge "${tmp_dir}/original-build-order" -for repo in ${repo_names}; do - eval 'repo_path="${repo_paths__'"${repo}"'}"' - repo_revision="$(cat "${work_dir}/${repo}.revision")" - - git -C "${repo_path}" archive "${repo_revision}" | \ - tar -t | \ - sed 's|/$||' | \ - grep -v '/' | \ - sort -u >> \ - "${tmp_dir}/known-packages" - - git -C "${repo_path}" archive "${repo_revision}" | \ - tar -Ox --wildcards --wildcards-match-slash '*/PKGBUILD' | \ - sed -n ' - s/#.*$// - /^\s*\(groups\|provides\)=/{ - :loop - /)/{ - s/).*$// - s/^.*(// - p - d - } - $!N - s/#.*$// - bloop - } - ' | \ - tr "'\" " "\n" | \ - cut -d= -f1 | \ - grep -vxF '' | \ - grep -vF '$' | \ - sort -u >> \ - "${tmp_dir}/known-groups" -done +ls "${work_dir}/package-infos" | \ + sed 's|\(\.[^.]\+\)\{3\}$||' | \ + sort -u > \ + "${tmp_dir}/known-packages" -sort -u "${tmp_dir}/known-groups" | \ - sponge "${tmp_dir}/known-groups" +ls "${work_dir}/package-infos" | \ + grep '\.groups$' | \ + sed "s|^|${work_dir}/package-infos/|" | \ + xargs -r cat | \ + sort -u > \ + "${tmp_dir}/known-groups" ls "${work_dir}/package-infos" | \ grep '\.packages$' | \ while read -r pf; do - grep -xF "${pf%.*.*.*}" "${work_dir}/package-infos/${pf}" >> \ - "${tmp_dir}/known-packages" || \ - true grep -vxF "${pf%.*.*.*}" "${work_dir}/package-infos/${pf}" | \ xargs -r printf "${pf%.*.*.*} %s\n" >> \ "${tmp_dir}/known-split-packages" done -sort -u "${tmp_dir}/known-packages" | \ - sponge "${tmp_dir}/known-packages" - for target_package in "$@"; do rm -f \ -- cgit v1.2.3-70-g09d2