forked from libgit2/libgit2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
captureObjects.sh
executable file
·27 lines (22 loc) · 1.12 KB
/
captureObjects.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#docker run -d --name gather -p443:22 -v /home/audris:/data -w /home/audris swsc/gather /bin/startsvc.sh audris
#head cgit.kde.org.heads.get | while read r; do rpp=$(echo $r| sed 's|.*kde.org/||;s|/|_|;s|^|kde_|'); git clone --mirror $r $rpp; /usr/bin/gitListSimp.sh $rpp | /usr/bin/classify $rpp 2>> $rpp.olist.err | gzip > $rpp.olist.gz; done
repo=$1
rp0=$(echo $repo|sed 's|.*//||')
rpn=$(echo $rp0|sed 's|[^/]*/||')
rpb=$(echo $rp0|sed 's|/[^/]*/[^/]*$||')
rpp=$(echo $rpn|sed 's|/|_|')
git clone --mirror $repo $rpp
/usr/bin/gitListSimp.sh $rpp | /usr/bin/classify $rpp 2>> $rpp.olist.err | gzip > $rpp.olist.gz
#now get p2c map
zcat $rpp.olist.gz | grep ';commit;' | cut -d\; -f1,3 | sort -T\. -t\; -k1b,2 | gzip > $rpp.p2c
# select only missing objects via /usr/bin/hasObj.perl
#zcat $rpp.olist.gz | /usr/bin/cleanBlb.perl | /usr/bin/hasObj.perl | gzip > $rpp.todo
zcat $rpp.olist.gz | /usr/bin/cleanBlb.perl | gzip > $rpp.todo
zcat $rpp.todo | /usr/bin/grabGitI.perl $rpp 2> $rpp.err
rm $rpp.todo $rpp.olist.gz
rm -rf $rpp
tar czf $rpp.tgz $rpp.*
#copy stuff back
scp $rpp.tgz -pP443 audris@localhost:/data/cloud
rm $rpp.*