Skip to content

Commit c3af54a

Browse files
committed
Merge pull request msys2#536 from Karlson2k/bat_files_04a
Bat files next update
2 parents adedcc0 + bad7377 commit c3af54a

File tree

5 files changed

+82
-86
lines changed

5 files changed

+82
-86
lines changed

filesystem/PKGBUILD

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
22

33
pkgname=filesystem
4-
pkgver=2016.03
5-
pkgrel=2
4+
pkgver=2016.04
5+
pkgrel=1
66
pkgdesc='Base filesystem'
77
arch=('i686' 'x86_64')
88
license=('BSD')
@@ -23,6 +23,7 @@ source=('bash.bash_logout'
2323
'dot.inputrc'
2424
'dot.profile'
2525
'fstab'
26+
'start_shell.cmd'
2627
'mingw32_shell.bat'
2728
'mingw64_shell.bat'
2829
'msys2_shell.bat'
@@ -51,9 +52,10 @@ sha256sums=('6d651f6b0b2d173961a3fa21acd9d44c783ed9cd73a031687698c8b9ed1f6dee'
5152
'b896abbbd7187184045e42e2646d4cb25f5484a27558f780137c7ec9ca9bdc47'
5253
'50c3746d621e682e3560e1b37cc1ac5d988460064a20ed15f107c203ac5ad622'
5354
'9620bdf1c82ea3f14c3553c44a2006ea61ff3f5a775a2a053130a59cc186daf5'
54-
'baba77f6d2a1878c79269950313a19b56a1d19c04bd670f67cb761720e3ea97a'
55-
'4cfb4c0d66f8d7799302159f6a5db073503135c65c677d224990f958f6d1b7c5'
56-
'b3deb47f92bdb9c38076da8603151d29a79280cd19d4c93a0671d9f56271f0d0'
55+
'15e6605867d891c0cc64ed3506280bc9d391d52475471a39cd809e6de289d91d'
56+
'147773db7cb87fe09f735b5f47ff0dc3e1ffb8bf3149a51636341f7f61feec11'
57+
'fd6d475058e122823aa8665d8c8bf6bde251524fbba954c1f1c941c10ea46f7f'
58+
'eae2795591117fd3d7665d94a7b1827e13176580bc5a16d65350c584df5aaa7e'
5759
'7d6994d7caf52a459b562cfb0da1d758a4b7bca478d1df00de3a96686e59008e'
5860
'91f1f918cf13deab0124082086e990786113b0e710dbda4678d8fc14905ad94d'
5961
'c2f0bd7714f4909c8be30217e6f68929ab5ea2856ebb04663e9e709cc35416d5'
@@ -108,6 +110,7 @@ package() {
108110
install -m644 ${srcdir}/profile.lang.sh etc/profile.d/lang.sh
109111

110112
install -m644 ${srcdir}/msys2.ico msys2.ico
113+
install -m755 ${srcdir}/start_shell.cmd start_shell.cmd
111114
install -m755 ${srcdir}/msys2_shell.bat msys2_shell.bat
112115
install -m755 ${srcdir}/mingw32_shell.bat mingw32_shell.bat
113116
install -m755 ${srcdir}/mingw64_shell.bat mingw64_shell.bat

filesystem/mingw32_shell.bat

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
:
22
@echo off
33

4-
if NOT "x%WD%" == "x" set WD=
5-
6-
if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0usr\bin\
7-
8-
set MSYSTEM=MINGW32
9-
104
rem To activate windows native symlinks uncomment next line
115
rem set MSYS=winsymlinks:nativestrict
126

@@ -16,25 +10,5 @@ rem set MSYS=error_start:%WD%../../mingw32/bin/qtcreator.exe^|-debug^|^<process-
1610
rem To export full current PATH from environment into MSYS2 uncomment next line
1711
rem set SET_FULL_PATH=1
1812

19-
set MSYSCON=mintty.exe
20-
if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe
21-
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe
22-
23-
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
24-
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
25-
26-
:startmintty
27-
if NOT EXIST %WD%mintty.exe goto startsh
28-
start %WD%mintty -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
29-
exit /b %ERRORLEVEL%
30-
31-
:startconsolez
32-
cd %WD%..\lib\ConsoleZ
33-
start console -t "MinGW" -r %1 %2 %3 %4 %5 %6 %7 %8 %9
34-
exit /b %ERRORLEVEL%
35-
36-
:startsh
37-
start %WD%sh --login -i %1 %2 %3 %4 %5 %6 %7 %8 %9
38-
exit /b %ERRORLEVEL%
39-
13+
call "%~dp0start_shell.cmd" -mingw32 %*
4014
:EOF

filesystem/mingw64_shell.bat

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
:
22
@echo off
33

4-
if NOT "x%WD%" == "x" set WD=
5-
6-
if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0usr\bin\
7-
8-
set MSYSTEM=MINGW64
9-
104
rem To activate windows native symlinks uncomment next line
115
rem set MSYS=winsymlinks:nativestrict
126

@@ -16,25 +10,5 @@ rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-
1610
rem To export full current PATH from environment into MSYS2 uncomment next line
1711
rem set SET_FULL_PATH=1
1812

19-
set MSYSCON=mintty.exe
20-
if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe
21-
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe
22-
23-
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
24-
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
25-
26-
:startmintty
27-
if NOT EXIST %WD%mintty.exe goto startsh
28-
start %WD%mintty -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
29-
exit /b %ERRORLEVEL%
30-
31-
:startconsolez
32-
cd %WD%..\lib\ConsoleZ
33-
start console -t "MinGW" -r %1 %2 %3 %4 %5 %6 %7 %8 %9
34-
exit /b %ERRORLEVEL%
35-
36-
:startsh
37-
start %WD%sh --login -i %1 %2 %3 %4 %5 %6 %7 %8 %9
38-
exit /b %ERRORLEVEL%
39-
13+
call "%~dp0start_shell.cmd" -mingw64 %*
4014
:EOF

filesystem/msys2_shell.bat

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
:
22
@echo off
33

4-
if NOT "x%WD%" == "x" set WD=
5-
6-
if NOT EXIST %WD%msys-2.0.dll set WD=%~dp0usr\bin\
7-
8-
set MSYSTEM=MSYS
9-
104
rem To activate windows native symlinks uncomment next line
115
rem set MSYS=winsymlinks:nativestrict
126

@@ -16,25 +10,5 @@ rem set MSYS=error_start:%WD%../../mingw32/bin/qtcreator.exe^|-debug^|^<process-
1610
rem To export full current PATH from environment into MSYS2 uncomment next line
1711
rem set SET_FULL_PATH=1
1812

19-
set MSYSCON=mintty.exe
20-
if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe
21-
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe
22-
23-
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
24-
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
25-
26-
:startmintty
27-
if NOT EXIST %WD%mintty.exe goto startsh
28-
start %WD%mintty -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
29-
exit /b %ERRORLEVEL%
30-
31-
:startconsolez
32-
cd %WD%..\lib\ConsoleZ
33-
start console -t "MSys2" -r %1 %2 %3 %4 %5 %6 %7 %8 %9
34-
exit /b %ERRORLEVEL%
35-
36-
:startsh
37-
start %WD%sh --login -i %1 %2 %3 %4 %5 %6 %7 %8 %9
38-
exit /b %ERRORLEVEL%
39-
13+
call "%~dp0start_shell.cmd" -msys %*
4014
:EOF

filesystem/start_shell.cmd

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
@echo off
2+
3+
set "WD=%__CD__%"
4+
if NOT EXIST "%WD%msys-2.0.dll" set "WD=%~dp0usr\bin\"
5+
6+
rem To activate windows native symlinks uncomment next line
7+
rem set MSYS=winsymlinks:nativestrict
8+
9+
rem Set debugging program for errors
10+
rem set MSYS=error_start:%WD%../../mingw64/bin/qtcreator.exe^|-debug^|^<process-id^>
11+
12+
rem To export full current PATH from environment into MSYS2 use '-use-full-path' parameter
13+
rem or uncomment next line
14+
rem set SET_FULL_PATH=1
15+
16+
:checkparams
17+
rem Shell types
18+
if "x%~1" == "x-msys" shift& set MSYSTEM=MSYS& goto :checkparams
19+
if "x%~1" == "x-msys2" shift& set MSYSTEM=MSYS& goto :checkparams
20+
if "x%~1" == "x-mingw32" shift& set MSYSTEM=MINGW32& goto :checkparams
21+
if "x%~1" == "x-mingw64" shift& set MSYSTEM=MINGW64& goto :checkparams
22+
if "x%~1" == "x-mingw" shift& (
23+
if exist "%WD%..\..\mingw64" (set MSYSTEM=MINGW64) else (set MSYSTEM=MINGW32)
24+
)& goto :checkparams
25+
rem Console types
26+
if "x%~1" == "x-consolez" shift& set MSYSCON=console.exe& goto :checkparams
27+
if "x%~1" == "x-mintty" shift& set MSYSCON=mintty.exe& goto :checkparams
28+
if "x%~1" == "x-defterm" shift& set MSYSCON=defterm& goto :checkparams
29+
rem Other parameters
30+
if "x%~1" == "x-use-full-path" shift& set SET_FULL_PATH=1& goto :checkparams
31+
32+
33+
rem Autodetect shell type if not specified
34+
if not defined MSYSTEM (
35+
if exist "%WD%..\..\mingw64" (
36+
set MSYSTEM=MINGW64
37+
) else if exist "%WD%..\..\mingw32" (
38+
set MSYSTEM=MINGW32
39+
) else (set MSYSTEM=MSYS)
40+
)
41+
42+
rem Setup proper title
43+
if "%MSYSTEM%" == "MSYS" (
44+
set CONTITLE=MSys2
45+
) else if "%MSYSTEM%" == "MINGW32" (
46+
set "CONTITLE=MinGW x32"
47+
) else if "%MSYSTEM%" == "MINGW64" (
48+
set "CONTITLE=MinGW x64"
49+
)
50+
51+
if "x%MSYSCON%" == "xmintty.exe" goto startmintty
52+
if "x%MSYSCON%" == "xconsole.exe" goto startconsolez
53+
if "x%MSYSCON%" == "xdefterm" goto startsh
54+
55+
if NOT EXIST "%WD%mintty.exe" goto startsh
56+
set MSYSCON=mintty.exe
57+
:startmintty
58+
start "%CONTITLE%" "%WD%mintty" -i /msys2.ico /usr/bin/bash --login %1 %2 %3 %4 %5 %6 %7 %8 %9
59+
exit /b %ERRORLEVEL%
60+
61+
:startconsolez
62+
cd %WD%..\lib\ConsoleZ
63+
start console -t "%CONTITLE%" -r %1 %2 %3 %4 %5 %6 %7 %8 %9
64+
exit /b %ERRORLEVEL%
65+
66+
:startsh
67+
set MSYSCON=
68+
start "%CONTITLE%" "%WD%bash" --login %1 %2 %3 %4 %5 %6 %7 %8 %9
69+
exit /b %ERRORLEVEL%
70+
71+
:EOF

0 commit comments

Comments
 (0)