-(* Helper function to read the latest version in a repo and return
- * the version.
- *)
-let git_latest_version branch =
- let v = shout "
- cd %s/repos/%s-%s
- git describe --tags --abbrev=0
- " buildtmp package (quote branch) in
- vernames v
-
-(* Get the latest commit. *)
-let git_latest_commit branch =
- shout "
- cd %s/repos/%s-%s
- git rev-parse HEAD
- " buildtmp package (quote branch)
-
-(* Clone or update a repo to the latest version on a branch, by force.
- * It is cached in name = $buildtmp/repos/<package>-<branch>
- *)
-let git_force url branch =
- sh "
- cd %s/repos
- if [ ! -d %s-%s ]; then git clone %s %s-%s; fi
- cd %s-%s
- git checkout --force %s
- git pull
- # Copy or update gnulib
- git submodule init
- git submodule update
- " buildtmp
- package (quote branch) (quote url) package (quote branch)
- package (quote branch)
- (quote branch)