summaryrefslogtreecommitdiffstats
path: root/src/build/tools/pre-commit-prologs
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2014-03-25 16:18:49 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-04-10 15:57:20 -0500
commit8031426efe467232b8338b839c1862bd84932c00 (patch)
treed737089d4ab35e36778d6548f1e4de43097a6b92 /src/build/tools/pre-commit-prologs
parentcab2e5a1ddcb47adf1d1ccc18f85f240f784afbd (diff)
downloadtalos-hostboot-8031426efe467232b8338b839c1862bd84932c00.tar.gz
talos-hostboot-8031426efe467232b8338b839c1862bd84932c00.zip
Fixed some issues with pre/post commit scripts
Change-Id: I9da6959c32fcc967ef86348b7d4a93b1c2bf86f3 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/9877 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/tools/pre-commit-prologs')
-rwxr-xr-xsrc/build/tools/pre-commit-prologs52
1 files changed, 25 insertions, 27 deletions
diff --git a/src/build/tools/pre-commit-prologs b/src/build/tools/pre-commit-prologs
index 775eaaa4d..1ce0b0107 100755
--- a/src/build/tools/pre-commit-prologs
+++ b/src/build/tools/pre-commit-prologs
@@ -1,47 +1,45 @@
#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/build/tools/pre-commit-prologs $
+# $Source: src/build/tools/pre-commit-prologs $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011
+# COPYRIGHT International Business Machines Corp. 2011,2014
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
#
-# The source code for this program is not published or other-
-# wise divested of its trade secrets, irrespective of what has
-# been deposited with the U.S. Copyright Office.
+# 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.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END
+# IBM_PROLOG_END_TAG
# This hook is used to add or update copyright prolog statements
-$COPYRIGHT_SCRIPT=".git/hooks/addCopyright.pl";
+my $script = "addCopyright.pl";
-## make up a list of all staged files ( --cached --name-only )
-## filter for only Added or Modified ( --diff-filter=AM )
-## paste puts them all on one line.
-my $fileList = `git diff --cached --name-only --diff-filter=AM | paste -s -`;
-chomp($fileList);
+## 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 (length($fileList) > 0)
+if ( @fileList )
{
- my $cmd = "$COPYRIGHT_SCRIPT update $fileList";
- print "run $cmd...\n";
- system $cmd;
+ print "run $script update ...\n";
+ print " $_\n" foreach @fileList;
+ print "\n";
+
+ system "$ENV{'TOOLS_DIR'}/$script update @fileList";
die("$?") if ($? != 0);
-# print "re-adding files $fileList\n";
- system "git add $fileList";
+ system "git add @fileList";
exit 1 if ($? != 0);
}
OpenPOWER on IntegriCloud