Skip to content

Commit

Permalink
Merge pull request wslutilities#132 from wslutilities/lts/master
Browse files Browse the repository at this point in the history
wslu 3.2.0 Long Term Support
  • Loading branch information
patrick330602 authored Aug 15, 2020
2 parents 248304b + c79a4c0 commit a33ce0a
Show file tree
Hide file tree
Showing 32 changed files with 235 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pkgbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- develop
- dev/**
- 3.x/**
- lts/**
jobs:
debbuild:
name: Debian
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ clean:
rm -rf $(OUTMANPATH)

test:
extras/bats/libexec/bats tests/header.bats tests/wslsys.bats tests/wslusc.bats tests/wslupath.bats tests/wslvar.bats tests/wslfetch.bats tests/wslview.bats tests/wslact.bats
extras/bats/bin/bats -r tests
6 changes: 2 additions & 4 deletions README.eo.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ Aro de rapidaj agoj por WSL, kiel repide surmeti ĉiujn Vindozajn diskingojn aŭ

### Alpine Linux

Oni povas instali `wslu` el **Alpine Linux community** per la jenaj komandoj:
Oni povas instali `wslu` el **Alpine Linux 3.12+** per la jenaj komandoj:

```
$ echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community/" | sudo tee -a /etc/apk/repositories
$ sudo apk update
$ sudo apk add wslu@testing
sudo apk add wslu
```

### Arch Linux
Expand Down
6 changes: 2 additions & 4 deletions README.hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@

### Alpine Linux

你可以用以下命令安装 `wslu`
你可以用以下命令从 **Alpine Linux 3.12+** 安装 `wslu`

```
$ echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community/" | sudo tee -a /etc/apk/repositories
$ sudo apk update
$ sudo apk add wslu@testing
sudo apk add wslu
```

### Arch Linux
Expand Down
6 changes: 2 additions & 4 deletions README.hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@

### Alpine Linux

你可以用以下指令安裝 `wslu`
你可以用以下指令通過 **Alpine Linux 3.12+** 安裝 `wslu`

```
$ echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community/" | sudo tee -a /etc/apk/repositories
$ sudo apk update
$ sudo apk add wslu@testing
sudo apk add wslu
```

### Arch Linux
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ A set of quick actions for WSL such as quickly mounting all drives or manually s

### Alpine Linux

You can install `wslu` from Alpine Linux community with the following command:
You can install `wslu` on **Alpine Linux 3.12+** with the following command:

```
$ echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/community/" | sudo tee -a /etc/apk/repositories
$ sudo apk update
$ sudo apk add wslu@testing
sudo apk add wslu
```

### Arch Linux
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1-1
3.2.0-1
11 changes: 6 additions & 5 deletions docs/wslact.1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Currently, we have two features available:
.in +4n
.nf
\fBts, time-sync\fR \- Time Sync
\fBsm, smart-mount\fR \- Smart Mounting
\fBsm, auto-mount\fR \- Auto Mounting
.fi
.in
.SH COMMANDS
Expand All @@ -31,11 +31,11 @@ OPTIONS
print a simple help.
.in
.fi
.SS "Smart Mounting"
Smart Mounting (\fIsmart-mount\fR) feature allows you to mount all drives available on Windows to WSL. Requires sudo.
.SS "Auto Mounting"
Smart Mounting (\fIauto-mount\fR) feature allows you to mount all drives available on Windows to WSL. Requires sudo.
.TP
SYNOPSIS
.B wslact smart-mount
.B wslact auto-mount
.RB [ \-h ]
.TP
OPTIONS
Expand All @@ -61,7 +61,8 @@ print current version.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
3 changes: 2 additions & 1 deletion docs/wslfetch.1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ add a colorbar to the printed information.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
5 changes: 3 additions & 2 deletions docs/wslsys.1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- Component of Windows 10 Linux Subsystem Utility
.SH SYNOSIS
.B wslsys
.RB [ \-IbBFUWRKPSlt ]
.RB [ \-VIbBFUWRKPSlt ]
.RB [ \-s ]
.PP
.B wslsys
Expand Down Expand Up @@ -77,7 +77,8 @@ For example, \fB"light"\fR.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
7 changes: 4 additions & 3 deletions docs/wslu.7
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a collection of utilities for Windows 10 Linux Subsystem, such as enabli
- Kali Linux
- OpenSUSE Leap 42, 12.0 and 15.0
- SUSE Linux Enterprise Server 12 and 15
- Ubuntu Latest, 16.04 LTS and 18.04 LTS
- Ubuntu Latest, 16.04 LTS, 18.04 LTS and 20.04 LTS
- Pengwin(Formerly WLinux)
.fi

Expand Down Expand Up @@ -67,10 +67,11 @@ unsupported feature (for a distro)
.B 40
Unknown system input.
.SH BUG
Report bugs to https://github.com/wslutilities/wslu/issues.
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under the terms of the GNU GPL version 3 or (at your option) any later version. There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Logo of WSL Utilities and wslusc icons is licensed under CC BY 4.0 International License.

For third-party license, please refer to https://wslutiliti.es/wslu/licenses.
For third-party license, please refer to <https://wslutiliti.es/wslu/licenses.html>.
5 changes: 4 additions & 1 deletion docs/wslupath.1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ print available registry input
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.PP
.B However, keep in mind this tool is deprecated and bugs reported for this tool will have a high chance to be ignored.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
3 changes: 2 additions & 1 deletion docs/wslusc.1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ interactive mode.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
3 changes: 2 additions & 1 deletion docs/wslvar.1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ show available Shell folder environment variables.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
3 changes: 2 additions & 1 deletion docs/wslview.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ register \fBwslview\fR as the default WSL web browser.
.SH AUTHOR
Created by Patrick Wu <[email protected]>
.SH REPORTING BUGS
Report bugs to <https://github.com/wslutilities/wslu/issues>
Report bugs to <https://github.com/wslutilities/wslu/issues>;
For Ubuntu specific/related bugs, report to <https://bugs.launchpad.net/ubuntu/+source/wslu>.
.SH COPYRIGHT
This is free software; you can redistribute it and/or modify it under
the terms of the GNU GPL version 3 or (at your option) any later
Expand Down
1 change: 0 additions & 1 deletion extras/bats
Submodule bats deleted from b1da56
2 changes: 1 addition & 1 deletion extras/build/alpine/APKBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Patrick Wu <[email protected]>
# Contributor: Patrick Wu <[email protected]>
pkgname=wslu
pkgver=3.0.1
pkgver=3.2.0
pkgrel=0
pkgdesc="A collection of utilities for Windows 10 Linux Subsystems"
url="https://github.com/wslutilities/wslu"
Expand Down
2 changes: 1 addition & 1 deletion extras/build/arch/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Patrick Wu <[email protected]>

pkgname=wslu
pkgver=3.0.1
pkgver=3.2.0
pkgrel=0
pkgdesc="A collection of utilities for Windows 10 Linux Subsystems"
arch=('any')
Expand Down
32 changes: 11 additions & 21 deletions src/etc/runHidden.vbs
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
' Mehthod by @mklement0 on Stack Overflow
' https://stackoverflow.com/questions/41225711/wsl-run-linux-from-windows-without-spawning-a-cmd-window
' Usage: wscript .\runHidden.vbs bash -c <COMMAND>
' Simple command-line help.
select case WScript.Arguments(0)
case "-?", "/?", "-h", "--help"
WScript.echo "Usage: runHidden executable [...]" & vbNewLine & vbNewLine & "Runs the specified command hidden (without a visible window)."
WScript.Quit(0)
end select
' Method provided by Tobias J by https://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window
If WScript.Arguments.Count >= 1 Then
ReDim arr(WScript.Arguments.Count-1)
For i = 0 To WScript.Arguments.Count-1
Arg = WScript.Arguments(i)
If InStr(Arg, " ") > 0 Then Arg = """" & Arg & """"
arr(i) = Arg
Next

' Separate the arguments into the executable name
' and a single string containing all arguments.
exe = WScript.Arguments(0)
sep = ""
for i = 1 to WScript.Arguments.Count -1
' Enclose arguments in "..." to preserve their original partitioning.
args = args & sep & """" & WScript.Arguments(i) & """"
sep = " "
next

' Execute the command with its window *hidden* (0)
WScript.CreateObject("Shell.Application").ShellExecute exe, args, "", "open", 0
RunCmd = Join(arr)
CreateObject("Wscript.Shell").Run RunCmd, 0, True
End If
Empty file modified src/etc/sudo.ps1
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions src/etc/wslusc-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,6 @@ export GDK_SCALE=$win_sys_scaling
export QT_SCALE_FACTOR=$win_sys_scaling
export GDK_DPI_SCALE=1

[ "$1" = "--no-cmd-mode" ] && exit 0
cd ~ || exit
bash -l -c "$*"
17 changes: 7 additions & 10 deletions src/wslact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,16 @@ function time_sync {
esac
done

if [ "$EUID" -ne 0 ]
then echo "${error} \`wslact time-sync\` requires you to run as root. Aborted."
exit 1
if [ "$EUID" -ne 0 ]; then
error_echo "\`wslact time-sync\` requires you to run as root. Aborted." 1
fi

echo "${info} Before Sync: $(date +"%d %b %Y %T %Z")"
if date -s "$(winps_exec "Get-Date -UFormat \"%m/%d/%Y %T %Z\"" | tr -d "\r")" >/dev/null; then
echo "${info} After Sync: $(date +"%d %b %Y %T %Z")"
echo "${info} Manual Time Sync Complete."
else
echo "${error} Time Sync failed."
exit 1
error_echo "Time Sync failed." 1
fi
}

Expand All @@ -42,9 +40,8 @@ function auto_mount {
esac
done

if [ "$EUID" -ne 0 ]
then echo "${error} \`wslact auto-mount\` requires you to run as root. Aborted."
exit 1
if [ "$EUID" -ne 0 ]; then
error_echo "\`wslact auto-mount\` requires you to run as root. Aborted." 1
fi


Expand Down Expand Up @@ -86,10 +83,10 @@ function auto_mount {

while [ "$1" != "" ]; do
case "$1" in
am|auto-mount) auto_mount "$@"; exit;;
am|auto-mount|sm|smart-mount) auto_mount "$@"; exit;;
ts|time-sync) time_sync "$@"; exit;;
-h|--help) help "$0" "$help_short"; exit;;
-v|--version) echo "wslu v$wslu_version; wslact v$version"; exit;;
*) echo "${error} Invalid Input. Aborted."; exit 22;;
*) error_echo "Invalid Input. Aborted." 22;;
esac
done
16 changes: 8 additions & 8 deletions src/wslsys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ function call_branch() {
}

function call_build() {
build=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion" /v CurrentBuild | tail -n 2 | head -n 1 | sed -e 's|\r||g')
echo "${build##* }"
wslu_get_build
}

function call_full_build() {
Expand Down Expand Up @@ -61,14 +60,15 @@ function get_wsl_version() {
wslutmpbuild="$(( $(call_build) + 0 ))"
if [ $wslutmpbuild -ge $BN_MAY_NINETEEN ]; then
# The environment variable only available in 19H1 or later.
wslu_distro_regpath=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Lxss" /s /f DistributionName 2>&1 | grep -B1 -e "$WSL_DISTRO_NAME" | head -n1 | sed -e 's|\r||g')
if "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "$wslu_distro_regpath" /v Version &>/dev/null; then
wslu_distro_version=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "$wslu_distro_regpath" /v Version | tail -n 2 | head -n 1 | sed -e 's|\r||g')
wslu_distro_regpath=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Lxss" /s /f DistributionName 2>&1 | sed -e 's|\r||g' | grep -B1 -e "$WSL_DISTRO_NAME$" | head -n1 )
if "$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "$wslu_distro_regpath" /v Flags &>/dev/null; then
wslu_distro_version=$("$(interop_prefix)$(sysdrive_prefix)"/Windows/System32/reg.exe query "$wslu_distro_regpath" /v Flags | tail -n 2 | head -n 1 | sed -e 's|\r||g')
wslu_distro_version=${wslu_distro_version##* }
if [ "$wslu_distro_version" != "0x2" ]; then
echo "1"
else
wslu_distro_version_processed=$(expr $(printf "%d\n" "$wslu_distro_version") / 8)
if [ "$wslu_distro_version_processed" == "1" ]; then
echo "2"
elif [ "$wslu_distro_version_processed" == "0" ]; then
echo "1"
fi
else
echo "1"
Expand Down
Loading

0 comments on commit a33ce0a

Please sign in to comment.