archs = set()
for fname in find_files(in_dir):
ftype = fname.split('.')[-2]
+ basename = os.path.basename(fname)
if ftype not in ("src", "noarch"):
archs.add(ftype)
is_debug = "-debugsource-" in fname or "-debuginfo-" in fname
- is_group = fname.startswith("package-groups-")
- is_imageconf = fname.startswith("image-configurations-")
+ is_group = basename.startswith("package-groups-") and not is_debug
+ is_imageconf = basename.startswith("image-configurations-") and \
+ not is_debug
files.append((fname, ftype, is_debug, is_group, is_imageconf))
return files, archs
# For package-groups package update package groups and patterns
if is_group:
+ repodata_dir = os.path.join(repo_dir, ftype, "packages",
+ "repodata")
+ if not os.path.exists(repodata_dir):
+ os.makedirs(repodata_dir)
for filename in ("group.xml", "patterns.xml"):
os.system("rpm2cpio %s | cpio -i --to-stdout "\
"./usr/share/package-groups/%s > %s" % \
- (fpath, filename, os.path.join(repo_dir, ftype,
- "repodata",
+ (fpath, filename, os.path.join(repodata_dir,
filename)))
# get names and content of .ks files from rpm
if is_imageconf:
for _rtype, _rarch, rpath in dirs:
# run createrepo
os.system('createrepo --quiet %s' % rpath)
+ for filename in ("group.xml", "patterns.xml"):
+ metafile = os.path.join(rpath, "repodata", filename)
+ if os.path.exists(metafile):
+ os.system('modifyrepo %s %s' % (metafile,
+ 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):