summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2016-03-24 14:12:39 -0500
committerWilliam G. Hoffa <wghoffa@us.ibm.com>2016-08-05 10:44:47 -0400
commit36b757e4ce2bac2107c6776ca4c4f529a5fa1b83 (patch)
tree9f8fa87b778259f4c306022d574f9848d7b84cf3
parent51dd9c2385c56836385acbc0d95258682b7d01d3 (diff)
downloadtalos-hostboot-36b757e4ce2bac2107c6776ca4c4f529a5fa1b83.tar.gz
talos-hostboot-36b757e4ce2bac2107c6776ca4c4f529a5fa1b83.zip
Enable the import tree to have hostboot prologs
Also removed suffix from addCopyright script Change-Id: I83f633ee8a9e91eccf817756e8f4f19a6c89da27 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22460 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Matthew A. Ploetz <maploetz@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
-rwxr-xr-xsrc/build/tools/addCopyright (renamed from src/build/tools/addCopyright.pl)76
-rwxr-xr-xsrc/build/tools/copyright-check.sh6
-rwxr-xr-xsrc/build/tools/hb4
-rwxr-xr-xsrc/build/tools/pre-commit21
-rwxr-xr-xsrc/build/tools/pre-commit-actions4
-rwxr-xr-xsrc/build/tools/pre-commit-prologs6
-rwxr-xr-xsrc/build/tools/pre-receive16
-rwxr-xr-xsrc/build/tools/verify-commit4
-rwxr-xr-xsrc/import/LICENSE_PROLOG14
9 files changed, 41 insertions, 110 deletions
diff --git a/src/build/tools/addCopyright.pl b/src/build/tools/addCopyright
index 000958c1e..36da77703 100755
--- a/src/build/tools/addCopyright.pl
+++ b/src/build/tools/addCopyright
@@ -2,7 +2,7 @@
# IBM_PROLOG_BEGIN_TAG
# This is an automatically generated prolog.
#
-# $Source: src/build/tools/addCopyright.pl $
+# $Source: src/build/tools/addCopyright $
#
# OpenPOWER HostBoot Project
#
@@ -30,7 +30,7 @@
# Author: Mark Jerde (mjerde@us.ibm.com) #
# Date: Fri Mar 19 17:40:32 2010 UTC #
# #
-# addCopyright.pl will automatically insert appropriate copyright statements #
+# addCopyright will automatically insert appropriate copyright statements #
# in source files following the IBM copyright guidelines (and templates) #
# referenced below : #
# FSP ClearCase Architecture #
@@ -47,8 +47,8 @@
# make clean # remove autogenerated files #
# find src -path 'src/build' -prune -o ! -type d -print | tr '\n' ' ' #
# #
-# addCopyright.pl does not support piping, but you can send these #
-# to a file, add "addCopyright.pl update" to the beginning of the line, #
+# addCopyright does not support piping, but you can send these #
+# to a file, add "addCopyright update" to the beginning of the line, #
# and run the file to update all #
###############################################################################
@@ -238,7 +238,7 @@ foreach ( @Files )
##
## Special case is this file, just return 0 and add copyright manually.
##
- if ( m/addCopyright\.pl/ )
+ if ( m/addCopyright/ )
{
print STDOUT "---------------------------------------------------------\n";
print STDOUT "Skipping special case file: $_\n";
@@ -285,18 +285,6 @@ foreach ( @Files )
}
##
- ## We do not want to modify the prologs of files mirrored from EKB
- ## Eventually we will enhance to allow different prologs, but at the time
- ## this breaks the mirror tool.
- if (m/^src\/import/)
- {
- print STDOUT "---------------------------------------------------------\n";
- print STDOUT "Skipping file mirrored from EKB: $_\n";
- print STDOUT "---------------------------------------------------------\n";
- next;
- }
-
- ##
## Check if any parent directory below $projectRoot has a LICENSE_PROLOG file
## Backtrack from the directory where the file lives and find the first
## custom LICENSE_PROLOG file.
@@ -316,13 +304,6 @@ foreach ( @Files )
}
} while ($path ne $projectRoot);
- ## extract the existing copyright block
- # Check if file from EKB in import tree
- if (mirrored_file($_))
- {
- # Remove copyright prefix as EKB does not have it
- $copyrightStr =~ s/$copyrightPrefix//;
- }
$CopyrightBlock = extractCopyrightBlock( $_ );
##
@@ -383,7 +364,7 @@ if ( $opt_logfile ne "" )
#######################################
sub usage
{
- print STDOUT "Usage: addCopyright.pl { update | validate } \n";
+ print STDOUT "Usage: addCopyright { update | validate } \n";
print STDOUT " [ --log-failed-files ]\n";
print STDOUT " [ --debug ] \n";
print STDOUT " file1 file2 ...\n";
@@ -391,43 +372,6 @@ sub usage
}
#######################################
-## checks if file was mirrored from EKB
-## param[in] $filename to check
-## returns 1 mirrored from EKB
-#######################################
-sub mirrored_file
-{
- my $filename = shift;
-
- if ($filename =~ m/^$importPrefix/)
- {
- # Import tree expects to have EKB in the prolog
- $projectName = "EKB";
- return 1;
- }
- return 0;
-}
-
-#######################################
-## Converts mirrored filename to match its original in EKB
-## Mirroring prefixes the name with the import tree.
-## param[in] $filename to check
-## returns new $filename with prefix removed
-#######################################
-sub convert_mirror_file
-{
- my $filename = shift;
-
- if (mirrored_file($filename))
- {
- # Remove $importPrefix as EKB does not have it
- $filename =~ s/^$importPrefix//;
- }
-
- return $filename
-}
-
-#######################################
## validate the file
## param[in] $filename to validate
## returns 0 success, nonzero failure
@@ -444,8 +388,7 @@ sub validate
return RC_NO_COPYRIGHT_BLOCK;
}
- my $converted_file = convert_mirror_file($filename);
- $rc = checkCopyrightBlock( $CopyrightBlock, $converted_file);
+ $rc = checkCopyrightBlock( $CopyrightBlock, $filename);
# good file
return $rc;
@@ -689,7 +632,7 @@ sub checkCopyrightBlock
close($licenseHndl);
print STDOUT "\nERROR> Prolog not correct for $filename.\n";
- print STDOUT "To fix run: git show --pretty=\"format:\" --name-only | xargs addCopyright.pl update\n";
+ print STDOUT "To fix run: git show --pretty=\"format:\" --name-only | xargs addCopyright update\n";
print STDOUT "\nDiff:\n";
print STDOUT `diff $blockFile $licenseFile`;
my $relLicensePath = $LicenseFile;
@@ -1096,8 +1039,7 @@ sub fillinEmptyCopyrightBlock
my $copyrightYear = createYearString( $filename );
## define the final copyright block template here.
- my $converted_file = convert_mirror_file($filename);
- my $IBMCopyrightBlock = genCopyrightBlock($converted_file,$filetype);
+ my $IBMCopyrightBlock = genCopyrightBlock($filename,$filetype);
## Modify file in place with temp file Perl Cookbook 7.8
my $savedbgfile = "$filename.fillin";
diff --git a/src/build/tools/copyright-check.sh b/src/build/tools/copyright-check.sh
index 07445902d..2b3c23961 100755
--- a/src/build/tools/copyright-check.sh
+++ b/src/build/tools/copyright-check.sh
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2011,2015
+# Contributors Listed Below - COPYRIGHT 2011,2016
# [+] International Business Machines Corp.
#
#
@@ -25,12 +25,12 @@
# IBM_PROLOG_END_TAG
#
-# Front end to addCopyright.pl - script to check for copyright block during
+# Front end to addCopyright - script to check for copyright block during
# Gerrit checkin.
#
export WORKSPACE_DIR=`pwd`
-export ADDCOPYRIGHT=${WORKSPACE_DIR}/src/build/tools/addCopyright.pl
+export ADDCOPYRIGHT=${WORKSPACE_DIR}/src/build/tools/addCopyright
## run git show to get a list of checked in files
CHECKINFILES=`git show --pretty=format: --name-only -n1 | tr '\n' ' '`
diff --git a/src/build/tools/hb b/src/build/tools/hb
index f5d2620fc..c5aa4ce9d 100755
--- a/src/build/tools/hb
+++ b/src/build/tools/hb
@@ -189,7 +189,7 @@ hb_helptext()
echo " Usage:"
echo " hb copyright_check"
echo
- echo " Executes addCopyright.pl in validate mode against the most"
+ echo " Executes addCopyright in validate mode against the most"
echo " recent commit in your repository to ensure the prologs are"
echo " all added properly."
;;
@@ -483,7 +483,7 @@ hb_objsizes()
hb_copyright_check()
{
- git diff HEAD~1 --name-only | xargs addCopyright.pl validate
+ git diff HEAD~1 --name-only | xargs addCopyright validate
}
hb_errlparser()
diff --git a/src/build/tools/pre-commit b/src/build/tools/pre-commit
index 8d6e3006a..121f286c8 100755
--- a/src/build/tools/pre-commit
+++ b/src/build/tools/pre-commit
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2011,2015
+# Contributors Listed Below - COPYRIGHT 2011,2016
# [+] International Business Machines Corp.
#
#
@@ -23,14 +23,13 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-if [ -z $MIRROR ]; then
- if [ -f $TOOLSDIR/pre-commit-actions ]; then
- $TOOLSDIR/pre-commit-actions
- # Legacy support for older releases
- elif [ -f $TOOLSDIR/pre-commit-prologs ]; then
- $TOOLSDIR/pre-commit-prologs
- else
- echo "Missing pre-commit files"
- exit -1
- fi
+
+if [ -f $TOOLSDIR/pre-commit-actions ]; then
+ $TOOLSDIR/pre-commit-actions
+# Legacy support for older releases
+elif [ -f $TOOLSDIR/pre-commit-prologs ]; then
+ $TOOLSDIR/pre-commit-prologs
+else
+ echo "Missing pre-commit files"
+ exit -1
fi
diff --git a/src/build/tools/pre-commit-actions b/src/build/tools/pre-commit-actions
index fc2740bdd..d47dfff74 100755
--- a/src/build/tools/pre-commit-actions
+++ b/src/build/tools/pre-commit-actions
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015
+# Contributors Listed Below - COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
@@ -27,7 +27,7 @@
# This hook is used to add or update copyright prolog statements and run
# the code beautifier astyle.
-my $copyrightScript = "addCopyright.pl";
+my $copyrightScript = "addCopyright";
## Make up a list of all staged files ( --cached --name-only )
## Filter for only Added or Modified ( --diff-filter=AM )
diff --git a/src/build/tools/pre-commit-prologs b/src/build/tools/pre-commit-prologs
index 4fe92a065..a64e4d176 100755
--- a/src/build/tools/pre-commit-prologs
+++ b/src/build/tools/pre-commit-prologs
@@ -6,7 +6,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2011,2014
+# Contributors Listed Below - COPYRIGHT 2011,2016
+# [+] 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.
@@ -24,7 +26,7 @@
# This hook is used to add or update copyright prolog statements
-my $script = "addCopyright.pl";
+my $script = "addCopyright";
## Make up a list of all staged files ( --cached --name-only )
## Filter for only Added or Modified ( --diff-filter=AM )
diff --git a/src/build/tools/pre-receive b/src/build/tools/pre-receive
index 793bc12c5..ebc370cd9 100755
--- a/src/build/tools/pre-receive
+++ b/src/build/tools/pre-receive
@@ -6,7 +6,9 @@
#
# OpenPOWER HostBoot Project
#
-# COPYRIGHT International Business Machines Corp. 2011,2014
+# Contributors Listed Below - COPYRIGHT 2011,2016
+# [+] 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.
@@ -24,19 +26,19 @@
#
# From "git help githooks" :
-# "This hook executes once for the receive operation. It takes no arguments,
-# but for each ref to be updated it receives on standard input a line of
+# "This hook executes once for the receive operation. It takes no arguments,
+# but for each ref to be updated it receives on standard input a line of
# the format:
#
# <old-value> SP <new-value> SP <ref-name> LF
#
-# where <old-value> is the old object name stored in the ref,
-# <new-value> is the new object name to be stored in the ref,
-# and <ref-name> is the full name of the ref.
+# where <old-value> is the old object name stored in the ref,
+# <new-value> is the new object name to be stored in the ref,
+# and <ref-name> is the full name of the ref.
# When creating a new ref, <old-value> is 40 0."
#
-$COPYRIGHT_SCRIPT=".git/hooks/addCopyright.pl";
+$COPYRIGHT_SCRIPT=".git/hooks/addCopyright";
print "Processing pre-receive script\n";
diff --git a/src/build/tools/verify-commit b/src/build/tools/verify-commit
index 0ce44a286..a48d06e38 100755
--- a/src/build/tools/verify-commit
+++ b/src/build/tools/verify-commit
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2013,2015
+# Contributors Listed Below - COPYRIGHT 2013,2016
# [+] International Business Machines Corp.
#
#
@@ -193,7 +193,7 @@ sub verifyFileLine
if ($line =~ m/Confidential/i && $projectName =~ m/HostBoot/i && !$mirror)
{
unless (($file =~ m/verify-commit/) ||
- ($file =~ m/addCopyright.pl/))
+ ($file =~ m/addCopyright/))
{
error($file,$line,$count,
"File contains 'Confidential'.");
diff --git a/src/import/LICENSE_PROLOG b/src/import/LICENSE_PROLOG
deleted file mode 100755
index 47e97d851..000000000
--- a/src/import/LICENSE_PROLOG
+++ /dev/null
@@ -1,14 +0,0 @@
-This is an automatically generated prolog.
-
-$SOURCE_BEGIN_TAG $filename $SOURCE_END_TAG
-
-IBM CONFIDENTIAL
-
-$projectName Project
-
-$copyrightStr $copyrightYear
-$copyright_Contributors
-
-The source code for this program is not published or otherwise
-divested of its trade secrets, irrespective of what has been
-deposited with the U.S. Copyright Office.
OpenPOWER on IntegriCloud