Skip to content

Commit 2b5f9c6

Browse files
shr-projectSusan Montooth
authored andcommitted
mcf: Simplify updaterepo function (v4.0.10)
:Release Notes: Use only one for loop to download, sanitycheck and update all layers. :Detailed Notes: :Testing Performed: Only build tested. :QA Notes: No change to image. :Issues Addressed: [ES-515] mcf: Fix problem with local repository is out-of-sync with remote Open-webOS-DCO-1.0-Signed-off-by: Martin Jansa <martin.jansa@lge.com> Change-Id: Idcb5a6a191c2c811296466e3cb37898546160758 Reviewed-on: https://g2g.palm.com/5448 Reviewed-by: DCO Verification Build: Martin Jansa <Martin.Jansa@lge.com> Reviewed-by: Martin Jansa <Martin.Jansa@lge.com> Tested-by: Martin Jansa <Martin.Jansa@lge.com> Reviewed-by: Build Verification Reviewed-by: Susan Montooth <susan.montooth@lge.com>
1 parent 4a69c8e commit 2b5f9c6

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

mcf

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ from time import gmtime, strftime
2525
import shutil
2626
import glob
2727

28-
__version__ = "4.0.9"
28+
__version__ = "4.0.10"
2929

3030
logger = logging.getLogger(__name__)
3131

@@ -473,29 +473,25 @@ def write_bblayers_conf(sourcedir, machine):
473473

474474
def update_layers(sourcedir):
475475
logger.info('MCF-%s: Updating build directory' % __version__)
476-
# all layers must exists before update
477-
for layer in WEBOSLAYERS:
478-
if not os.path.exists(os.path.abspath( LOCATIONS[layer] ) ):
479-
downloadrepo(layer)
480-
481-
# run sanity check on repo
482476
layers_sanity = list()
483477
update_location = list()
484-
updated_layers = list()
485478
for layer in WEBOSLAYERS:
486479
if LOCATIONS[layer] not in update_location:
487480
update_location.append(LOCATIONS[layer])
488-
updated_layers.append(layer)
489-
if reposanitycheck(layer) != 0:
490-
layers_sanity.append(layer)
481+
if not os.path.exists(os.path.abspath( LOCATIONS[layer] ) ):
482+
# downloadrepo
483+
downloadrepo(layer)
484+
else:
485+
# run sanity check on repo
486+
if reposanitycheck(layer) != 0:
487+
layers_sanity.append(layer)
488+
489+
# update layers
490+
updaterepo(layer)
491491

492492
if layers_sanity:
493493
logger.info('Found local changes for repos(s) %s' % layers_sanity)
494494

495-
# update layers
496-
for layer in WEBOSLAYERS:
497-
if layer in updated_layers:
498-
updaterepo(layer)
499495
printupdatesummary()
500496

501497
def printupdatesummary ():

0 commit comments

Comments
 (0)