From b2b1ab39add0cf505cd2d045797eb8e143810f53 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Tue, 27 Dec 2022 11:02:18 +0100 Subject: [PATCH 01/44] Ensure conf file is installed in the etc/wslu/ directory --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 42611177..d4ebbfbe 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ res_install: install -Dm 644 src/etc/conf $(DESTDIR)$(PREFIX)/share/wslu conf_install: - install -Dm 644 src/etc/user/conf $(DESTDIR)/etc/wslu + install -Dm 644 src/etc/user/conf -t $(DESTDIR)/etc/wslu clean: rm -rf $(OUTPATH) From 7f2bcdc1b169bcf8a4676e86cabfded3a29de386 Mon Sep 17 00:00:00 2001 From: Patrick Wu Date: Fri, 30 Dec 2022 18:56:38 +0800 Subject: [PATCH 02/44] Update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7096a11f..00cf9325 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.0-1 +4.1.1-1 From a5cba04290822ed0796ce4bd55bef772d0e9825c Mon Sep 17 00:00:00 2001 From: iskandarma Date: Thu, 12 Jan 2023 00:12:00 +0800 Subject: [PATCH 03/44] bugfix: sysdrive_prefix returning wrong label when Windows installed at label other than C: --- src/wslu-header | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/wslu-header b/src/wslu-header index 5f339250..a1e75c97 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -206,14 +206,13 @@ function interop_prefix { } function sysdrive_prefix { - win_location="$(interop_prefix)" hard_reset=0 - for pt in "$win_location"/*; do + for pt in "$(interop_prefix)"/*; do [[ -e "$pt" ]] || break if [ "$(echo "$pt" | wc -l)" -eq 1 ]; then - if [ -d "$win_location$pt/Windows/System32" ]; then + if [ -d "$pt/Windows/System32" ]; then hard_reset=1 - win_location="$pt" + win_location="$(echo "$pt" | sed -e 's,^'"$(interop_prefix)"'/,,')" break fi fi From 1c2e96334c290090d63e0ead00400288a77fadc2 Mon Sep 17 00:00:00 2001 From: iskandarma Date: Tue, 24 Jan 2023 23:25:11 +0800 Subject: [PATCH 04/44] replace `sed` with simple `basename` --- src/wslu-header | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wslu-header b/src/wslu-header index a1e75c97..e4e695ea 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -212,7 +212,7 @@ function sysdrive_prefix { if [ "$(echo "$pt" | wc -l)" -eq 1 ]; then if [ -d "$pt/Windows/System32" ]; then hard_reset=1 - win_location="$(echo "$pt" | sed -e 's,^'"$(interop_prefix)"'/,,')" + win_location="$(basename "$pt")" break fi fi From f68117f69e4e4dfc00029319ec3f8f87425a4bb2 Mon Sep 17 00:00:00 2001 From: Charlie Jones Date: Tue, 14 Mar 2023 15:13:23 -0500 Subject: [PATCH 05/44] Add support for Rocky to installer --- extras/scripts/wslu-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/scripts/wslu-install b/extras/scripts/wslu-install index ad82d3e5..82cdeba4 100644 --- a/extras/scripts/wslu-install +++ b/extras/scripts/wslu-install @@ -24,7 +24,7 @@ case $distro in Alpine*) sudo apk add git;; Arch*) sudo pacman -Syyu git --noconfirm;; Scientific*) sudo yum install -y git;; - *Fedora*) sudo dnf install -y git;; + *Fedora*|*Rocky*) sudo dnf install -y git;; *Gentoo*) sudo emerge -a n dev-vcs/git;; *Generic*) [ "fedora" == "$(cat /etc/os-release | grep -e "LIKE=" | sed -e 's/ID_LIKE=//g')" ] && sudo dnf install -y git || exit 1;; *) exit 1;; From 7e976b8a939d82ac009a33a74e76ee022a117396 Mon Sep 17 00:00:00 2001 From: kbpk Date: Wed, 22 Mar 2023 02:26:20 +0100 Subject: [PATCH 06/44] wslact: fix memory-reclaim incoherence --- docs/wslact.1 | 8 ++++---- src/wslact.sh | 2 +- tests/wslact.bats | 26 +++++++++++++++++++++++++- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/docs/wslact.1 b/docs/wslact.1 index 4fc59254..659dce82 100644 --- a/docs/wslact.1 +++ b/docs/wslact.1 @@ -14,7 +14,7 @@ Currently, we have two features available: .nf \fBts, time-sync\fR \- Time Sync \fBam, auto-mount\fR \- Auto Mounting -\fBmr, mem-reclaim\fR \- Memory Reclaimation +\fBmr, memory-reclaim\fR \- Memory Reclamation .fi .in .SH COMMANDS @@ -52,11 +52,11 @@ pass a list of options you want to pass to \fImount\fR command. print a simple help. .in .fi -.SS "Memory Reclaimation" -Memory Reclaimation (\fImem-reclaim\fR) feature allows you to reclaim memory by dropping memory cache. Requires sudo. +.SS "Memory Reclamation" +Memory Reclamation (\fImemory-reclaim\fR) feature allows you to reclaim memory by dropping memory cache. Requires sudo. .TP SYNOPSIS -.B wslact auto-mount +.B wslact memory-reclaim .RB [ \-h ] .TP OPTIONS diff --git a/src/wslact.sh b/src/wslact.sh index 59e8a9c4..1060bea3 100644 --- a/src/wslact.sh +++ b/src/wslact.sh @@ -101,7 +101,7 @@ while [ "$1" != "" ]; do case "$1" in ts|time-sync|tr|time-reset) time_reset "$@"; exit;; am|auto-mount|sm|smart-mount) auto_mount "$@"; exit;; - mr|mem-reclaim) memory_reclaim "$@"; exit;; + mr|memory-reclaim|mem-reclaim) memory_reclaim "$@"; exit;; -h|--help) help "$0" "$help_short"; exit;; -v|--version) version; exit;; *) error_echo "Invalid Input. Aborted." 22;; diff --git a/tests/wslact.bats b/tests/wslact.bats index b8b39a61..b880224d 100644 --- a/tests/wslact.bats +++ b/tests/wslact.bats @@ -59,4 +59,28 @@ run out/wslact am -h [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] -} \ No newline at end of file +} + +@test "wslact - Memory Reclamation - Help" { + run out/wslact memory-reclaim --help + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] +} + +@test "wslact - Memory Reclamation - Help - Alt." { + run out/wslact memory-reclaim -h + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] +} + +@test "wslact - Memory Reclamation - short form - Help" { + run out/wslact mr --help + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] +} + +@test "wslact - Memory Reclamation - short form - Help - Alt." { + run out/wslact mr -h + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] +} From 2cd6c5db61cb67e19488d0c253dfa11cc94859b6 Mon Sep 17 00:00:00 2001 From: kbpk Date: Wed, 22 Mar 2023 02:43:35 +0100 Subject: [PATCH 07/44] wslact: increase memory reclamation amount --- src/wslact.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wslact.sh b/src/wslact.sh index 1060bea3..4865df2d 100644 --- a/src/wslact.sh +++ b/src/wslact.sh @@ -93,6 +93,7 @@ function memory_reclaim { error_echo "\`wslact memory-reclaim\` requires you to run as root. Aborted." 1 fi + sync echo 1 > /proc/sys/vm/drop_caches echo "${info} Memory Reclaimed." } From b19df3d9ee311c3f82846af0c0be2ce7f4def201 Mon Sep 17 00:00:00 2001 From: Carlos Rafael Ramirez Date: Mon, 3 Jul 2023 22:47:10 +0200 Subject: [PATCH 08/44] Deploy to Pengwin debian bookworm as well --- .github/workflows/pkgdeploy.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index 9edb2b9b..8fa4defb 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -54,10 +54,14 @@ jobs: with: name: PengwinDEBs - run: gem install package_cloud - - name: deploy to the dev + - name: deploy to bullseye repo env: PACKAGECLOUD_TOKEN: ${{ secrets.PGW_DEV_DEPLOY_KEY }} run: package_cloud push whitewaterfoundry/wslu/debian/bullseye ./PengwinDEBs/*.deb --skip-errors + - name: deploy to bookworm + env: + PACKAGECLOUD_TOKEN: ${{ secrets.PGW_DEV_DEPLOY_KEY }} + run: package_cloud push whitewaterfoundry/wslu/debian/bookworm ./PengwinDEBs/*.deb --skip-errors rpmobsbuild: name: RPM - OpenSUSE Build Service runs-on: ubuntu-20.04 From db7c574e537b90eb1ce26016f57dff3e30735772 Mon Sep 17 00:00:00 2001 From: Muhammad Imaduddin Date: Fri, 22 Sep 2023 09:54:57 +0700 Subject: [PATCH 09/44] wslview: fix opening links with brackets curl treats brackets as special glob characters, but powershell does not have that same behavior so it should be better to turn off curl globbing. --- src/wslview.sh | 2 +- tests/wslview.bats | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wslview.sh b/src/wslview.sh index 9699ae16..1c26d494 100644 --- a/src/wslview.sh +++ b/src/wslview.sh @@ -25,7 +25,7 @@ function add_reg_alt { } function url_validator { - content=$(curl --head --silent "$*" | head -n 1) + content=$(curl --head --silent -g "$*" | head -n 1) if [ -n "$content" ]; then return 0 else diff --git a/tests/wslview.bats b/tests/wslview.bats index 99a1b297..f6a22285 100644 --- a/tests/wslview.bats +++ b/tests/wslview.bats @@ -95,3 +95,8 @@ setup() { run out/wslview "https://wslutiliti.es/" [ "$status" -eq 0 ] } + +@test "wslview - Internet - with brackets" { + run out/wslview "https://www.duckduckgo.com/?q=[wslu]" + [ "$status" -eq 0 ] +} From e4aecb3c0a79dcb3c0d12c00aaa5b28adac7e468 Mon Sep 17 00:00:00 2001 From: Smoothieewastaken Date: Fri, 27 Oct 2023 13:31:56 +0545 Subject: [PATCH 10/44] docs:fixed typos --- docs/wslfetch.1 | 2 +- docs/wslgsu.1 | 2 +- docs/wslsys.1 | 4 ++-- docs/wslu.7 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/wslfetch.1 b/docs/wslfetch.1 index 8b9d2dbf..6998a115 100644 --- a/docs/wslfetch.1 +++ b/docs/wslfetch.1 @@ -26,7 +26,7 @@ add a colorbar to the printed information. This can also be set with the configu Force to print information with generic WSL logo. .TP .B -t, --theme \fITHEME\fR -set a cutom theme from the file \fITHEME\fR. This can also be set with the configuration \fIWSLFETCH_THEME_PATH\fR. +set a custom theme from the file \fITHEME\fR. This can also be set with the configuration \fIWSLFETCH_THEME_PATH\fR. .TP .B -o, --options \fIOPTIONS\fR set custom options from the file \fIOPTIONS\fR. Please refer to the WSLFETCH_INFO_SECTION in the CONFIGURATION section for more information. diff --git a/docs/wslgsu.1 b/docs/wslgsu.1 index fe8c7a96..60be5b9e 100644 --- a/docs/wslgsu.1 +++ b/docs/wslgsu.1 @@ -27,7 +27,7 @@ Print current version. Use a separate user to execute the command/service. By default it's \fIroot\fR. .TP .B -n, --name \fINAME\fR -Add an explicit name instead of the default of autoamtically extracting a name from the service/command. +Add an explicit name instead of the default of automatically extracting a name from the service/command. .TP .B -S, --service Using this option means you are addng a system service. without \fB-S\fR, you are adding a command to system. diff --git a/docs/wslsys.1 b/docs/wslsys.1 index 3b40a5ef..acd3f92d 100644 --- a/docs/wslsys.1 +++ b/docs/wslsys.1 @@ -38,7 +38,7 @@ For example, \fB"0x5df84068"\fR. .TP .B -b, --branch Print current release branch of your Windows 10. -For example, \fB"rs_prerelease"\fR means you are on rs_prerelease realease branch. +For example, \fB"rs_prerelease"\fR means you are on rs_prerelease release branch. .TP .B -B, --build Print current build version of your Windows 10. @@ -73,7 +73,7 @@ Print the current IPv4 address for your WSL distro. For example, \fB"127.37.41.23"\fR. .TP .B -S, --display-scaling -Print the current disply scaling from your display setting. +Print the current display scaling from your display setting. For example, \fB"2"\fR for 200% scaling. .TP .B -l, --locale diff --git a/docs/wslu.7 b/docs/wslu.7 index a8c18cca..464fa381 100644 --- a/docs/wslu.7 +++ b/docs/wslu.7 @@ -45,7 +45,7 @@ Entering debug mode. Entering verbose mode. .SH CONFIGURATION .TP -The defualt configuration is stored in /usr/share/wslu/conf. You can override the default configuration in \'/etc/wslu/conf\', \'/etc/wslu/custom.conf\', \'$HOME/.config/wslu/conf\', or \'$HOME/.wslurc\'. They will be read in the direction they are listed. +The default configuration is stored in /usr/share/wslu/conf. You can override the default configuration in \'/etc/wslu/conf\', \'/etc/wslu/custom.conf\', \'$HOME/.config/wslu/conf\', or \'$HOME/.wslurc\'. They will be read in the direction they are listed. .SH EXIT STATUS .TP .B 1 From b89be255279a76cd587b4c8123a9ac1fe4dfe2bc Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 12 Nov 2023 18:35:57 +0800 Subject: [PATCH 11/44] ci: upgrade CI pengwin deployment ruby version --- .github/workflows/pkgbuild.yml | 2 +- .github/workflows/pkgdeploy.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index f3430770..d21b80eb 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -52,7 +52,7 @@ jobs: name: Pengwin Deploying needs: pgwbuild runs-on: ubuntu-20.04 - container: circleci/ruby:2.3-jessie + container: cimg/ruby:2.7 steps: - name: Retrive package for deployment uses: actions/download-artifact@v1 diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index 8fa4defb..ddc2af41 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -47,7 +47,7 @@ jobs: name: Pengwin Deploying needs: pgwbuild runs-on: ubuntu-20.04 - container: circleci/ruby:2.3-jessie + container: cimg/ruby:2.7 steps: - name: Retrive package for deployment uses: actions/download-artifact@v1 From 1e450d8a75cafc40dffe0d9d326dc54523bba161 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 12 Nov 2023 18:52:16 +0800 Subject: [PATCH 12/44] fix: [#290] use proper folder for the states --- src/wslu-header | 30 ++++++++++++++++++------------ src/wslusc.sh | 2 +- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/wslu-header b/src/wslu-header index e4e695ea..21d28007 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -30,6 +30,12 @@ wslu_prefix="PREFIXPLACEHOLDER" LC_ALL=C LANG=C +# current state location +wslu_state_dir=${XDG_STATE_HOME:-$HOME/.local/state}/wslu +if [ ! -d "$wslu_state_dir" ]; then + mkdir -p "$wslu_state_dir" +fi + # prevent bash -x set +x @@ -262,7 +268,7 @@ function chcp_com { function winps_exec { debug_echo "winps_exec: called with command $*" wslutmpbuild="$(wslu_get_build)" - cp="$(cat ~/.config/wslu/oemcp)" + cp="$(cat "${wslu_state_dir}"/oemcp)" [ "$wslutmpbuild" -ge $BN_OCT_NINETEEN ] || chcp_com "$cp" "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; [Console]::InputEncoding = [System.Text.Encoding]::GetEncoding($cp); $*" EXIT_STATUS=$? @@ -294,32 +300,32 @@ function baseexec_gen { debug_echo "baseexec_gen: base_exe_folder_path: $wslu_base_exec_folder_path" if find "$wslu_base_exec_folder_path" -name "*.exe" -print -quit &>/dev/null; then debug_echo "baseexec_gen: found exe in wslu_base_exec_folder_path" - wslpath -w "$(find "$wslu_base_exec_folder_path" -name "*.exe" -print -quit)" > ~/.config/wslu/baseexec + wslpath -w "$(find "$wslu_base_exec_folder_path" -name "*.exe" -print -quit)" > "${wslu_state_dir}"/baseexec else debug_echo "baseexec_gen: do not have base exec in the folder; use fallback" - echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")\\Windows\\System32\\wsl.exe" > ~/.config/wslu/baseexec + echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")\\Windows\\System32\\wsl.exe" > "${wslu_state_dir}"/baseexec fi else debug_echo "baseexec_gen: imported distro" # if it is imported distro - echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")Windows\\System32\\wsl.exe" > ~/.config/wslu/baseexec + echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")Windows\\System32\\wsl.exe" > "${wslu_state_dir}"/baseexec fi else debug_echo "baseexec_gen: fallback mode" # older version fallback. - echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")\\Windows\\System32\\wsl.exe" > ~/.config/wslu/baseexec + echo "$(wslpath -w "$(interop_prefix)$(sysdrive_prefix)")\\Windows\\System32\\wsl.exe" > "${wslu_state_dir}"/baseexec fi } function var_gen { debug_echo "var_gen: called" - date +"%s" > ~/.config/wslu/triggered_time + date +"%s" > "${wslu_state_dir}"/triggered_time - rm -f ~/.config/wslu/baseexec - rm -f ~/.config/wslu/oemcp + rm -f "${wslu_state_dir}"/baseexec + rm -f "${wslu_state_dir}"/oemcp # generate oem codepage - "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage" /v OEMCP 2>&1 | sed -n 3p | sed -e 's|\r||g' | grep -o '[[:digit:]]*' > ~/.config/wslu/oemcp + "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage" /v OEMCP 2>&1 | sed -n 3p | sed -e 's|\r||g' | grep -o '[[:digit:]]*' > "${wslu_state_dir}"/oemcp # generate base exe location baseexec_gen @@ -393,15 +399,15 @@ fi # This gets tirggered then: # 1. if it's the first time the script is triggered, i.e., -# ~/.config/wslu/triggered time +# ${wslu_state_dir}/triggered time # 2. if update_time is also not present, i.e., # badly installed packages or installed via install script -if [ ! -f ~/.config/wslu/triggered_time ] || [ ! -f /usr/share/wslu/updated_time ]; then +if [ ! -f "${wslu_state_dir}"/triggered_time ] || [ ! -f /usr/share/wslu/updated_time ]; then debug_echo "first run or update_time not present; calling var_gen" var_gen # This gets triggered when: # installed time is larger than the last triggered time -elif [ "$(cat ~/.config/wslu/triggered_time)" -lt "$(cat /usr/share/wslu/updated_time)" ]; then +elif [ "$(cat "${wslu_state_dir}"/triggered_time)" -lt "$(cat /usr/share/wslu/updated_time)" ]; then debug_echo "upgraded package; calling var_gen" var_gen fi diff --git a/src/wslusc.sh b/src/wslusc.sh index 754bc0bc..9b4556ba 100644 --- a/src/wslusc.sh +++ b/src/wslusc.sh @@ -67,7 +67,7 @@ if [[ "$cname_header" != "" ]]; then dpath=$(wslpath "$(wslvar -l Desktop)") # Windows Desktop, WSL Sty. script_location="$(wslpath "$up_path")/wslu" # Windows wslu, Linux WSL Sty. script_location_win="$(double_dash_p "$up_path")\\wslu" # Windows wslu, Win Double Sty. - distro_location_win="$(double_dash_p "$(cat ~/.config/wslu/baseexec)")" # Distro Location, Win Double Sty. + distro_location_win="$(double_dash_p "$(cat "${wslu_state_dir}"/baseexec)")" # Distro Location, Win Double Sty. # change param according to the exec. distro_param="run" From 86cc1e5d3ec8920ae9dcc65cb9b1f64fe074a85d Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 12 Nov 2023 23:53:30 +0800 Subject: [PATCH 13/44] chore: [#288] improve documentation a bit --- CONTRIBUTING.md | 6 ++++++ README.md | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index caa237ad..503d70ea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,12 @@ We love pull requests from everyone. By participating in this project, you agree to abide by [Code of Conduct](CODE_OF_CONDUCT.md). +> **ATTENTION!** +> +> Built-in versions of wslu in Ubuntu are no longer supported by me. +> +> If you have problems, please check whther you are using the [PPA version of wslu](https://launchpad.net/~wslutilities/+archive/ubuntu/wslu). If not, please report to the Ubuntu WSL team; However, the PPA version of wslu will address most issue that come from the built-in version. + ## Code contributions ### Setup diff --git a/README.md b/README.md index 5f390e00..016a90c3 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,16 @@ [![GitHub license](https://img.shields.io/github/license/wslutilities/wslu?style=flat-square&label=license&color=blue&logo=github)](https://github.com/wslutilities/wslu/blob/master/LICENSE) [![GitHub (pre-)release](https://img.shields.io/github/v/release/wslutilities/wslu?include_prereleases&logo=github&style=flat-square)](https://github.com/wslutilities/wslu) -[![Twitter Follow](https://img.shields.io/twitter/follow/wslutilities?style=flat-square&logo=twitter&color=1DA1F2&label=follow)](https://twitter.com/wslutilities) [![Mastodon Follow](https://img.shields.io/mastodon/follow/108802672885079993?color=6364FF&domain=https%3A%2F%2Ffosstodon.org&label=follow&logo=mastodon&logoColor=6364FF&style=flat-square)](https://fosstodon.org/@wslutilities) +> **ATTENTION!** +> +> Built-in versions of wslu in Ubuntu are no longer supported by me. +> +> If you have problems, please check whther you are using the [PPA version of wslu](https://launchpad.net/~wslutilities/+archive/ubuntu/wslu). If not, please report to the Ubuntu WSL team; However, the PPA version of wslu will address most issue that come from the built-in version. + This is a collection of utilities for the Linux Subsystem for Windows (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. - Requires at least Windows 10 Creators Update; From c818f000c3ab5b102f5508f7fa54000f48dd934e Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Mon, 13 Nov 2023 00:34:12 +0800 Subject: [PATCH 14/44] fix: [#268] allow skipping validation --- docs/wslview.1 | 8 +++++++- src/etc/conf | 5 ++++- src/etc/user/conf | 5 ++++- src/wslview.sh | 11 +++++++++-- tests/wslview.bats | 4 ++-- 5 files changed, 26 insertions(+), 7 deletions(-) diff --git a/docs/wslview.1 b/docs/wslview.1 index 6cd27bf4..e3802fbe 100644 --- a/docs/wslview.1 +++ b/docs/wslview.1 @@ -5,7 +5,7 @@ - Component of WSL Utilities .SH SYNOPSIS .B wslview, wview, wslstart, wstart -.RB [ \-hvur ] +.RB [ \-hsvur ] .PP .B wslview, wview, wslstart, wstart .I LINK/FILE @@ -19,6 +19,9 @@ print a simple help. .B -v, --version print current version. .TP +.B -s, --skip-validation-check +skip url validation check. +.TP .B -u, --unreg-as-browser remove \fBwslview\fR as the default WSL web browser. .TP @@ -35,6 +38,9 @@ cmd: use cmd.exe to start website/folder/file cmd_explorer: use explorer.exe via cmd.exe to start website/folder/file .in .fi +.TP +.B WSLVIEW_SKIP_VALIDATION_CHECK +whether to skip validation check. Default is 1, which is not skipping. Can be either `0` or `1`. .SH AUTHOR Created by Patrick Wu .SH REPORTING BUGS diff --git a/src/etc/conf b/src/etc/conf index e41ac504..dbc82423 100644 --- a/src/etc/conf +++ b/src/etc/conf @@ -66,4 +66,7 @@ WSLVAR_DEFAULT_VARTYPE=1 # powershell: use powershell.exe to start website/folder/file # cmd: use cmd.exe to start website/folder/file # cmd_explorer: use explorer.exe via cmd.exe to start website/folder/file -WSLVIEW_DEFAULT_ENGINE="powershell" \ No newline at end of file +WSLVIEW_DEFAULT_ENGINE="powershell" + +# wslview: whether to skip validation check. Default is 1, which is not skipping. Can be either `0` or `1`. +WSLVIEW_SKIP_VALIDATION_CHECK=1 \ No newline at end of file diff --git a/src/etc/user/conf b/src/etc/user/conf index 3879d437..6a7a69e8 100644 --- a/src/etc/user/conf +++ b/src/etc/user/conf @@ -58,4 +58,7 @@ # powershell: use powershell.exe to start website/folder/file # cmd: use cmd.exe to start website/folder/file # cmd_explorer: use explorer.exe via cmd.exe to start website/folder/file -# WSLVIEW_DEFAULT_ENGINE="powershell" \ No newline at end of file +# WSLVIEW_DEFAULT_ENGINE="powershell" + +# wslview: whether to skip validation check. Default is 1, which is not skipping. Can be either `0` or `1`. +# WSLVIEW_SKIP_VALIDATION_CHECK=1 \ No newline at end of file diff --git a/src/wslview.sh b/src/wslview.sh index 1c26d494..1562ebae 100644 --- a/src/wslview.sh +++ b/src/wslview.sh @@ -1,7 +1,8 @@ # shellcheck shell=bash lname="" +skip_validation_check=${WSLVIEW_SKIP_VALIDATION_CHECK:-1} -help_short="$0 [-hvur]\n$0 [-E ENGINE] LINK/FILE" +help_short="$0 [-hsvur]\n$0 [-E ENGINE] LINK/FILE" function del_reg_alt { if [ "$distro" == "archlinux" ] || [ "$distro" == "alpine" ]; then @@ -36,6 +37,7 @@ function url_validator { while [ "$1" != "" ]; do case "$1" in + -s|--skip-validation-check) skip_validation_check=0; shift;; -r|--reg-as-browser) add_reg_alt;; -u|--unreg-as-browser) del_reg_alt;; -h|--help) help "$0" "$help_short"; exit;; @@ -68,7 +70,12 @@ if [[ "$lname" != "" ]]; then fi debug_echo "properfile_full_path: $properfile_full_path" debug_echo "validating whether if it is a link" - if (url_validator "$lname") && [ -z "$properfile_full_path" ]; then + is_valid_url=$(url_validator "$lname") + if [ "$skip_validation_check" -eq 0 ]; then + debug_echo "Skipping validation check" + is_valid_url=0 + fi + if [[ "$is_valid_url" -eq 0 ]] && [ -z "$properfile_full_path" ]; then debug_echo "It is a link" cmd="\"$lname\"" elif [[ "$lname" =~ ^file:\/\/(\/)+[A-Za-z]\:.*$ ]] || [[ "$lname" =~ ^[A-Za-z]\:.*$ ]]; then diff --git a/tests/wslview.bats b/tests/wslview.bats index f6a22285..eb4882ce 100644 --- a/tests/wslview.bats +++ b/tests/wslview.bats @@ -15,14 +15,14 @@ setup() { @test "wslview - Help" { run out/wslview --help [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] - [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hvur\]$ ]] + [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hsvur\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } @test "wslview - Help - Alt." { run out/wslview -h [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] - [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hvur\]$ ]] + [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hsvur\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } From b6fa4b70b22909337cb13b5b2ea9845f733f60ff Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Mon, 13 Nov 2023 01:15:45 +0800 Subject: [PATCH 15/44] fix: [#264] make DESTDIR properly configured in header --- CONTRIBUTING.md | 1 + Makefile | 2 +- src/wslu-header | 17 +++++++++-------- src/wslvar.sh | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 503d70ea..f12215c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -89,6 +89,7 @@ For contributing, there are several functions and variables built-in the header - `wslu_util_name` - current utility name - `wslu_version` - wslu version, written by `VERSION` - `wslu_prefix` - the location `wslu` installed to, written by the `PREFIX` during the make. + - `wslu_dest_dir` - the location `wslu` installed to, written by the `DESTDIR` during the make. - `wslu_debug` - the variable used for calling utility across. This will allow calling the `--debug` option for other `wslu` utilities inside script easier. - Formatting: `black`, `red`, `green`, `brown`, `blue`, `purple`, `cyan`, `yellow`, `white`, `dark_gray`, `light_red`, `light_green`, `light_blue`, `light_purple`, `light_cyan`, `light_gray`, `orange`, `light_orange`, `deep_purple`, `bold`, `reset` - Indicator: `info`, `input_info`, `error`, `warn` diff --git a/Makefile b/Makefile index d4ebbfbe..23990093 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ VERTMP = $(shell cat ./VERSION) all: doc [ -d $(OUTPATH) ] || mkdir $(OUTPATH) - sed -e 's/VERSIONPLACEHOLDER/'$(VERTMP)'/' -e 's|PREFIXPLACEHOLDER|'$(PREFIX)'|' $(HEADER) > $(HEADER).tmp; \ + sed -e 's/VERSIONPLACEHOLDER/'$(VERTMP)'/' -e 's|PREFIXPLACEHOLDER|'$(PREFIX)'|' -e 's|DESTDIRPLACEHOLDER|'$(DESTDIR)'|' $(HEADER) > $(HEADER).tmp; \ for file in $(SOURCES); do \ cat $(HEADER).tmp $$file > $(OUTPATH)/`basename $$file`; \ mv $(OUTPATH)/`basename $$file` $(OUTPATH)/`basename $$file .sh`; \ diff --git a/src/wslu-header b/src/wslu-header index 21d28007..85a016bc 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -25,6 +25,7 @@ wslu_util_name=$(basename "$wslu_util_fullpath") # Version wslu_version=VERSIONPLACEHOLDER wslu_prefix="PREFIXPLACEHOLDER" +wslu_dest_dir="DESTDIRPLACEHOLDER" # Speed up script by using unicode. LC_ALL=C @@ -150,20 +151,20 @@ function error_echo { } # source default config -if [ -f "${wslu_prefix}/share/wslu/conf" ]; then +if [ -f "${wslu_dest_dir}${wslu_prefix}/share/wslu/conf" ]; then debug_echo "source default setting" - source "${wslu_prefix}/share/wslu/conf" + source "${wslu_dest_dir}${wslu_prefix}/share/wslu/conf" fi # source user-defined config -if [ -f "${wslu_prefix}/share/wslu/custom.conf" ]; then - debug_echo "${wslu_prefix}/share/wslu/custom.conf found, sourcing" - source "${wslu_prefix}/share/wslu/custom.conf" +if [ -f "${wslu_dest_dir}${wslu_prefix}/share/wslu/custom.conf" ]; then + debug_echo "${wslu_dest_dir}${wslu_prefix}/share/wslu/custom.conf found, sourcing" + source "${wslu_dest_dir}${wslu_prefix}/share/wslu/custom.conf" fi -if [ -f "/etc/wslu/conf" ]; then - debug_echo "/etc/wslu/conf found, sourcing" - source "/etc/wslu/conf" +if [ -f "${wslu_dest_dir}/etc/wslu/conf" ]; then + debug_echo "${wslu_dest_dir}/etc/wslu/conf found, sourcing" + source "${wslu_dest_dir}/etc/wslu/conf" fi if [ -f "/etc/wslu/custom.conf" ]; then diff --git a/src/wslvar.sh b/src/wslvar.sh index 1ae9164e..a770d09c 100644 --- a/src/wslvar.sh +++ b/src/wslvar.sh @@ -1,5 +1,5 @@ # shellcheck shell=bash -var_type=1 +var_type=${WSLVAR_DEFAULT_VARTYPE:-1} help_short="wslvar [-sl] NAME\nwslvar [-hvSL]" @@ -25,7 +25,7 @@ function cl_destoryer { function caller { if [ "$*" != "" ]; then - case $WSLVAR_DEFAULT_VARTYPE in + case $var_type in 1) p="$(cl_destoryer "$(call_sys "$@")")";; 2) p="$(cl_destoryer "$(call_shell "$@")")";; *) error_echo "Invalid variable type. Aborted." 22;; @@ -38,8 +38,8 @@ function caller { while [ "$1" != "" ]; do case "$1" in - -s|--sys) WSLVAR_DEFAULT_VARTYPE=1; shift;; - -l|--shell) WSLVAR_DEFAULT_VARTYPE=2; shift;; + -s|--sys) var_type=1; shift;; + -l|--shell) var_type=2; shift;; -S|--getsys) view_sys; exit;; -L|--getshell) view_shell; exit;; -h|--help) help "$0" "$help_short"; exit;; From 7c6a9ed3df608340f216dfe257382062b36320f9 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sat, 30 Dec 2023 00:09:51 +0800 Subject: [PATCH 16/44] fix: [#295] decode file protocol url properly --- src/wslview.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wslview.sh b/src/wslview.sh index 1562ebae..efa4bab3 100644 --- a/src/wslview.sh +++ b/src/wslview.sh @@ -4,6 +4,8 @@ skip_validation_check=${WSLVIEW_SKIP_VALIDATION_CHECK:-1} help_short="$0 [-hsvur]\n$0 [-E ENGINE] LINK/FILE" +function fileprotocoldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } + function del_reg_alt { if [ "$distro" == "archlinux" ] || [ "$distro" == "alpine" ]; then error_echo "Unsupported action for this distro. Aborted." 34 @@ -55,6 +57,8 @@ if [[ "$lname" != "" ]]; then # file:/// protocol used in linux if [[ "$lname" =~ ^file:\/\/.*$ ]] && [[ ! "$lname" =~ ^file:\/\/(\/)+[A-Za-z]\:.*$ ]]; then debug_echo "Received file:/// protocol used in linux" + # convert before set + lname="$(fileprotocoldecode "$lname")" [ "$wslutmpbuild" -ge "$BN_MAY_NINETEEN" ] || error_echo "This protocol is not supported before version 1903." 34 properfile_full_path="$(readlink -f "${lname//file:\/\//}")" # Linux absolute path From ea34a92840d8a20635ec0ed19b2b751067b6cd06 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sat, 30 Dec 2023 23:27:59 +0800 Subject: [PATCH 17/44] feat: [#293] allow set path with param -e to set BROWSER variable --- docs/wslview.1 | 5 ++++- src/wslview.sh | 27 ++++++++++++++++++++++++++- tests/wslview.bats | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/docs/wslview.1 b/docs/wslview.1 index e3802fbe..7d682bc5 100644 --- a/docs/wslview.1 +++ b/docs/wslview.1 @@ -5,7 +5,7 @@ - Component of WSL Utilities .SH SYNOPSIS .B wslview, wview, wslstart, wstart -.RB [ \-hsvur ] +.RB [ \-ehsvurE ] .PP .B wslview, wview, wslstart, wstart .I LINK/FILE @@ -27,6 +27,9 @@ remove \fBwslview\fR as the default WSL web browser. .TP .B -r, --reg-as-browser register \fBwslview\fR as the default WSL web browser. +.TP +.B -e, --export-as-browser +register \fBwslview\fR as the default WSL web browser using export method. .SH CONFIGURATION .TP .B WSLVIEW_DEFAULT_ENGINE diff --git a/src/wslview.sh b/src/wslview.sh index efa4bab3..a8c34d12 100644 --- a/src/wslview.sh +++ b/src/wslview.sh @@ -2,7 +2,7 @@ lname="" skip_validation_check=${WSLVIEW_SKIP_VALIDATION_CHECK:-1} -help_short="$0 [-hsvur]\n$0 [-E ENGINE] LINK/FILE" +help_short="$0 [-ehsvurE]\n$0 [-E ENGINE] LINK/FILE" function fileprotocoldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } @@ -27,6 +27,30 @@ function add_reg_alt { fi } +function add_browser_export { + # find all possible shell rc file and append export BROWSER="/usr/bin/wslview" at the end; if found existing export, comment it out + # Define the shell rc files to search + rc_files=(".bashrc" ".zshrc" ".kshrc" ".cshrc" ".tcshrc") + + # Loop over each file + for rc_file in "${rc_files[@]}"; do + # Check if the file exists + if [ -f "$HOME/$rc_file" ]; then + echo "Processing $rc_file..." + + # Comment out existing BROWSER export + if grep -q "export BROWSER=" "$HOME/$rc_file"; then + echo "Commenting out existing BROWSER export in $rc_file..." + $SED -i 's/^export BROWSER=/#export BROWSER=/' "$HOME/$rc_file" + fi + + # Append new BROWSER export + echo "Appending new BROWSER export to $rc_file..." + echo 'export BROWSER="/usr/bin/wslview"' >> "$HOME/$rc_file" + fi + done +} + function url_validator { content=$(curl --head --silent -g "$*" | head -n 1) if [ -n "$content" ]; then @@ -42,6 +66,7 @@ while [ "$1" != "" ]; do -s|--skip-validation-check) skip_validation_check=0; shift;; -r|--reg-as-browser) add_reg_alt;; -u|--unreg-as-browser) del_reg_alt;; + -e|--export-as-browser) add_browser_export;; -h|--help) help "$0" "$help_short"; exit;; -v|--version) version; exit;; -E|--engine) shift; WSLVIEW_DEFAULT_ENGINE="$1"; shift;; diff --git a/tests/wslview.bats b/tests/wslview.bats index eb4882ce..cad22dff 100644 --- a/tests/wslview.bats +++ b/tests/wslview.bats @@ -15,14 +15,14 @@ setup() { @test "wslview - Help" { run out/wslview --help [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] - [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hsvur\]$ ]] + [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } @test "wslview - Help - Alt." { run out/wslview -h [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] - [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-hsvur\]$ ]] + [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } From e52ebcfb91645d931ca924820d3611749cdc161b Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 31 Dec 2023 00:23:46 +0800 Subject: [PATCH 18/44] fix: [#294] add bash version requirement. --- src/wslu-header | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wslu-header b/src/wslu-header index 85a016bc..a76eaa60 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -40,6 +40,8 @@ fi # prevent bash -x set +x +bash_version_major=$(echo $BASH_VERSION | cut -d'.' -f1) + # pipeline content to pipe... if it is wslclip if [[ "$wslu_util_name" == "wslclip" ]]; then if [[ -p /dev/stdin ]]; then @@ -150,6 +152,11 @@ function error_echo { exit "$2" } +# Check if the major version number is greater than 5 +if [ $(expr $bash_version_major \> 5) -ne 1 ]; then + error_echo "You should use Bash 5 and higher; exiting." 1 +fi + # source default config if [ -f "${wslu_dest_dir}${wslu_prefix}/share/wslu/conf" ]; then debug_echo "source default setting" From b08c0b813e341b7966697b013990ae0d9fcfebf7 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 31 Dec 2023 12:48:49 +0800 Subject: [PATCH 19/44] fix: [#291] allow disable reading from registry --- docs/wslu.7 | 4 ++++ src/etc/conf | 4 ++++ src/etc/user/conf | 4 ++++ src/wslu-header | 20 +++++++++++++------- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/docs/wslu.7 b/docs/wslu.7 index 464fa381..546aec55 100644 --- a/docs/wslu.7 +++ b/docs/wslu.7 @@ -80,6 +80,10 @@ unsupported feature (for your Windows 10 build) .TP .B 40 Unknown system input. +.SH CONFIGURATION +.TP +.B WSLVIEW_DEFAULT_ENGINE +control whether to enable the chcp workaround for powershell. By default it is true; if you encounter any PowerShell issues, you can try to disable it. .SH BUG Report bugs to ; For Ubuntu specific bugs, report to . diff --git a/src/etc/conf b/src/etc/conf index dbc82423..539b8fe2 100644 --- a/src/etc/conf +++ b/src/etc/conf @@ -19,6 +19,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# wslu: control whether to enable the chcp workaround for powershell. +# By default it is true; if you encounter any PowerShell issues, you can try to disable it. +WSLU_POWERSHELL_CHCP_WORKAROUND=true + # wslfetch: the sections of info from wslsys to show in wslfetch. # Available options: # windows-install-date diff --git a/src/etc/user/conf b/src/etc/user/conf index 6a7a69e8..39c71dc5 100644 --- a/src/etc/user/conf +++ b/src/etc/user/conf @@ -11,6 +11,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# wslu: control whether to enable the chcp workaround for powershell. +# By default it is true; if you encounter any PowerShell issues, you can try to disable it. +# WSLU_POWERSHELL_CHCP_WORKAROUND=true + # wslfetch: the sections of info from wslsys to show in wslfetch. # Available options: # windows-install-date diff --git a/src/wslu-header b/src/wslu-header index a76eaa60..205b5bd5 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -275,13 +275,19 @@ function chcp_com { function winps_exec { debug_echo "winps_exec: called with command $*" - wslutmpbuild="$(wslu_get_build)" - cp="$(cat "${wslu_state_dir}"/oemcp)" - [ "$wslutmpbuild" -ge $BN_OCT_NINETEEN ] || chcp_com "$cp" - "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; [Console]::InputEncoding = [System.Text.Encoding]::GetEncoding($cp); $*" - EXIT_STATUS=$? - [ "$wslutmpbuild" -ge $BN_OCT_NINETEEN ] || chcp_com 65001 - return $EXIT_STATUS + if [[ "$WSLU_POWERSHELL_CHCP_WORKAROUND" == "true" ]]; then + wslutmpbuild="$(wslu_get_build)" + cp="$(cat "${wslu_state_dir}"/oemcp)" + [ "$wslutmpbuild" -ge $BN_OCT_NINETEEN ] || chcp_com "$cp" + "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "[Console]::OutputEncoding = [System.Text.Encoding]::UTF8; [Console]::InputEncoding = [System.Text.Encoding]::GetEncoding($cp); $*" + EXIT_STATUS=$? + [ "$wslutmpbuild" -ge $BN_OCT_NINETEEN ] || chcp_com 65001 + return $EXIT_STATUS + else + "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "$*" + EXIT_STATUS=$? + return $EXIT_STATUS + fi } function cmd_exec { From d3e688ff1ec32f7b9602ca35349c77b50a66d0c7 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 31 Dec 2023 23:00:27 +0800 Subject: [PATCH 20/44] chore: shellcheck fix --- src/wslu-header | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wslu-header b/src/wslu-header index 205b5bd5..9645f333 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -40,7 +40,7 @@ fi # prevent bash -x set +x -bash_version_major=$(echo $BASH_VERSION | cut -d'.' -f1) +bash_version_major=$(echo "$BASH_VERSION" | cut -d'.' -f1) # pipeline content to pipe... if it is wslclip if [[ "$wslu_util_name" == "wslclip" ]]; then @@ -153,7 +153,7 @@ function error_echo { } # Check if the major version number is greater than 5 -if [ $(expr $bash_version_major \> 5) -ne 1 ]; then +if [ "$(expr "$bash_version_major" \>= 5)" -ne 1 ]; then error_echo "You should use Bash 5 and higher; exiting." 1 fi From 4dc00179dbcdffe880c7561835f09b9106ef3075 Mon Sep 17 00:00:00 2001 From: Edwin Kofler Date: Fri, 5 Jan 2024 16:40:12 -0800 Subject: [PATCH 21/44] perf: Use POSIX Parameter substitution instead of `basename` exec --- extras/scripts/manpage_deploy.bash | 2 +- src/wslfetch.sh | 2 +- src/wslgsu.sh | 3 ++- src/wslu-header | 5 +++-- src/wslusc.sh | 8 ++++---- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/extras/scripts/manpage_deploy.bash b/extras/scripts/manpage_deploy.bash index 069ebb70..479fa66e 100644 --- a/extras/scripts/manpage_deploy.bash +++ b/extras/scripts/manpage_deploy.bash @@ -5,7 +5,7 @@ if [ ! -d "./website/wslu/man/${wslu_ver}" ] ; then cp ./docs/*.html ./website/wslu/man/${wslu_ver} rm -f ./website/wslu/man/*.html for f in $(ls -d ./website/wslu/man/${wslu_ver}/*.html); do - fname="$(basename ${f})" + fname="${f##*/}" ln -s ./${wslu_ver}/${fname} ./website/wslu/man/${fname} done fi diff --git a/src/wslfetch.sh b/src/wslfetch.sh index 150ac6aa..7e8e6c17 100644 --- a/src/wslfetch.sh +++ b/src/wslfetch.sh @@ -4,7 +4,7 @@ is_generic=0 help_short="wslfetch [-hvcg] [-t THEME] [-o OPTIONS]" -PARSED_ARGUMENTS=$(getopt -a -n "$(basename "$wslu_util_name")" -o hvtcgo: --long help,version,theme,colorbar,generic,options: -- "$@") +PARSED_ARGUMENTS=$(getopt -a -n "${wslu_util_name##*/}" -o hvtcgo: --long help,version,theme,colorbar,generic,options: -- "$@") #shellcheck disable=SC2181 [ "$?" != "0" ] && help "$wslu_util_name" "$help_short" diff --git a/src/wslgsu.sh b/src/wslgsu.sh index 9afdd128..3d8a5500 100644 --- a/src/wslgsu.sh +++ b/src/wslgsu.sh @@ -73,7 +73,8 @@ if [[ "$wa_gs_commd" != "" ]] || [[ $isWakeup -eq 1 ]]; then # handling no name given case if [[ "$wa_gs_name" = "" ]]; then debug_echo "No name given, automatically generate" - wa_gs_name=$(basename "$(echo "$wa_gs_commd" | awk '{print $1}')") + wa_gs_name=$(echo "$wa_gs_commd" | awk '{print $1}') + wa_gs_name=${wa_gs_name##*/} fi wa_gs_commd="wsl.exe -d $WSL_DISTRO_NAME -u $wa_gs_user $wa_gs_commd" wa_gs_dscp="Executing following command \`$wa_gs_name\` from $WSL_DISTRO_NAME when computer start up; Generated By WSL Utilities" diff --git a/src/wslu-header b/src/wslu-header index 9645f333..27ec8e18 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -20,7 +20,7 @@ # Current utility wslu_util_fullpath="$0" -wslu_util_name=$(basename "$wslu_util_fullpath") +wslu_util_name="${wslu_util_fullpath##*/}" # Version wslu_version=VERSIONPLACEHOLDER @@ -226,7 +226,8 @@ function sysdrive_prefix { if [ "$(echo "$pt" | wc -l)" -eq 1 ]; then if [ -d "$pt/Windows/System32" ]; then hard_reset=1 - win_location="$(basename "$pt")" + pt=${pt%/} + win_location="${pt##*/}" break fi fi diff --git a/src/wslusc.sh b/src/wslusc.sh index 9b4556ba..db42493a 100644 --- a/src/wslusc.sh +++ b/src/wslusc.sh @@ -9,7 +9,7 @@ base_converter_engine=${WSLUSC_BASE_CONVERTER_ENGINE:-"imagemagick"} help_short="wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND\nwslusc [-hv]" -PARSED_ARGUMENTS=$(getopt -a -n "$(basename "$wslu_util_name")" -o hvd:Ie:n:i:gNs --long help,version,shortcut-debug:,interactive,path:,name:,icon:,gui,native,smart-icon -- "$@") +PARSED_ARGUMENTS=$(getopt -a -n "${wslu_util_name##*/}" -o hvd:Ie:n:i:gNs --long help,version,shortcut-debug:,interactive,path:,name:,icon:,gui,native,smart-icon -- "$@") #shellcheck disable=SC2181 [ "$?" != "0" ] && help "$wslu_util_name" "$help_short" @@ -93,7 +93,7 @@ if [[ "$cname_header" != "" ]]; then [ -z "$cname_header" ] && error_echo "Bad or invalid input; Aborting" 30 # handling no name given case - new_cname=$(basename "$cname_header") + new_cname="${cname_header##*/}" # handling name given case if [[ "$customname" != "" ]]; then new_cname=$customname @@ -114,7 +114,7 @@ if [[ "$cname_header" != "" ]]; then #handling smart icon first; always first if [[ "$WSLUSC_SMART_ICON_DETECTION" == "true" ]]; then if wslpy_check; then - tmp_fcname="$(basename "$cname_header")" + tmp_fcname="${cname_header##*/}" iconpath="$(python3 -c "import wslpy.__internal__; print(wslpy.__internal__.find_icon(\"$tmp_fcname\"))")" echo "${info} Icon Detector found icon $tmp_fcname at: $iconpath" else @@ -123,7 +123,7 @@ if [[ "$cname_header" != "" ]]; then fi # normal detection section - icon_filename="$(basename "$iconpath")" + icon_filename="${iconpath##*/}" ext="${iconpath##*.}" if [[ ! -f $iconpath ]]; then From 060b047875c55b3bbc4cd1814caa8168cbab89e6 Mon Sep 17 00:00:00 2001 From: Jasper Zonneveld Date: Thu, 11 Jan 2024 15:15:46 +0100 Subject: [PATCH 22/44] fix: [#268] do not validate URL when skip flag is used --- src/wslview.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wslview.sh b/src/wslview.sh index a8c34d12..7098f9f4 100644 --- a/src/wslview.sh +++ b/src/wslview.sh @@ -98,11 +98,12 @@ if [[ "$lname" != "" ]]; then properfile_full_path="$(readlink -f "${lname}")" fi debug_echo "properfile_full_path: $properfile_full_path" - debug_echo "validating whether if it is a link" - is_valid_url=$(url_validator "$lname") if [ "$skip_validation_check" -eq 0 ]; then debug_echo "Skipping validation check" is_valid_url=0 + else + debug_echo "Validating whether if it is a link" + is_valid_url=$(url_validator "$lname") fi if [[ "$is_valid_url" -eq 0 ]] && [ -z "$properfile_full_path" ]; then debug_echo "It is a link" From 37da694b98b892d91e1a9eeacc62c20e1fa4d94d Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 10 Mar 2024 21:52:01 +0800 Subject: [PATCH 23/44] chore: update VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 00cf9325..658e3ea6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.1-1 +4.1.2-1 From 2febbae083e6ea1a1c28d4670d7c329fae0bbb09 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 10 Mar 2024 22:34:37 +0800 Subject: [PATCH 24/44] ci: fixes for documentation deployment --- .github/workflows/docs.yml | 4 ++-- .github/workflows/manpage.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 127faed2..32ca833f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,11 +11,11 @@ jobs: - uses: actions/checkout@v2 - name: deploy manpages to website env: - GH_TOKEN: ${{ secrets.GIT_DEPLOY_KEY }} + GH_TOKEN: ${{ secrets.GITLAB_DEPLOY_KEY }} run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick330602:$GH_TOKEN@github.com/wslutilities/wslutilities.github.io.git website + git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/documentation website cp -f ./CODE_OF_CONDUCT.md ./website/coc.md cp -f ./CONTRIBUTING.md ./website/contributing.md git --git-dir=./website/.git --work-tree=./website add -A diff --git a/.github/workflows/manpage.yml b/.github/workflows/manpage.yml index a0bafdb6..5d9cc011 100644 --- a/.github/workflows/manpage.yml +++ b/.github/workflows/manpage.yml @@ -17,11 +17,11 @@ jobs: run: bash -c "for x in docs/*; do groff \$x -mandoc -Thtml > \${x%.*}.html; done" - name: deploy manpages to website env: - GH_TOKEN: ${{ secrets.GIT_DEPLOY_KEY }} + GH_TOKEN: ${{ secrets.GITLAB_DEPLOY_KEY }} run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick330602:$GH_TOKEN@github.com/wslutilities/wslutilities.github.io.git website + git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/website website bash -x extras/scripts/manpage_deploy.bash git --git-dir=./website/.git --work-tree=./website add -A git --git-dir=./website/.git --work-tree=./website commit -m "Manpage update" From 19cef0a97955b9f951d7a1dafa7bc3fb08901eff Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 10 Mar 2024 22:34:37 +0800 Subject: [PATCH 25/44] ci: fixes for documentation deployment --- .github/workflows/docs.yml | 4 ++-- .github/workflows/manpage.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 127faed2..32ca833f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,11 +11,11 @@ jobs: - uses: actions/checkout@v2 - name: deploy manpages to website env: - GH_TOKEN: ${{ secrets.GIT_DEPLOY_KEY }} + GH_TOKEN: ${{ secrets.GITLAB_DEPLOY_KEY }} run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick330602:$GH_TOKEN@github.com/wslutilities/wslutilities.github.io.git website + git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/documentation website cp -f ./CODE_OF_CONDUCT.md ./website/coc.md cp -f ./CONTRIBUTING.md ./website/contributing.md git --git-dir=./website/.git --work-tree=./website add -A diff --git a/.github/workflows/manpage.yml b/.github/workflows/manpage.yml index a0bafdb6..5d9cc011 100644 --- a/.github/workflows/manpage.yml +++ b/.github/workflows/manpage.yml @@ -17,11 +17,11 @@ jobs: run: bash -c "for x in docs/*; do groff \$x -mandoc -Thtml > \${x%.*}.html; done" - name: deploy manpages to website env: - GH_TOKEN: ${{ secrets.GIT_DEPLOY_KEY }} + GH_TOKEN: ${{ secrets.GITLAB_DEPLOY_KEY }} run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick330602:$GH_TOKEN@github.com/wslutilities/wslutilities.github.io.git website + git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/website website bash -x extras/scripts/manpage_deploy.bash git --git-dir=./website/.git --work-tree=./website add -A git --git-dir=./website/.git --work-tree=./website commit -m "Manpage update" From 2029cb647a7cacd41acd8cae707f025289f2ad85 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Mon, 11 Mar 2024 23:54:46 +0800 Subject: [PATCH 26/44] fix: [#305] fix problematic name --- README.md | 2 +- docs/wslu.7 | 4 ++-- extras/build/alpine/APKBUILD | 2 +- extras/build/arch/PKGBUILD | 2 +- extras/build/rpm/copr/wslu.spec | 2 +- extras/build/rpm/obs/wslu.spec | 2 +- src/wslu-header | 2 +- tests/wslact.bats | 28 ++++++++++++++-------------- tests/wslfetch.bats | 4 ++-- tests/wslgsu.bats | 4 ++-- tests/wslsys.bats | 4 ++-- tests/wslupath.bats | 4 ++-- tests/wslusc.bats | 4 ++-- tests/wslvar.bats | 4 ++-- tests/wslview.bats | 4 ++-- 15 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 016a90c3..ca71523d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ > > If you have problems, please check whther you are using the [PPA version of wslu](https://launchpad.net/~wslutilities/+archive/ubuntu/wslu). If not, please report to the Ubuntu WSL team; However, the PPA version of wslu will address most issue that come from the built-in version. -This is a collection of utilities for the Linux Subsystem for Windows (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. +This is a collection of utilities for the Windows Subsystem for Linux (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. - Requires at least Windows 10 Creators Update; - Some of the features require a higher version of Windows; diff --git a/docs/wslu.7 b/docs/wslu.7 index 546aec55..4dbdb2c4 100644 --- a/docs/wslu.7 +++ b/docs/wslu.7 @@ -1,9 +1,9 @@ .TH "WSLU" "7" "DATEPLACEHOLDER" "VERSIONPLACEHOLDER" "WSL Utilities User Manual" .SH NAME .B wslu -A collection of utilities for the Linux Subsystem for Windows +A collection of utilities for the Windows Subsystem for Linux .SH DESCRIPTION -This is a collection of utilities for the Linux Subsystem for Windows (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. +This is a collection of utilities for the Windows Subsystem for Linux (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. .PP Requires Windows 10 Creators Update and higher. .SH AVAILABLE COMMANDS diff --git a/extras/build/alpine/APKBUILD b/extras/build/alpine/APKBUILD index a9b84cf8..05e01141 100644 --- a/extras/build/alpine/APKBUILD +++ b/extras/build/alpine/APKBUILD @@ -3,7 +3,7 @@ pkgname=wslu pkgver=4.1.0 pkgrel=0 -pkgdesc="A collection of utilities for the Linux Subsystem for Windows" +pkgdesc="A collection of utilities for the Windows Subsystem for Linux" url="https://github.com/wslutilities/wslu" arch="noarch" license="GPL-3.0-or-later" diff --git a/extras/build/arch/PKGBUILD b/extras/build/arch/PKGBUILD index 447e1025..3d87693f 100644 --- a/extras/build/arch/PKGBUILD +++ b/extras/build/arch/PKGBUILD @@ -3,7 +3,7 @@ pkgname=wslu pkgver=4.1.0 pkgrel=0 -pkgdesc="A collection of utilities for the Linux Subsystem for Windows" +pkgdesc="A collection of utilities for the Windows Subsystem for Linux" arch=('any') url='https://github.com/wslutilities/wslu' license=('GPL-3.0-or-later') diff --git a/extras/build/rpm/copr/wslu.spec b/extras/build/rpm/copr/wslu.spec index 66f8c5c1..8c928f61 100644 --- a/extras/build/rpm/copr/wslu.spec +++ b/extras/build/rpm/copr/wslu.spec @@ -1,5 +1,5 @@ %define packager Jinming Wu, Patrick -Summary: A collection of utilities for the Linux Subsystem for Windows +Summary: A collection of utilities for the Windows Subsystem for Linux Name: wslu Version: BUILDVERPLACEHOLDER Release: RELVERPLACEHOLDER diff --git a/extras/build/rpm/obs/wslu.spec b/extras/build/rpm/obs/wslu.spec index 53ecc681..a987b9dd 100644 --- a/extras/build/rpm/obs/wslu.spec +++ b/extras/build/rpm/obs/wslu.spec @@ -1,5 +1,5 @@ %define packager Jinming Wu, Patrick -Summary: A collection of utilities for the Linux Subsystem for Windows +Summary: A collection of utilities for the Windows Subsystem for Linux Name: wslu Version: BUILDVERPLACEHOLDER Release: RELVERPLACEHOLDER diff --git a/src/wslu-header b/src/wslu-header index 27ec8e18..b0daef0a 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -192,7 +192,7 @@ fi function help { app_name=$wslu_util_name - echo -e "$app_name - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL) + echo -e "$app_name - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL) Usage: $2 For more help for $app_name, please use the command \`man $app_name\` or visit the following site: https://wslutiliti.es/wslu/man/$app_name.html. diff --git a/tests/wslact.bats b/tests/wslact.bats index b880224d..a90d4d39 100644 --- a/tests/wslact.bats +++ b/tests/wslact.bats @@ -3,84 +3,84 @@ #wslact testing @test "wslact - Help" { run out/wslact --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact COMMAND ..." ] } @test "wslact - Help - Alt." { run out/wslact -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact COMMAND ..." ] } @test "wslact - Time Sync - Help" { run out/wslact time-sync --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - Help - Alt." { run out/wslact time-sync -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - short form - Help" { run out/wslact ts --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - short form - Help - Alt." { run out/wslact ts -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Smart Mounting - Help" { run out/wslact auto-mount --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - Help - Alt." { run out/wslact auto-mount -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - short form - Help" { run out/wslact am --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - short form - Help - Alt." { run out/wslact am -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Memory Reclamation - Help" { run out/wslact memory-reclaim --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - Help - Alt." { run out/wslact memory-reclaim -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - short form - Help" { run out/wslact mr --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - short form - Help - Alt." { run out/wslact mr -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } diff --git a/tests/wslfetch.bats b/tests/wslfetch.bats index 965da741..7d9ef491 100644 --- a/tests/wslfetch.bats +++ b/tests/wslfetch.bats @@ -8,12 +8,12 @@ @test "wslfetch - Help" { run out/wslfetch --help - [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslfetch [-hvcg] [-t THEME] [-o OPTIONS]" ] } @test "wslfetch - Help - Alt." { run out/wslfetch -h - [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslfetch [-hvcg] [-t THEME] [-o OPTIONS]" ] } diff --git a/tests/wslgsu.bats b/tests/wslgsu.bats index 2134a333..66b55f62 100644 --- a/tests/wslgsu.bats +++ b/tests/wslgsu.bats @@ -3,14 +3,14 @@ #wslgsu testing @test "wslgsu - Help" { run out/wslgsu --help - [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslgsu [-u USERNAME] [-n NAME] [-S] SERVICE/COMMAND" ] [ "${lines[2]}" = "wslgsu [-hvw]" ] } @test "wslgsu - Help - Alt." { run out/wslgsu -h - [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslgsu [-u USERNAME] [-n NAME] [-S] SERVICE/COMMAND" ] [ "${lines[2]}" = "wslgsu [-hvw]" ] } \ No newline at end of file diff --git a/tests/wslsys.bats b/tests/wslsys.bats index 1d5e6704..3843d4df 100644 --- a/tests/wslsys.bats +++ b/tests/wslsys.bats @@ -9,14 +9,14 @@ @test "wslsys - Help" { run out/wslsys --help - [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslsys\ \[\-VIbBFUWRKPSltTd\]\ \[\-s\]$ ]] [[ "${lines[2]}" =~ ^.*wslsys\ \[\-hv\]\ \[\-n\ NAME\]$ ]] } @test "wslsys - Help - Alt." { run out/wslsys -h - [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslsys\ \[\-VIbBFUWRKPSltTd\]\ \[\-s\]$ ]] [[ "${lines[2]}" =~ ^.*wslsys\ \[\-hv\]\ \[\-n\ NAME\]$ ]] } diff --git a/tests/wslupath.bats b/tests/wslupath.bats index ee57f52f..da00d982 100644 --- a/tests/wslupath.bats +++ b/tests/wslupath.bats @@ -10,14 +10,14 @@ @test "wslupath - Help" { run out/wslupath --help - [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslupath [-dOr] [-D|-A|-T|-S|-W|-s|-su|-H|-P|...NAME...]" ] [ "${lines[2]}" = "wslupath [-h|-v|-R]" ] } @test "wslupath - Help - Alt." { run out/wslupath -h - [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslupath [-dOr] [-D|-A|-T|-S|-W|-s|-su|-H|-P|...NAME...]" ] [ "${lines[2]}" = "wslupath [-h|-v|-R]" ] } diff --git a/tests/wslusc.bats b/tests/wslusc.bats index 97f3ec91..dcbfba3c 100644 --- a/tests/wslusc.bats +++ b/tests/wslusc.bats @@ -16,14 +16,14 @@ teardown() { @test "wslusc - Help" { run out/wslusc --help - [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND" ] [ "${lines[2]}" = "wslusc [-hv]" ] } @test "wslusc - Help - Alt." { run out/wslusc -h - [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND" ] [ "${lines[2]}" = "wslusc [-hv]" ] } diff --git a/tests/wslvar.bats b/tests/wslvar.bats index e74fe9b7..9d60797a 100644 --- a/tests/wslvar.bats +++ b/tests/wslvar.bats @@ -8,14 +8,14 @@ @test "wslvar - Help" { run out/wslvar --help - [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslvar [-sl] NAME" ] [ "${lines[2]}" = "wslvar [-hvSL]" ] } @test "wslvar - Help - Alt." { run out/wslvar -h - [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslvar [-sl] NAME" ] [ "${lines[2]}" = "wslvar [-hvSL]" ] } diff --git a/tests/wslview.bats b/tests/wslview.bats index cad22dff..d73e74c7 100644 --- a/tests/wslview.bats +++ b/tests/wslview.bats @@ -14,14 +14,14 @@ setup() { @test "wslview - Help" { run out/wslview --help - [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } @test "wslview - Help - Alt." { run out/wslview -h - [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } From 399dfe46fbbad55b159c9916d3e9cb16b701aaf8 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Mon, 11 Mar 2024 23:54:46 +0800 Subject: [PATCH 27/44] fix: [#305] fix problematic name --- README.md | 2 +- docs/wslu.7 | 4 ++-- extras/build/alpine/APKBUILD | 2 +- extras/build/arch/PKGBUILD | 2 +- extras/build/rpm/copr/wslu.spec | 2 +- extras/build/rpm/obs/wslu.spec | 2 +- src/wslu-header | 2 +- tests/wslact.bats | 28 ++++++++++++++-------------- tests/wslfetch.bats | 4 ++-- tests/wslgsu.bats | 4 ++-- tests/wslsys.bats | 4 ++-- tests/wslupath.bats | 4 ++-- tests/wslusc.bats | 4 ++-- tests/wslvar.bats | 4 ++-- tests/wslview.bats | 4 ++-- 15 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 016a90c3..ca71523d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ > > If you have problems, please check whther you are using the [PPA version of wslu](https://launchpad.net/~wslutilities/+archive/ubuntu/wslu). If not, please report to the Ubuntu WSL team; However, the PPA version of wslu will address most issue that come from the built-in version. -This is a collection of utilities for the Linux Subsystem for Windows (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. +This is a collection of utilities for the Windows Subsystem for Linux (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. - Requires at least Windows 10 Creators Update; - Some of the features require a higher version of Windows; diff --git a/docs/wslu.7 b/docs/wslu.7 index 546aec55..4dbdb2c4 100644 --- a/docs/wslu.7 +++ b/docs/wslu.7 @@ -1,9 +1,9 @@ .TH "WSLU" "7" "DATEPLACEHOLDER" "VERSIONPLACEHOLDER" "WSL Utilities User Manual" .SH NAME .B wslu -A collection of utilities for the Linux Subsystem for Windows +A collection of utilities for the Windows Subsystem for Linux .SH DESCRIPTION -This is a collection of utilities for the Linux Subsystem for Windows (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. +This is a collection of utilities for the Windows Subsystem for Linux (WSL), such as converting Linux paths to Windows paths or creating Linux application shortcuts on the Windows Desktop. .PP Requires Windows 10 Creators Update and higher. .SH AVAILABLE COMMANDS diff --git a/extras/build/alpine/APKBUILD b/extras/build/alpine/APKBUILD index a9b84cf8..05e01141 100644 --- a/extras/build/alpine/APKBUILD +++ b/extras/build/alpine/APKBUILD @@ -3,7 +3,7 @@ pkgname=wslu pkgver=4.1.0 pkgrel=0 -pkgdesc="A collection of utilities for the Linux Subsystem for Windows" +pkgdesc="A collection of utilities for the Windows Subsystem for Linux" url="https://github.com/wslutilities/wslu" arch="noarch" license="GPL-3.0-or-later" diff --git a/extras/build/arch/PKGBUILD b/extras/build/arch/PKGBUILD index 447e1025..3d87693f 100644 --- a/extras/build/arch/PKGBUILD +++ b/extras/build/arch/PKGBUILD @@ -3,7 +3,7 @@ pkgname=wslu pkgver=4.1.0 pkgrel=0 -pkgdesc="A collection of utilities for the Linux Subsystem for Windows" +pkgdesc="A collection of utilities for the Windows Subsystem for Linux" arch=('any') url='https://github.com/wslutilities/wslu' license=('GPL-3.0-or-later') diff --git a/extras/build/rpm/copr/wslu.spec b/extras/build/rpm/copr/wslu.spec index 66f8c5c1..8c928f61 100644 --- a/extras/build/rpm/copr/wslu.spec +++ b/extras/build/rpm/copr/wslu.spec @@ -1,5 +1,5 @@ %define packager Jinming Wu, Patrick -Summary: A collection of utilities for the Linux Subsystem for Windows +Summary: A collection of utilities for the Windows Subsystem for Linux Name: wslu Version: BUILDVERPLACEHOLDER Release: RELVERPLACEHOLDER diff --git a/extras/build/rpm/obs/wslu.spec b/extras/build/rpm/obs/wslu.spec index 53ecc681..a987b9dd 100644 --- a/extras/build/rpm/obs/wslu.spec +++ b/extras/build/rpm/obs/wslu.spec @@ -1,5 +1,5 @@ %define packager Jinming Wu, Patrick -Summary: A collection of utilities for the Linux Subsystem for Windows +Summary: A collection of utilities for the Windows Subsystem for Linux Name: wslu Version: BUILDVERPLACEHOLDER Release: RELVERPLACEHOLDER diff --git a/src/wslu-header b/src/wslu-header index 27ec8e18..b0daef0a 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -192,7 +192,7 @@ fi function help { app_name=$wslu_util_name - echo -e "$app_name - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL) + echo -e "$app_name - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL) Usage: $2 For more help for $app_name, please use the command \`man $app_name\` or visit the following site: https://wslutiliti.es/wslu/man/$app_name.html. diff --git a/tests/wslact.bats b/tests/wslact.bats index b880224d..a90d4d39 100644 --- a/tests/wslact.bats +++ b/tests/wslact.bats @@ -3,84 +3,84 @@ #wslact testing @test "wslact - Help" { run out/wslact --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact COMMAND ..." ] } @test "wslact - Help - Alt." { run out/wslact -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact COMMAND ..." ] } @test "wslact - Time Sync - Help" { run out/wslact time-sync --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - Help - Alt." { run out/wslact time-sync -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - short form - Help" { run out/wslact ts --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Time Sync - short form - Help - Alt." { run out/wslact ts -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact time-reset [-h]" ] } @test "wslact - Smart Mounting - Help" { run out/wslact auto-mount --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - Help - Alt." { run out/wslact auto-mount -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - short form - Help" { run out/wslact am --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Smart Mounting - short form - Help - Alt." { run out/wslact am -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact auto-mount [-mh]" ] } @test "wslact - Memory Reclamation - Help" { run out/wslact memory-reclaim --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - Help - Alt." { run out/wslact memory-reclaim -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - short form - Help" { run out/wslact mr --help - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } @test "wslact - Memory Reclamation - short form - Help - Alt." { run out/wslact mr -h - [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslact - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslact memory-reclaim [-h]" ] } diff --git a/tests/wslfetch.bats b/tests/wslfetch.bats index 965da741..7d9ef491 100644 --- a/tests/wslfetch.bats +++ b/tests/wslfetch.bats @@ -8,12 +8,12 @@ @test "wslfetch - Help" { run out/wslfetch --help - [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslfetch [-hvcg] [-t THEME] [-o OPTIONS]" ] } @test "wslfetch - Help - Alt." { run out/wslfetch -h - [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslfetch - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslfetch [-hvcg] [-t THEME] [-o OPTIONS]" ] } diff --git a/tests/wslgsu.bats b/tests/wslgsu.bats index 2134a333..66b55f62 100644 --- a/tests/wslgsu.bats +++ b/tests/wslgsu.bats @@ -3,14 +3,14 @@ #wslgsu testing @test "wslgsu - Help" { run out/wslgsu --help - [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslgsu [-u USERNAME] [-n NAME] [-S] SERVICE/COMMAND" ] [ "${lines[2]}" = "wslgsu [-hvw]" ] } @test "wslgsu - Help - Alt." { run out/wslgsu -h - [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslgsu - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslgsu [-u USERNAME] [-n NAME] [-S] SERVICE/COMMAND" ] [ "${lines[2]}" = "wslgsu [-hvw]" ] } \ No newline at end of file diff --git a/tests/wslsys.bats b/tests/wslsys.bats index 1d5e6704..3843d4df 100644 --- a/tests/wslsys.bats +++ b/tests/wslsys.bats @@ -9,14 +9,14 @@ @test "wslsys - Help" { run out/wslsys --help - [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslsys\ \[\-VIbBFUWRKPSltTd\]\ \[\-s\]$ ]] [[ "${lines[2]}" =~ ^.*wslsys\ \[\-hv\]\ \[\-n\ NAME\]$ ]] } @test "wslsys - Help - Alt." { run out/wslsys -h - [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslsys - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslsys\ \[\-VIbBFUWRKPSltTd\]\ \[\-s\]$ ]] [[ "${lines[2]}" =~ ^.*wslsys\ \[\-hv\]\ \[\-n\ NAME\]$ ]] } diff --git a/tests/wslupath.bats b/tests/wslupath.bats index ee57f52f..da00d982 100644 --- a/tests/wslupath.bats +++ b/tests/wslupath.bats @@ -10,14 +10,14 @@ @test "wslupath - Help" { run out/wslupath --help - [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslupath [-dOr] [-D|-A|-T|-S|-W|-s|-su|-H|-P|...NAME...]" ] [ "${lines[2]}" = "wslupath [-h|-v|-R]" ] } @test "wslupath - Help - Alt." { run out/wslupath -h - [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslupath - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslupath [-dOr] [-D|-A|-T|-S|-W|-s|-su|-H|-P|...NAME...]" ] [ "${lines[2]}" = "wslupath [-h|-v|-R]" ] } diff --git a/tests/wslusc.bats b/tests/wslusc.bats index 97f3ec91..dcbfba3c 100644 --- a/tests/wslusc.bats +++ b/tests/wslusc.bats @@ -16,14 +16,14 @@ teardown() { @test "wslusc - Help" { run out/wslusc --help - [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND" ] [ "${lines[2]}" = "wslusc [-hv]" ] } @test "wslusc - Help - Alt." { run out/wslusc -h - [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslusc - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND" ] [ "${lines[2]}" = "wslusc [-hv]" ] } diff --git a/tests/wslvar.bats b/tests/wslvar.bats index e74fe9b7..9d60797a 100644 --- a/tests/wslvar.bats +++ b/tests/wslvar.bats @@ -8,14 +8,14 @@ @test "wslvar - Help" { run out/wslvar --help - [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslvar [-sl] NAME" ] [ "${lines[2]}" = "wslvar [-hvSL]" ] } @test "wslvar - Help - Alt." { run out/wslvar -h - [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslvar - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [ "${lines[1]}" = "Usage: wslvar [-sl] NAME" ] [ "${lines[2]}" = "wslvar [-hvSL]" ] } diff --git a/tests/wslview.bats b/tests/wslview.bats index cad22dff..d73e74c7 100644 --- a/tests/wslview.bats +++ b/tests/wslview.bats @@ -14,14 +14,14 @@ setup() { @test "wslview - Help" { run out/wslview --help - [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } @test "wslview - Help - Alt." { run out/wslview -h - [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Linux Subsystem for Windows (WSL)" ] + [ "${lines[0]}" = "wslview - Part of wslu, a collection of utilities for Windows Subsystem for Linux (WSL)" ] [[ "${lines[1]}" =~ ^Usage\:\ .*wslview\ \[\-ehsvurE\]$ ]] [[ "${lines[2]}" =~ ^.*wslview\ \[\-E\ ENGINE\]\ LINK/FILE$ ]] } From 4ead018d9373a3a1cb92df3b75f5825af8a3a421 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 10 Apr 2024 23:38:34 +0800 Subject: [PATCH 28/44] fix(header): [#307] rewrite bash checking method and reduce required bash version --- src/wslu-header | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/wslu-header b/src/wslu-header index b0daef0a..1efa0e52 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -40,7 +40,9 @@ fi # prevent bash -x set +x -bash_version_major=$(echo "$BASH_VERSION" | cut -d'.' -f1) +bash_version_full=$(bash --version | head -n 1) +bash_version_major=$(echo "$bash_version_full" | cut -d ' ' -f 4 | cut -d '.' -f 1) +bash_version_minor=$(echo "$bash_version_full" | cut -d ' ' -f 4 | cut -d '.' -f 2) # pipeline content to pipe... if it is wslclip if [[ "$wslu_util_name" == "wslclip" ]]; then @@ -152,11 +154,12 @@ function error_echo { exit "$2" } -# Check if the major version number is greater than 5 -if [ "$(expr "$bash_version_major" \>= 5)" -ne 1 ]; then - error_echo "You should use Bash 5 and higher; exiting." 1 +# Check if the version number of bash is greater or equal to 4.4 +if [ "$bash_version_major" -lt 4 ] || { [ "$bash_version_major" -eq 4 ] && [ "$bash_version_minor" -lt 4 ]; }; then + error_echo "Bash version is too old. Please upgrade to 4.4 or later." 1 fi + # source default config if [ -f "${wslu_dest_dir}${wslu_prefix}/share/wslu/conf" ]; then debug_echo "source default setting" From a75dd3d2d8b18920828270ce77ae022fdc4f0623 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 10 Apr 2024 23:43:31 +0800 Subject: [PATCH 29/44] chore: vscode def small cleanup --- .vscode/extensions.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index acbb6e9c..e4bdf30a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,9 +1,5 @@ { "recommendations": [ "shakram02.bash-beautify", "jetmartin.bats", "timonwong.shellcheck" - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [ - ] } \ No newline at end of file From 3955de52b19aa14a6f225ee90ae8f9d74c7e0b1c Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 10 Apr 2024 23:50:31 +0800 Subject: [PATCH 30/44] chore: update version to 4.1.3 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 658e3ea6..2325db43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.2-1 +4.1.3-1 From 59249c1ae6a5a56502a1a74a32d3f6470b6e56f2 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 31 Jul 2024 22:42:40 +0800 Subject: [PATCH 31/44] chore: [GH#315] remove old unused configure.sh -i --- configure.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.sh b/configure.sh index f8b394b9..ae1b91f1 100644 --- a/configure.sh +++ b/configure.sh @@ -67,13 +67,6 @@ case $distro in esac } -function main_inst { -env_check -pkg_inst -make -sudo make DESTDIR=/usr install -} - function general_build_prep { sed -i s/VERSIONPLACEHOLDER/"$(cat ./VERSION)"/g ./src/wslu-header } @@ -117,7 +110,6 @@ for args; do --deb) deb_build_prep $2; exit;; -e|--env) env_check; exit;; -P|--pkg) pkg_inst; exit;; - -i|--install) main_inst; exit;; *) exit 1;; esac done From 7a6ddfc529d69b222d52e10dfdec9943106f6efe Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 31 Jul 2024 22:42:40 +0800 Subject: [PATCH 32/44] chore: [GH #315 ] remove old unused configure.sh -i --- configure.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/configure.sh b/configure.sh index f8b394b9..ae1b91f1 100644 --- a/configure.sh +++ b/configure.sh @@ -67,13 +67,6 @@ case $distro in esac } -function main_inst { -env_check -pkg_inst -make -sudo make DESTDIR=/usr install -} - function general_build_prep { sed -i s/VERSIONPLACEHOLDER/"$(cat ./VERSION)"/g ./src/wslu-header } @@ -117,7 +110,6 @@ for args; do --deb) deb_build_prep $2; exit;; -e|--env) env_check; exit;; -P|--pkg) pkg_inst; exit;; - -i|--install) main_inst; exit;; *) exit 1;; esac done From bc9b4fbaae464921295d19946577420cd47296ae Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 31 Jul 2024 23:27:48 +0800 Subject: [PATCH 33/44] build: [GH #314 ] prevent removal of wslpath --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23990093..81c3f35f 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,9 @@ install: doc_install res_install conf_install uninstall: for f in $(INSTEDEXES); do \ - rm -f $$f; \ + if [ `basename $$f` != "wslpath" ]; then \ + rm -f $$f; \ + fi; \ done for f in $(INSTEDMANOS); do \ rm -f $$f; \ From c3af5e18e326df9d4c41eebc1467f51bc2741383 Mon Sep 17 00:00:00 2001 From: Tim Schwenke Date: Wed, 31 Jul 2024 19:28:27 +0200 Subject: [PATCH 34/44] build: [GH #316 ] prevent removal of wslinfo --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 81c3f35f..f1dc82d2 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ install: doc_install res_install conf_install uninstall: for f in $(INSTEDEXES); do \ - if [ `basename $$f` != "wslpath" ]; then \ + if [ `basename $$f` != "wslpath" ] && [ `basename $$f` != "wslinfo" ]; then \ rm -f $$f; \ fi; \ done From 372746d41487cc22cf7e37185c628a701bbbb358 Mon Sep 17 00:00:00 2001 From: Jax Young Date: Thu, 22 Aug 2024 17:04:05 +0800 Subject: [PATCH 35/44] feat: register wslview as a XDG MIME applications This change allows desktop environment to find and use wslview to open registered MIME types. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f1dc82d2..fee8a420 100644 --- a/Makefile +++ b/Makefile @@ -42,6 +42,7 @@ uninstall: done rm -rf $(DESTDIR)$(PREFIX)/share/man/man7/wslu.7.gz rm -rf $(DESTDIR)$(PREFIX)/share/wslu + rm -f $(DESTDIR)$(PREFIX)/share/applications/wslview.desktop doc: [ -d $(OUTMANPATH) ] || mkdir $(OUTMANPATH) @@ -61,7 +62,7 @@ res_install: install -Dm 644 src/etc/*.ps1 -t $(DESTDIR)$(PREFIX)/share/wslu install -Dm 644 src/etc/*.ico -t $(DESTDIR)$(PREFIX)/share/wslu install -Dm 755 src/etc/*.sh -t $(DESTDIR)$(PREFIX)/share/wslu - install -Dm 644 src/etc/*.desktop $(DESTDIR)$(PREFIX)/share/wslu + install -Dm 644 src/etc/wslview.desktop -t $(DESTDIR)$(PREFIX)/share/applications install -Dm 644 src/etc/conf $(DESTDIR)$(PREFIX)/share/wslu conf_install: From 8305eab38bbad45505d6a9903ce3e96ea233337c Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 4 Sep 2024 10:27:07 +0800 Subject: [PATCH 36/44] ci: fix GHSA-cxww-7g56-2vh6 --- .github/workflows/pkgbuild.yml | 6 +++--- .github/workflows/pkgdeploy.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index d21b80eb..80894399 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -55,7 +55,7 @@ jobs: container: cimg/ruby:2.7 steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: PengwinDEBs - run: gem install package_cloud @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: OBS_RES - name: Install Pre-requisites @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: COPRRPMs - name: Install API token for copr-cli diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index ddc2af41..815014af 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -50,7 +50,7 @@ jobs: container: cimg/ruby:2.7 steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: PengwinDEBs - run: gem install package_cloud @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: OBS_RES - name: Install Pre-requisites @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@v1 + uses: actions/download-artifact@4.1.7 with: name: COPRRPMs - name: Install API token for copr-cli From 2d6103bc6333294bdf860b040896d01766eb8de8 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 4 Sep 2024 10:49:02 +0800 Subject: [PATCH 37/44] ci: fix bad artifact version number --- .github/workflows/pkgbuild.yml | 6 +++--- .github/workflows/pkgdeploy.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index 80894399..b0c08484 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -55,7 +55,7 @@ jobs: container: cimg/ruby:2.7 steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: PengwinDEBs - run: gem install package_cloud @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: OBS_RES - name: Install Pre-requisites @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: COPRRPMs - name: Install API token for copr-cli diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index 815014af..b9cfd4c5 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -50,7 +50,7 @@ jobs: container: cimg/ruby:2.7 steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: PengwinDEBs - run: gem install package_cloud @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: OBS_RES - name: Install Pre-requisites @@ -155,7 +155,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Retrive package for deployment - uses: actions/download-artifact@4.1.7 + uses: actions/download-artifact@v4 with: name: COPRRPMs - name: Install API token for copr-cli From 4bc7586726c5cf3c926eafa3707dee749a92d071 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 4 Sep 2024 11:03:00 +0800 Subject: [PATCH 38/44] ci: upgrade actions/checkout and actions/upload-artifact to v4 --- .github/workflows/docs.yml | 2 +- .github/workflows/manpage.yml | 2 +- .github/workflows/pkgbuild.yml | 8 ++++---- .github/workflows/pkgdeploy.yaml | 4 ++-- .github/workflows/tests.yaml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 32ca833f..ab94e812 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,7 @@ jobs: name: Documentation Deployment runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: deploy manpages to website env: GH_TOKEN: ${{ secrets.GITLAB_DEPLOY_KEY }} diff --git a/.github/workflows/manpage.yml b/.github/workflows/manpage.yml index 5d9cc011..1b244012 100644 --- a/.github/workflows/manpage.yml +++ b/.github/workflows/manpage.yml @@ -8,7 +8,7 @@ jobs: name: Manpage Generate and Deployment runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index b0c08484..ed41be52 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -10,7 +10,7 @@ jobs: name: Debian runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -31,7 +31,7 @@ jobs: name: Pengwin runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -67,7 +67,7 @@ jobs: name: RPM - OpenSUSE Build Service runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -122,7 +122,7 @@ jobs: name: RPM - Cool Other Package Repo runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index b9cfd4c5..81a887ab 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -67,7 +67,7 @@ jobs: runs-on: ubuntu-20.04 needs: tests steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -123,7 +123,7 @@ jobs: needs: tests runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0792f9ba..aff8b7c0 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,7 +9,7 @@ jobs: name: ShellCheck Tests runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -26,7 +26,7 @@ jobs: run: | git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: Vampire/setup-wsl@v1.2.0 with: distribution: Debian From 5c26eff62709c136a712f90343e9a0a2663a21e3 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 4 Sep 2024 11:11:05 +0800 Subject: [PATCH 39/44] ci: further fixes on missed actions/upload-artifact --- .github/workflows/pkgbuild.yml | 8 ++++---- .github/workflows/pkgdeploy.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index ed41be52..b25c8503 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -23,7 +23,7 @@ jobs: cd ../ mkdir -p ./pkgs mv ../wsl*.* ./pkgs - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: DebianDEBs path: pkgs @@ -44,7 +44,7 @@ jobs: cd ../ mkdir -p ./pkgs mv ../wsl*.* ./pkgs - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: PengwinDEBs path: pkgs @@ -88,7 +88,7 @@ jobs: mkdir obs_res cp ../wslu-*.tar.gz obs_res cp ../wslu-canary.spec obs_res - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: OBS_RES path: obs_res @@ -144,7 +144,7 @@ jobs: cp SRPMS/* compiled_rpms cp RPMS/noarch/* compiled_rpms #uses: robertdebock/rpmbuild-action@1.1.1 - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: COPRRPMs path: compiled_rpms diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index 81a887ab..c794f721 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -21,7 +21,7 @@ jobs: git clone https://github.com/wslutilities/wslu-debian builder cd ./builder bash ./build.sh latest debian buster - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: DebianDEBs path: builder/pkgs @@ -39,7 +39,7 @@ jobs: git clone https://github.com/wslutilities/wslu-debian builder cd ./builder bash ./build.sh latest pengwin - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: PengwinDEBs path: builder/pkgs @@ -88,7 +88,7 @@ jobs: mkdir obs_res cp ../wslu-*.tar.gz obs_res cp ../wslu.spec obs_res - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: OBS_RES path: obs_res @@ -144,7 +144,7 @@ jobs: mkdir compiled_rpms cp SRPMS/* compiled_rpms cp RPMS/noarch/* compiled_rpms - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: COPRRPMs path: compiled_rpms From 87704cf31f0ec3c97fc1fb89265264ecca99f2b2 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Wed, 4 Sep 2024 17:14:39 +0800 Subject: [PATCH 40/44] ci: fix chnages to download-artifact@v4 --- .github/workflows/pkgbuild.yml | 3 +++ .github/workflows/pkgdeploy.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/pkgbuild.yml b/.github/workflows/pkgbuild.yml index b25c8503..d91a416f 100644 --- a/.github/workflows/pkgbuild.yml +++ b/.github/workflows/pkgbuild.yml @@ -58,6 +58,7 @@ jobs: uses: actions/download-artifact@v4 with: name: PengwinDEBs + path: PengwinDEBs - run: gem install package_cloud - name: deploy to the dev env: @@ -101,6 +102,7 @@ jobs: uses: actions/download-artifact@v4 with: name: OBS_RES + path: OBS_RES - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -158,6 +160,7 @@ jobs: uses: actions/download-artifact@v4 with: name: COPRRPMs + path: COPRRPMs - name: Install API token for copr-cli env: API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} diff --git a/.github/workflows/pkgdeploy.yaml b/.github/workflows/pkgdeploy.yaml index c794f721..ff3dbabf 100644 --- a/.github/workflows/pkgdeploy.yaml +++ b/.github/workflows/pkgdeploy.yaml @@ -53,6 +53,7 @@ jobs: uses: actions/download-artifact@v4 with: name: PengwinDEBs + path: PengwinDEBs - run: gem install package_cloud - name: deploy to bullseye repo env: @@ -101,6 +102,7 @@ jobs: uses: actions/download-artifact@v4 with: name: OBS_RES + path: OBS_RES - name: Install Pre-requisites run: | sudo apt-get update -qq @@ -158,6 +160,7 @@ jobs: uses: actions/download-artifact@v4 with: name: COPRRPMs + path: COPRRPMs - name: Install API token for copr-cli env: API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }} From 5f8e8da79a50a9c004bf2895fd6770d702e331d5 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Thu, 5 Sep 2024 01:18:35 +0800 Subject: [PATCH 41/44] chore: remove stuff --- .gitignore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index b3f57400..3365763a 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,4 @@ compiled_rpms pkgs # system files -**/*/.DS_Store - -# Synk Scanning Cache -.dccache \ No newline at end of file +**/*/.DS_Store \ No newline at end of file From 1f01fc1d0c50598b842d4e8e7ca5f51265817708 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Mon, 28 Oct 2024 00:00:30 +0800 Subject: [PATCH 42/44] fix: [#319] check WSLInterop-late too --- src/wslu-header | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/wslu-header b/src/wslu-header index 1efa0e52..d1432431 100644 --- a/src/wslu-header +++ b/src/wslu-header @@ -78,10 +78,14 @@ if __wsl_conf_read interop enabled | grep false >/dev/null; then 2. under [interop] section, set enabled to true; 3. restart your distribution." exit 1 -elif grep ^disabled /proc/sys/fs/binfmt_misc/WSLInterop >/dev/null; then - echo -e "WSL Interopability is temporarily disabled and WSL Utilities won't work. Please enable it by: - # echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop" - exit 1 +elif [ -f /proc/sys/fs/binfmt_misc/WSLInterop ] && grep -q '^disabled' /proc/sys/fs/binfmt_misc/WSLInterop; then + echo "WSL Interopability is temporarily disabled and WSL Utilities won't work. Please enable it by: + # echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop" + exit 1 +elif [ -f /proc/sys/fs/binfmt_misc/WSLInterop-late ] && grep -q '^disabled' /proc/sys/fs/binfmt_misc/WSLInterop-late; then + echo "WSL Interopability is temporarily disabled and WSL Utilities won't work. Please enable it by: + # echo 1 > /proc/sys/fs/binfmt_misc/WSLInterop-late" + exit 1 fi # when --verbose, verbose; when --debug, debug. From 3dabbee85c64b9e09d3fb266fa96676d2e76c31f Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 17 Nov 2024 23:36:28 +0800 Subject: [PATCH 43/44] chore: release 4.1.4 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 2325db43..5e5ff801 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.1.3-1 +4.1.4-1 From 5004f1367922449f53e567305dddc4f6f013d621 Mon Sep 17 00:00:00 2001 From: "Jinming Wu, Patrick" Date: Sun, 17 Nov 2024 23:41:44 +0800 Subject: [PATCH 44/44] ci: fix a url error --- .github/workflows/docs.yml | 2 +- .github/workflows/manpage.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ab94e812..1f25f89c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,7 +15,7 @@ jobs: run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/documentation website + git clone --depth 1 https://patrick:$GH_TOKEN@code.wedotstud.io/wslu/documentation website cp -f ./CODE_OF_CONDUCT.md ./website/coc.md cp -f ./CONTRIBUTING.md ./website/contributing.md git --git-dir=./website/.git --work-tree=./website add -A diff --git a/.github/workflows/manpage.yml b/.github/workflows/manpage.yml index 1b244012..caaefe72 100644 --- a/.github/workflows/manpage.yml +++ b/.github/workflows/manpage.yml @@ -21,7 +21,7 @@ jobs: run: | git config --global user.email "me@patrickwu.space" git config --global user.name "Jinming Wu, Patrick" - git clone --depth 1 https://patrick:$GH_TOKEN@git.wedotstud.io/wslu/website website + git clone --depth 1 https://patrick:$GH_TOKEN@code.wedotstud.io/wslu/website website bash -x extras/scripts/manpage_deploy.bash git --git-dir=./website/.git --work-tree=./website add -A git --git-dir=./website/.git --work-tree=./website commit -m "Manpage update"