GetP4PORT.bat #1

  • //
  • guest/
  • perforce_software/
  • sdp/
  • main/
  • Server/
  • Windows/
  • p4/
  • common/
  • bin/
  • GetP4PORT.bat
  • View
  • Commits
  • Open Download .zip Download (640 B)
@ECHO OFF

if x%1==x (GOTO Usage)

:: Note: This script goes to some effort to avoid any side effects.
:: The P4CONFIG and P4PORT values must be cleared, but they are set
:: back to their original values when done.
SET INSTANCE=%1
SET ORIG_P4CONFIG=%P4CONFIG%
SET ORIG_P4PORT=%P4PORT%
SET P4CONFIG=
SET P4PORT=

FOR /F %%F IN ('%SDP_INSTANCE_BIN_DIR%\p4 set -S P4_%INSTANCE% P4PORT') DO (
   ECHO %%F
)

GOTO WrapUp

:Usage
ECHO : Usage:
ECHO :    GetP4PORT.bat Instance
ECHO :
ECHO : Example:
ECHO :    GetP4PORT.bat 1

:WrapUp

IF NOT x%ORIG_P4CONFIG%==x (SET P4CONFIG=%ORIG_P4CONFIG%)
IF NOT x%ORIG_P4PORT%==x (SET P4PORT=%ORIG_P4PORT%)
# Change User Description Committed
#2 20767 C. Thomas Tyler Released SDP 2016.2.20755 (2016/09/29).
Copy Up using 'p4 copy -r -b perforce_software-sdp-dev'.
#1 10872 C. Thomas Tyler Added Windows SDP into The Workshop:
* Combined (back) into Unix SDP structure.
* Avoided adding duplicate files p4verify.pl, p4review.(py,cfg).
* Upgraded 'dist.sh' utility to produce both Unix and Windows
packages (*.tgz and *.zip), adjusting line endings on text
files to be appropriate for Windows prior to packaging.

To Do:
* Resolve duplication of [template_]configure_new_server.bat.
* Merge test suites for Windows and Unix into a cohesive set.