Update, repo tool cloner: recursive clones

Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
2022-07-29 17:03:15 +02:00
parent 8a150c63c5
commit 6463a6bb95
6 changed files with 142 additions and 65 deletions

View File

@@ -8,34 +8,10 @@ mydir=$(dirname $(realpath $0))
source $mydir/detector-lib-cfg
# interval - in minutes
interval=${cloner_interval:-0}
stampfile=$CCLONE_CACHE/last-check-time
# does it exist - if not, sync
[ -d $CCLONE_CACHE ] || mkdir $CCLONE_CACHE
[ -f $stampfile ] || echo 0 > $stampfile
now=$(date +"%s")
last=$(cat $stampfile)
diff=$(($now - $last))
mindiff=$(($interval * 60))
unset now last
if [ $diff -lt $mindiff ]
then
echo "Limit not reached - not syncing now"
exit 0
fi
# check and clone repo
submodules=${cloner_submodules:-0}
depth=${cloner_submodule_depth:-}
export HOME=$CCLONE_CACHE
prepareGitAuth $CONFIG_DIR
# without submodule support
@@ -46,8 +22,6 @@ else
mirror-recursive $repo $depth
fi
date +"%s" > $stampfile
# if detector is not enabled, quit quietly
if ! detectorRunCapable
then