package/pkg-generic.mk: add missing quotes
PATCH 1/1 package/pkg-generic.mk: add missing quotes
This allows <PKG>_SOURCE to contain characters like &.
--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +1 -1
@@ -176,7 +176,7 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES)) $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded - $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ + $(Q)for p in "$($(PKG)_ALL_DOWNLOADS)"; do \ if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \
Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 3 lines · Simon Richter via buildroot
This allows <PKG>_SOURCE to contain characters like
&.Signed-off-by Simon Richter <[email protected]>
It is a bad idea to have such name, but it makes sense.
LGTM
Quoted 24 lines
--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/pkg-generic.mk +1
-1@@ -176,7 +176,7 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES)) $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded - $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ + $(Q)for p in "$($(PKG)_ALL_DOWNLOADS)"; do \ if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Am 20.11.24 um 09:03 schrieb Vincent Jardin:
Quoted 5 lines · Simon Richter via buildroot
Quoted 3 lines
This allows <PKG>_SOURCE to contain characters like
&.Signed-off-by Simon Richter <[email protected]>It is a bad idea to have such name, but it makes sense.
I agree. I am trying to download a file from a private file share in Azure DevOps.
For authentication, I need to add some data to the URL, separated by '?' or '&':
<PKG>_SOURCE = <FILE>?foo&bar&baz&blah
If there is a better way to solve this, I will be happy to implement it.
Regards,
Simon
Quoted 24 lines
LGTM
Reviewed-by Vincent Jardin <[email protected]>Quoted 20 lines
--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/pkg-generic.mk +1
-1@@ -176,7 +176,7 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES)) $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded - $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ + $(Q)for p in "$($(PKG)_ALL_DOWNLOADS)"; do \ if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \Signature · 1 line
2.47.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Simon,
Quoted 1 line · Simon Richter
If there is a better way to solve this, I will be happy to implement it.
$ echo "foo&b a;r" | sed 's/&/%26/g; s/?/%3F/g; s/;/%3B/g; s/ /%20/g' foo%26b%20a%3Br
best regards,
Vincent
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Simon, All,
On 2024-11-20 08:37 +0100, Simon Richter via buildroot spake thusly:
Quoted 12 lines
This allows <PKG>_SOURCE to contain characters like
&.Signed-off-by Simon Richter <[email protected]>--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/pkg-generic.mk +0
-0
package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_downloaded: · line 179
Quoted 5 lines
package/pkg-generic.mk +1
-1@@ -176,7 +176,7 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES)) $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded - $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ + $(Q)for p in "$($(PKG)_ALL_DOWNLOADS)"; do \
What this change is doing is basically make the for-loop useless.
$($(PKG)_ALL_DOWNLOADS) is a space-separated list, that may contain more than one item, so it must not be quoted.
See for example the cvs package:
$ make defconfig
$ make show-vars 2>&1 |jq .CVS_ALL_DOWNLOADS
{
"expanded": "http+http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/c/cvs/cvs_1.12.13.orig.tar.gz http+http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/c/cvs/cvs_1.12.13-12+squeeze1.diff.gz",
"raw": "$(CVS_MAIN_DOWNLOAD) $(CVS_ADDITIONAL_DOWNLOADS)"
}So, this is not the proper solution to your issue.
Indeed, having & in a filename is really asking for trouble all along the way! :-/ As this is a downloaded file, have you tried URL-escaping the & with '%26' instead? If it works, that would give a one-off solution for your case, but maybe we need to handle that in a generic way (somehow)...
Regards,
Yann E. MORIN.
Quoted 10 lines
package/pkg-generic.mk +0
-0if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 23 lines
____________ .-----------------.--------------------: _ :------------------. | Yann E. MORIN | Real-Time Embedded | __/ ) | /"\ ASCII RIBBON | | | Software Designer | _/ - /' | \ / CAMPAIGN | | +33 638.411.245 '--------------------: (_ `--, | X AGAINST | | yann.morin (at) orange.com |_=" ,--' | / \ HTML MAIL | '--------------------------------------:______/_____:------------------' ____________________________________________________________________________________________________________ Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration, Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci. This message and its attachments may contain confidential or privileged information that may be protected by law; they should not be distributed, used or copied without authorisation. If you have received this email in error, please notify the sender and delete this message and its attachments. As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified. Thank you. _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Yann, hi Vincent,
Am 20.11.24 um 09:38 schrieb [email protected]:
Quoted 27 lines
Simon, All,
On 2024-11-20 08:37 +0100, Simon Richter via buildroot spake thusly:
Quoted 12 lines
This allows <PKG>_SOURCE to contain characters like
&.Signed-off-by Simon Richter<[email protected]>--- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)package/pkg-generic.mk +0
-0package/pkg-generic.mk $(BUILD_DIR)/%/.stamp_downloaded: · line 179
Quoted 5 lines
package/pkg-generic.mk +1
-1@@ -176,7 +176,7 @@ $(BUILD_DIR)/%/.stamp_downloaded: $(call prepare-per-package-directory,$($(PKG)_FINAL_DOWNLOAD_DEPENDENCIES)) $(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep)) # Only show the download message if it isn't already downloaded - $(Q)for p in $($(PKG)_ALL_DOWNLOADS); do \ + $(Q)for p in "$($(PKG)_ALL_DOWNLOADS)"; do \What this change is doing is basically make the for-loop useless.
$($(PKG)_ALL_DOWNLOADS) is a space-separated list, that may contain more than one item, so it must not be quoted.
See for example the cvs package:
Quoted 8 lines
$ make defconfig $ make show-vars 2>&1 |jq .CVS_ALL_DOWNLOADS { "expanded": "http+http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/c/cvs/cvs_1.12.13.orig.tar.gz http+http://snapshot.debian.org/archive/debian/20141023T043132Z/pool/main/c/cvs/cvs_1.12.13-12+squeeze1.diff.gz", "raw": "$(CVS_MAIN_DOWNLOAD) $(CVS_ADDITIONAL_DOWNLOADS)" }So, this is not the proper solution to your issue.
Thanks for the explanation. You're right of course, we can't apply the patch like that, I should have seen that too.
Quoted 5 lines
Indeed, having
&in a filename is really asking for trouble all along the way! :-/ As this is a downloaded file, have you tried URL-escaping the&with '%26' instead? If it works, that would give a one-off solution for your case, but maybe we need to handle that in a generic way (somehow)...
I tried to encode the URL (thanks @Vincent), but Azure doesn't like it:
400 The value for one of the HTTP headers is not in the correct format.
Our current solution is to abuse <PKG>_DL_OPTS as we don't need the variable (with our packages to be loaded via Azure). We have our own download script (a customized copy of support/download/wget):
<while getopts>
shift $((OPTIND-1))
sas="$1”
shift
url=${url#*+*+} # remove the 'azcopy+' before 'https://...' _wget() {
echo ${WGET} “${@}”
eval ${WGET} “${@}”
}
_wget -O “‘${output}’” “‘${url}/${filename}${sas}’”
In my opinion this is more of a hack than a solution.
Do you have any ideas on how we could solve this properly (so that we can bring it upstream)?
Thanks and regards,
Simon
Quoted 13 lines
Regards,
Yann E. MORIN.Quoted 10 lines
package/pkg-generic.mk +0
-0if test ! -e $($(PKG)_DL_DIR)/`basename $$p` ; then \ $(call MESSAGE,"Downloading") ; \ break ; \Signature · 6 lines
2.47.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Hi Simon,
Raising this thread from the dead...
Quoted 4 lines · Simon Richter via buildroot
Hi Yann, hi Vincent,
Am 20.11.24 um 09:38 schrieb [email protected]:
Quoted 1 line
Simon, All,
[snip]
Quoted 7 lines
Quoted 5 lines
Indeed, having
&in a filename is really asking for trouble all along the way! :-/ As this is a downloaded file, have you tried URL-escaping the&with '%26' instead? If it works, that would give a one-off solution for your case, but maybe we need to handle that in a generic way (somehow)...I tried to encode the URL (thanks @Vincent), but Azure doesn't like it:
400 The value for one of the HTTP headers is not in the correct format.
Have you tried simply adding quotes in the .mk file? So
<PKG>_SOURCE = '<FILE>?foo&bar&baz&blah'
Regards,
Arnout
Quoted 35 lines
Our current solution is to abuse <PKG>_DL_OPTS as we don't need the variable (with our packages to be loaded via Azure). We have our own download script (a customized copy of support/download/wget):
<while getopts>
shift $((OPTIND-1))
sas="$1”
shift
url=${url#*+*+} # remove the 'azcopy+' before 'https://...'_wget(){
echo ${WGET} “${@}”
eval ${WGET} “${@}”
}
_wget-O “‘${output}’” “‘${url}/${filename}${sas}’”In my opinion this is more of a hack than a solution.
Do you have any ideas on how we could solve this properly (so that we can bring it upstream)?
Thanks and regards,
SimonQuoted 9 lines
Regards,
Yann E. MORIN.Quoted 6 lines
if test ! -e $($(PKG)_DL_DIR)/
basename $$p; then \
$(call MESSAGE,"Downloading") ; \
break ; \Signature · 1 line
2.47.0
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot