aboutsummaryrefslogtreecommitdiff
path: root/grok-cron.py
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2016-11-07 11:41:20 -0600
committerAndy Doan <andy.doan@linaro.org>2016-11-07 11:41:20 -0600
commit336061bcd623f77112df2371e75e030f216f1341 (patch)
treec5232f75591ec9f145d1eb0837729624089a0c24 /grok-cron.py
parenta2fb9626a79765dad3067afb7e93bd2de7e63a8c (diff)
bugs found while debug last commmit
Change-Id: Id7bc4bd2997c9998de4cf8f89b33cdd4040fe57a
Diffstat (limited to 'grok-cron.py')
-rwxr-xr-xgrok-cron.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/grok-cron.py b/grok-cron.py
index 37efbb1..9a4eba8 100755
--- a/grok-cron.py
+++ b/grok-cron.py
@@ -16,6 +16,21 @@ logging.basicConfig(level=logging.INFO)
log = logging.getLogger('grok-cron')
+def _can_mirror(full_path):
+ # we have a couple of old symlinks set up, that we don't have
+ # to manage via grokmirror
+ if os.path.isdir(full_path) and not os.path.islink(full_path):
+ if os.path.exists(os.path.join(full_path, 'noweb')):
+ return False
+ if len(os.listdir(os.path.join(full_path, 'refs/heads'))) == 0:
+ # grokmirror won't add these to the manifest (although it should)
+ # these are typicall Gerrit project holders with:
+ # HEAD=refs/meta/config
+ return False
+ return True
+ return False
+
+
def handle_unmanaged(manifile, manifest_repos, repo_dir, dryrun):
'''Handle repos that have been moved and not picked up by grokmirror.
This can happen when ITS moves a repo from one user's account to another
@@ -29,9 +44,7 @@ def handle_unmanaged(manifile, manifest_repos, repo_dir, dryrun):
for repo in repos.splitlines():
repo = repo.strip() + '.git'
full_path = os.path.join(repo_dir, repo)
- # we have a couple of old symlinks set up, that we don't have
- # to manage via grokmirror
- if os.path.isdir(full_path) and not os.path.islink(full_path):
+ if _can_mirror(full_path):
if repo not in manifest_repos and repo not in EXCLUDES:
missing.append(repo)