Skip to content

Commit d3a6a12

Browse files
shr-projectSusan Montooth
authored andcommitted
mcf: Fix setting SSTATE_MIRRORS variable (v4.0.14)
:Release Notes: getopts function wasn't setting global SSTATE_MIRRORS variable causing @sstatemirror_assignment@ replacement to be always empty. :Detailed Notes: Move SSTATE_MIRRORS setting into separate function. Move all global variables together. :Testing Performed: Only build tested. :QA Notes: No change to image. :Issues Addressed: Open-webOS-DCO-1.0-Signed-off-by: Martin Jansa <martin.jansa@lge.com> Change-Id: I3f96e191993b79c65716b38bdf8fbd4862ff8e9f Reviewed-on: https://g2g.palm.com/6206 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: Herb Kuta <herb.kuta@lge.com> Reviewed-by: Susan Montooth <susan.montooth@lge.com>
1 parent 56125bb commit d3a6a12

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

‎mcf‎

Lines changed: 37 additions & 30 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.13"
28+
__version__ = "4.0.14"
2929

3030
logger = logging.getLogger(__name__)
3131

@@ -34,6 +34,23 @@ CLEAN = False
3434
TRACE = False
3535
REMOTE = "origin"
3636
SSTATE_MIRRORS = ''
37+
WEBOSLAYERS = []
38+
LAYERSPRIORITY = {}
39+
SUBMISSIONS = {}
40+
LOCATIONS = {}
41+
URLS = {}
42+
PRIORITYORDER = []
43+
COLLECTION_NAME = {}
44+
COLLECTION_PATH = {}
45+
SUMMARYINFO = {}
46+
BRANCHINFONEW = {}
47+
BRANCHINFOCURRENT = {}
48+
COMMITIDSNEW = {}
49+
COMMITIDSCURRENT = {}
50+
TAGSINFONEW = {}
51+
REPOPATCHDIR = {}
52+
DISTRO = None
53+
SUPPORTED_MACHINES = []
3754

3855
def echo_check_call(todo, verbosity=False):
3956
if verbosity or TRACE:
@@ -219,37 +236,27 @@ def getopts():
219236

220237
options = parser.parse_args(arglist)
221238
if mcfcommand in ('configure','update+configure') and options.sstatemirror:
222-
# /PATH is automatically added when generating SSTATE_MIRRORS value
223-
# verify and show error
224-
SSTATE_MIRRORS = "SSTATE_MIRRORS ?= \" \\\n"
225-
for m in options.sstatemirror:
226-
if m.endswith("/PATH"):
227-
logger.error("sstatemirror entry '%s', already ends with '/PATH', remove that" % m)
228-
sys.exit(1)
229-
if m.endswith("/"):
230-
logger.error("sstatemirror entry '%s', ends with '/', remove that" % m)
231-
sys.exit(1)
232-
SSTATE_MIRRORS += "file://.* %s/PATH \\n \\\n"
233-
SSTATE_MIRRORS += "\"\n"
239+
process_sstatemirror_option(options)
234240
return options
235241

236-
WEBOSLAYERS = []
237-
LAYERSPRIORITY = {}
238-
SUBMISSIONS = {}
239-
LOCATIONS = {}
240-
URLS = {}
241-
PRIORITYORDER = []
242-
COLLECTION_NAME = {}
243-
COLLECTION_PATH = {}
244-
SUMMARYINFO = {}
245-
BRANCHINFONEW = {}
246-
BRANCHINFOCURRENT = {}
247-
COMMITIDSNEW = {}
248-
COMMITIDSCURRENT = {}
249-
TAGSINFONEW = {}
250-
REPOPATCHDIR = {}
251-
DISTRO = None
252-
SUPPORTED_MACHINES = []
242+
def process_sstatemirror_option(options):
243+
"""
244+
Sets global variable SSTATE_MIRRORS based on list of mirrors in options.sstatemirror
245+
246+
/PATH suffix is automatically added when generating SSTATE_MIRRORS value
247+
verify that user didn't already include it and show error if he did
248+
"""
249+
global SSTATE_MIRRORS
250+
SSTATE_MIRRORS = "SSTATE_MIRRORS ?= \" \\\n"
251+
for m in options.sstatemirror:
252+
if m.endswith("/PATH"):
253+
logger.error("sstatemirror entry '%s', already ends with '/PATH', remove that" % m)
254+
sys.exit(1)
255+
if m.endswith("/"):
256+
logger.error("sstatemirror entry '%s', ends with '/', remove that" % m)
257+
sys.exit(1)
258+
SSTATE_MIRRORS += "file://.* %s/PATH \\n \\\n" % m
259+
SSTATE_MIRRORS += "\"\n"
253260

254261
def _icecc_installed():
255262
try:

0 commit comments

Comments
 (0)