[ros-diffs] [dreimer] 37344: Further work on PS files. Last problems left: - raddr2line fails - ssvn status fails

dreimer at svn.reactos.org dreimer at svn.reactos.org
Thu Nov 13 21:16:33 CET 2008


Author: dreimer
Date: Thu Nov 13 14:16:33 2008
New Revision: 37344

URL: http://svn.reactos.org/svn/reactos?rev=37344&view=rev
Log:
Further work on PS files.
Last problems left:
- raddr2line fails
- ssvn status fails

Modified:
    trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1
    trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1
    trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1
    trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1
    trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1
    trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/charch.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -24,7 +24,7 @@
     # If Parameters were set, parse them, if not, ask the user to add them.
     #
     $_1 = Read-Host "Please enter a Architecture you want to build ReactOS for: "
-    if ($_1 -eq $null) {
+    if ($_1.length -eq 0) {
         "ERROR: You must enter a Architecture."
     }
 } else {
@@ -46,7 +46,7 @@
     $_ROSBE_ARCH = 3
     SYSPARAM
 }
-elseif ($_1 -eq $null) {
+else {
     "Unknown parameter specified. Try 'help [COMMAND]'."
 }
 

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/chdefdir.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -19,7 +19,7 @@
     # If Parameters were set, parse them, if not, ask the user to add them.
     #
     $_1 = Read-Host "Please enter a ReactOS source directory, or 'previous': "
-    if ($_1 -eq $null) {
+    if ($_1.length -eq 0) {
         "ERROR: You must enter a ReactOS source directory, or 'previous'."
     }
 } else {

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/chdefgcc.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -11,46 +11,47 @@
     $host.ui.RawUI.WindowTitle = "Change the current MinGW/GCC Host/Target directory..."
 }
 
+function settitle {
+    if ($_ROSBE_VERSION -ne $null) {
+        $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
+    }
+    exit
+}
+
 function EOA {
     IEX "&'$_ROSBE_BASEDIR\rosbe-gcc-env.cmd' chdefgcc"
-}
-
-function INTERACTIVE {
-    $_1 = Read-Host "Please enter a MinGW/GCC directory (don't use quotes): "
-    if ($_1 -eq $null) {
-        "ERROR: You must enter a MinGW/GCC directory."
-    }
-    $_2 = Read-Host "Please specify, if this will be the Target or Host GCC: "
-    if ($_2 -eq $null) {
-        "ERROR: You must enter ""target"" or ""host""."
-    }
-}
-if ($_ROSBE_VERSION -ne $null) {
-    $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"
+    settitle
 }
 
 #
 # Parse the command line arguments.
 #
 $_1 = $args[0]
-"$_1"
-$_1 = IEX "& '$_ROSBE_BASEDIR\Tools\rquote.exe' '$_1'"
 $_2 = $args[1]
 if ($_1 -eq $null) {
-    INTERACTIVE
+    $_1 = Read-Host "Please enter a MinGW/GCC directory (don't use quotes): "
+    if ($_1.length -eq 0) {
+        "ERROR: You must enter a MinGW/GCC directory."
+        settitle
+    }
 }
 if ($_2 -eq $null) {
-    INTERACTIVE
+    $_2 = Read-Host "Please specify, if this will be the Target or Host GCC: "
+    if ($_2.length -eq 0) {
+        "ERROR: You must enter ""target"" or ""host""."
+        settitle
+    }
 }
-
 if (Test-Path "$_ROSBE_BASEDIR\$_1\.") {
     $_1 = "$_ROSBE_BASEDIR\$_1"
 } elseif (!(Test-Path "$_1\.")) {
     "ERROR: The path specified doesn't seem to exist."
+    settitle
 }
 
 if (!(Test-Path "$_1\bin\*gcc.exe")) {
     "ERROR: No MinGW/GCC found in the specified path."
+    settitle
 }
 
 if ($_2 -eq "target") {
@@ -64,6 +65,7 @@
     EOA
 } else {
     "ERROR: You specified wrong parameters."
+    settitle
 }
 
 #

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/options.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -13,9 +13,7 @@
 # Run options.exe
 #
 if (Test-Path "$_ROSBE_BASEDIR\Tools\options.exe") {
-    pushd "$_ROSBE_BASEDIR"
-    & "$_ROSBE_BASEDIR\Tools\options.exe"
-    popd
+    & "$_ROSBE_BASEDIR\Tools\options.exe" | out-null
     if (Test-Path "$ENV:APPDATA\RosBE\rosbe-options.cmd") {
         & "$ENV:APPDATA\RosBE\rosbe-options.cmd"
     }

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/sSVN.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -15,7 +15,7 @@
         "Your tree is not up to date. Do you want to update it?"
         $UP = Read-Host "Please enter 'yes' or 'no': "
         if ($UP -eq "yes") {
-            IEX "'$_ROSBE_BASEDIR\ssvn' update"
+            IEX "&'$_ROSBE_BASEDIR\ssvn' update"
         }
     }
     if ($OFFSVN -eq $ONSVN) {
@@ -38,16 +38,17 @@
     "This might take a while, so please be patient."
     ""
     if ($args[1] -ne $null) {
-        IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' update -r $args[1]"
+        $temparg = $args[1]
+        IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' update -r $temparg"
     } else {
-        IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' update"
+        IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' update"
     }
 }
 elseif ($args[0] -eq "cleanup") {
     $host.ui.RawUI.WindowTitle = "SVN Cleaning..."
     "This might take a while, so please be patient."
     ""
-    IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' cleanup"
+    IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' cleanup"
 }
 
 #
@@ -58,9 +59,9 @@
     if (Test-Path ".svn\.") {
         "ERROR: Folder already contains a repository."
     } else {
-        dir /b 2>nul | findstr "." >nul
-        if (errorlevel -eq 1) {
-            IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' checkout svn://svn.reactos.org/reactos/trunk/reactos ."
+        $dir = dir
+        if ($dir -eq $null) {
+            IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' checkout svn://svn.reactos.org/reactos/trunk/reactos ."
         } else {
             "ERROR: Folder is not empty. Continuing is dangerous and can cause errors. ABORTED"
         }
@@ -75,8 +76,8 @@
     $host.ui.RawUI.WindowTitle = "SVN Status"
     "This might take a while, so please be patient."
     ""
-    $OFFSVN = IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' info" | find "Revision:"
-    $ONSVN = IEX "'$_ROSBE_BASEDIR\Tools\svn.exe' info svn://svn.reactos.org/reactos/trunk/reactos" | find "Revision:"
+    $OFFSVN = IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' info" | find "Revision:"
+    $ONSVN = IEX "&'$_ROSBE_BASEDIR\Tools\svn.exe' info svn://svn.reactos.org/reactos/trunk/reactos" | find "Revision:"
     UP
 }
 
@@ -94,3 +95,5 @@
 $OFFSVN = $null
 $ONSVN = $null
 $UP = $null
+$dir = dir
+$temparg = $null

Modified: trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1
URL: http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1?rev=37344&r1=37343&r2=37344&view=diff
==============================================================================
--- trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 [iso-8859-1] (original)
+++ trunk/tools/RosBE/RosBE-Windows/Powershell/scut.ps1 [iso-8859-1] Thu Nov 13 14:16:33 2008
@@ -8,9 +8,12 @@
 #                             Peter Ward <dralnix at gmail.com>
 #
 
-function paramcall {
-    $OUT = IEX "'$_ROSBE_BASEDIR\Tools\scut.exe' $args"
+function paramcall($arg) {
+    IEX "&'$_ROSBE_BASEDIR\Tools\scut.exe' $arg"
+}
 
+function parse($arg) {
+    $OUT = paramcall($arg)
     # It's a shortcut name, so change the directory
 
     if ($OUT -ne "Default") {
@@ -22,14 +25,15 @@
 }
 
 # Check if the parameter is an scut parameter, which can just be forwarded to the EXE file
-if ($args[0] -eq "add")    {paramcall}
-if ($args[0] -eq "rem")    {paramcall}
-if ($args[0] -eq "edit")   {paramcall}
-if ($args[0] -eq "def")    {paramcall}
-if ($args[0] -eq "list")   {paramcall}
-if ($args[0] -eq "/?")     {paramcall}
-if ($args[0] -eq "-h")     {paramcall}
-if ($args[0] -eq "--help") {paramcall}
+if ($args[0] -eq "add")    {paramcall($args)}
+elseif ($args[0] -eq "rem")    {paramcall($args)}
+elseif ($args[0] -eq "edit")   {paramcall($args)}
+elseif ($args[0] -eq "def")    {paramcall($args)}
+elseif ($args[0] -eq "list")   {paramcall($args)}
+elseif ($args[0] -eq "/?")     {paramcall($args)}
+elseif ($args[0] -eq "-h")     {paramcall($args)}
+elseif ($args[0] -eq "--help") {paramcall($args)}
+else {parse($args)}
 
 if ($_ROSBE_VERSION -ne $null) {
     $host.ui.RawUI.WindowTitle = "ReactOS Build Environment $_ROSBE_VERSION"



More information about the Ros-diffs mailing list