From d1b23f080783372ef0b0238b7fd6840d5bf5abd3 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 10 May 2012 10:30:02 -0400 Subject: [PATCH] ostbuild: Fix pull-components We need to pull the actual commits, not the refs. --- .../pyostbuild/builtin_pull_components.py | 30 ++++++------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/src/ostbuild/pyostbuild/builtin_pull_components.py b/src/ostbuild/pyostbuild/builtin_pull_components.py index 501f8555..8716351f 100755 --- a/src/ostbuild/pyostbuild/builtin_pull_components.py +++ b/src/ostbuild/pyostbuild/builtin_pull_components.py @@ -40,31 +40,19 @@ class OstbuildPullComponents(builtins.Builtin): def execute(self, argv): parser = argparse.ArgumentParser(description=self.short_description) + parser.add_argument('origin') parser.add_argument('targets', nargs='*') + parser.add_argument('--prefix') + parser.add_argument('--bin-snapshot') args = parser.parse_args(argv) self.parse_config() - self._init_repo() + self.parse_bin_snapshot(args.prefix, args.bin_snapshot) - if len(args.targets) == 0: - targets = [self.active_branch] - else: - targets = args.targets - - tree_contents_list = [] - for target in targets: - tree_contents_path = os.path.join(self.ostree_dir, target, 'contents.json') - tree_contents = json.load(open(tree_contents_path)) - tree_contents_list.append(tree_contents) - revisions = set() - for tree_contents in tree_contents_list: - for component in tree_contents['components']: - revisions.add('components/' + component) - args = ['ostree-pull', '--repo=' + self.repo] - # FIXME FIXME - don't hardcode origin here - args.append('gnome') - for revision in revisions: - args.append(revision) - run_sync(args) + child_args = ['ostree-pull', '--repo=' + self.repo, '--prefer-loose', + args.origin] + for component,revision in self.bin_snapshot['components'].iteritems(): + child_args.append(revision) + run_sync(child_args) builtins.register(OstbuildPullComponents)