Merge branch 'master' into rorcz
[girocco.git] / toolbox / inactive
blobafb01c6769ee55dbae76b38fe5808713fbae1c74
1 #!/bin/sh
3 . @basedir@/shlib.sh
5 echo Checking for inactive projects (empty repositories)
7 cd "$cfg_reporoot"
8 mkdir -p "$cfg_reporoot-recyclebin"
9 for i in $(find . -name heads -type d); do [ "$(ls $i)" ] && continue; fb="${i##*/}"; fb="${fb%.git}"; [ -d "$i/../../../$fb" ] && continue; [ -e "$i/../../packed-refs" ] && continue; echo "${i%/refs/heads} $(cat $i/../../owner)"; done >sack
11 while read x y; do echo -e 'Hello,\n\nI have removed your project '$x' from repo.or.cz since you have set it up quite some time ago and nothing has ever been pushed in (I run this job once in few months). If you want to publish anything on repo.or.cz in the future, feel free to create the project again. If you experienced any technical difficulties with publishing on repo.or.cz, please let me know, hopefully we can solve them together (sometimes I don't reply for some time, in that case it's best to harass me again, and repeatedly ;-). In case the automated check went wrong, the repository is still backed up...\n\nThanks for using repo.or.cz!\n\n\t\t\tPetr Baudis <pasky@suse.cz>' | mail -s '[repo.or.cz] Automated project removal' $y; done <sack
13 #for i in $(find . -name heads -type d); do [ "$(ls $i)" ] && continue; mv ${i%/refs/heads} "$cfg_reporoot-recyclebin/"; done
14 while read x y; do f="${x%/*}"; x="${x##*/}"; [ "$f" != "$x" ] || f=""; echo "$f .. $x"; mkdir -p "$cfg_reporoot-recyclebin/$f"; mv "$cfg_reporoot/$f/$x" "$cfg_reporoot-recyclebin/$f"; done <sack
16 for i in `cut -d ' ' -f 1 "$cfg_reporoot/sack"`; do echo $i; j=${i#./}; j=${j%.git}; perl -Icgi -MGirocco::Project -e 'Girocco::Project->ghost("'$j'", 0)->_group_remove()'; done