Delete the subdirectory is named for archs in debug directory.
Original .rpm are in subdirectory will be put directly into parent directory.
And use the archs name of OBS replaces the unified archs name 'ia32',
to name the subdirectory in packages directory.
Change-Id: Iec48ec926639dc153bd88d6b8fd53591bd450099
ftype = fname.split('.')[-2]
# Unify arch name
- ftype = ARCH_MAP.get(ftype, ftype)
-
if ftype not in ("src", "noarch"):
if ftype not in archs:
# skip packages for unknown architectures
"""Create directory structure of the repos."""
dirs = [("binary", arch, os.path.join(repo_dir, subdir, arch)) \
for arch in archs \
- for subdir in ('packages', 'debug')]
+ for subdir in ['packages']]
dirs.append(("noarch", "noarch", os.path.join(repo_dir,
"packages",
"noarch")))
dirs.append(("source", None, os.path.join(repo_dir, "source")))
+ dirs.append(("debug", None, os.path.join(repo_dir, "debug")))
repo_dirs = set([])
# create and get repo_dirs
"""Prepare list of target dirs depending on type of package."""
if ftype == "src":
return [os.path.join(repo_dir, "source")]
+ elif is_debug:
+ return [os.path.join(repo_dir, "debug")]
else:
- return [os.path.join(repo_dir, ["packages", "debug"][is_debug], ftype)]
+ return [os.path.join(repo_dir, "packages", ftype)]
def move_or_hardlink(fpath, target_dirs, move=False):
"""Move or hardlink file to target directories."""
if name not in self.repos:
self.repos[name] = {'archs': list(set(archs))}
+ # translate unified archs name 'ia23' to 'i586' 'i686' matched
+ # with OBS archs
+ if set(archs).intersection(set(ARCH_MAP.values())):
+ new_archs = [arch for arch in ARCH_MAP
+ if ARCH_MAP.get(arch) in archs]
+ archs = new_archs + \
+ list(set(archs).difference(set(ARCH_MAP.values())))
+
files = collect(in_dir, archs, name)
# Create directory structure
if not repomaker.imagedata:
raise LocalError("Image configuration not found in %s" % snapshot.path)
- repos[repo['Name']] = repomaker.repos
+ repos.update(repomaker.repos)
imagedatas[repo['Name']] = repomaker.imagedata
# Generate image info to builddata/ dir
'pkg2-0.1-2.3.src.rpm', 'pkg2-1.2-3.4.src.rpm',
'pkg3-0.1-2.3.src.rpm', 'pkg3-1.2-3.4.src.rpm'],
'packages':
- ['ia32/pkg1-0.1-2.3.i586.rpm',
- 'ia32/pkg1-0.1-2.3.i686.rpm',
- 'ia32/pkg1-1.2-3.4.i586.rpm',
- 'ia32/pkg1-1.2-3.4.i686.rpm',
- 'ia32/pkg2-0.1-2.3.i586.rpm',
- 'ia32/pkg2-0.1-2.3.i686.rpm',
- 'ia32/pkg2-1.2-3.4.i586.rpm',
- 'ia32/pkg2-1.2-3.4.i686.rpm',
- 'ia32/pkg3-0.1-2.3.i586.rpm',
- 'ia32/pkg3-0.1-2.3.i686.rpm',
- 'ia32/pkg3-1.2-3.4.i586.rpm',
- 'ia32/pkg3-1.2-3.4.i686.rpm',
+ ['i586/pkg1-0.1-2.3.i586.rpm',
+ 'i586/pkg1-1.2-3.4.i586.rpm',
+ 'i586/pkg2-0.1-2.3.i586.rpm',
+ 'i586/pkg2-1.2-3.4.i586.rpm',
+ 'i586/pkg3-0.1-2.3.i586.rpm',
+ 'i586/pkg3-1.2-3.4.i586.rpm',
+ 'i686/pkg1-0.1-2.3.i686.rpm',
+ 'i686/pkg1-1.2-3.4.i686.rpm',
+ 'i686/pkg2-0.1-2.3.i686.rpm',
+ 'i686/pkg2-1.2-3.4.i686.rpm',
+ 'i686/pkg3-0.1-2.3.i686.rpm',
+ 'i686/pkg3-1.2-3.4.i686.rpm',
'noarch/pkg1-0.1-2.3.noarch.rpm',
'noarch/pkg1-1.2-3.4.noarch.rpm',
'noarch/pkg2-0.1-2.3.noarch.rpm',