r-darwish / topgrade

Upgrade everything
GNU General Public License v3.0
3.36k stars 160 forks source link

Support multiple WSL distributions (fix #855) #858

Closed r-darwish closed 2 years ago

r-darwish commented 2 years ago

@Lim-Dul can you test this feature?

Lim-Dul commented 2 years ago

Yes I could. Do I have to compile from source or are there automated development builds available somewhere? The links on the README.md lead me to outdated URLs.

r-darwish commented 2 years ago

Just clone this branch and run cargo run

Lim-Dul commented 2 years ago

OK, took me a bit since I needed to set up Rust and gcc on the machine I'm on.

~~Unfortunately, test failed. Default Linux distro (Ubuntu in this case) updated, second Linux distro was left out. Everything else worked.~~

OS Info:

Edition Windows 11 Pro
Version 21H2
Installed on    ‎2022-‎01-‎26
OS build    22000.493
Experience  Windows Feature Experience Pack 1000.22000.493.0

Executed via PowerShell 7.2.1.

image image image image image

Last screenshot showing the command as it would have worked for Kali:

wsl -d kali-linux -- topgrade

Or

wsl -d kali-linux topgrade

Or

wsl -d kali-linux -e topgrade

The latter -e version skips shell, which might not be such a good idea since e.g. PATH set in e.g. .bashrc is not loaded as we see for instance for the pip3 update and the corresponding warning, which doesn't happen if I run topgrade directly from within an interactive shell.

I read in the commit that the command being run through

bash -c topgrade

perhaps it'd be better to run it just via wsl -d <distro> topgrade in general for those few bash-less configurations out there (e.g. running dash as system shell and, dunno, zsh for interactive). Alternatively

P.S. Don't know why neofetch claims I'm on Win10 though I believe even the PowerShell system info shows Win11 only as a flavor of Win10.

Lim-Dul commented 2 years ago

Oh man! Scratch all my comments! It's all my fault. I pulled the develop branch instead of topgrade-855. It works beautifully (apart from the fact that it runs bash instead of passing the commands via '--' as written above) sorry for the incorrect test report!

image

Sorry for potentially wasting your time on a non-bug. :(

r-darwish commented 2 years ago

I tried switching it to -- but it didn't detect Topgrade. I think that bash don't reload .profile when -- is used. If this works as expected then I'll merge it as it is