* [PATCH] bitbake: fetch2/git: Escape parentheses in git src name
@ 2024-03-10 3:33 Philippe Rivest
2024-04-13 10:20 ` [bitbake-devel] " Paulo Neves
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Rivest @ 2024-03-10 3:33 UTC (permalink / raw)
To: bitbake-devel; +Cc: Philippe Rivest, Philippe Rivest
From: Philippe Rivest <technophil98@gmail.com>
FIXES [YOCTO #15404]
When using git fetcher on a repo with parentheses in its URL, the
invocation of the git clone command will fail. The clone directory
is not quoted thus the shell will return an error and won't execute
the command.
(Bitbake rev: b5624ee5643d881afa004571a096a189ab5389b5)
Cc: Philippe Rivest <privest@genetec.com>
Signed-off-by: Philippe Rivest <technophil98@gmail.com>
---
bitbake/lib/bb/fetch2/git.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index b9dc576d47..6170da7fa6 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -277,7 +277,7 @@ class Git(FetchMethod):
ud.unresolvedrev[name] = ud.revisions[name]
ud.revisions[name] = self.latest_revision(ud, d, name)
- gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_'))
+ gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_').replace('(', '_').replace(')', '_'))
if gitsrcname.startswith('.'):
gitsrcname = gitsrcname[1:]
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [bitbake-devel] [PATCH] bitbake: fetch2/git: Escape parentheses in git src name
2024-03-10 3:33 [PATCH] bitbake: fetch2/git: Escape parentheses in git src name Philippe Rivest
@ 2024-04-13 10:20 ` Paulo Neves
2024-04-23 13:51 ` Philippe Rivest
0 siblings, 1 reply; 3+ messages in thread
From: Paulo Neves @ 2024-04-13 10:20 UTC (permalink / raw)
To: Philippe Rivest, bitbake-devel; +Cc: Philippe Rivest
[-- Attachment #1: Type: text/plain, Size: 2110 bytes --]
Have you considered quoting the git clone paths in the command?
Would there be side effects? Also perhaps a more robust set of
allowed characters would be better than increasing the list of replace calls?
Paulo Neves
On 3/10/24 04:33, Philippe Rivest wrote:
> From: Philippe Rivest
> [<technophil98@gmail.com>](mailto:technophil98@gmail.com)
> FIXES [YOCTO #15404]
>
> When using git fetcher on a repo with parentheses in its URL, the
> invocation of the git clone command will fail. The clone directory
> is not quoted thus the shell will return an error and won't execute
> the command.
>
> (Bitbake rev: b5624ee5643d881afa004571a096a189ab5389b5)
>
> Cc: Philippe Rivest
> [<privest@genetec.com>](mailto:privest@genetec.com)
> Signed-off-by: Philippe Rivest
> [<technophil98@gmail.com>](mailto:technophil98@gmail.com)
> ---
> bitbake/lib/bb/fetch2/git.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
> index b9dc576d47..6170da7fa6 100644
> --- a/bitbake/lib/bb/fetch2/git.py
> +++ b/bitbake/lib/bb/fetch2/git.py
> @@ -277,7 +277,7 @@ class Git(FetchMethod):
> ud.unresolvedrev[name] = ud.revisions[name]
> ud.revisions[name] = self.latest_revision(ud, d, name)
>
> - gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_'))
> + gitsrcname = '%s%s' % (ud.host.replace(':', '.'), ud.path.replace('/', '.').replace('*', '.').replace(' ','_').replace('(', '_').replace(')', '_'))
> if gitsrcname.startswith('.'):
> gitsrcname = gitsrcname[1:]
>
> --
> 2.40.0
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#15996):
> https://lists.openembedded.org/g/bitbake-devel/message/15996
> Mute This Topic:
> https://lists.openembedded.org/mt/104839313/4454782
> Group Owner:
> bitbake-devel+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/bitbake-devel/unsub
> [
> paulo@myneves.com
> ]
> -=-=-=-=-=-=-=-=-=-=-=-
[-- Attachment #2: Type: text/html, Size: 3081 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bitbake: fetch2/git: Escape parentheses in git src name
2024-04-13 10:20 ` [bitbake-devel] " Paulo Neves
@ 2024-04-23 13:51 ` Philippe Rivest
0 siblings, 0 replies; 3+ messages in thread
From: Philippe Rivest @ 2024-04-23 13:51 UTC (permalink / raw)
To: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
I considered quoting the clone directory. However, since the base implementation used replace calls, I followed suit.
Whenever there was a parenthesis in the repo name, the clone would fail with the original implementation.
There should not be any side effects: no released version of Bitbake/git fetcher has support for parentheses in
in the repo name.
I agree that a replacement list/map is a more scalable solution, but might come with a higher risk of side effects.
The same can be said for quoting the clone directory. Adding replace calls was a simple fix to a simple and narrow problem.
[-- Attachment #2: Type: text/html, Size: 627 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-04-23 13:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-10 3:33 [PATCH] bitbake: fetch2/git: Escape parentheses in git src name Philippe Rivest
2024-04-13 10:20 ` [bitbake-devel] " Paulo Neves
2024-04-23 13:51 ` Philippe Rivest
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.