From 2232f805d30adfa370d2a5079d74f97d0e6c09fa Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 30 Oct 2009 01:17:58 +0100 Subject: [PATCH] get_repo_list_here -> get_repo_list, use the group project database --- jobs/gccheck.sh | 12 +++++++----- jobs/updatecheck.sh | 2 +- shlib.sh | 10 +++++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/jobs/gccheck.sh b/jobs/gccheck.sh index 140b4e3..7219edc 100755 --- a/jobs/gccheck.sh +++ b/jobs/gccheck.sh @@ -19,14 +19,17 @@ repack() # the redundant ones again then forkdir="${dir%.git}" if [ -d "$forkdir" ]; then - (cd "$forkdir" && get_repo_list_here) | - (cd "$dir" && while read fork; do + pushd "$rootdir/$dir" + get_repo_list "$forkdir/" | + while read fork; do + # Match objects in parent project for d in objects/?? objects/pack; do [ "$d" != "objects/??" ] || continue mkdir -p "$rootdir/$forkdir/$fork/$d" ln -f "$d"/* "$rootdir/$forkdir/$fork/$d" done - done) + done + popd fi git --git-dir="$dir" repack -A -d --window-memory=3G -l -q @@ -36,8 +39,7 @@ repack() progress "- `date` $dir" } -cd "$rootdir" -get_repo_list_here | +get_repo_list | while read dir; do repack "$dir" done 2>&1 | grep -v '^Pack.*created\.$' diff --git a/jobs/updatecheck.sh b/jobs/updatecheck.sh index 171afe9..23ce05f 100755 --- a/jobs/updatecheck.sh +++ b/jobs/updatecheck.sh @@ -9,7 +9,7 @@ fi touch /tmp/gitupdatelock cd "$cfg_reporoot" -get_repo_list_here | +get_repo_list | while read dir; do progress "+ `date` $dir" if [ ! -e "$dir"/.nofetch ]; then diff --git a/shlib.sh b/shlib.sh index df9e2af..39856aa 100644 --- a/shlib.sh +++ b/shlib.sh @@ -56,7 +56,11 @@ progress() { } -# List all Git repositories in current directory, one-per-line -get_repo_list_here() { - find . -name base_url | cut -c 3- | sed -e 's/\/base_url$//' +# List all Git repositories, with given prefix if specified, one-per-line +get_repo_list() { + if [ -n "$1" ]; then + cut -d : -f 1 | grep "^$1" + else + cut -d : -f 1 + fi } -- 2.11.4.GIT