[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdesupport/emerge
From:       Andre Heinecke <aheinecke () intevation ! de>
Date:       2011-01-29 17:22:12
Message-ID: 20110129172212.07E4BAC8C6 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1217922 by aheinecke:

Change the way drives are substituted:
 - If the drives are already mapped correctly they are no
   longer deleted (which broke running builds in the same
   environment)
 - If mapping needs to be done print out a clear message
 - No longer produce error messages

You can now remove the handle drive substitution part from
existing kdesettings.bat files but behavior will stay the
same if you do not remove it.

I would rather have the kdesettings executed output also
in kdeenv but did not want to irritate existing setups.


 M  +46 -0     kdeenv.bat  
 M  +2 -18     kdesettings-example.bat  


--- trunk/kdesupport/emerge/kdeenv.bat #1217921:1217922
@@ -68,6 +68,52 @@
 call %~dp0etc\kdesettings.bat %BUILDTYPE%
 )
 
+rem handle drive substitution
+if !EMERGE_USE_SHORT_PATH! == 1 (
+    set ROOT_SET=FALSE
+    set SVN_SET=FALSE
+    set DOWNLOAD_SET=FALSE
+    FOR /F "tokens=1,2,3* delims= " %%i in ('subst') DO (
+        if /I "%%i" == "!EMERGE_ROOT_DRIVE!\:" (
+            if /I "%%k" == "!KDEROOT!" (
+                set ROOT_SET=TRUE
+            )
+        )
+        if /I "%%i" == "!EMERGE_SVN_DRIVE!\:" (
+            if /I "%%k" == "!KDESVNDIR!" (
+                set SVN_SET=TRUE
+            )
+        )
+        if /I "%%i" == "!EMERGE_DOWNLOAD_DRIVE!\:" (
+            if /I "%%k" == "!DOWNLOADDIR!" (
+                set DOWNLOAD_SET=TRUE
+            )
+        )
+    )
+    if NOT "!ROOT_SET!"=="TRUE" (
+        echo Mapping !KDEROOT! to !EMERGE_ROOT_DRIVE!
+        if exist !EMERGE_ROOT_DRIVE! subst !EMERGE_ROOT_DRIVE! /D
+        subst !EMERGE_ROOT_DRIVE! !KDEROOT!
+    )
+    if NOT "!DOWNLOAD_SET!"=="TRUE" (
+        echo Mapping !DOWNLOADDIR! to !EMERGE_DOWNLOAD_DRIVE!
+        if not exist !DOWNLOADDIR! mkdir !DOWNLOADDIR!
+        if exist !EMERGE_DOWNLOAD_DRIVE! subst !EMERGE_DOWNLOAD_DRIVE! /D
+        subst !EMERGE_DOWNLOAD_DRIVE! !DOWNLOADDIR!
+    )
+    if NOT "!SVN_SET!"=="TRUE" (
+        echo Mapping !KDESVNDIR! to !EMERGE_SVN_DRIVE!
+        if not exist !KDESVNDIR! mkdir !KDESVNDIR!
+        if exist !EMERGE_SVN_DRIVE! subst !EMERGE_SVN_DRIVE! /D
+        subst !EMERGE_SVN_DRIVE! !KDESVNDIR!
+    )
+
+    set KDEROOT=!EMERGE_ROOT_DRIVE!\
+    set KDESVNDIR=!EMERGE_SVN_DRIVE!\
+    set DOWNLOADDIR=!EMERGE_DOWNLOAD_DRIVE!\
+    !EMERGE_ROOT_DRIVE!
+)
+
 set SUBDIR=
 if "%BUILDTYPE%" == "" (
     if "%EMERGE_MERGE_ROOT_WITH_BUILD_TYPE%" == "True" (
--- trunk/kdesupport/emerge/kdesettings-example.bat #1217921:1217922
@@ -251,25 +251,9 @@
 
 rem No editing should be necessary below this line (in an ideal world)
 rem ##################################################################
+rem Developer note: Please think twice if anything you add here can not
+rem be placed into kdeenv.bat
 
-rem handle drive substitution
-if %EMERGE_USE_SHORT_PATH% == 1 (
-    subst %EMERGE_ROOT_DRIVE% /D
-    subst %EMERGE_SVN_DRIVE% /D
-    subst %EMERGE_DOWNLOAD_DRIVE% /D
-
-    mkdir %DOWNLOADDIR% 2>NUL
-    mkdir %KDESVNDIR% 2>NUL
-    
-    subst %EMERGE_ROOT_DRIVE% %KDEROOT%
-    subst %EMERGE_SVN_DRIVE% %KDESVNDIR%
-    subst %EMERGE_DOWNLOAD_DRIVE% %DOWNLOADDIR%
-    set KDEROOT=%EMERGE_ROOT_DRIVE%\
-    set KDESVNDIR=%EMERGE_SVN_DRIVE%\
-    set DOWNLOADDIR=%EMERGE_DOWNLOAD_DRIVE%\
-    %EMERGE_ROOT_DRIVE%
-)
-
 echo kdesettings.bat executed
 echo KDEROOT     : %KDEROOT%
 echo KDECOMPILER : %KDECOMPILER%
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic