diff options
| author | Robbin Van Damme <robbinvandamme@gmail.com> | 2025-06-01 22:15:05 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-06-02 22:17:43 +0100 |
| commit | a2f77bbe0fd564e0b95df15c27f2c6a3b15c7be7 (patch) | |
| tree | 743b6ac3297366f6819a74c44f6b48c76a64214c | |
| parent | 47ff241a845961d75761f05c76a5712622a2c5a6 (diff) | |
| download | poky-a2f77bbe0fd564e0b95df15c27f2c6a3b15c7be7.tar.gz | |
bitbake: fetch/az: Add sanity check and clarify documentation
AZ_SAS token should be prefixed with a question mark. Add a sanity check for
this and fix the documentation.
[YOCTO #15882]
(Bitbake rev: 22011765202514600314732b97f1bb938e21f585)
Signed-off-by: Robbin Van Damme <robbinvandamme@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | 4 | ||||
| -rw-r--r-- | bitbake/lib/bb/fetch2/az.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst index fb4f0a23d7..eac3cbdfb5 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.rst | |||
| @@ -686,9 +686,9 @@ Such functionality is set by the variable: | |||
| 686 | delegate access to resources, if this variable is set, the Az Fetcher will | 686 | delegate access to resources, if this variable is set, the Az Fetcher will |
| 687 | use it when fetching artifacts from the cloud. | 687 | use it when fetching artifacts from the cloud. |
| 688 | 688 | ||
| 689 | You can specify the AZ_SAS variable as shown below:: | 689 | You can specify the AZ_SAS variable prefixed with a ? as shown below:: |
| 690 | 690 | ||
| 691 | AZ_SAS = "se=2021-01-01&sp=r&sv=2018-11-09&sr=c&skoid=<skoid>&sig=<signature>" | 691 | AZ_SAS = "?se=2021-01-01&sp=r&sv=2018-11-09&sr=c&skoid=<skoid>&sig=<signature>" |
| 692 | 692 | ||
| 693 | Here is an example URL:: | 693 | Here is an example URL:: |
| 694 | 694 | ||
diff --git a/bitbake/lib/bb/fetch2/az.py b/bitbake/lib/bb/fetch2/az.py index 346124a8bf..1d3664f213 100644 --- a/bitbake/lib/bb/fetch2/az.py +++ b/bitbake/lib/bb/fetch2/az.py | |||
| @@ -36,6 +36,8 @@ class Az(Wget): | |||
| 36 | 36 | ||
| 37 | az_sas = d.getVar('AZ_SAS') | 37 | az_sas = d.getVar('AZ_SAS') |
| 38 | if az_sas and az_sas not in ud.url: | 38 | if az_sas and az_sas not in ud.url: |
| 39 | if not az_sas.startswith('?'): | ||
| 40 | raise FetchError("When using AZ_SAS, it must start with a '?' character to mark the start of the query-parameters.") | ||
| 39 | ud.url += az_sas | 41 | ud.url += az_sas |
| 40 | 42 | ||
| 41 | return Wget.checkstatus(self, fetch, ud, d, try_again) | 43 | return Wget.checkstatus(self, fetch, ud, d, try_again) |
| @@ -62,6 +64,8 @@ class Az(Wget): | |||
| 62 | az_sas = d.getVar('AZ_SAS') | 64 | az_sas = d.getVar('AZ_SAS') |
| 63 | 65 | ||
| 64 | if az_sas: | 66 | if az_sas: |
| 67 | if not az_sas.startswith('?'): | ||
| 68 | raise FetchError("When using AZ_SAS, it must start with a '?' character to mark the start of the query-parameters.") | ||
| 65 | azuri = '%s%s%s%s' % ('https://', ud.host, ud.path, az_sas) | 69 | azuri = '%s%s%s%s' % ('https://', ud.host, ud.path, az_sas) |
| 66 | else: | 70 | else: |
| 67 | azuri = '%s%s%s' % ('https://', ud.host, ud.path) | 71 | azuri = '%s%s%s' % ('https://', ud.host, ud.path) |
