From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6635926855683670016 X-Received: by 2002:a2e:844d:: with SMTP id u13-v6mr972302ljh.17.1545047729271; Mon, 17 Dec 2018 03:55:29 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:5d9d:: with SMTP id v29-v6ls1528335lje.12.gmail; Mon, 17 Dec 2018 03:55:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNSfQGAKhuyIuhWDt2YucCzQ71624dF0QKKH65i0luNbbdKbwtoHwx9pG4NUe7Gw0DIfkP X-Received: by 2002:a2e:7c02:: with SMTP id x2-v6mr1001770ljc.1.1545047728777; Mon, 17 Dec 2018 03:55:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545047728; cv=none; d=google.com; s=arc-20160816; b=KntOqTpPKN8nlOxzV/QJoWjNqWTSCkQf52P+uCNhD8oMJwPiJCfvrjDTxlhexsqmQz vr3QtL4wWjIdOJqlR0PBPZqtjJk0L/+3A6gaUVLS8ND9AW8Eu15hFZPdnwskwwlYWvgO 0cvmjnhj7CECyal/ZiG13VGZOkbb5nqhE2Q5nWtYiMrBrBOa2LKgHLWpDITCVGzLeD8a k5xQIj3WBe3jsTbhJSrk1BM9kQbNDAL+Jofu9qv2BTWaiGpBIWCztsnUq+UnHBPFWtK0 yrIsPbGyt4acCgTQBI4JrP89k3xIN3Krvy1xAmZLo1bY6AEvmUdE7KHiV3aM6gJVMkfh Q5hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=nFI8sHsNFJGkY2ndcKouFZVWi7ksyU7aZq0rCkciCUk=; b=mfku772NaT23thaWMwmMl9Z8SPtnVYnsihP7CHRQsOdrE/+viALjcBzSPYYn/3Osvx PXBWi6il2Ij69/BKmuLD41Y9y1W6ovNnVdV78hH6njTlpK2KqvjzrH3N8O3VfFueW9XC NkVRwi1DgqrvP9//w6ACk0wkaa4/jF6lz9zO3vhzmD3Bts2DIgSTa0CA4jSASXGUbZKH elGknoVayQEY/57vCZXeYArU2Re09Wn9dg0Ue5Z7G4QIRIYsbWJtE/SNogvXAE1gVxCx DX51tzKNldJT96+SFptIAdvUmGho39PAKxbQYJ8B+FRWah96RJbeogR1Gg5UrFyqAhvo 9MYQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id y27si370546lfb.0.2018.12.17.03.55.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Dec 2018 03:55:28 -0800 (PST) Received-SPF: pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of claudius.heine.ext@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=claudius.heine.ext@siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id wBHBtRrG020283 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Dec 2018 12:55:27 +0100 Received: from [139.25.69.181] (linux-ses-ext02.ppmd.siemens.net [139.25.69.181]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id wBHBtRQe007639; Mon, 17 Dec 2018 12:55:27 +0100 Subject: Re: [PATCH v2 2/2] isar-bootstrap: simplified distro source functions To: "Hosgor, Tolga (CT RDA DS EU TR MTS)" , isar-users@googlegroups.com References: <20181217114518.17995-1-tolga.hosgor@siemens.com> <20181217114518.17995-3-tolga.hosgor@siemens.com> From: Claudius Heine Message-ID: <91c39b5a-f581-b309-7626-f24149da0473@siemens.com> Date: Mon, 17 Dec 2018 12:55:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181217114518.17995-3-tolga.hosgor@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: X5apOKMiRvb+ Hi Tolga, On 17/12/2018 12.45, Hosgor, Tolga (CT RDA DS EU TR MTS) wrote: > - distro sources are created with a generator > - debian-buster.list begins with a 'deb-src' to test > the parser works correctly > > Signed-off-by: Hosgor, Tolga (CT RDA DS EU TR MTS) > --- > meta-isar/conf/distro/debian-buster.list | 1 + > .../isar-bootstrap/isar-bootstrap.inc | 22 ++++++++----------- > 2 files changed, 10 insertions(+), 13 deletions(-) > > diff --git a/meta-isar/conf/distro/debian-buster.list b/meta-isar/conf/distro/debian-buster.list > index 92d20e1..7828671 100644 > --- a/meta-isar/conf/distro/debian-buster.list > +++ b/meta-isar/conf/distro/debian-buster.list > @@ -1,3 +1,4 @@ > +deb-src http://ftp.de.debian.org/debian buster main contrib non-free > deb http://ftp.de.debian.org/debian buster main contrib non-free > deb https://debian.inf.tu-dresden.de/debian buster main contrib non-free > deb http://ftp.de.debian.org/debian buster-updates main contrib non-free > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > index d868bb6..6dc1888 100644 > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc > @@ -117,7 +117,7 @@ def get_aptsources_list(d, is_host=False): > apt_sources_list = (d.getVar("DISTRO_APT_SOURCES", True) or "").split() > return apt_sources_list > > -def get_distro_primary_source_entry(d, is_host=False): > +def generate_distro_sources(d, is_host=False): > apt_sources_list = get_aptsources_list(d, is_host) > for entry in apt_sources_list: > entry_real = bb.parse.resolve_file(entry, d) > @@ -126,21 +126,17 @@ def get_distro_primary_source_entry(d, is_host=False): > parsed = parse_aptsources_list_line(line) > if parsed: > parsed = get_apt_source_mirror(d, parsed) > - if parsed[0] == "deb": > - return parsed[2:] > + yield parsed > + > +def get_distro_primary_source_entry(d, is_host=False): > + apt_sources_list = get_aptsources_list(d, is_host) > + for source in generate_distro_sources(d, is_host): > + if source[0] == "deb": > + return source[2:] > return ["", "", ""] > > def get_distro_have_https_source(d, is_host=False): > - for entry in get_aptsources_list(d, is_host): > - entry_real = bb.parse.resolve_file(entry, d) > - with open(entry_real, "r") as in_fd: > - for line in in_fd: > - parsed = parse_aptsources_list_line(line) > - if parsed: > - parsed = get_apt_source_mirror(d, parsed) > - if parsed[2].startswith("https://"): > - return True > - return False > + return any(source[2].startswith("https://") for source in generate_distro_sources(d, is_host)) Maybe you should merge those changes into the first patch? Changing the same code in one patchset makes the review more difficult, also I don't really see a reason for this split here. Cheers, Claudius > > def get_distro_needs_https_support(d, is_host=False): > if get_distro_have_https_source(d, is_host): > -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de