repo_dir = os.path.join(self.outdir, "repos", name)
if name not in self.repos:
- self.repos[name] = {'archs': set(archs)}
+ self.repos[name] = {'archs': list(set(archs))}
files = collect(in_dir, archs)
filename)))
# get names and content of .ks files from rpm
if is_imageconf:
- self.load_imagedata(fpath)
+ self.load_imagedata(name, fpath)
# Generate or update build.xml
self.update_builddata(name, repo_dirs)
"""
return bool(self.imagedata.images)
- def load_imagedata(self, rpm):
+ def load_imagedata(self, repo, rpm):
"""
Args:
Raises: ImageDataError
"""
- self.imagedata.extract_image_conf(rpm)
+ self.imagedata.extract_image_conf(rpm, repo)
def gen_image_info(self, updated_ks=None):
"""
if updated_ks:
self.imagedata.ks = updated_ks
- self.imagedata.save(self.outdir)
+ for repo in self.repos:
+ self.imagedata.save(os.path.join(self.outdir,
+ 'builddata/images/%s' % repo))
def update_builddata(self, name, dirs, buildconf=None):
"""
if not os.path.exists(manifest_dir):
os.makedirs(manifest_dir)
- else:
- raise RepoMakerError("The directory %s supposed must be clean"
- % manifest_dir )
repo_primary = manifest.get_repo_primary_md(self.outdir, name)
gerrit_fetch_url,
gerrit_review_url)
with open(os.path.join(manifest_dir,
- "%s_%s.xml" %(self.build_id, arch)),
+ "%s_%s_%s.xml" %(self.build_id, name, arch)),
'w') as manifest_fh:
manifest_fh.write(manifest_string)