* [PATCH] isar-bootstrap: Fail on invalid apt source list
@ 2021-11-16 9:59 Anton Mikanovich
2021-11-17 17:12 ` Henning Schild
0 siblings, 1 reply; 3+ messages in thread
From: Anton Mikanovich @ 2021-11-16 9:59 UTC (permalink / raw)
To: isar-users; +Cc: Anton Mikanovich
Returning empty list leads to ambiguous errors, so we should fail early
if distro sources.list is empty or incorrect.
Fix issue #72
Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index e9f92916..20a9afaf 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -163,11 +163,10 @@ def generate_distro_sources(d):
yield parsed
def get_distro_primary_source_entry(d):
- apt_sources_list = get_aptsources_list(d)
for source in generate_distro_sources(d):
if source[0] == "deb":
return source[2:]
- return ["", "", ""]
+ bb.fatal('Invalid apt sources list')
def get_distro_have_https_source(d):
return any(source[2].startswith("https://") for source in generate_distro_sources(d))
--
2.20.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] isar-bootstrap: Fail on invalid apt source list
2021-11-16 9:59 [PATCH] isar-bootstrap: Fail on invalid apt source list Anton Mikanovich
@ 2021-11-17 17:12 ` Henning Schild
2021-11-18 6:50 ` Anton Mikanovich
0 siblings, 1 reply; 3+ messages in thread
From: Henning Schild @ 2021-11-17 17:12 UTC (permalink / raw)
To: Anton Mikanovich; +Cc: isar-users
Am Tue, 16 Nov 2021 12:59:07 +0300
schrieb Anton Mikanovich <amikan@ilbers.de>:
> Returning empty list leads to ambiguous errors, so we should fail
> early if distro sources.list is empty or incorrect.
>
> Fix issue #72
Not sure that will work. In case you want github to close on "master"
merge.
Fixes
Closes
should work
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
> e9f92916..20a9afaf 100644 ---
> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -163,11
> +163,10 @@ def generate_distro_sources(d): yield parsed
>
> def get_distro_primary_source_entry(d):
> - apt_sources_list = get_aptsources_list(d)
maybe that should be its own patch? Looks like a drive-by fix.
> for source in generate_distro_sources(d):
> if source[0] == "deb":
> return source[2:]
> - return ["", "", ""]
> + bb.fatal('Invalid apt sources list')
I did a bit of digging in history. Seems like bbfatal is the right
thing, the empty strings seem to not have had any deeper meaning.
Henning
> def get_distro_have_https_source(d):
> return any(source[2].startswith("https://") for source in
> generate_distro_sources(d))
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] isar-bootstrap: Fail on invalid apt source list
2021-11-17 17:12 ` Henning Schild
@ 2021-11-18 6:50 ` Anton Mikanovich
0 siblings, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2021-11-18 6:50 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
17.11.2021 20:12, Henning Schild wrote:
> Am Tue, 16 Nov 2021 12:59:07 +0300
> schrieb Anton Mikanovich <amikan@ilbers.de>:
>
>> Returning empty list leads to ambiguous errors, so we should fail
>> early if distro sources.list is empty or incorrect.
>>
>> Fix issue #72
> Not sure that will work. In case you want github to close on "master"
> merge.
>
> Fixes
> Closes
>
> should work
> https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
This format will be shown inside the issue like `username added a commit
that referenced this issue` whenever it pushed. See
https://github.com/ilbers/isar/issues/73 as reference.
We are not using pull requests, so not sure if more deep integration is
really needed.
>> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
>> ---
>> meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index
>> e9f92916..20a9afaf 100644 ---
>> a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++
>> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -163,11
>> +163,10 @@ def generate_distro_sources(d): yield parsed
>>
>> def get_distro_primary_source_entry(d):
>> - apt_sources_list = get_aptsources_list(d)
> maybe that should be its own patch? Looks like a drive-by fix.
Ok, will separate in v2.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-18 6:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 9:59 [PATCH] isar-bootstrap: Fail on invalid apt source list Anton Mikanovich
2021-11-17 17:12 ` Henning Schild
2021-11-18 6:50 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox