6962318: Update copyright year jdk7-b124

Tue, 28 Dec 2010 15:52:09 -0800

author
ohair
date
Tue, 28 Dec 2010 15:52:09 -0800
changeset 280
024a6755895b
parent 279
d0eb51cc458a
child 281
5c4df7e99277
child 288
6db0e6f221bd

6962318: Update copyright year
Reviewed-by: xdono

make/Defs-internal.gmk file | annotate | diff | comparison | revisions
make/deploy-rules.gmk file | annotate | diff | comparison | revisions
make/hotspot-rules.gmk file | annotate | diff | comparison | revisions
make/install-rules.gmk file | annotate | diff | comparison | revisions
make/jprt.gmk file | annotate | diff | comparison | revisions
make/sanity-rules.gmk file | annotate | diff | comparison | revisions
make/scripts/update_copyright_year.sh file | annotate | diff | comparison | revisions
     1.1 --- a/make/Defs-internal.gmk	Fri Dec 24 11:16:02 2010 -0800
     1.2 +++ b/make/Defs-internal.gmk	Tue Dec 28 15:52:09 2010 -0800
     1.3 @@ -1,5 +1,5 @@
     1.4  #
     1.5 -# Copyright (c) 1995, 2009, Oracle and/or its affiliates. All rights reserved.
     1.6 +# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
     1.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8  #
     1.9  # This code is free software; you can redistribute it and/or modify it
     2.1 --- a/make/deploy-rules.gmk	Fri Dec 24 11:16:02 2010 -0800
     2.2 +++ b/make/deploy-rules.gmk	Tue Dec 28 15:52:09 2010 -0800
     2.3 @@ -1,5 +1,5 @@
     2.4  #
     2.5 -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
     2.6 +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     2.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8  #
     2.9  # This code is free software; you can redistribute it and/or modify it
     3.1 --- a/make/hotspot-rules.gmk	Fri Dec 24 11:16:02 2010 -0800
     3.2 +++ b/make/hotspot-rules.gmk	Tue Dec 28 15:52:09 2010 -0800
     3.3 @@ -1,5 +1,5 @@
     3.4  #
     3.5 -# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
     3.6 +# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     3.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8  #
     3.9  # This code is free software; you can redistribute it and/or modify it
     4.1 --- a/make/install-rules.gmk	Fri Dec 24 11:16:02 2010 -0800
     4.2 +++ b/make/install-rules.gmk	Tue Dec 28 15:52:09 2010 -0800
     4.3 @@ -1,5 +1,5 @@
     4.4  #
     4.5 -# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
     4.6 +# Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
     4.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8  #
     4.9  # This code is free software; you can redistribute it and/or modify it
     5.1 --- a/make/jprt.gmk	Fri Dec 24 11:16:02 2010 -0800
     5.2 +++ b/make/jprt.gmk	Tue Dec 28 15:52:09 2010 -0800
     5.3 @@ -1,5 +1,5 @@
     5.4  #
     5.5 -# Copyright (c) 2006, 2009, Oracle and/or its affiliates. All rights reserved.
     5.6 +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
     5.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8  #
     5.9  # This code is free software; you can redistribute it and/or modify it
     6.1 --- a/make/sanity-rules.gmk	Fri Dec 24 11:16:02 2010 -0800
     6.2 +++ b/make/sanity-rules.gmk	Tue Dec 28 15:52:09 2010 -0800
     6.3 @@ -1,5 +1,5 @@
     6.4  #
     6.5 -# Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved.
     6.6 +# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
     6.7  # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     6.8  #
     6.9  # This code is free software; you can redistribute it and/or modify it
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/make/scripts/update_copyright_year.sh	Tue Dec 28 15:52:09 2010 -0800
     7.3 @@ -0,0 +1,189 @@
     7.4 +#!/bin/sh -f
     7.5 +
     7.6 +#
     7.7 +# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
     7.8 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.9 +#
    7.10 +# This code is free software; you can redistribute it and/or modify it
    7.11 +# under the terms of the GNU General Public License version 2 only, as
    7.12 +# published by the Free Software Foundation.
    7.13 +#
    7.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    7.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    7.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    7.17 +# version 2 for more details (a copy is included in the LICENSE file that
    7.18 +# accompanied this code).
    7.19 +#
    7.20 +# You should have received a copy of the GNU General Public License version
    7.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    7.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    7.23 +#
    7.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    7.25 +# or visit www.oracle.com if you need additional information or have any
    7.26 +# questions.
    7.27 +#
    7.28 +
    7.29 +# Script to update the Copyright YEAR range in Mercurial sources.
    7.30 +#  (Originally from xdono, Thanks!)
    7.31 +
    7.32 +if [ "`uname -s`" = "SunOS" ] ; then
    7.33 +  awk=nawk
    7.34 +else
    7.35 +  awk=awk
    7.36 +fi
    7.37 +
    7.38 +# Stop on any error
    7.39 +set -e
    7.40 +
    7.41 +# Temp area
    7.42 +tmp=/tmp/`basename $0`.${USER}.$$
    7.43 +rm -f -r ${tmp}
    7.44 +mkdir -p ${tmp}
    7.45 +total=0
    7.46 +
    7.47 +# This year or supplied year
    7.48 +if [ "$1" != "" ] ; then
    7.49 +  year="$1"
    7.50 +else
    7.51 +  year=`date +%Y`
    7.52 +fi
    7.53 +
    7.54 +# Return true if it makes sense to edit this file
    7.55 +saneFileToCheck()
    7.56 +{
    7.57 +  if [ "$1" != "" -a -f $1 ] ; then
    7.58 +    isText=`file "$1" | egrep -i '(text|source)' | cat`
    7.59 +    hasCopyright=`grep 'Copyright' "$1" | cat`
    7.60 +    lastLineCount=`tail -1 "$1" | wc -l`
    7.61 +    if [ "${isText}" != ""  \
    7.62 +         -a "${hasCopyright}" != "" \
    7.63 +	 -a ${lastLineCount} -eq 1 ] ; then
    7.64 +      echo "true"
    7.65 +    else
    7.66 +      echo "false"
    7.67 +    fi
    7.68 +  else
    7.69 +    echo "false"
    7.70 +  fi
    7.71 +}
    7.72 +
    7.73 +# Update the copyright year on a file
    7.74 +updateFile() # file
    7.75 +{
    7.76 +  changed="false"
    7.77 +  if [ `saneFileToCheck "$1"` = "true" ] ; then
    7.78 +    copyright="Copyright (c)"
    7.79 +    company="Oracle"
    7.80 +    rm -f $1.OLD
    7.81 +    mv $1 $1.OLD
    7.82 +    cat $1.OLD | \
    7.83 +      sed -e "s@\(${copyright} [12][0-9][0-9][0-9],\) [12][0-9][0-9][0-9], ${company}@\1 ${year}, ${company}@" | \
    7.84 +      sed -e "s@\(${copyright} [12][0-9][0-9][0-9],\) ${company}@\1 ${year}, ${company}@" | \
    7.85 +      sed -e "s@${copyright} ${year}, ${year}, ${company}@${copyright} ${year}, ${company}@"  \
    7.86 +      > $1
    7.87 +    if ! diff -b -w $1.OLD $1 > /dev/null ; then \
    7.88 +      changed="true"
    7.89 +      rm -f $1.OLD
    7.90 +    else
    7.91 +      rm -f $1
    7.92 +      mv $1.OLD $1
    7.93 +    fi
    7.94 +  fi
    7.95 +  echo "${changed}"
    7.96 +}
    7.97 +
    7.98 +# Update the copyright year on all files changed by this changeset
    7.99 +updateChangesetFiles() # changeset
   7.100 +{
   7.101 +  count=0
   7.102 +  files=${tmp}/files.$1
   7.103 +  rm -f ${files}
   7.104 +  hg log --rev $1 -v --template '{files}\n' | expand \
   7.105 +    | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \
   7.106 +    > ${files}
   7.107 +  if [ -f "${files}" -a -s "${files}" ] ; then
   7.108 +    copyright="Copyright (c)"
   7.109 +    company="Oracle"
   7.110 +    fcount=`cat ${files}| wc -l`
   7.111 +    for i in `cat ${files}` ; do
   7.112 +      if [ `updateFile "${i}"` = "true" ] ; then
   7.113 +        count=`expr ${count} '+' 1`
   7.114 +      fi
   7.115 +    done
   7.116 +    if [ ${count} -gt 0 ] ; then
   7.117 +      printf "  UPDATED year on %d of %d files.\n" ${count} ${fcount}
   7.118 +      total=`expr ${total} '+' ${count}`
   7.119 +    else
   7.120 +      printf "  None of the %d files were changed.\n" ${fcount}
   7.121 +    fi
   7.122 +  else
   7.123 +    printf "  ERROR: No files changed in the changeset? Must be a mistake.\n"
   7.124 +    set -x
   7.125 +    ls -al ${files}
   7.126 +    hg log --rev $1 -v --template '{files}\n'
   7.127 +    hg log --rev $1 -v --template '{files}\n' | expand \
   7.128 +      | ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}'
   7.129 +    set +x
   7.130 +    exit 1
   7.131 +  fi
   7.132 +  rm -f ${files}
   7.133 +}
   7.134 +
   7.135 +# Check if repository is clean
   7.136 +previous=`hg status|wc -l`
   7.137 +if [ ${previous} -ne 0 ] ; then
   7.138 +  echo "WARNING: This repository contains previously edited working set files."
   7.139 +  echo "  hg status | wc -l = `hg status | wc -l`"
   7.140 +fi
   7.141 +
   7.142 +# Get all changesets this year
   7.143 +all_changesets=${tmp}/all_changesets
   7.144 +rm -f ${all_changesets}
   7.145 +hg log --no-merges -v -d "${year}-01-01 to ${year}-12-31" --template '{node}\n' > ${all_changesets}
   7.146 +
   7.147 +# Check changeset to see if it is Copyright only changes, filter changesets
   7.148 +if [ -s ${all_changesets} ] ; then
   7.149 +  echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`"
   7.150 +  index=0
   7.151 +  cat ${all_changesets} | while read changeset ; do
   7.152 +    index=`expr ${index} '+' 1`
   7.153 +    desc=${tmp}/desc.${changeset}
   7.154 +    rm -f ${desc}
   7.155 +    echo "------------------------------------------------"
   7.156 +    hg log --rev ${changeset} --template '{desc}\n' > ${desc}
   7.157 +    printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
   7.158 +    if cat ${desc} | fgrep -i "Added tag" > /dev/null ; then
   7.159 +      printf "  EXCLUDED tag changeset.\n"
   7.160 +    elif cat ${desc} | fgrep -i rebrand > /dev/null ; then
   7.161 +      printf "  EXCLUDED rebrand changeset.\n"
   7.162 +    elif cat ${desc} | fgrep -i copyright > /dev/null ; then
   7.163 +      printf "  EXCLUDED copyright changeset.\n"
   7.164 +    else
   7.165 +      updateChangesetFiles ${changeset}
   7.166 +    fi
   7.167 +    rm -f ${desc}
   7.168 +  done
   7.169 +fi
   7.170 +
   7.171 +if [ ${total} -gt 0 ] ; then
   7.172 +   echo "---------------------------------------------"
   7.173 +   echo "Updated the copyright year on a total of ${total} files."
   7.174 +   if [ ${previous} -eq 0 ] ; then
   7.175 +     echo "This count should match the count of modified files in the repository: hg status -m"
   7.176 +   else
   7.177 +     echo "WARNING: This repository contained previously edited working set files."
   7.178 +   fi
   7.179 +   echo "  hg status -m | wc -l = `hg status -m | wc -l`"
   7.180 +else
   7.181 +   echo "---------------------------------------------"
   7.182 +   echo "No files were changed"
   7.183 +   if [ ${previous} -ne 0 ] ; then
   7.184 +     echo "WARNING: This repository contained previously edited working set files."
   7.185 +   fi
   7.186 +   echo "  hg status -m | wc -l = `hg status -m | wc -l`"
   7.187 +fi
   7.188 +
   7.189 +# Cleanup
   7.190 +rm -f -r ${tmp}
   7.191 +exit 0
   7.192 +

mercurial