From ecc4c2bd1c2004970e2627f945d3136b28f7f3e5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 15 May 2023 16:22:47 +0200 Subject: [PATCH 1/2] tests: flake8 not happy about escape sequence in comment @_@ --- src/utils/resources.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index 8e775e109..9891fe9c6 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -294,9 +294,9 @@ class SourcesResource(AppResource): armhf.sha256 = "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865" autoupdate.strategy = "latest_github_release" - autoupdate.asset.amd64 = ".*\.amd64.tar.gz" - autoupdate.asset.i386 = ".*\.386.tar.gz" - autoupdate.asset.armhf = ".*\.arm.tar.gz" + autoupdate.asset.amd64 = ".*\\.amd64.tar.gz" + autoupdate.asset.i386 = ".*\\.386.tar.gz" + autoupdate.asset.armhf = ".*\\.arm.tar.gz" [resources.sources.zblerg] url = "https://zblerg.com/download/zblerg" From d698c4c3de91b7e835ff7885a11d356f30e61b00 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 15 May 2023 16:43:36 +0200 Subject: [PATCH 2/2] helpers: improve error message for corrupt source in ynh_setup_source, it's more relevant to cite the source url rather than the downloaded output path --- helpers/utils | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/utils b/helpers/utils index 6b069a021..489c5c261 100644 --- a/helpers/utils +++ b/helpers/utils @@ -271,9 +271,9 @@ ynh_setup_source() { if ! echo "${src_sum} ${src_filename}" | ${src_sumprg} --check --status then local actual_sum="$(${src_sumprg} ${src_filename} | cut --delimiter=' ' --fields=1)" - local actual_size="$(du -hs ${src_filename} | cut --delimiter=' ' --fields=1)" + local actual_size="$(du -hs ${src_filename} | cut --fields=1)" rm -f ${src_filename} - ynh_die --message="Corrupt source for ${src_filename}: Expected ${src_sum} but got ${actual_sum} (size: ${actual_size})." + ynh_die --message="Corrupt source for ${src_url}: Expected sha256sum to be ${src_sum} but got ${actual_sum} (size: ${actual_size})." fi fi