build-pkgs: Prevent copying debs again after reuse
If run 'build-pkgs -p <package>' after 'build-pkgs -p <package> --reuse', the reused package will be copied from the shared repository again. This commit prevents importing the package again. Test Plan: Pass: export STX_SHARED_REPO="<url of remote shared repository>" export STX_SHARED_SOURCE="<url of shared source repository>" $build-pkgs -p <package> --reuse $build-pkgs -p <package> The second build should not trigger to copy the deb packages from the shared repository Story: 2008846 Task: 46481 Signed-off-by: Haiqing Bai <haiqing.bai@windriver.com> Change-Id: I4f0b9ab941c7f8433c2425ade9f93757620c16be
This commit is contained in:
parent
a834b6be11
commit
8791e3c66e
@ -875,7 +875,7 @@ class BuildController():
|
|||||||
continues to be used
|
continues to be used
|
||||||
'''
|
'''
|
||||||
if dsc_file == 'reuse':
|
if dsc_file == 'reuse':
|
||||||
logger.info("%s is reused package which has no meta changes", pkg_name)
|
logger.info("%s is a reused package which has no meta changes", pkg_name)
|
||||||
skip_create_dsc = True
|
skip_create_dsc = True
|
||||||
return skip_create_dsc, None
|
return skip_create_dsc, None
|
||||||
|
|
||||||
@ -1429,7 +1429,10 @@ class BuildController():
|
|||||||
self.upload_with_dsc(pkg_name, dsc_file, REPO_SOURCE)
|
self.upload_with_dsc(pkg_name, dsc_file, REPO_SOURCE)
|
||||||
else:
|
else:
|
||||||
if skip_dsc:
|
if skip_dsc:
|
||||||
logger.debug("Reuse the remote debs, skip this dsc")
|
if self.attrs['reuse']:
|
||||||
|
logger.info("%s will reuse the remote debs, skip to build", pkg_name)
|
||||||
|
else:
|
||||||
|
logger.info("%s has reused the shared debs, skip to build", pkg_name)
|
||||||
self.lists['reuse_' + build_type].append(pkg_dir)
|
self.lists['reuse_' + build_type].append(pkg_dir)
|
||||||
self.lists['reuse_pkgname_' + build_type].append(pkg_name)
|
self.lists['reuse_pkgname_' + build_type].append(pkg_name)
|
||||||
continue
|
continue
|
||||||
@ -1449,7 +1452,7 @@ class BuildController():
|
|||||||
if pkg in layer_pkgdir_dscs.keys():
|
if pkg in layer_pkgdir_dscs.keys():
|
||||||
target_pkgdir_dscs[pkg] = layer_pkgdir_dscs[pkg]
|
target_pkgdir_dscs[pkg] = layer_pkgdir_dscs[pkg]
|
||||||
|
|
||||||
if len(self.lists['reuse_pkgname_' + build_type]) > 0:
|
if self.attrs['reuse'] and len(self.lists['reuse_pkgname_' + build_type]) > 0:
|
||||||
logger.info("The reused pkgs:%s", ','.join(self.lists['reuse_pkgname_' + build_type]))
|
logger.info("The reused pkgs:%s", ','.join(self.lists['reuse_pkgname_' + build_type]))
|
||||||
stx_meta_dir = os.path.join(STX_META_NAME, STX_META_NAME + '-1.0')
|
stx_meta_dir = os.path.join(STX_META_NAME, STX_META_NAME + '-1.0')
|
||||||
remote_debsentry = os.path.join(BUILD_ROOT, stx_meta_dir, build_type + '_debsentry.pkl')
|
remote_debsentry = os.path.join(BUILD_ROOT, stx_meta_dir, build_type + '_debsentry.pkl')
|
||||||
@ -1474,7 +1477,7 @@ class BuildController():
|
|||||||
if debs_reused:
|
if debs_reused:
|
||||||
logger.info("All sub debs of %s will be imported:%s", pkgname, debs_reused)
|
logger.info("All sub debs of %s will be imported:%s", pkgname, debs_reused)
|
||||||
try:
|
try:
|
||||||
logger.debug("Calls copy_pkgs: mirror=%s local_repo=%s type=binary deploy=True overwrite=True",
|
logger.info("Calls copy_pkgs: mirror=%s local_repo=%s type=binary deploy=True overwrite=True",
|
||||||
REUSE_MIRROR, REPO_BUILD)
|
REUSE_MIRROR, REPO_BUILD)
|
||||||
ret = self.kits['repo_mgr'].copy_pkgs(REUSE_MIRROR, REPO_BUILD, debs_reused,
|
ret = self.kits['repo_mgr'].copy_pkgs(REUSE_MIRROR, REPO_BUILD, debs_reused,
|
||||||
pkg_type='binary',
|
pkg_type='binary',
|
||||||
@ -1491,7 +1494,7 @@ class BuildController():
|
|||||||
if target_pkgdir_dscs:
|
if target_pkgdir_dscs:
|
||||||
self.run_build_loop(layer_pkgdir_dscs, target_pkgdir_dscs, layer, build_type=build_type)
|
self.run_build_loop(layer_pkgdir_dscs, target_pkgdir_dscs, layer, build_type=build_type)
|
||||||
else:
|
else:
|
||||||
logger.info("No debian dsc files found")
|
logger.debug("There are no debian dsc files feeded to build_packages")
|
||||||
|
|
||||||
def show_build_stats(self):
|
def show_build_stats(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user