[ostree] ostbuild: Rename build manifest to "snapshot.json"



commit b8e3f622f1bc07ffafb78711c3b5894aa183a7b7
Author: Colin Walters <walters verbum org>
Date:   Mon Feb 27 18:57:56 2012 -0500

    ostbuild: Rename build manifest to "snapshot.json"
    
    It was confusing having two manifests.  "snapshot" matches the
    jhbuild term for the same thing.

 gnomeos/3.4/manifest.json                          |    2 ++
 src/ostbuild/pyostbuild/builtin_build.py           |    4 ++--
 src/ostbuild/pyostbuild/builtin_checkout.py        |    2 +-
 .../pyostbuild/builtin_chroot_compile_one.py       |    2 +-
 src/ostbuild/pyostbuild/builtin_resolve.py         |   13 ++++++++++---
 src/ostbuild/pyostbuild/builtin_status.py          |    2 +-
 6 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/gnomeos/3.4/manifest.json b/gnomeos/3.4/manifest.json
index 8d9544f..2deb3e9 100644
--- a/gnomeos/3.4/manifest.json
+++ b/gnomeos/3.4/manifest.json
@@ -23,6 +23,8 @@
 		"netfilter": "git:git://git.netfilter.org/",
 		"cgwalters": "git:git://github.com/cgwalters/"},
 
+  "patches": {"src": "gnome:ostree"},
+
   "components": [
    		{"src": "cgwalters:ginitscripts"},
 
diff --git a/src/ostbuild/pyostbuild/builtin_build.py b/src/ostbuild/pyostbuild/builtin_build.py
index 124d3c1..3497b78 100755
--- a/src/ostbuild/pyostbuild/builtin_build.py
+++ b/src/ostbuild/pyostbuild/builtin_build.py
@@ -173,7 +173,7 @@ class OstbuildBuild(builtins.Builtin):
         f.close()
 
         args = ['ostree', '--repo=' + self.repo,
-                'commit', '-b', buildname, '-s', 'Build ' + artifact_meta['revision'],
+                'commit', '-b', buildname, '-s', 'Build',
                 '--add-metadata-string=ostbuild-buildroot-version=' + artifact_meta['buildroot-version'],
                 '--add-metadata-string=ostbuild-artifact-version=' + artifact_meta['revision'],
                 '--owner-uid=0', '--owner-gid=0', '--no-xattrs', 
@@ -233,7 +233,7 @@ class OstbuildBuild(builtins.Builtin):
         self.buildopts.shell_on_failure = args.shell_on_failure
         self.buildopts.skip_built = args.skip_built
 
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         self.patchdir = os.path.join(self.workdir, 'patches')
diff --git a/src/ostbuild/pyostbuild/builtin_checkout.py b/src/ostbuild/pyostbuild/builtin_checkout.py
index 691cfb2..3aa4c50 100755
--- a/src/ostbuild/pyostbuild/builtin_checkout.py
+++ b/src/ostbuild/pyostbuild/builtin_checkout.py
@@ -45,7 +45,7 @@ class OstbuildCheckout(builtins.Builtin):
         
         self.parse_config()
 
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         for component_name in args.components:
diff --git a/src/ostbuild/pyostbuild/builtin_chroot_compile_one.py b/src/ostbuild/pyostbuild/builtin_chroot_compile_one.py
index ce699dc..3503805 100755
--- a/src/ostbuild/pyostbuild/builtin_chroot_compile_one.py
+++ b/src/ostbuild/pyostbuild/builtin_chroot_compile_one.py
@@ -39,7 +39,7 @@ class OstbuildChrootCompileOne(builtins.Builtin):
         self.parse_config()
 
         component_name = os.path.basename(os.getcwd())
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         if args.meta is not None:
diff --git a/src/ostbuild/pyostbuild/builtin_resolve.py b/src/ostbuild/pyostbuild/builtin_resolve.py
index 7a1ec90..e6f680c 100755
--- a/src/ostbuild/pyostbuild/builtin_resolve.py
+++ b/src/ostbuild/pyostbuild/builtin_resolve.py
@@ -159,6 +159,13 @@ class OstbuildResolve(builtins.Builtin):
                 run_sync(['git', 'fetch'], cwd=mirrordir, log_initiation=False)
         else:
             fetch_components = []
+            
+        self.manifest['patches'] = self._resolve_component_meta(self.manifest['patches'])
+        patches_meta = self.manifest['patches']
+        (keytype, uri) = self._parse_src_key(patches_meta['src'])
+        mirrordir = self._ensure_vcs_mirror(patches_meta['name'], keytype, uri, patches_meta['branch'])
+        revision = buildutil.get_git_version_describe(mirrordir, patches_meta['branch'])
+        patches_meta['revision'] = revision
 
         for component in self.resolved_components:
             (keytype, uri) = self._parse_src_key(component['src'])
@@ -202,7 +209,7 @@ class OstbuildResolve(builtins.Builtin):
 
         self.manifest['components'] = self.resolved_components
 
-        out_manifest = os.path.join(self.workdir, 'manifest.json')
+        out_snapshot = os.path.join(self.workdir, 'snapshot.json')
         patchdir = os.path.join(self.workdir, 'patches')
         if not os.path.isdir(patchdir):
             os.mkdir(patchdir)
@@ -217,9 +224,9 @@ class OstbuildResolve(builtins.Builtin):
             dest = os.path.join(patchdir, patch)
             shutil.copy(src, dest)
         
-        f = open(out_manifest, 'w')
+        f = open(out_snapshot, 'w')
         json.dump(self.manifest, f, indent=4)
         f.close()
-        print "Created: %s, %d patches" % (out_manifest, len(all_patches.keys()))
+        print "Created: %s, %d patches" % (out_snapshot, len(all_patches.keys()))
         
 builtins.register(OstbuildResolve)
diff --git a/src/ostbuild/pyostbuild/builtin_status.py b/src/ostbuild/pyostbuild/builtin_status.py
index 9cd49be..76da628 100755
--- a/src/ostbuild/pyostbuild/builtin_status.py
+++ b/src/ostbuild/pyostbuild/builtin_status.py
@@ -36,7 +36,7 @@ class OstbuildStatus(builtins.Builtin):
 
     def execute(self, args):
         self.parse_config()
-        build_manifest_path = os.path.join(self.workdir, 'manifest.json')
+        build_manifest_path = os.path.join(self.workdir, 'snapshot.json')
         self.manifest = json.load(open(build_manifest_path))
 
         for architecture in self.manifest['architectures']:



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