#!/bin/bash #============================================================================== # Copyright and license info is available in the LICENSE file included with # the P4BBI tool, and also available online: # https://swarm.workshop.perforce.com/view/p4bbi/main/LICENSE #------------------------------------------------------------------------------ #============================================================================== # Declarations and Environment #set -e export P4BBI_HOME=${P4BBI_HOME:-Undefined} export P4U_LOG=UndefinedLog if [[ "$P4BBI_HOME" == Undefined ]]; then if [[ -r "$PWD/env.sh" ]]; then # shellcheck disable=SC1091 source "$PWD/env.sh" else echo -e "\\n\\nERROR: The environment file 'env.sh' is expected to exist\\nin the same directory as this script, in\n$PWD/env.sh.\\n\\n" exit 2 fi fi declare -i Debug="${DEBUG:-1}" declare TestP4PORT= declare BASH_LIBS=$P4U_ENV BASH_LIBS+=" $P4BBI_LIB/libcore.sh" BASH_LIBS+=" $P4BBI_LIB/libp4u.sh" BASH_LIBS+=" $P4BBI_LIB/bbi_load_and_verify.sh" BASH_LIBS+=" $P4BBI_LIB/bbi_paths.sh" BASH_LIBS+=" $P4BBI_LIB/bbi_actions.sh" for bash_lib in $BASH_LIBS; do # shellcheck disable=SC1090 source "$bash_lib" done export VERBOSITY=4 declare Version=3.5.9 declare -i SilentMode=0 declare -A Baselines declare -A BaselineOptions declare -a ActionType declare -a ActionBaseline declare -a ActionPath1 declare -a ActionPath2 declare -a ActionDepotName declare -a ActionDepotType declare -a ActionDesc declare -a ActionBranchSpecFile declare -a ActionDepotSpecFile declare -a ActionStreamSpecFile declare -a ActionUpdateOptions declare -a ActionStreamPath declare -a ActionStreamType declare -a ActionStreamOwner declare -a ActionStreamParent declare -a ActionStreamDesc declare -a ActionStreamOptions declare -i ActionCount=0 declare -i NetParallelMax=0 declare TmpFile=/tmp/bbi.$$.$RANDOM # A lexiographic compare is used to compare required vs. actual version of # the BBI config file. Config files define their version with 3 digits, e.g. # 3.0.0 or 3.0.1. The RequiredCfgVersion here must be defined with two # digits, e.g. "3.0" if "3.0.0" is good enough, since 3.0 is lexiographically # greater than 3.0. declare RequiredCfgVersion=3.6 #============================================================================== # Local Functions #------------------------------------------------------------------------------ # Function: terminate function terminate { # Disable signal trapping. trap - EXIT SIGINT SIGTERM # Don't litter. cleanTrash vvmsg "$THISSCRIPT: EXITCODE: $OverallReturnStatus" # Stop logging. [[ "${P4U_LOG}" == off ]] || stoplog # With the trap removed, exit. exit "$OverallReturnStatus" } #------------------------------------------------------------------------------ # Function: usage (required function) # # Input: # $1 - style, either -h (for short form) or -man (for man-page like format). #------------------------------------------------------------------------------ function usage { declare style=${1:--h} echo "USAGE for $THISSCRIPT v$Version: $THISSCRIPT -c <bbi_cfg> -P <P4CONFIG> [-w <working_dir>] [-R] [-C] [-J] [-L <log>] [-si] [-v<n>] [-T] [-n] [-D] [-S] or $THISSCRIPT [-h|-man|-V] " if [[ $style == -man ]]; then echo -e " DESCRIPTION: This is the Perforce Baseline and Branch Import Tool, $THISSCRIPT v$Version. This tool implements the Basline & Branch Import (BBI) migration strategy described in the document "Legacy SCM Migration Strategies": https://swarm.workshop.perforce.com/files/p4bbi/main/docs/LegacySCM-MigrationStrategies.pdf This strategy has been used by many companies over the years to quickly migrate from any number of legacy SCM systems to Perforce Helix Core. This tool is savvy with Perforce, but does not undertand your legacy system. You define the interesting history to be imported by defining BBI config files, discussed below. This script is self-logging. That is, all output displayed on the screen (stdout and stderr) is simultaneously captured in a log file. You do not need to run this script with redirection operators like '> log' or '2>&1', and do not need to use 'tee.' The default log file is: $P4BBI_LOGS/bbi.<NAME>.<DATESTAMP>.log BBI CONFIG FILES: The BBI config file defines a distilled, hand-crafted view of the history that you'd like to appear in Perforce. Typically one BBI config file is created for each product/component/module you plan to import. Examine the $P4BBI_HOME/BBIConfigFileFormat.txt for detailed information on the BBI config file format. Also see sample BBI config files in the sample_cfg dirctory, FGS.Streams.bbi.cfg and FGS.Classic.bbi.cfg. These sample files illustrate the format. COMMAND LINE OPTIONS: -c <bbi_cfg> Specify the path to your hand-crafted BBI config file. See documentation below on the format of this file. This argument is required (unless you are running the test suite with '-T'). -P <P4CONFIG> Specify P4CONFIG value to use for imports. This must reference the target Perforce server. See additional details below. This argument is required (unless you are running the test suite with '-T'). -w <working_dir> Specify a path with enough space to hold staged copies of your baselines. The default is: $P4BBI_HOME/w/<name>.<pid>.<random_number> Where <name> is the import name defined with the NAME tag in the BBI config file, <pid> is the current process id, and <random_number> (combined with <pid>) gives a likely unique folder. -J Specify '-J' to run the 'p4 obliterate' command to remove files exepcted to be garbage. The file $P4BBI_HOME/BBIJunkFiles.txt contains a list of file patterns defining junk to be obliterated. If '-J' is not used, it can be done as a separte step later by running: $P4C -x $P4BBI_HOME/BBIJunkFiles.txt obliterate WARNING: Obliteration can have a large performance impact on a live Production server. See 'p4 help obliterate' and contact Perforce Support for more information if this is a concern. There are options to running 'p4 obliterate' directly on a live server (offline obliterations). -T Execute the BBI Test Suite, as documented in the EXAMPLES below. This bootstraps a local P4D instance on port 8674, and imports the Classic and Streams imports into it. When this option is used, the '-c' and '-P' flags, normally required, are neither necessary or allowed. -v<n> Set verbosity 1-5 (-v1 = quiet, -v5 = highest). -L <log> Specify the path to a log file, or the special value 'off' to disable logging. By default, all output (stdout and stderr) is captured in a log file named: $P4BBI_LOGS/bbi.<NAME>.<DATESTAMP>.log -R Attempt rename detection. By default, this script calls the 'p4 reconcile' command in multiple passes, processing adds, deletes, and edits separately. This has the effect of preventing 'p4 recocnile' from attempting to detect renames, which 'p4 reconcile' would do by default if adds and deletes were processed in a single call, subject to certain server configurables governing reconcile behavior. The configurables dm.status.matchlines and dm.status.matchsize (described in 'p4 help undoc' as of P4D 2016.1) govern rename detection behavior. Rename detection is based on heuristic guesswork, but typically yields accurate results. If it guesses it wrong, i.e. misclassisifes a file action as a rename that wasn't or vice versa, the damage is limited to consuing history -- file lists and contents are still correct. However, with very large data sets and certain data patterns, e.g. deletion of many files, rename detection could take an onerous amount of time. Having a changelist with a big enough number of adds and deletes is rare with normal Perforce usage, but is more likely in the case of a BBI import, where each changelist can represent the sum of months of work and involve hundrededs of thousands of files. The heuristic rename detection has non-linear performance characteristics, which can result in imports taking an excessively long time while performing file diff comparisons on all files opened for add/delete to apply it rename detection logic. In one case while processing 0.75M files, an import of a baseline took 2 hours without attepting rename detection, and over 40 hours before being terminiated with rename detection. So, use '-R' with care -- be aware of potential "run away" performance if used. That said, the results when it runs are generally wonderful, a more faithful representation of actual history (without the work of using the explicit RENAME tag in the BBI config file, which is the other way to capture renames). -C Check the BBI config file and then stop. This can be used to verify the syntax of the BBI config file without starting an actual import. -si Operate silently. All output (stdout and stderr) is redirected to the log only; no output appears on the terminal. This cannot be used with '-L off'. -n No-Op. Doesn't run commands that affect data. This is for debugging purposes. -D Set extreme debugging verbosity. -S Step mode - if running interactively prompt user to enter return before progressing to the next Config file item HELP OPTIONS: -h Display short help message -man Display man-style help message -V Dispay version info for this script and its libraries. P4CONFIG FILE: In addition to the BBI config file, you must provide a P4CONFIG file that references the Perforce server you want to import into. The value *must* be an absolute path, and the specified file must exist. The P4CONFIG file MUST define: * P4PORT=your_target_server:P4PORT * P4USER=p4import (this use must be a super user) The P4CONFIG file may define: * P4TICKETS (if the target server requires authentication). * P4TRUST (if the target server is SSL enabled.) * P4IGNORE (optional but recommend. A sample P4IGNORE file is provided, p4ignore.bbi. This defines files to avoid adding to Perforce. The P4CONFIG file *MUST NOT* define these settings: * P4CLIENT. An import client workspace is generted dynmically by this script. DEPENDENCIES: The 'p4' and 'p4d' binaries appropriate to this platform must be copied to $P4BBI_BIN. You may be able to get them with commands like these samples: cd $P4BBI_BIN wget ftp://ftp.perforce.com/perforce/r15.2/bin.linux26x86_64/p4 wget ftp://ftp.perforce.com/perforce/r15.2/bin.linux26x86_64/p4d chmod +x p4 p4d Alternately, you can put symlinks for 'p4' and 'p4d' in $P4BBI_BIN. The 'rsync' and 'perl' utilities must also be available in the PATH. This uses modern bash shell featues, mainly an associative array. This is available on modern Unix systems and Linux distros, but not installed by default on Mac OSX systems (at least not as of Yosemite). ENVIRONMENT SETUP: To prepare your shell environment, first cd to the directory where the p4bbi.*.tgz file was extracted (typically /p4/p4bbi). Then source in the env.sh file, like so: cd /install/directory/for/p4bbi source env.sh This works if your shell is /bin/bash. Alternately, if you execute this script from the directory containing env.sh, you do not need to source env.sh. Sourcing the env.sh using bash file is recommended, as it allows you to run from anywhere. In addition to the standard /p4/p4bbi/env.sh file, you can add your own local environment file, /p4/p4bbi/env.local.sh. If this file exists, it will be sourced by the master env.sh file. This can be used to make PATH adjustments or other site-specific environment settings. In bash, the '.' (dot) command is shorthand for the 'source' command. TEST SUITE: To execute the BBI Test Suite: bbi.sh -T or with more details: bbi.sh -T -v5 Test imports appear on a Helix Server on the local host, running on port $TestP4PORT. To play with a test import on the command line, set the P4CONFIG variable as in this bash-syntax example: export P4CONFIG=$P4BBI_HOME/sample_cfg/p4config.test Or view the import with P4V. EXAMPLES: All examples assume the ENVIRONMENT SETUP is complete. To step thru an import, one action at a time, interactively: bbi.sh -c MyProject.bbi.cfg -P $PWD/p4config.myproj -S To preview an import: bbi.sh -c MyProject.bbi.cfg -P $PWD/p4config.myproj -n Remove the '-n' to execute a live import. CONSIDERATIONS: == Typemap == The 'typemap' should be configured manually, to help Perforce determine file type preferences. While Perforce's built-in type detection is pretty good for base file types, it does not apply file type modifers you may desire, such as exclusive checkout for binary files like *.pdf files. == Case Sensitivty == The case senitivty setting of your target Perforce server should be considered. In particular, if you are targeting a Windows (case-insensitive) server from a Linux machines, there may be issues. == Unicode Mode == The Unicode mode of your server should be considered, especially if you have Unicode characters in pathnames. See www.perforce.com for details on Unicode Support. Files with Unicode in the pathnames may not be handled well, and have not been tested. LIMITATIONS: Files with '...' in the name cannot be added. Rename detection is available as a feature of 'p4 reconcile'. Pratically speaking, the rename detection is very useful and accurate. However, it does use heuristics: the logic that determines if a file was renamed (as opposed to one file deleted and a new one added) is essentially an educated guess, based on the content difference between old and new being close enough. If targeting Winwdow Perforce server, symlinks are supported only from Window Vista and later (when Windows added native OS support for symlinks). Hard links cannot be added to Perforce. (Symlinks are handled normally). If the delta between one baseline and another includes certain complex symlink refactoring, such as replacing a symlink with a file of the same name (or vice versa), you must artificially create additional baselines to 'split' such activity up into two baselines, one basline removing the symlink, and the next baseline addding the file that replaced it. Typically the 'extra' baseline artifically injected between the two real ones will contain only symlink refactoring changes. UNNATURAL DEPENDENCIES: For normal usage, this script does not require super user (i.e. 'root' access). However, in some cases while processing the UPDATE action, when importing tarfiles of Crytpo libraries, permissions are set in such a way that an 'rm -rf' by the regular OS user who extracted the tar file fails, where a 'sudo rm -rf' of the same staging area succeeds. The removal as the regular acccount is always attempted first. If that fails, a second attempt to perform the removal is attempted using 'sudo', which of course can only succeed if the user has sudo access. For general import purposes, sudo access should not be required. TO DO: * Implement support for \$N tags in changelist descriptions in the BBI config file. * Enhance P4CONFIG file verifications. These notes describe in detail what should and should not be listed in the P4CONFIG. But the actual check is limited, checking for existence of the file and super user access only. * This script is only tested on Unix/Linux systems. It can be made to run on Windows in a ported bash shell (bash 4.0+), and this has been done. Details of how to do it need to be captured in docs. Out-of-the-box Windows support is a goal, even if it introduces a dependency (e.g. on Git bash). * Document rename detection engine via 'p4 reconcile' and related configurables and potential performance issues for large-scale imports. Add flags to enable or disable. OF SHELLS AND SNAKES: This script is a rewrite of the venerable p4bbi.py, which remains available in th BBI toolkit. * Supports Streams. * Uses 'p4 reconcile' for simpler and faster processing. * Built-in rename detection as a feature of 'p4 reconcile'. * Improved error messages; easier to track down failures. * Faster implementation. Limitations of the bbi.sh vs. p4bbi.py: * This version will have a much tougher time handling Unicode than a Ruby/Python/Perl implementation would. * It will take more work to get this to run on Windows. " fi exit 2 } #============================================================================== # Command Line Processing declare BBIConfigDir= declare BBIConfigFile= declare ImportWS= declare VerifyWS= declare ImportWSRoot= declare VerifyWSRoot= declare ImportUser= declare ImportTag= declare GlobalUpdateOptions= declare WorkingDir=UndefinedWorkingDir declare UserP4CONFIG= declare -i OK declare -i PreflightCheck=0 declare -i AttemptRenameDetection=0 declare -i RunTestSuite=0 declare -i ObliterateJunkFiles=0 declare -i StepMode=0 declare -i shiftArgs=0 declare -i OverallReturnStatus=0 set +u while [[ $# -gt 0 ]]; do case $1 in (-c) BBIConfigFile="$2"; shiftArgs=1;; (-P) UserP4CONFIG=$2; shiftArgs=1;; (-w) WorkingDir=$2; shiftArgs=1;; (-C) PreflightCheck=1;; (-R) AttemptRenameDetection=1;; (-J) ObliterateJunkFiles=1;; (-S) StepMode=1;; (-T) RunTestSuite=1;; (-h) usage -h;; (-man) usage -man;; (-V) show_versions; exit 1;; (-v1) export VERBOSITY=1;; (-v2) export VERBOSITY=2;; (-v3) export VERBOSITY=3;; (-v4) export VERBOSITY=4;; (-v5) export VERBOSITY=5;; (-v) export VERBOSITY=$2; shiftArgs=1;; (-L) export P4U_LOG=$2; shiftArgs=1;; (-si) SilentMode=1;; (-n) export NO_OP=1;; (-d) Debug=1;; # Enable debug messages. (-D) Debug=1; set -x;; # Extreme Debug; use bash 'set -x' mode. (*) usageError "Unknown arg ($1).";; esac # Shift (modify $#) the appropriate number of times. shift; while [[ $shiftArgs -gt 0 ]]; do [[ $# -eq 0 ]] && usageError "Bad usage." shiftArgs=$shiftArgs-1 shift done done set -u #set -e #============================================================================== # Command Line Verification [[ "$SilentMode" -eq 1 && "$P4U_LOG" == off ]] && \ usageError "Cannot use '-si' with '-L off'." if [[ $RunTestSuite -eq 1 ]]; then [[ -n "$BBIConfigFile" ]] && \ usageError "The '-c <bbi_config>' argument is not allowed with -T." [[ -n "$UserP4CONFIG" ]] && \ usageError "The '-P <P4CONFIG>' argument is not allowed with -T." else [[ -z "$BBIConfigFile" ]] && \ usageError "The '-c <bbi_config>' argument is required." [[ -z "$UserP4CONFIG" ]] && \ usageError "The '-P <P4CONFIG>' argument is required." [[ "$UserP4CONFIG" == /* ]] || \ usageError "An absolute path starting with / to the P4CONFIG file must be specified with '-P'." fi if [[ "$BBIConfigFile" == /* ]]; then BBIConfigDir="$(dirname "$BBIConfigFile")" else BBIConfigDir="$PWD" fi # Only allow step mode if running interactively so prompt/response can be handled if [[ $StepMode -eq 1 ]]; then if [[ ! -t 0 || ! -t 1 ]]; then echo Step Mode can only be used if running interactively StepMode=0 fi fi #============================================================================== # Main Program if [[ $RunTestSuite -eq 1 ]]; then "$P4BBI_HOME"/test/run_test_suite.sh exit "$OverallReturnStatus" fi # Very first thing - check BASH_VERSION case $BASH_VERSION in (1*|2*|3*) echo -e "\\n The version of /bin/bash is too old. This script requires bash 4.0 or higher.\\n This version is $BASH_VERSION. If working on Mac, do a web search for\\n 'bash 4 mac' for options on acquring a bash 4.x. Please acquire a new bash\\n and install it somewhere, perhaps /usr/local/bin/bash, and change the '#!'\\n line at the top of this script ($THISSCRIPT) to reference the newer bash.\\n" exit 1;; esac [[ ! -r "$BBIConfigFile" ]] && bail "The BBI config file specified with '-c' [$BBIConfigFile] does not exist." [[ ! -r "$UserP4CONFIG" ]] && bail "The P4CONFIG file [$UserP4CONFIG] does not exist." ImportTag=$(grep ^NAME= "$BBIConfigFile" 2>/dev/null | cut -d '=' -f 2) [[ -z "$ImportTag" ]] && \ bail "The specified BBI config file [$BBIConfigFile] is missing a 'NAME=' definition." if [[ "$P4U_LOG" == UndefinedLog ]]; then [[ -r "$BBIConfigFile" ]] || \ bail "The BBI config file specified with '-c $BBIConfigFile' does not exist." export P4U_LOG="$P4BBI_LOGS/bbi.$ImportTag.$(date +'%Y%m%d-%H%M%S').log" fi trap terminate EXIT SIGINT SIGTERM if [[ "${P4U_LOG}" != off ]]; then touch "${P4U_LOG}" || bail "Couldn't touch log file [${P4U_LOG}]." # Redirect stdout and stderr to a log file. if [[ $SilentMode -eq 0 ]]; then exec > >(tee "${P4U_LOG}") exec 2>&1 else exec >"${P4U_LOG}" exec 2>&1 fi initlog fi msg "${H}\\nStarted at $(date). Versions:" show_versions export P4BIN=$P4BBI_BIN/p4 export P4DBIN=$P4BBI_BIN/p4d export P4CONFIG=Undefined ImportWS=bbi_import.$ImportTag VerifyWS=bbi_verify.$ImportTag if [[ $WorkingDir == UndefinedWorkingDir ]]; then WorkingDir=$P4BBI_HOME/w/${ImportTag}.$$.$RANDOM fi ImportWSRoot=$WorkingDir/ws VerifyWSRoot=$WorkingDir/v # Environment isolation: Clear Perforce environment settings. # Set P4ENVIRO to a junk value so as to avoid accidentally interacting # with a personal DVCS repo which slickly applies a P4CONFIG value # even after we unset it, by reading it from the P4ENVIRO file # (~/.p4enviro by default). unset P4AUDIT P4AUTH P4CHANGE P4CONFIG P4DEBUG P4DESCRIPTION P4JOURNAL \ P4LOG P4NAME P4PORT P4ROOT P4SSLDIR P4TARGET P4TICKETS P4TRUST export P4ENVIRO=/tmp/NonExistentFile.$$.$RANDOM [[ -z "$P4BIN" || ! -x "$P4BIN" || -z "$P4DBIN" || ! -x "$P4DBIN" ]] && \ bail "\\n\\nThe p4d and p4d binaries are missing or are not executable.\\nPlease put 'p4' and 'p4d' binaries appropriate to this platform in $P4BBI_BIN.\\n\\nYou may be able to get them with commands like these samples:\\n\\n\\tcd $P4BBI_BIN\\n\\twget ftp://ftp.perforce.com/perforce/r15.2/bin.linux26x86_64/p4\\n\\twget ftp://ftp.perforce.com/perforce/r15.2/bin.linux26x86_64/p4d\\nchmod +x p4 p4d\\n\\n" P4BinRev=$($P4BIN -V|grep ^Rev) P4DBinRev=$($P4DBIN -V|grep ^Rev) msg "Using these p4/p4d executables:\\n$P4BIN: $P4BinRev\\n$P4DBIN: $P4DBinRev\\n" if [[ -n "$UserP4CONFIG" ]]; then export P4CONFIG=$UserP4CONFIG [[ "$($P4BIN set P4CLIENT)" == *"(config)"* ]] && \ bail "The specified P4CONFIG file must not define any value for P4CLIENT. Please remove the P4CLIENT setting from $P4CONFIG." check_p4_env ||\ bail "Perforce Environment is not ready to receive an import." else bail "P4CONFIG not defined." fi ImportPort=$($P4BIN set P4PORT|cut -d '=' -f 2) ImportPort=${ImportPort%% *} ImportUser=$($P4BIN set P4USER|cut -d '=' -f 2) ImportUser=${ImportUser%% *} export P4="$P4BIN -p $ImportPort -u $ImportUser" export P4C="$P4BIN -p $ImportPort -u $ImportUser -c $ImportWS" export P4VC="$P4BIN -p $ImportPort -u $ImportUser -c $VerifyWS" export RSYNC=$(which rsync 2>/dev/null ||:) export PERL=$(which perl 2>/dev/null ||:) export DIFF=$(which diff 2>/dev/null ||:) [[ -z "$RSYNC" ]] && \ bail "\\n\\nCannot find required 'rsync' utility in PATH. Add\\na symlink in $P4BBI_BIN to it, and/or install if necessary to a location on the PATH.\\n\\n" [[ -z "$PERL" ]] && \ bail "\\n\\nCannot find required 'perl' utility in PATH. Add\\na symlink in $P4BBI_BIN to it, and/or install if necessary to a location on the PATH.\\n\\n" [[ -z "$DIFF" ]] && \ bail "\\n\\nCannot find required 'diff' utility in PATH. Add\\na symlink in $P4BBI_BIN to it, and/or install if necessary to a location on the PATH.\\n\\n" #------------------------------------------------------------------------------ msg "Ensuring the 'diff' utility supports '--no-dereference' needed for UPDATE actions which use the VERIFY option." $DIFF --no-dereference /tmp/junk.1.$$ /tmp/junk.2.$$ > $TmpFile 2>&1 if grep -l 'No such file or directory' $TmpFile > /dev/null 2>&1; then msg "Verified: The 'diff' utility supports the '--no-dereference' option." else if grep -l 'unrecognized option' $TmpFile > /dev/null 2>&1; then warnmsg "The diff utility ($DIFF) does NOT support the '--no-dereference' option, which is required if the VERIFY option to the UPDATE action is used. Do not use this option, or else acquire a newer version of the diff utility, e.g. from ftp.gnu.org/diffutils." else warnmsg "Unable to find a suitable diff utility on the PATH. VERIFY actions will fail." fi fi /bin/rm -f "$TmpFile" if [[ $PreflightCheck -eq 0 ]]; then load_baselines "$BBIConfigFile" "$RequiredCfgVersion" ||\ bail "Baseline definitions are not verified." load_actions "$BBIConfigFile" ||\ bail "Action definitions contain errors." else OK=1 load_baselines "$BBIConfigFile" "$RequiredCfgVersion" if [[ $? -eq 1 ]]; then OK=0 warnmsg "Baseline definitions contain errors." fi load_actions "$BBIConfigFile" ||\ if [[ $? -eq 1 ]]; then OK=0 warnmsg "Action definitions contain errors." fi if [[ $OK -eq 1 ]]; then msg "Overall, [$BBIConfigFile] PASSED preflight sanity checks." exit 0 else errmsg "Overall, [$BBIConfigFile] FAILED preflight sanity checks." exit 1 fi fi baseline_and_branch_import ||\ OverallReturnStatus=1 if [[ $ObliterateJunkFiles -eq 1 ]]; then if [[ -r "$P4BBI_HOME/BBIJunkFiles.txt" ]]; then runCmd "$P4C -x $P4BBI_HOME/BBIJunkFiles.txt obliterate -y" \ "Obliterating gargbage files." ||\ bail "Obliteration failed." else errmsg "The '-J' flag was specified, but this file is missing: $P4BBI_HOME/BBIJunkFiles.txt" OverallReturnStatus=1 fi fi if [[ $OverallReturnStatus -eq 0 ]]; then msg "${H}\\nAll processing completed successfully.\\n" else msg "${H}\\nProcessing completed, but with errors. Scan above output carefully.\\n" fi msg "That took about $((SECONDS/3600)) hours $((SECONDS%3600/60)) minutes $((SECONDS%60)) seconds.\\n" [[ -r "${P4U_LOG}" ]] && msg "Log file is: $P4U_LOG\\n${H}\\n" exit "$OverallReturnStatus"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 30973 | C. Thomas Tyler |
Adapting to new home in //p4bbi stream depot. Mostly minor changes to doc links. More significant changes we needed for package_downloads.sh. |
||
#1 | 30968 | C. Thomas Tyler |
Migration from Classic to Streams with: p4 copy -b P4BBI_Classic_to_Streams |
||
//guest/perforce_software/p4bbi/main/bbi.sh | |||||
#14 | 30957 | C. Thomas Tyler | Addressed various ShellCheck errors. | ||
#13 | 30952 | C. Thomas Tyler | Picked up bug fixes and doc improvements from the dev branch. | ||
#12 | 18718 | C. Thomas Tyler | Updated to P4BBI/MultiArch/2016.3/18716 (2016/03/20). | ||
#11 | 18506 | C. Thomas Tyler | Released P4BBI/MultiArch/2016.2/18504 (2016/03/04). | ||
#10 | 18412 | C. Thomas Tyler | Released P4BBI. | ||
#9 | 18224 | C. Thomas Tyler | Released P4BBI/MultiArch/2016.1/18220 (2016/02/19). | ||
#8 | 16894 | C. Thomas Tyler |
Update of BBI with latest dev changes: * Doc enhancements. * Added COPY rule to the test suite. |
||
#7 | 16882 | C. Thomas Tyler |
Update of BBI with latest dev changes: * Added support for processing 'astyle' as part of an import. * Fixed bug in COPY rule. |
||
#6 | 15968 | C. Thomas Tyler |
Copy Up to main from dev using: p4 copy -r -b perforce-software-p4bbi-dev |
||
#5 | 15131 | Russell C. Jackson (Rusty) | Fixed a couple of doc typos. | ||
#4 | 12500 | C. Thomas Tyler | Published p4bbi.2015.3.12498. | ||
#3 | 12395 | C. Thomas Tyler |
Copy Up to main for release. Updated ditribution tar file. |
||
#2 | 11961 | C. Thomas Tyler | Copy Up to release p4bbi.2015.2.11959. | ||
#1 | 11814 | C. Thomas Tyler | Copy up for dev for release of p4bbi.2015.2.11812. | ||
//guest/perforce_software/p4bbi/dev/bbi.sh | |||||
#10 | 11810 | C. Thomas Tyler |
Implemented RMTOP feature. Updated TO DO notes. |
||
#9 | 11808 | C. Thomas Tyler |
Addd root-relative style of tar file, not needing RMTOP. Added support for *.zip files. Added -J flag to bbi.sh to obliterate junk files in BBIJunkFiles.txt. Enahnced sample files and docs. |
||
#8 | 11805 | C. Thomas Tyler | Enhanced docs. | ||
#7 | 11799 | C. Thomas Tyler | Added 'perl' as a utility/dependency. | ||
#6 | 11785 | C. Thomas Tyler |
Partially imported import actions. Enhanced BBI config file version check. Enhanced logging. |
||
#5 | 11784 | C. Thomas Tyler |
Refactored bash libriaries. Added bbi_actions.lib to hold the BBI functionality. Branched 3 bash library files from the SDP, removing the SDP dependency. Enhanced docs. |
||
#4 | 11776 | C. Thomas Tyler |
Added directory structure placeholder for logs and bin dirs. Provided a way to override SDP executables. Changed default logs dir to $P4BBI_HOME/logs. Adjusted environment. |
||
#3 | 11774 | C. Thomas Tyler |
Defined format of STREAM and DEPOT actions. Added new sample config file illustrating new v3.x format. This version parses and verifies the config file with the new fromat, but does not perform an import. |
||
#2 | 11771 | C. Thomas Tyler | Added load_actions() | ||
#1 | 11767 | C. Thomas Tyler | Broke ground on BBI v3.0 (shell script version). |