diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2015-04-27 15:02:25 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-09-01 16:18:32 -0500 |
commit | 4ae690e4eeb9297ed59ff932cc4184d23896234d (patch) | |
tree | b3205f1b84aff7dbad3f949c78fe6e4c08067368 /src/build/tools | |
parent | 0795cc6781a4d937786b39c23b655397432ec90e (diff) | |
download | talos-hostboot-4ae690e4eeb9297ed59ff932cc4184d23896234d.tar.gz talos-hostboot-4ae690e4eeb9297ed59ff932cc4184d23896234d.zip |
Generalize env vars, env setup, and copyright scripts
Methods ported over from code in EKB.
Change-Id: I26b6f2326314936b0316f64272230730ecd3f9ee
RTC: 126634
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/17465
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Tested-by: FSP CI Jenkins
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/tools')
-rwxr-xr-x | src/build/tools/addCopyright.pl | 79 | ||||
-rwxr-xr-x | src/build/tools/gerrit-hostname | 79 | ||||
-rwxr-xr-x | src/build/tools/hb | 46 | ||||
-rwxr-xr-x | src/build/tools/hbGenConfig | 6 | ||||
-rwxr-xr-x | src/build/tools/post-commit | 10 | ||||
-rwxr-xr-x | src/build/tools/pre-commit | 10 | ||||
-rwxr-xr-x | src/build/tools/pre-commit-actions | 50 | ||||
-rwxr-xr-x | src/build/tools/setupgithooks.sh | 14 | ||||
-rwxr-xr-x | src/build/tools/verify-commit | 4 |
9 files changed, 206 insertions, 92 deletions
diff --git a/src/build/tools/addCopyright.pl b/src/build/tools/addCopyright.pl index 604fa9807..c89ddbf5f 100755 --- a/src/build/tools/addCopyright.pl +++ b/src/build/tools/addCopyright.pl @@ -52,7 +52,6 @@ # and run the file to update all # ############################################################################### - use strict; use warnings; use POSIX; @@ -60,21 +59,35 @@ use Getopt::Long; use File::Basename; use lib dirname (__FILE__); - #------------------------------------------------------------------------------ # Project-specific settings. #------------------------------------------------------------------------------ my $ReleaseYear = `date +%Y`; chomp( $ReleaseYear ); - $ReleaseYear = $ENV{'DATE_OVERRIDE'} if defined $ENV{'DATE_OVERRIDE'}; my $copyrightSymbol = ""; # my $copyrightSymbol = "(C)"; # Uncomment if unable to use character. -my $projectName = "HostBoot"; +# set by environment variable in project env.bash +my $projectName = $ENV{'PROJECT_NAME'}; my $copyrightStr = "Contributors Listed Below - COPYRIGHT"; +## note that these use single ticks so that the escape chars are NOT evaluated yet. +my $OLD_DELIMITER_END = 'IBM_PROLOG_END'; +my $DELIMITER_END = 'IBM_PROLOG_END_TAG'; +my $DELIMITER_BEGIN = 'IBM_PROLOG_BEGIN_TAG'; + +my $SOURCE_BEGIN_TAG = "\$Source:"; +my $SOURCE_END_TAG = "\$"; + +# Desired License, set by environment variable in project env.bash +my $LicenseFile = $ENV{'LICENSE'}; + +#------------------------------------------------------------------------------ +# Contributer info +#------------------------------------------------------------------------------ + # Constants for company's copyright # When adding a new company add constant here and to %fileContributorsCompany use constant IBM => 'International Business Machines Corp.'; @@ -88,16 +101,6 @@ my %fileContributorsCompany = ( "Google Shared Technology" => GOOGLE, ); -## note that these use single ticks so that the escape chars are NOT evaluated yet. -my $OLD_DELIMITER_END = 'IBM_PROLOG_END'; -my $DELIMITER_END = 'IBM_PROLOG_END_TAG'; -my $DELIMITER_BEGIN = 'IBM_PROLOG_BEGIN_TAG'; - -my $SOURCE_BEGIN_TAG = "\$Source:"; -my $SOURCE_END_TAG = "\$"; - -# End Project-specific settings - #------------------------------------------------------------------------------ # Constants #------------------------------------------------------------------------------ @@ -107,7 +110,7 @@ use constant RC_NO_COPYRIGHT_BLOCK => 3; use constant RC_INVALID_SOURCE_LINE => 4; use constant RC_INVALID_YEAR => 5; use constant RC_OLD_DELIMITER_END => 6; -use constant RC_NOT_HOSTBOOT_BLOCK => 7; +use constant RC_PROJECT_DOES_NOT_MATCH => 7; use constant RC_BAD_CONTRIBUTORS_BLOCK => 8; use constant RC_NO_COPYRIGHT_STRING => 9; use constant RC_INVALID_FILETYPE => 10; @@ -342,9 +345,6 @@ foreach ( @Files ) } # end foreach - - - if ( $opt_logfile ne "" ) { close( LOGFH ); @@ -648,11 +648,11 @@ sub checkCopyrightBlock( $$ ) return RC_NO_COPYRIGHT_STRING; } - ## Check to see if this is a HostBoot Copyright notice - if ( !( $block =~ m/OpenPOWER $projectName Project/ ) ) + ## Check to see if this matches the project it lives in + if ( !( $block =~ m/$projectName Project/ ) ) { - print STDOUT "WARNING: Not a $projectName copyright block\n"; - return RC_NOT_HOSTBOOT_BLOCK; + print STDOUT "WARNING: Copyright block does not reference project $projectName\n"; + return RC_PROJECT_DOES_NOT_MATCH; } ## split into lines and check for specific things @@ -1026,7 +1026,7 @@ sub addPrologComments($$$) # NOTE: CMVC prologs with inline comments will have a single trailing # space at the end of the line. This is undesirable for most - # hostboot developers so it will not be added. + # developers so it will not be added. if ( $line =~ m/$DELIMITER_BEGIN/ ) { @@ -1083,30 +1083,20 @@ sub fillinEmptyCopyrightBlock( $$ ) $copyright_Contributors .= "[+] ".$key."\n"; } + ## Get desired license + my $LicenseContent = ""; + open(LICENSE, "< $LicenseFile") or die " $? can't open $LicenseFile: $!" ; + while (my $line = <LICENSE>) + { + my $evalLine = eval "qq($line)"; + $LicenseContent .= $evalLine; + } + close(LICENSE); + ## define the final copyright block template here. my $IBMCopyrightBlock = <<EOF; $DELIMITER_BEGIN -This is an automatically generated prolog. - -$SOURCE_BEGIN_TAG $filename $SOURCE_END_TAG - -OpenPOWER $projectName Project - -$copyrightStr $copyrightYear -$copyright_Contributors - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing -permissions and limitations under the License. - +$LicenseContent $DELIMITER_END EOF @@ -1189,7 +1179,6 @@ EOF } } - ####################################### ## Gets file contirbutors based on git log of a file ## diff --git a/src/build/tools/gerrit-hostname b/src/build/tools/gerrit-hostname new file mode 100755 index 000000000..6f77778bd --- /dev/null +++ b/src/build/tools/gerrit-hostname @@ -0,0 +1,79 @@ +#!/usr/bin/perl +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/tools/gerrit-hostname $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2015 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG + +## Usage +# It is imperative that there are no prints other than the die command or +# "export GERRIT_SRV=$host" as this script is evaluated by env.bash and not +# called directly + +use strict; + +my $homeDir = $ENV{'HOME'}; +my $sshConfigFile = $homeDir."/.ssh/config"; +# If the server changes location these will change +my $gerritHostname = "gfw160.aus.stglabs.ibm.com"; +my $gerritPort = "29418"; + +open(CONFIG, "< $sshConfigFile") or die " $? can't open $sshConfigFile: $!" ; + +my $host = ""; +my $hostname = ""; +my $port = ""; +while (my $line = <CONFIG>) +{ + # Whitespace after each constant is important + if ($line =~ m/^Host [^\s]/) + { + ($host) = $line =~ m/^Host (.*?)\s/ + } + elsif ($line =~ m/Hostname [^\s]/) + { + ($hostname) = $line =~ m/^*Hostname (.*)/; + } + elsif ($line =~ m/Port [^\s]/) + { + ($port) = $line =~ m/^*Port (.*)/; + } + + # Check if we found the gerrit host name + if ($host ne "" && + $hostname eq $gerritHostname && + $port eq $gerritPort) + { + last; + } +} +close(CONFIG); + +if ($host eq "") +{ + die "Error> Could not find gerrit host in $sshConfigFile"; +} +else +{ + # Set gerrit server env variable by returning command to env.bash + print "export GERRIT_SRV=$host\n"; +} diff --git a/src/build/tools/hb b/src/build/tools/hb index bb2490350..357653768 100755 --- a/src/build/tools/hb +++ b/src/build/tools/hb @@ -287,7 +287,7 @@ hb_workon() hb_prime() { [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 if [ ! -d "${SANDBOXBASE}" ]; then echo "Sandbox does not exist. Create with 'hb simsetup." @@ -297,10 +297,10 @@ hb_prime() # Prevent error message in cases where SANDBOXBASE is set but hb simsetup # is not performed. Example seen in cronjob scripts if [[ -f ${SANDBOXBASE}/rc_files/sb.conf ]] && - [[ -f ${HOSTBOOTROOT}/src/build/citest/etc/bbuild ]]; then + [[ -f ${PROJECT_ROOT}/src/build/citest/etc/bbuild ]]; then SBDRIVER=`cat ${SANDBOXBASE}/rc_files/sb.conf | \ grep "backing_build" | awk '{ print $3 }'` - DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` + DRIVER=`cat ${PROJECT_ROOT}/src/build/citest/etc/bbuild` if [ ${SBDRIVER} != ${DRIVER} ]; then echo "ERROR: Driver mismatch between sandbox and src/build/citest/etc/bbuild." echo "Sandbox at ${SBDRIVER}" @@ -317,10 +317,10 @@ hb_fipssetup() [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 [ -z "${SANDBOXROOT}" ] && echo "Missing SANDBOXROOT." && exit -1 [ -z "${SANDBOXNAME}" ] && echo "Missing SANDBOXNAME." && exit -1 - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 SANDBOXRC="${SANDBOXROOT}/hbsandboxrc" - DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` + DRIVER=`cat ${PROJECT_ROOT}/src/build/citest/etc/bbuild` if [ -d "${SANDBOXBASE}" ]; then echo "Removing old sandbox." @@ -342,7 +342,7 @@ hb_fipssetup() -sb ${SANDBOXNAME} -m ppc echo "Running workarounds (presimsetup)." - cp ${HOSTBOOTROOT}/src/build/citest/etc/workarounds.presimsetup \ + cp ${PROJECT_ROOT}/src/build/citest/etc/workarounds.presimsetup \ ${SANDBOXBASE}/src execute_in_sandbox "export BACKING_BUILD=\$bb && \ ./workarounds.presimsetup" "ppc" @@ -353,13 +353,13 @@ hb_simsetup() { hb_fipssetup - DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` + DRIVER=`cat ${PROJECT_ROOT}/src/build/citest/etc/bbuild` needs_machine_variable execute_in_sandbox "start_simics -no_start -machine ${MACHINE}" "ppc" echo "Running workarounds (postsimsetup)." - cp ${HOSTBOOTROOT}/src/build/citest/etc/workarounds.postsimsetup ${SANDBOXBASE}/src + cp ${PROJECT_ROOT}/src/build/citest/etc/workarounds.postsimsetup ${SANDBOXBASE}/src execute_in_sandbox "export BACKING_BUILD=\$bb && ./workarounds.postsimsetup" "ppc" rm ${SANDBOXBASE}/src/workarounds.postsimsetup @@ -372,7 +372,7 @@ hb_simsetup() hb_startsimics() { [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 if [ ! -d "${SANDBOXBASE}" ]; then echo "Sandbox does not exist. Create with 'hb simsetup." @@ -381,7 +381,7 @@ hb_startsimics() SBDRIVER=`cat ${SANDBOXBASE}/rc_files/sb.conf | \ grep "backing_build" | awk '{ print $3 }'` - DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` + DRIVER=`cat ${PROJECT_ROOT}/src/build/citest/etc/bbuild` if [ ${SBDRIVER} != ${DRIVER} ]; then echo "Driver mismatch between sandbox and src/build/citest/etc/bbuild." @@ -398,9 +398,9 @@ hb_startsimics() hb_rsync_call() { if [ -z "${RSYNCHOST}" ]; then - rsync -av --delete ${HOSTBOOTROOT}/ ${RSYNCDIR} + rsync -av --delete ${PROJECT_ROOT}/ ${RSYNCDIR} else - rsync -zav --delete ${HOSTBOOTROOT}/ ${RSYNCHOST}:${RSYNCDIR} + rsync -zav --delete ${PROJECT_ROOT}/ ${RSYNCHOST}:${RSYNCDIR} fi } @@ -423,7 +423,7 @@ hb_rsync_helper() hb_rsync() { - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 [ -z "${RSYNCDIR}" ] && echo "Missing RSYNCDIR." && exit -1 # Parse arguments @@ -462,11 +462,11 @@ hb_rsync() hb_objsizes() { - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 echo "Object,Text Size,RO Data Size,Data Size" - objdump -h ${HOSTBOOTROOT}/img/*.elf ${HOSTBOOTROOT}/img/*.so | \ + objdump -h ${PROJECT_ROOT}/img/*.elf ${PROJECT_ROOT}/img/*.so | \ grep -e ".elf" -e ".so:" -e ".text " -e ".rodata" -e ".data " | \ sed "s/.so:.*/.so/" | \ sed "s/.elf:.*/.elf/" | \ @@ -488,9 +488,9 @@ hb_errlparser() [ -z "${SANDBOXBASE}" ] && echo "Missing SANDBOXBASE." && exit -1 [ -z "${SANDBOXROOT}" ] && echo "Missing SANDBOXROOT." && exit -1 [ -z "${SANDBOXNAME}" ] && echo "Missing SANDBOXNAME." && exit -1 - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 - DRIVER=`cat ${HOSTBOOTROOT}/src/build/citest/etc/bbuild` + DRIVER=`cat ${PROJECT_ROOT}/src/build/citest/etc/bbuild` # sanity checks if [ ! -f ${DRIVER}/src/makefile ]; then @@ -498,19 +498,19 @@ hb_errlparser() exit -1 fi - ${HOSTBOOTROOT}/src/build/citest/build-errl-parsers + ${PROJECT_ROOT}/src/build/citest/build-errl-parsers return $? } hb_cachesync() { - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 rsync -av /gsa/ausgsa/projects/h/hostboot/.binary_cache/ \ - ${HOSTBOOTROOT}/.git/hb_cache + ${PROJECT_ROOT}/.git/hb_cache failure=0 - for files in ${HOSTBOOTROOT}/.git/hb_cache/data/*; do + for files in ${PROJECT_ROOT}/.git/hb_cache/data/*; do echo "`basename $files` $files" | sha1sum --check >> /dev/null if [ $? -ne 0 ]; then echo "Failed SHA1 verification! $files" @@ -523,7 +523,7 @@ hb_cachesync() hb_cacheadd() { - [ -z "${HOSTBOOTROOT}" ] && echo "Missing HOSTBOOTROOT." && exit -1 + [ -z "${PROJECT_ROOT}" ] && echo "Missing PROJECT_ROOT." && exit -1 CACHE_PATH=/gsa/ausgsa/projects/h/hostboot/.binary_cache/ FILE=$1 @@ -531,7 +531,7 @@ hb_cacheadd() if [ $FILE == "--local" ]; then echo "Adding as local copy." - CACHE_PATH=${HOSTBOOTROOT}/.git/hb_cache/ + CACHE_PATH=${PROJECT_ROOT}/.git/hb_cache/ FILE=$1 shift diff --git a/src/build/tools/hbGenConfig b/src/build/tools/hbGenConfig index f846faa3c..3792c50bf 100755 --- a/src/build/tools/hbGenConfig +++ b/src/build/tools/hbGenConfig @@ -254,9 +254,9 @@ sub evaluateExpr # Create the config.mk / config.h files with the enabled options. sub outputResults { - die if not defined $ENV{HOSTBOOTROOT}; - open CONFIGMK, "> $ENV{HOSTBOOTROOT}/obj/genfiles/config.mk" or die; - open CONFIGH, "> $ENV{HOSTBOOTROOT}/obj/genfiles/config.h" or die; + die if not defined $ENV{PROJECT_ROOT}; + open CONFIGMK, "> $ENV{PROJECT_ROOT}/obj/genfiles/config.mk" or die; + open CONFIGH, "> $ENV{PROJECT_ROOT}/obj/genfiles/config.h" or die; print CONFIGH "#ifndef __HOSTBOOT_CONFIG_H\n"; print CONFIGH "#define __HOSTBOOT_CONFIG_H\n"; diff --git a/src/build/tools/post-commit b/src/build/tools/post-commit index 42eaa9928..ab0f6ad1e 100755 --- a/src/build/tools/post-commit +++ b/src/build/tools/post-commit @@ -6,7 +6,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2013,2014 +# Contributors Listed Below - COPYRIGHT 2013,2015 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,8 +24,4 @@ # # IBM_PROLOG_END_TAG -. git-sh-setup -export GIT_DIR=$GIT_DIR -export TOOLS_DIR=$GIT_DIR/../src/build/tools - -$TOOLS_DIR/verify-commit +$TOOLSDIR/verify-commit diff --git a/src/build/tools/pre-commit b/src/build/tools/pre-commit index 316b4a989..013e42329 100755 --- a/src/build/tools/pre-commit +++ b/src/build/tools/pre-commit @@ -6,7 +6,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2011,2014 +# Contributors Listed Below - COPYRIGHT 2011,2015 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,8 +24,4 @@ # # IBM_PROLOG_END_TAG -. git-sh-setup -export GIT_DIR=$GIT_DIR -export TOOLS_DIR=$GIT_DIR/../src/build/tools - -$TOOLS_DIR/pre-commit-prologs +$TOOLSDIR/pre-commit-actions diff --git a/src/build/tools/pre-commit-actions b/src/build/tools/pre-commit-actions new file mode 100755 index 000000000..fc2740bdd --- /dev/null +++ b/src/build/tools/pre-commit-actions @@ -0,0 +1,50 @@ +#!/usr/bin/perl +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/tools/pre-commit-actions $ +# +# OpenPOWER HostBoot Project +# +# Contributors Listed Below - COPYRIGHT 2015 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG + +# This hook is used to add or update copyright prolog statements and run +# the code beautifier astyle. + +my $copyrightScript = "addCopyright.pl"; + +## Make up a list of all staged files ( --cached --name-only ) +## Filter for only Added or Modified ( --diff-filter=AM ) +chomp( my @fileList = `git diff --cached --name-only --diff-filter=AM` ); + + +if ( @fileList ) +{ + print "run $copyrightScript update ...\n"; + print " $_\n" foreach @fileList; + print "\n"; + + system "$ENV{'TOOLSDIR'}/$copyrightScript update @fileList"; + die("$?") if ($? != 0); + + system "git add @fileList"; + exit 1 if ($? != 0); +} + +exit 0; diff --git a/src/build/tools/setupgithooks.sh b/src/build/tools/setupgithooks.sh index cde55518a..707286e6e 100755 --- a/src/build/tools/setupgithooks.sh +++ b/src/build/tools/setupgithooks.sh @@ -6,7 +6,9 @@ # # OpenPOWER HostBoot Project # -# COPYRIGHT International Business Machines Corp. 2011,2014 +# Contributors Listed Below - COPYRIGHT 2011,2015 +# [+] International Business Machines Corp. +# # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,11 +27,6 @@ # Each developer runs this from the git_repo base dir, where it will copy the # needed scripts into .git/hooks/ directory and make them executable. -# Setup some global variables -HOOKSDIR=$HOSTBOOTROOT/.git/hooks -TOOLSDIR=$HOSTBOOTROOT/src/build/tools -HB_SRV=hostboot.gerrit - if [ -d $HOOKSDIR ] then @@ -37,11 +34,12 @@ then if [ ! -f $HOOKSDIR/commit-msg ] then echo "Copying Gerrit hooks..." - scp -p -q $HB_SRV:hooks/commit-msg $HOOKSDIR + scp -p -q $GERRIT_SRV:hooks/commit-msg $HOOKSDIR fi # Copy custom pre/post commit hooks from tools directory. - if [ -f "$TOOLSDIR/pre-commit" -a -f "$TOOLSDIR/post-commit" ] + if [ -f "$TOOLSDIR/pre-commit" -a \ + -f "$TOOLSDIR/post-commit" ] then echo "Copying pre/post commit hooks..." diff --git a/src/build/tools/verify-commit b/src/build/tools/verify-commit index 65b589c4d..f4218293a 100755 --- a/src/build/tools/verify-commit +++ b/src/build/tools/verify-commit @@ -29,6 +29,8 @@ use strict; my $issueFound = 0; my $errorFound = 0; +my $projectName = $ENV{'PROJECT_NAME'}; + verifyPatchSet(); # Verify the patch contents. verifyCommitMsg(); # Verify the commit message. @@ -179,7 +181,7 @@ sub verifyFileLine } # Check for "Confidential". - if ($line =~ m/Confidential/i) + if ($line =~ m/Confidential/i && $projectName =~ m/HostBoot/i) { unless (($file =~ m/verify-commit/) || ($file =~ m/addCopyright.pl/)) |