put build conf file under repodata directory
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 31 May 2013 08:45:52 +0000 (16:45 +0800)
committerZhang Qiang <qiang.z.zhang@intel.com>
Thu, 27 Jun 2013 05:10:37 +0000 (13:10 +0800)
Change-Id: I77444c09559eb244e200db5f74bd53e132df1580

common/repomaker.py

index 24e2fac..79fd301 100644 (file)
@@ -163,14 +163,8 @@ class RepoMaker(object):
             if is_imageconf:
                 self.load_imagedata(fpath)
 
-        # Save build configuration file if provided
-        if buildconf:
-            confpath = os.path.join(repo_dir, "%s-build.conf" % name)
-            with open(confpath, 'w') as conf:
-                conf.write(buildconf)
-
         # Generate or update build.xml
-        self.update_builddata(name, dirs, buildconf)
+        self.update_builddata(name, dirs)
 
         # Run createrepo
         for _rtype, _rarch, rpath in dirs:
@@ -182,6 +176,15 @@ class RepoMaker(object):
                     os.system('modifyrepo %s %s' % (metafile,
                               os.path.join(rpath, "repodata")))
 
+            # update build configuration file to repodata
+            if buildconf:
+                confpath = os.path.join(rpath, "repodata",
+                                           'build.conf')
+                with open(confpath, 'w') as conf:
+                    conf.write(buildconf)
+                os.system('modifyrepo %s %s' % (confpath,
+                          os.path.join(rpath, "repodata")))
+
         # sign if gpg_key is provided
         if gpg_key and os.path.exists(signer) and os.access(signer, os.X_OK):
             for _rtype, _rarch, rpath in dirs: