Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 installation: Escaped asterisks while echoing ddev and docker sources as it list directory contents without it [skip ci] #4731

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

alexbogias
Copy link
Contributor

@alexbogias alexbogias commented Mar 9, 2023

The Issue

image

How This PR Solves The Issue

Manual Testing Instructions

Automated Testing Overview

Related Issue Link(s)

Release/Deployment Notes

@rfay
Copy link
Member

rfay commented Mar 9, 2023

Thanks for the work here.

Are you perhaps not using PowerShell v5? I've tested both of these scripts quite a number of times.

When you create a PR though, please give a description and explain what the issues are. A screenshot just isn't enough to explain it.

@alexbogias
Copy link
Contributor Author

Yes sorry I am using the latest:
PowerShell 7.3.3

@alexbogias
Copy link
Contributor Author

For example, Line 50 of your script:
wsl -u root -e bash -c 'echo \"deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *\" > /etc/apt/sources.list.d/ddev.list'
Gives me this content on /etc/apt/sources.list.d/ddev.list
image

@rfay
Copy link
Member

rfay commented Mar 9, 2023

As stated in the instructions, please run this with PowerShell 5.

I haven't been able to figure out a way to get it to work with both.

@rfay
Copy link
Member

rfay commented Mar 9, 2023

The provided PowerShell script can do most of the work for you, or you can handle these things manually. (This script works with the built-in PowerShell v5, but not with the newer v7.)

@rfay
Copy link
Member

rfay commented Mar 9, 2023

Maybe there's a way to detect the PS version and abort the script?

@alexbogias
Copy link
Contributor Author

I just tried with version 5, and you are right, it works good.
But my code looks good for both 5 and 7.
Feel free to close it or merge. Its up to you

@rfay
Copy link
Member

rfay commented Mar 9, 2023

It has to more than look good. It has to be tested with both.

If you can test this with both PS5 and PS7 successfully, we can go forward. Like I say, I didn't succeed.

But you need to avoid the trap of an existing setup. Not all the same things fail if you have already run it successfully once. So please create a new WSL2 distro each time when testing.

This was already approached in

@alexbogias
Copy link
Contributor Author

alexbogias commented Mar 10, 2023

Yes you are right. I now tested on both.
I install WSL Ubuntu 22.04 and set it to default. Tried with PowerShell 7.

PS 7 output
PS C:\Users\oMikR> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
PS C:\Users\oMikR> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/alexbogias/ddev/5580e3315cde30b5eb0aed3494d702a344a68c5f/scripts/install_ddev_wsl2_docker_inside.ps1'))
Chocolatey v1.3.0
Upgrading the following packages:
ddev;gsudo;mkcert
By upgrading, you accept licenses for the packages.
ddev v1.21.5 is the latest version available based on your source(s).
gsudo v2.0.4 is the latest version available based on your source(s).
mkcert v1.4.4 is the latest version available based on your source(s).

Chocolatey upgraded 0/3 packages.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The local CA is already installed in the system trust store! 👍


SUCCESS: Specified value was saved.
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:3 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Fetched 226 kB in 1s (373 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu4).
lsb-release set to manually installed.
ca-certificates is already the newest version (20211016ubuntu0.22.04.1).
ca-certificates set to manually installed.
curl is already the newest version (7.81.0-1ubuntu1.8).
curl set to manually installed.
gnupg is already the newest version (2.2.27-3ubuntu2.1).
gnupg set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Get:1 https://download.docker.com/linux/ubuntu jammy InRelease [48.9 kB]
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 https://download.docker.com/linux/ubuntu jammy/stable amd64 Packages [13.6 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:7 https://apt.fury.io/drud * InRelease
Get:8 https://apt.fury.io/drud */* amd64 Packages [4180 B]
Fetched 298 kB in 1s (276 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme at-spi2-core bc cpp cpp-11 dbus-user-session dconf-gsettings-backend dconf-service
...
  x11-xserver-utils xdg-utils
0 upgraded, 190 newly installed, 0 to remove and 0 not upgraded.
Need to get 222 MB of archives.
After this operation, 823 MB of additional disk space will be used.
Get:1 https://download.docker.com/linux/ubuntu jammy/stable amd64 containerd.io amd64 1.6.18-1 [28.2 MB]
...
Get:170 http://archive.ubuntu.com/ubuntu jammy/main amd64 libxft2 amd64 2.3.4-1 [41.8 kB]
Setting up libgdk-pixbuf2.0-bin (2.42.8+dfsg-1ubuntu0.2) ...
Setting up x11-utils (7.7+5build2) ...
Setting up libwww-perl (6.61-1) ...
Setting up adwaita-icon-theme (41.0-1ubuntu1) ...
update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up liblwp-protocol-https-perl (6.10-1) ...
Setting up libxml-parser-perl:amd64 (2.46-3build1) ...
Setting up libxml-twig-perl (1:3.52-1) ...
Setting up libnet-dbus-perl (1.2.0-1build3) ...
Setting up humanity-icon-theme (0.6.16) ...
Setting up ubuntu-mono (20.10-0ubuntu2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for libglib2.0-0:amd64 (2.72.4-0ubuntu1) ...
Setting up libgtk-3-0:amd64 (3.24.33-1ubuntu2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Setting up libgtk-3-bin (3.24.33-1ubuntu2) ...
Setting up libvte-2.91-0:amd64 (0.68.0-1) ...
Setting up libvted-3-0:amd64 (3.10.0-1ubuntu1) ...
Setting up at-spi2-core (2.44.0-3) ...
Setting up libgtkd-3-0:amd64 (3.10.0-1ubuntu1) ...
Setting up tilix (1.9.4-2build1) ...
update-alternatives: using /usr/bin/tilix.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in auto mode
Processing triggers for libgdk-pixbuf-2.0-0:amd64 (2.42.8+dfsg-1ubuntu0.2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
[sudo] password for alex:
CAROOT=/mnt/c/Users/oMikR/AppData/Local/mkcert
The local CA is now installed in the system trust store! ⚡️

 * Starting Docker: docker                                                                                       [ OK ]
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..
Downloading https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 ...
docker-compose 45.50 MiB / 45.50 MiB [=====================================================================] 100.00% 15s
Download complete.
 ITEM             VALUE
 DDEV version     v1.21.5
 architecture     amd64
 db               drud/ddev-dbserver-mariadb-10.4:v1.21.5
 dba              phpmyadmin:5
 ddev-ssh-agent   drud/ddev-ssh-agent:v1.21.5
 docker           23.0.1
 docker-compose   v2.16.0
 docker-platform  unstablebox
 mutagen          0.16.0
 os               linux
 router           drud/ddev-router:v1.21.5
 web              drud/ddev-webserver:v1.21.5

PS C:\Users\oMikR> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.3
PSEdition                      Core
GitCommitId                    7.3.3
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/docker.list'
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable

PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/ddev.list'
deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *

Then I installed WSL Ubuntu 20.04 and set it to default. Tried with PowerShell 5.

PS5 ouput ``` PS C:\Users\oMikR> wsl --install Ubuntu-20.04 Installing: Ubuntu 20.04 LTS Ubuntu 20.04 LTS has been installed. Launching Ubuntu 20.04 LTS... Installing, this may take a few minutes... Please create a default UNIX user account. The username does not need to match your Windows username. For more information visit: https://aka.ms/wslusers Enter new UNIX username: alex New password: Retype new password: passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), use "sudo ". See "man sudo_root" for details.

Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.15.90.1-microsoft-standard-WSL2 x86_64)

System information as of Fri Mar 10 11:41:35 EET 2023

System load: 0.22 Processes: 9
Usage of /: 0.1% of 1006.85GB Users logged in: 0
Memory usage: 3% IPv4 address for docker0: 172.17.0.1
Swap usage: 0% IPv4 address for eth0: 172.27.186.152

1 update can be applied immediately.
To see these additional updates run: apt list --upgradable

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

This message is shown once a day. To disable it please create the
/home/alex/.hushlogin file.
alex@unstablebox:~$ exit
logout
PS C:\Users\oMikR> wsl --set-default Ubuntu-20.04
The operation completed successfully.
PS C:\Users\oMikR> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
PS C:\Users\oMikR> iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/alexbogias/ddev/5580e3315cde30b5eb0aed3494d702a344a68c5f/scripts/install_ddev_wsl2_docker_inside.ps1'))
Chocolatey v1.3.0
Upgrading the following packages:
ddev;gsudo;mkcert
By upgrading, you accept licenses for the packages.
ddev v1.21.5 is the latest version available based on your source(s).
gsudo v2.0.4 is the latest version available based on your source(s).
mkcert v1.4.4 is the latest version available based on your source(s).

Chocolatey upgraded 0/3 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The local CA is already installed in the system trust store! 👍

SUCCESS: Specified value was saved.
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
...
Get:42 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 26.0 MB in 16s (1622 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu2).
lsb-release set to manually installed.
The following additional packages will be installed:
dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libcurl4
Suggested packages:
pinentry-gnome3 tor parcimonie xloadimage scdaemon
The following packages will be upgraded:
ca-certificates curl dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpg-wks-server gpgconf gpgsm
gpgv libcurl4
14 upgraded, 0 newly installed, 0 to remove and 176 not upgraded.
Need to get 3099 kB of archives.
After this operation, 7168 B disk space will be freed.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 gpg-wks-client amd64 2.2.19-3ubuntu2.2 [97.4 kB]
..
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.16 [235 kB]
Fetched 3099 kB in 3s (1082 kB/s)
Preconfiguring packages ...
(Reading database ... 32289 files and directories currently installed.)
Preparing to unpack .../00-gpg-wks-client_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-wks-client (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../01-dirmngr_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking dirmngr (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../02-gpg-wks-server_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-wks-server (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../03-gnupg-utils_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gnupg-utils (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../04-gpg-agent_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg-agent (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../05-gpg_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpg (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../06-gpgconf_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgconf (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../07-gnupg-l10n_2.2.19-3ubuntu2.2_all.deb ...
Unpacking gnupg-l10n (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../08-gnupg_2.2.19-3ubuntu2.2_all.deb ...
Unpacking gnupg (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../09-gpgsm_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgsm (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Preparing to unpack .../10-gpgv_2.2.19-3ubuntu2.2_amd64.deb ...
Unpacking gpgv (2.2.19-3ubuntu2.2) over (2.2.19-3ubuntu2.1) ...
Setting up gpgv (2.2.19-3ubuntu2.2) ...
(Reading database ... 32289 files and directories currently installed.)
Preparing to unpack .../ca-certificates_20211016ubuntu0.20.04.1_all.deb ...
Unpacking ca-certificates (20211016ubuntu0.20.04.1) over (2021011920.04.2) ...
Preparing to unpack .../curl_7.68.0-1ubuntu2.16_amd64.deb ...
Unpacking curl (7.68.0-1ubuntu2.16) over (7.68.0-1ubuntu2.7) ...
Preparing to unpack .../libcurl4_7.68.0-1ubuntu2.16_amd64.deb ...
Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.16) over (7.68.0-1ubuntu2.7) ...
Setting up ca-certificates (20211016ubuntu0.20.04.1) ...
Updating certificates in /etc/ssl/certs...
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
7 added, 11 removed; done.
Setting up gnupg-l10n (2.2.19-3ubuntu2.2) ...
Setting up gpgconf (2.2.19-3ubuntu2.2) ...
Setting up libcurl4:amd64 (7.68.0-1ubuntu2.16) ...
Setting up curl (7.68.0-1ubuntu2.16) ...
Setting up gpg (2.2.19-3ubuntu2.2) ...
Setting up gnupg-utils (2.2.19-3ubuntu2.2) ...
Setting up gpg-agent (2.2.19-3ubuntu2.2) ...
Setting up gpgsm (2.2.19-3ubuntu2.2) ...
Setting up dirmngr (2.2.19-3ubuntu2.2) ...
Setting up gpg-wks-server (2.2.19-3ubuntu2.2) ...
Setting up gpg-wks-client (2.2.19-3ubuntu2.2) ...
Setting up gnupg (2.2.19-3ubuntu2.2) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for install-info (6.7.0.dfsg.2-5) ...
Processing triggers for ca-certificates (20211016ubuntu0.20.04.1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
Get:1 https://download.docker.com/linux/ubuntu focal InRelease [57.7 kB]
Get:2 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [24.7 kB]
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu focal InRelease
Hit:5 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Get:7 https://apt.fury.io/drud * InRelease
Get:8 https://apt.fury.io/drud / amd64 Packages [4180 B]
Fetched 92.2 kB in 1s (106 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
176 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
wslu is already the newest version (2.3.6-0ubuntu2
20.04.0).
The following additional packages will be installed:
cpp cpp-9 docker-buildx-plugin docker-ce-rootless-extras docker-compose-plugin docker-scan-plugin gcc-9-base
...
perl-openssl-defaults pigz slirp4netns x11-xserver-utils xdg-utils
0 upgraded, 59 newly installed, 0 to remove and 176 not upgraded.
Need to get 137 MB of archives.
After this operation, 467 MB of additional disk space will be used.
Get:1 https://download.docker.com/linux/ubuntu focal/stable amd64 containerd.io amd64 1.6.18-1 [28.2 MB]
...
Get:39 http://archive.ubuntu.com/ubuntu focal/main amd64 libwww-robotrules-perl all 6.02-1 [12.6 kB]
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
invoke-rc.d: could not determine current runlevel
Setting up libfile-desktopentry-perl (0.22-1) ...
Setting up libwww-robotrules-perl (6.02-1) ...
Setting up libhtml-parser-perl (3.72-5) ...
Setting up cpp-9 (9.4.0-1ubuntu1~20.04.1) ...
Setting up libio-socket-ssl-perl (2.067-1) ...
Setting up libhttp-message-perl (6.22-1) ...
Setting up libhtml-form-perl (6.07-1) ...
Setting up libfile-mimeinfo-perl (0.29-1) ...
Setting up libhttp-negotiate-perl (6.01-1) ...
Setting up libhttp-cookies-perl (6.08-1) ...
Setting up libhtml-tree-perl (5.07-2) ...
Setting up libhtml-format-perl (2.12-1) ...
Setting up libnet-smtp-ssl-perl (1.04-1) ...
Setting up libmailtools-perl (2.21-1) ...
Setting up libhttp-daemon-perl (6.06-1ubuntu0.1) ...
Setting up cpp (4:9.3.0-1ubuntu2) ...
Setting up x11-xserver-utils (7.7+8) ...
Setting up liblwp-protocol-https-perl (6.07-2ubuntu2) ...
Setting up libwww-perl (6.43-1) ...
Setting up libxml-parser-perl (2.46-1) ...
Setting up libxml-twig-perl (1:3.50-2) ...
Setting up libnet-dbus-perl (1.2.0-1) ...
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Extracting templates from packages: 100%
[sudo] password for alex:
CAROOT=/mnt/c/Users/oMikR/AppData/Local/mkcert
The local CA is now installed in the system trust store! ⚡️

  • Starting Docker: docker [ OK ]
    Refreshing environment variables from registry for cmd.exe. Please wait...Finished..
    Downloading https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 ...
    docker-compose 45.50 MiB / 45.50 MiB [=====================================================================] 100.00% 15s
    Download complete.
    ITEM VALUE
    DDEV version v1.21.5
    architecture amd64
    db drud/ddev-dbserver-mariadb-10.4:v1.21.5
    dba phpmyadmin:5
    ddev-ssh-agent drud/ddev-ssh-agent:v1.21.5
    docker 23.0.1
    docker-compose v2.16.0
    docker-platform unstablebox
    mutagen 0.16.0
    os linux
    router drud/ddev-router:v1.21.5
    web drud/ddev-webserver:v1.21.5

PS C:\Users\oMikR> $PSVersionTable

Name Value


PSVersion 5.1.22621.963
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.963
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/docker.list'
deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable

PS C:\Users\oMikR> wsl -u root -e bash -c 'cat /etc/apt/sources.list.d/ddev.list'
deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *


</details>

@rfay
Copy link
Member

rfay commented Mar 10, 2023

I would love to have a solution that works both places. And of course I'd rather it be an installer instead of a script.

PS is very much an unfamiliar language, and nobody has pointed out why something as important as quoting would work differently between PS5 and PS7. But since 5 is the standard... we'll have to stick with it as preferred.

I'd love to have you come up with something that works both places.

@rfay rfay marked this pull request as draft March 10, 2023 14:02
@rfay rfay changed the title Escaped asterisks while echoing ddev and docker sources as it list directory contents without it WSL2 installation: Escaped asterisks while echoing ddev and docker sources as it list directory contents without it Mar 10, 2023
@rfay
Copy link
Member

rfay commented Mar 17, 2023

Closing this for now, but if you can either improve it by checking the PS version and saying "Can't do with PS 7" or edit it so it works both places, it will be very welcome. Thanks for giving it a try!

@rfay rfay closed this Mar 17, 2023
@alexbogias
Copy link
Contributor Author

alexbogias commented Mar 17, 2023

I already tried it in both versions and works for me. Maybe its my bad English. Sorry :(

@rfay
Copy link
Member

rfay commented Mar 17, 2023

You agreed that I was correct about the problem above in #4731 (comment) :)

You do have to start with a fresh WSL2 distro to demonstrate the problem. Running your version with PS7 and then PS5 will work, but running your version with a fresh WSL2 and PS5 will not.

Again, if you can either improve it by checking the PS version and saying "Can't do with PS 7" or edit it so it works both places, it will be very welcome

@alexbogias
Copy link
Contributor Author

Yes I said that you were correct that PS5 worked just fine with your code.
I then tried mine to both versions and I also included outputs with both and new distros and you can see that nothing failed.

@rfay
Copy link
Member

rfay commented Mar 17, 2023

Sorry, I guess we're having language difficulties. I think you know I carefully tested the exact same PR in

and found it didn't work with PS5. Is there are difference between your PR and that one?

@alexbogias
Copy link
Contributor Author

alexbogias commented Mar 17, 2023

Yeah looks different:

Mine:
wsl -u root -e bash -c 'echo deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ \* \* > /etc/apt/sources.list.d/ddev.list'

And scarselli:
wsl -u root -e bash -c 'echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" > /etc/apt/sources.list.d/ddev.list'

@rfay
Copy link
Member

rfay commented Mar 17, 2023

Ah, so your is not using the nested double-quotes at all. Maybe it could work. Thanks for looking closely. I don't like echoing random content without quotes but you've escaped the asterisks so it's more-or-less safe. I'll reopen and hope to test this in coming days. As you know (thanks) it's a bit of work :)

@rfay rfay reopened this Mar 17, 2023
@rfay rfay marked this pull request as ready for review March 17, 2023 13:16
@alexbogias
Copy link
Contributor Author

Thanks a lot for your time @rfay

@rfay rfay changed the title WSL2 installation: Escaped asterisks while echoing ddev and docker sources as it list directory contents without it WSL2 installation: Escaped asterisks while echoing ddev and docker sources as it list directory contents without it [skip ci] Mar 17, 2023
@alexbogias alexbogias requested a review from a team as a code owner March 23, 2023 17:58
@alexbogias
Copy link
Contributor Author

Removed duplicated line for docker.list file

@rfay
Copy link
Member

rfay commented Mar 23, 2023

Thanks for your effort on this, it's going to help a lot. You seem very confident of your testing, so please update the install doc with the PR to remove the constraints about PS5. I'm way behind on PRs will will get there. And this one takes some effort to test as you already know.

@rfay rfay marked this pull request as draft April 6, 2023 22:57
@rfay
Copy link
Member

rfay commented Apr 7, 2023

I updated the docker-desktop script and the docs and tested on PS5 and PS7, thanks for solving this!

@rfay rfay marked this pull request as ready for review April 7, 2023 14:21
@rfay rfay requested a review from a team as a code owner April 7, 2023 14:21
Copy link
Sponsor Collaborator

@mattstein mattstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh, I’m fond of removing docs because life is better and requires fewer warnings. Looks great to me! 👏

@mattstein mattstein self-requested a review April 7, 2023 16:45
@rfay rfay merged commit c74a8ae into ddev:master Apr 7, 2023
@alexbogias alexbogias deleted the patch-2 branch April 8, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants