<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15404</bug_id>
          
          <creation_ts>2024-02-16 16:06:42 +0000</creation_ts>
          <short_desc>git fetcher: Git clone invocation fails when URL contains parentheses</short_desc>
          <delta_ts>2024-10-17 20:24:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>2.0.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Rivest">privest</reporter>
          <assigned_to name="Randy MacLeod">randy.macleod</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98223</commentid>
    <comment_count>0</comment_count>
      <attachid>5015</attachid>
    <who name="Philippe Rivest">privest</who>
    <bug_when>2024-02-16 16:06:42 +0000</bug_when>
    <thetext>Created attachment 5015
Proposed patch to escape parentheses in git fetcher

# Summary:

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&apos;t execute the command.

# To reproduce:

1. Create a recipe using git fetcher with a repo containing parentheses. (example SRC_URI: &quot;git://mygit.com/my%28repo%29name;protocol=https;rev=22c569f770d8b5594dc5661f99a92e7a0c042d26&quot;)

2. Run bitbake my-recipe

# Actual result (from log.do_fetch):

```
DEBUG: Fetcher accessed the network with the command LANG=C git clone --bare --mirror &apos;https://mygit.com/my(repo)name&apos; /data/privest/YoctoProject/build/downloads//git2/my(repo)name --progress
/bin/sh: 1: Syntax error: &quot;(&quot; unexpected
```

# Expected result:

Should clone the repo successfully.
A solution would be to escape parentheses from the srcname. See the attached patch.

# Build Configuration: 

BB_VERSION           = &quot;2.0.0&quot;
BUILD_SYS            = &quot;x86_64-linux&quot;
NATIVELSBSTRING      = &quot;ubuntu-22.04&quot;
meta
meta-poky            = &quot;kirkstone:0b39955d14600257a6eafc211fd68a933c69a0e9&quot;
meta-yocto-bsp       = &quot;kirkstone:0b39955d14600257a6eafc211fd68a933c69a0e9&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98258</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-02-22 15:39:21 +0000</bug_when>
    <thetext>It&apos;s a simple patch. Philippe, can you send the patch to the email list?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98446</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Rivest">privest</who>
    <bug_when>2024-03-10 03:34:51 +0000</bug_when>
    <thetext>(In reply to Randy MacLeod from comment #1)
&gt; It&apos;s a simple patch. Philippe, can you send the patch to the email list?

A properly formatted patch was sent to the bitbake-devel@lists.openembedded.org mailing list. Thank you!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98477</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-03-14 15:08:13 +0000</bug_when>
    <thetext>Thanks Philippe.
Richard expects to merge this to master soon and I&apos;ll add a link when he does that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99937</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-10-17 20:24:27 +0000</bug_when>
    <thetext>Fixed by:
https://git.openembedded.org/bitbake/commit/?id=12f9738577934ad7c99f0770f1392a9d6050e7d6

bitbake on master
❯ git branch -a --contains 12f9738577934ad7c99f0770f1392a9d6050e7d6
* master
  remotes/origin/2.10
  remotes/origin/2.8
  remotes/origin/HEAD -&gt; origin/master
  remotes/origin/master

Thanks Philippe!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>5015</attachid>
            <date>2024-02-16 16:06:42 +0000</date>
            <delta_ts>2024-02-16 16:06:42 +0000</delta_ts>
            <desc>Proposed patch to escape parentheses in git fetcher</desc>
            <filename>0001-Escape-parentheses-in-git-src-name-in-git-fetcher.patch</filename>
            <type>application/mbox</type>
            <size>1045</size>
            <attacher name="Philippe Rivest">privest</attacher>
            
              <data encoding="base64">RnJvbSA1NjIxNDUyOWU0OWNkNGIxNTY0MTFhMzk1NmQ5YjQ5NmExYjQ1ZGJhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwZSBSaXZlc3QgPHByaXZlc3RAZ2VuZXRlYy5jb20+
CkRhdGU6IEZyaSwgMTYgRmViIDIwMjQgMTA6NTc6MzcgLTA1MDAKU3ViamVjdDogW1BBVENIXSBF
c2NhcGUgcGFyZW50aGVzZXMgaW4gZ2l0IHNyYyBuYW1lIGluIGdpdCBmZXRjaGVyCgotLS0KIGJp
dGJha2UvbGliL2JiL2ZldGNoMi9naXQucHkgfCAyICstCiAxIGZpbGUgY2hhbmdlZCwgMSBpbnNl
cnRpb24oKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS9iaXRiYWtlL2xpYi9iYi9mZXRj
aDIvZ2l0LnB5IGIvYml0YmFrZS9saWIvYmIvZmV0Y2gyL2dpdC5weQppbmRleCA0ZDZlNTdhZGU3
Li41MjdlNWUwZTE0IDEwMDY0NAotLS0gYS9iaXRiYWtlL2xpYi9iYi9mZXRjaDIvZ2l0LnB5Cisr
KyBiL2JpdGJha2UvbGliL2JiL2ZldGNoMi9naXQucHkKQEAgLTI1Niw3ICsyNTYsNyBAQCBjbGFz
cyBHaXQoRmV0Y2hNZXRob2QpOgogICAgICAgICAgICAgICAgICAgICB1ZC51bnJlc29sdmVkcmV2
W25hbWVdID0gdWQucmV2aXNpb25zW25hbWVdCiAgICAgICAgICAgICAgICAgdWQucmV2aXNpb25z
W25hbWVdID0gc2VsZi5sYXRlc3RfcmV2aXNpb24odWQsIGQsIG5hbWUpCiAKLSAgICAgICAgZ2l0
c3JjbmFtZSA9ICclcyVzJyAlICh1ZC5ob3N0LnJlcGxhY2UoJzonLCAnLicpLCB1ZC5wYXRoLnJl
cGxhY2UoJy8nLCAnLicpLnJlcGxhY2UoJyonLCAnLicpLnJlcGxhY2UoJyAnLCdfJykpCisgICAg
ICAgIGdpdHNyY25hbWUgPSAnJXMlcycgJSAodWQuaG9zdC5yZXBsYWNlKCc6JywgJy4nKSwgdWQu
cGF0aC5yZXBsYWNlKCcvJywgJy4nKS5yZXBsYWNlKCcqJywgJy4nKS5yZXBsYWNlKCcgJywnXycp
LnJlcGxhY2UoJygnLCAnXycpLnJlcGxhY2UoJyknLCAnXycpKQogICAgICAgICBpZiBnaXRzcmNu
YW1lLnN0YXJ0c3dpdGgoJy4nKToKICAgICAgICAgICAgIGdpdHNyY25hbWUgPSBnaXRzcmNuYW1l
WzE6XQogCi0tIAoyLjQwLjAKCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>