[ostree] ostbuild: When doing a fetch, call fetch before trying to mirror the branch
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] ostbuild: When doing a fetch, call fetch before trying to mirror the branch
- Date: Thu, 9 Feb 2012 17:40:01 +0000 (UTC)
commit 820709e791f9f07f5b81dddf0387f527af6c8fb3
Author: Colin Walters <walters verbum org>
Date: Thu Feb 9 11:19:33 2012 -0500
ostbuild: When doing a fetch, call fetch before trying to mirror the branch
Otherwise when the manifest specifies a branch we haven't fetched, we
error out.
src/ostbuild/pyostbuild/builtin_resolve.py | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/ostbuild/pyostbuild/builtin_resolve.py b/src/ostbuild/pyostbuild/builtin_resolve.py
index 5e0e037..408f316 100755
--- a/src/ostbuild/pyostbuild/builtin_resolve.py
+++ b/src/ostbuild/pyostbuild/builtin_resolve.py
@@ -45,6 +45,8 @@ class OstbuildResolve(builtins.Builtin):
run_sync(['git', 'clone', '--mirror', uri, tmp_mirror])
run_sync(['git', 'config', 'gc.auto', '0'], cwd=tmp_mirror)
os.rename(tmp_mirror, mirror)
+ if branch is None:
+ return mirror
last_fetch_path = mirror + '.%s-lastfetch' % (name, )
if os.path.exists(last_fetch_path):
f = open(last_fetch_path)
@@ -152,7 +154,7 @@ class OstbuildResolve(builtins.Builtin):
if not found:
fatal("Unknown component %r" % (component_name, ))
(keytype, uri) = self._parse_src_key(component['src'])
- mirrordir = self._ensure_vcs_mirror(component_name, keytype, uri, component['branch'])
+ mirrordir = self._ensure_vcs_mirror(component_name, keytype, uri, None)
log("Running git fetch for %s" % (component['name'], ))
run_sync(['git', 'fetch'], cwd=mirrordir, log_initiation=False)
else:
@@ -161,11 +163,7 @@ class OstbuildResolve(builtins.Builtin):
for component in self.resolved_components:
(keytype, uri) = self._parse_src_key(component['src'])
name = component['name']
- try:
- fetch_components.index(name)
- mirrordir = buildutil.get_mirrordir(self.mirrordir, keytype, uri)
- except ValueError, e:
- mirrordir = self._ensure_vcs_mirror(name, keytype, uri, component['branch'])
+ mirrordir = self._ensure_vcs_mirror(name, keytype, uri, component['branch'])
revision = buildutil.get_git_version_describe(mirrordir,
component['branch'])
component['revision'] = revision
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]