Author: dreimer
Date: Thu Jan 15 05:40:40 2009
New Revision: 38767
URL:
http://svn.reactos.org/svn/reactos?rev=38767&view=rev
Log:
Prettyfy the output of clean.*
First try to make options.exe generate a options file fir PS and CMD. Right now the ps1
file isalways empty... No Idea why
Modified:
trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1
trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd
trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c
Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershe…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/Clean.ps1 [iso-8859-1] Thu Jan 15 05:40:40
2009
@@ -57,6 +57,10 @@
$_ROSBE_MAKEFILE = "makefile.auto"
}
+ if ($ENV:ROS_ARCH -eq $null) {
+ $ENV:ROS_ARCH = "i386"
+ }
+
if (Test-Path "$_ROSBE_OBJCLEANPATH\.") {
"Cleaning ReactOS $ENV:ROS_ARCH source directory..."
if (Test-Path "$_ROSBE_OBJCLEANPATH\.") {
@@ -71,6 +75,10 @@
"Done cleaning ReactOS $ENV:ROS_ARCH source directory."
} else {
"ERROR: There is no $ENV:ROS_ARCH compiler output to clean."
+ }
+
+ if ($ENV:ROS_ARCH -eq "i386") {
+ $ENV:ROS_ARCH = $null
}
if (Test-Path "reactos") {
Modified: trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cle…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] Thu Jan 15 05:40:40 2009
@@ -84,6 +84,10 @@
set _ROSBE_MAKEFILE=makefile.auto
)
+if "%ROS_ARCH%" == "" (
+ set ROS_ARCH=i386
+)
+
if exist "%_ROSBE_OBJCLEANPATH%\." (
echo Cleaning ReactOS %ROS_ARCH% source directory...
if exist "%_ROSBE_OBJCLEANPATH%\." (
@@ -98,6 +102,10 @@
echo Done cleaning ReactOS %ROS_ARCH% source directory.
) else (
echo ERROR: There is no %ROS_ARCH% compiler output to clean.
+)
+
+if "%ROS_ARCH%" == "i386" (
+ set ROS_ARCH=
)
:ROS
Modified: trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Tools/co…
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Tools/config/options.c [iso-8859-1] Thu Jan 15
05:40:40 2009
@@ -40,7 +40,7 @@
static
const
WCHAR*
-getConfigFile()
+getConfigFileCMD()
{
static WCHAR filename[MAX_PATH];
if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE))
@@ -55,6 +55,23 @@
return filename;
}
+static
+const
+WCHAR*
+getConfigFilePS1()
+{
+ static WCHAR filename[MAX_PATH];
+ if (SHGetSpecialFolderPathW(NULL, filename, CSIDL_APPDATA, FALSE))
+ {
+ if ((wcslen(filename) + wcslen(L"\\RosBE\\rosbe-options.ps1")) <
MAX_PATH)
+ wcscat(filename, L"\\RosBE\\rosbe-options.ps1");
+ }
+ else
+ {
+ wcscpy(filename, L"rosbe-options.ps1");
+ }
+ return filename;
+}
INT
WriteSettings(POPTIONS_DLG infoPtr)
@@ -64,7 +81,7 @@
WCHAR logdir[MAX_PATH], objdir[MAX_PATH], outdir[MAX_PATH], mingwpath[MAX_PATH],
checkmgw[MAX_PATH];
WCHAR msgerror[256];
HANDLE hFile;
- FILE *pFile;
+ FILE *pFilecmd, *pFileps1;
showtime = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SHOWBUILDTIME, BM_GETCHECK, 0,
0) == BST_CHECKED);
writelog = (SendDlgItemMessage(infoPtr->hwndDlg, ID_SAVELOGS, BM_GETCHECK, 0, 0)
== BST_CHECKED);
@@ -104,26 +121,49 @@
}
CloseHandle(hFile);
- pFile = _wfopen(getConfigFile(), L"w");
- if (pFile)
- {
- fwprintf(pFile, L"::\n");
- fwprintf(pFile, L":: This file has been automatically generated by the
ReactOS\n");
- fwprintf(pFile, L":: Build Environment options utility.\n");
- fwprintf(pFile, L"::\n\n");
- fwprintf(pFile, L"color %X%X\n", background, foreground);
- fwprintf(pFile, L"set _ROSBE_SHOWTIME=%d\n", showtime);
- fwprintf(pFile, L"set _ROSBE_USECCACHE=%d\n", useccache);
- fwprintf(pFile, L"set _ROSBE_STRIP=%d\n", strip);
- fwprintf(pFile, L"set _ROSBE_NOSTRIP=%d\n", nostrip);
- fwprintf(pFile, L"set _ROSBE_WRITELOG=%d\n", writelog);
- if (logdir[0] != 0) fwprintf(pFile, L"set _ROSBE_LOGDIR=%s\n",
logdir);
- if (mingwpath[0] != 0) fwprintf(pFile, L"set _ROSBE_MINGWPATH=%s\n",
mingwpath);
- if ((objdir[0] != 0) && objstate) fwprintf(pFile, L"set
_ROSBE_OBJPATH=%s\n", objdir);
- if ((outdir[0] != 0) && outstate) fwprintf(pFile, L"set
_ROSBE_OUTPATH=%s\n", outdir);
- fclose(pFile);
+ pFilecmd = _wfopen(getConfigFileCMD(), L"w");
+ pFileps1 = _wfopen(getConfigFilePS1(), L"w");
+
+ if (pFilecmd)
+ {
+ fwprintf(pFilecmd, L"::\n");
+ fwprintf(pFilecmd, L":: This file has been automatically generated by the
ReactOS\n");
+ fwprintf(pFilecmd, L":: Build Environment options utility.\n");
+ fwprintf(pFilecmd, L"::\n\n");
+ fwprintf(pFilecmd, L"color %X%X\n", background, foreground);
+ fwprintf(pFilecmd, L"set _ROSBE_SHOWTIME=%d\n", showtime);
+ fwprintf(pFilecmd, L"set _ROSBE_USECCACHE=%d\n", useccache);
+ fwprintf(pFilecmd, L"set _ROSBE_STRIP=%d\n", strip);
+ fwprintf(pFilecmd, L"set _ROSBE_NOSTRIP=%d\n", nostrip);
+ fwprintf(pFilecmd, L"set _ROSBE_WRITELOG=%d\n", writelog);
+ if (logdir[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_LOGDIR=%s\n",
logdir);
+ if (mingwpath[0] != 0) fwprintf(pFilecmd, L"set _ROSBE_MINGWPATH=%s\n",
mingwpath);
+ if ((objdir[0] != 0) && objstate) fwprintf(pFilecmd, L"set
_ROSBE_OBJPATH=%s\n", objdir);
+ if ((outdir[0] != 0) && outstate) fwprintf(pFilecmd, L"set
_ROSBE_OUTPATH=%s\n", outdir);
+ fclose(pFilecmd);
return TRUE;
}
+
+ if (pFileps1)
+ {
+ fwprintf(pFileps1, L"#\n");
+ fwprintf(pFileps1, L"# This file has been automatically generated by the
ReactOS\n");
+ fwprintf(pFileps1, L"# Build Environment options utility.\n");
+ fwprintf(pFileps1, L"#\n\n");
+ fwprintf(pFileps1, L"# color %X%X\n", background, foreground);
+ fwprintf(pFileps1, L"$_ROSBE_SHOWTIME=%d\n", showtime);
+ fwprintf(pFileps1, L"$_ROSBE_USECCACHE=%d\n", useccache);
+ fwprintf(pFileps1, L"$_ROSBE_STRIP=%d\n", strip);
+ fwprintf(pFileps1, L"$_ROSBE_NOSTRIP=%d\n", nostrip);
+ fwprintf(pFileps1, L"$_ROSBE_WRITELOG=%d\n", writelog);
+ if (logdir[0] != 0) fwprintf(pFileps1, L"$_ROSBE_LOGDIR=%s\n",
logdir);
+ if (mingwpath[0] != 0) fwprintf(pFileps1, L"$_ROSBE_MINGWPATH=%s\n",
mingwpath);
+ if ((objdir[0] != 0) && objstate) fwprintf(pFileps1,
L"$_ROSBE_OBJPATH=%s\n", objdir);
+ if ((outdir[0] != 0) && outstate) fwprintf(pFileps1,
L"$_ROSBE_OUTPATH=%s\n", outdir);
+ fclose(pFileps1);
+ return TRUE;
+ }
+
LoadString(hInstance, MSG_FILEFAILED, msgerror, 256);
MessageBox(infoPtr->hwndDlg, msgerror, NULL, MB_ICONERROR);
return FALSE;
@@ -137,7 +177,7 @@
WCHAR SBTitle[256];
PSETTINGS LoadedSettings = &infoPtr->Settings;
- pFile = _wfopen(getConfigFile(), L"r");
+ pFile = _wfopen(getConfigFileCMD(), L"r");
if (pFile)
{
while (fgetws(WTempLine, 24+MAX_PATH, pFile))
@@ -153,7 +193,7 @@
}
else if (wcscmp(ptr, L"set") == 0)
{
- ptr = wcstok(NULL, L" ");
+ ptr = wcstok(NULL, L"\0");
ptr = wcstok(ptr, L"=");
ptr2 = wcstok(NULL, L"=");
if (wcscmp(ptr, L"_ROSBE_SHOWTIME") == 0)