[gnome-ostree] vcs: Clean up vcs mirroring code



commit 51aa72dd269df279413a9dd7568737a2dccb7973
Author: Colin Walters <walters verbum org>
Date:   Tue Nov 27 17:18:17 2012 -0500

    vcs: Clean up vcs mirroring code
    
    I'm not sure if there's a bug here that caused mirroring of
    gnome-control-center to fail, but this should be equivalent to what
    existed before, just clearer.

 src/ostbuild/pyostbuild/vcs.py |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/ostbuild/pyostbuild/vcs.py b/src/ostbuild/pyostbuild/vcs.py
index 9e8fe44..5ec06f6 100755
--- a/src/ostbuild/pyostbuild/vcs.py
+++ b/src/ostbuild/pyostbuild/vcs.py
@@ -156,22 +156,17 @@ def ensure_vcs_mirror(mirrordir, keytype, uri, branch, fetch=False,
     current_vcs_version = run_sync_get_output(['git', 'rev-parse', branch], cwd=mirror)
     current_vcs_version = current_vcs_version.strip()
 
-    if fetch:
-        f = open(last_fetch_path, 'w')
-        f.write(current_vcs_version + '\n')
-        f.close()
-
-    if current_vcs_version != last_fetch_contents:
+    changed = current_vcs_version != last_fetch_contents
+    if changed:
         log("last fetch %r differs from branch %r" % (last_fetch_contents, current_vcs_version))
-        check_submodules = True
-    else:
-        check_submodules = did_update
-    if check_submodules:
         for (sub_checksum, sub_name, sub_url) in _list_submodules(mirrordir, mirror, keytype, uri, branch):
             ensure_vcs_mirror(mirrordir, keytype, sub_url, sub_checksum, fetch=fetch)
+    
+    if changed:
         f = open(last_fetch_path, 'w')
         f.write(current_vcs_version + '\n')
         f.close()
+
     return mirror
 
 def fetch(mirrordir, keytype, uri, branch, keep_going=False):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]