From: Claudius Heine <claudius.heine.ext@siemens.com>
To: "Tolga Hoşgör" <tlghosgor@gmail.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v2 2/2] isar-bootstrap: simplified distro source functions
Date: Tue, 18 Dec 2018 09:20:40 +0100 [thread overview]
Message-ID: <27c2d5ed-42b3-c3d3-73df-e33bf4e99368@siemens.com> (raw)
In-Reply-To: <CAEFs9tznnFvqseNi=cW9EM7CczwXs-ea8jvdJA2hDZ4ygBL-Sg@mail.gmail.com>
Hi Tolga,
On 17/12/2018 19.11, Tolga Hoşgör wrote:
> Hi,
>
> The second patch is kind of an unrelated clean up that does a relatively
> big change to other parts of the code (get_distro_primary_source_entry to
> be exact). I believe it is better off as a separate commit that is
> revertible on its own.
But I pointed out the changes to get_distro_have_https_source specifically.
If you feel that refactoring of your just introduced
`get_distro_primary_source_entry` function should be handled separately,
then OK. I sort of see where you are coming from here. Since you just
split a function before and then change it in the next patch.
Also please avoid top-posting in mailing lists.
Cheers,
Claudius
>
> On Mon, Dec 17, 2018, 14:55 Claudius Heine <claudius.heine.ext@siemens.com
> wrote:
>
>> 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) <
>> tolga.hosgor@siemens.com>
>>> ---
>>> 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
>>
>
--
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
next prev parent reply other threads:[~2018-12-18 8:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-17 11:45 [PATCH v2 0/2] isar-bootstrap: debootstrap https support Hosgor, Tolga (CT RDA DS EU TR MTS)
2018-12-17 11:45 ` [PATCH v2 1/2] " Hosgor, Tolga (CT RDA DS EU TR MTS)
2018-12-18 13:20 ` Claudius Heine
2018-12-19 6:52 ` Tolga Hoşgör
2018-12-17 11:45 ` [PATCH v2 2/2] isar-bootstrap: simplified distro source functions Hosgor, Tolga (CT RDA DS EU TR MTS)
2018-12-17 11:55 ` Claudius Heine
2018-12-17 18:11 ` Tolga Hoşgör
2018-12-18 8:20 ` Claudius Heine [this message]
2019-01-17 14:08 ` [PATCH v2 0/2] isar-bootstrap: debootstrap https support Henning Schild
2019-01-17 14:21 ` Claudius Heine
2019-01-23 13:39 ` Maxim Yu. Osipov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27c2d5ed-42b3-c3d3-73df-e33bf4e99368@siemens.com \
--to=claudius.heine.ext@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=tlghosgor@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox