pmbootstrap status: check if git repo is outdated (!1882)

Use the timestamp of .git/FETCH_HEAD in each git repository, to
determine if too much time has passed since the last fetch/pull.
Modify pmb.helpers.git.clone, so FETCH_HEAD is always created if it does
not exist (because "git clone" would not create it).

Related: #1829
This commit is contained in:
Oliver Smith 2020-02-12 22:44:26 +01:00 committed by Alexey Min
parent c8526f2fcb
commit cfd93bc6ea
No known key found for this signature in database
GPG key ID: 0B19D2A65870B448
5 changed files with 79 additions and 13 deletions

View file

@ -91,6 +91,12 @@ def print_checks_git_repo(args, repo, details=True):
"update with 'pmbootstrap pull'")
log_ok("up to date with remote branch")
# Outdated remote information
if pmb.helpers.git.is_outdated(args, path):
return log_nok_ret(-5, "outdated remote information",
"update with 'pmbootstrap pull'")
log_ok("remote information updated recently (via git fetch/pull)")
return (0, "")