From a8c131e47ef6e8ca9a653619ae7113ce9bcf9ac3 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sep 14 2018 09:40:43 +0000 Subject: [dist-git] fix `cgit_pkg_list` script Fixes: #397 --- diff --git a/dist-git/copr-dist-git.spec b/dist-git/copr-dist-git.spec index d99debf..64f7917 100644 --- a/dist-git/copr-dist-git.spec +++ b/dist-git/copr-dist-git.spec @@ -28,6 +28,7 @@ Requires: dist-git Requires: python3-requests Requires: python3-rpkg Requires: python3-munch +Requires: findutils %{?fedora:Requires(post): policycoreutils-python-utils} %{?rhel:Requires(post): policycoreutils-python} diff --git a/dist-git/dist_git/bin/cgit_pkg_list b/dist-git/dist_git/bin/cgit_pkg_list index ef1f5cf..e853bf5 100755 --- a/dist-git/dist_git/bin/cgit_pkg_list +++ b/dist-git/dist_git/bin/cgit_pkg_list @@ -13,8 +13,12 @@ fi newfile=`mktemp` -cd /var/lib/dist-git/git/repositories -ls > $newfile -cp -fZ $newfile $destination -rm $newfile -chmod 644 $destination +# TODO: we should read the 'SetEnv GIT_PROJECT_ROOT /var/lib/dist-git/git' +# instead of hardcoding it here +cd /var/lib/dist-git/git + +# We expect //.git directories. +find -maxdepth 3 -mindepth 3 -type d -printf '%P\n' > "$newfile" +cp -fZ "$newfile" "$destination" +rm "$newfile" +chmod 644 "$destination"