/hg/release/icedtea7-forest-2.4: 15 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Thu Feb 14 01:00:41 PST 2013
changeset 168aa0f1417b in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=168aa0f1417b
author: katleman
date: Fri Jan 11 09:00:00 2013 -0800
Added tag jdk7u11-b20 for changeset c2d5141baeda
changeset d3c10b908b04 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=d3c10b908b04
author: katleman
date: Sat Jan 12 14:42:47 2013 -0800
Added tag jdk7u11-b21 for changeset 168aa0f1417b
changeset 0b418e2ccf90 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=0b418e2ccf90
author: katleman
date: Tue Nov 13 16:57:15 2012 -0800
Added tag jdk7u11-b03 for changeset c8a37a49fc90
changeset 7d5922ad2e59 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=7d5922ad2e59
author: ewendeli
date: Mon Nov 19 16:25:42 2012 +0100
Merge
changeset e127e6c94b56 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=e127e6c94b56
author: cl
date: Tue Nov 20 18:12:06 2012 -0800
Added tag jdk7u11-b04 for changeset 0b418e2ccf90
changeset 70caee36d4d5 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=70caee36d4d5
author: cl
date: Tue Nov 20 18:31:12 2012 -0800
Added tag jdk7u11-b05 for changeset e127e6c94b56
changeset f6abff072aab in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=f6abff072aab
author: ewendeli
date: Thu Nov 22 08:18:33 2012 +0100
Merge
changeset bc8041e46049 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=bc8041e46049
author: katleman
date: Wed Nov 28 15:41:24 2012 -0800
Added tag jdk7u11-b06 for changeset f6abff072aab
changeset 80a3d0bcd3d4 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=80a3d0bcd3d4
author: ewendeli
date: Fri Nov 30 04:54:05 2012 +0100
Merge
changeset 139b3df918c3 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=139b3df918c3
author: katleman
date: Tue Dec 04 10:39:01 2012 -0800
Added tag jdk7u11-b07 for changeset 80a3d0bcd3d4
changeset e7c55def6796 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=e7c55def6796
author: ewendeli
date: Thu Dec 06 17:41:00 2012 +0100
Merge
changeset e6dcbb5781da in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=e6dcbb5781da
author: katleman
date: Tue Dec 11 12:13:49 2012 -0800
Added tag jdk7u11-b08 for changeset e7c55def6796
changeset 2412f7b8551e in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=2412f7b8551e
author: ewendeli
date: Mon Jan 14 18:31:14 2013 +0100
Merge
changeset 3b7815df113f in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=3b7815df113f
author: katleman
date: Tue Jan 15 18:57:06 2013 -0800
Added tag jdk7u13-b09 for changeset 2412f7b8551e
changeset 6e8081c44ae9 in /hg/release/icedtea7-forest-2.4
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4?cmd=changeset;node=6e8081c44ae9
author: andrew
date: Thu Feb 14 02:27:23 2013 +0000
Merge jdk7u13-b20
diffstat:
.hgtags | 36 +++++++
get_source.sh | 4 +-
make/Defs-internal.gmk | 3 +-
make/jprt.properties | 16 +-
make/scripts/hgforest.sh | 72 ++++++++++++---
make/scripts/normalizer.pl | 208 +++++++++++++++++++++++++++++++++++++++++++++
test/Makefile | 12 +-
7 files changed, 318 insertions(+), 33 deletions(-)
diffs (truncated from 556 to 500 lines):
diff -r c2d5141baeda -r 6e8081c44ae9 .hgtags
--- a/.hgtags Tue Dec 04 17:28:07 2012 -0800
+++ b/.hgtags Thu Feb 14 02:27:23 2013 +0000
@@ -50,6 +50,7 @@
3ac6dcf7823205546fbbc3d4ea59f37358d0b0d4 jdk7-b73
2c88089b6e1c053597418099a14232182c387edc jdk7-b74
d1516b9f23954b29b8e76e6f4efc467c08c78133 jdk7-b75
+f0bfd9bd1a0e674288a8a4d17dcbb9e632b42e6d icedtea7-1.12
c8b63075403d53a208104a8a6ea5072c1cb66aab jdk7-b76
1f17ca8353babb13f4908c1f87d11508232518c8 jdk7-b77
ab4ae8f4514693a9fe17ca2fec0239d8f8450d2c jdk7-b78
@@ -63,6 +64,7 @@
433a60a9c0bf1b26ee7e65cebaa89c541f497aed jdk7-b86
6b1069f53fbc30663ccef49d78c31bb7d6967bde jdk7-b87
82135c848d5fcddb065e98ae77b81077c858f593 jdk7-b88
+195fcceefddce1963bb26ba32920de67806ed2db icedtea7-1.13
7f1ba4459972bf84b8201dc1cc4f62b1fe1c74f4 jdk7-b89
425ba3efabbfe0b188105c10aaf7c3c8fa8d1a38 jdk7-b90
97d8b6c659c29c8493a8b2b72c2796a021a8cf79 jdk7-b91
@@ -111,6 +113,7 @@
ddc2fcb3682ffd27f44354db666128827be7e3c3 jdk7-b134
783bd02b4ab4596059c74b10a1793d7bd2f1c157 jdk7-b135
2fe76e73adaa5133ac559f0b3c2c0707eca04580 jdk7-b136
+d4aea1a51d625f5601c840714c7c94f1de5bc1af icedtea-1.14
7654afc6a29e43cb0a1343ce7f1287bf690d5e5f jdk7-b137
fc47c97bbbd91b1f774d855c48a7e285eb1a351a jdk7-b138
7ed6d0b9aaa12320832a7ddadb88d6d8d0dda4c1 jdk7-b139
@@ -123,6 +126,7 @@
2d38c2a79c144c30cd04d143d83ee7ec6af40771 jdk7-b146
3ac30b3852876ccad6bd61697b5f9efa91ca7bc6 jdk7u1-b01
d91364304d7c4ecd34caffdba2b840aeb0d10b51 jdk7-b147
+3defd24c2671eb2e7796b5dc45b98954341d73a7 icedtea-2.0-branchpoint
34451dc0580d5c95d97b95a564e6198f36545d68 jdk7u1-b02
bf735d852f79bdbb3373c777eec3ff27e035e7ba jdk7u1-b03
f66a2bada589f4157789e6f66472954d2f1c114e jdk7u1-b04
@@ -141,6 +145,7 @@
b2deaf5bde5ec455a06786e8e2aea2e673be13aa jdk7u2-b12
c95558e566ac3605c480a3d070b1102088dab07f jdk7u2-b13
e30fd289f0019700575593ee4e1635fbc5c9a484 jdk7u2-b21
+a66b58021165f5a43e3974fe5fb9fead29824098 icedtea-2.1-branchpoint
e30fd289f0019700575593ee4e1635fbc5c9a484 jdk7u3-b02
becd013ae6072a6633ba015fc4f5862fca589cee jdk7u3-b03
d64361a28584728aa25dca3781cffbaf4199e088 jdk7u3-b04
@@ -157,6 +162,7 @@
2b07c262a8a9ff78dc908efb9d7b3bb099df9ac4 jdk7u4-b10
1abfee16e8cc7e3950052befa78dbf14a5ca9cfc jdk7u4-b11
e6f915094dccbba16df6ebeb002e6867392eda40 jdk7u4-b12
+e7886f5ad6cc837092386fa513e670d4a770456c icedtea-2.2-branchpoint
9108e3c2f07ffa218641d93893ac9928e95d213a jdk7u4-b13
d9580838fd08872fc0da648ecfc6782704b4aac1 jdk7u4-b14
008753000680a2008175d14b25373356f531aa07 jdk7u4-b15
@@ -191,6 +197,7 @@
528f1589f5f2adf18d5d21384ba668b9aa79841e jdk7u6-b15
7b77364eb09faac4c37ce9dd2c2308ca5525f18f jdk7u6-b16
b7c1b441d131c70278de299b5d1e59dce0755dc5 jdk7u6-b17
+0e7b94bd450d4270d4e9bd6c040c94fa4be714a6 icedtea-2.3-branchpoint
9c41f7b1460b106d18676899d24b6ea07de5a369 jdk7u6-b18
56291720b5e578046bc02761dcad2a575f99fd8e jdk7u6-b19
e79fa743fe5a801db4acc7a7daa68f581423e5d3 jdk7u6-b20
@@ -199,6 +206,7 @@
d1c709f1196a73d1df10d04a221b10e30fd2eb48 jdk7u6-b23
e4def733cc8c58e83b7cefa7edd89a3e2b793520 jdk7u6-b24
f5f546dba006778854e7a81141fc1b44acd257a4 jdk7u6-b30
+43775eae8df6c874fb3631c86009505cf3821b1f jdk7u6-b31
43775eae8df6c874fb3631c86009505cf3821b1f jdk7u7-b10
a380c75873bfb578e605d4362edb18c08698cc3e jdk7u7-b30
d7f2b3949f9c9ff1115ea61c496d3cd4c62e2759 jdk7u7-b11
@@ -222,3 +230,31 @@
494e838439db7f0f4e36f7dcfeba06d2bef78c8d jdk7u10-b17
dce9058d2151e6b5c84898c13cfd1521a627a296 jdk7u10-b18
b5fb925394331313dbe3859fdc408bfd37193476 jdk7u10-b30
+1ab3edf5061fdde3a6f6510373a92444445af710 jdk7u8-b01
+d7a94c8cbbbfadbd9e2f3e4737eb7deb572dedc9 jdk7u8-b02
+e7c504c99ab60e3b21cdc9460afaa3926d53cff1 jdk7u8-b03
+996e3145029120fd6ef2cacb3d03cb1f20862247 jdk7u8-b04
+891689cc39ff9d67bc4fe43bcb91ecdabda1f9f8 jdk7u8-b05
+f16343fe14acb4118f0a3f78fd735a4a6133c76a jdk7u10-b06
+1fa71ffbbd596086dbade86505d2d7e1c436de76 jdk7u10-b07
+e7014c55a9e55c10fe4f91ca092eb01029c36c75 jdk7u10-b08
+aaf495a24a9bb996b3955e52edff8d93ff62dc5f jdk7u10-b09
+3eddc50eb3574bf4cff4081310fd763e958ed073 jdk7u12-b01
+207c000ac697d052f84cde6e782865b209e60239 jdk7u12-b02
+a3917db5d568d9805b3c46ce67c39c475cf10e0e jdk7u12-b03
+52945b197d7c93d215067034a45e5e9452c67f78 jdk7u12-b04
+eae53fe51e79e04ca28b5790a6ae25d39a06b0ab jdk7u12-b05
+a008905ce525b88e5bdc80fe6ad7570f6f6a19ac jdk7u12-b06
+c3e42860af1cfd997fe1895594f652f0d1e9984e jdk7u12-b07
+1a03ef4794dc8face4de605ae480d4c763e6b494 jdk7u12-b08
+87cf81226f2012e5c21131adac7880f7e4da1133 jdk7u12-b09
+8a10a3c51f1cd88009008cf1b82071797b5f516d icedtea-2.4-branchpoint
+c2d5141baeda6c9b5bbc83c21eff9c3940fefae4 jdk7u11-b20
+168aa0f1417b3651a955ae66068dc148b660f829 jdk7u11-b21
+c8a37a49fc90ae31b864544d6d4a9f6137d4995d jdk7u11-b03
+0b418e2ccf9093718609144689d1a8b316ad951f jdk7u11-b04
+e127e6c94b56f7348df67d9672c16a7dc9c5ec5e jdk7u11-b05
+f6abff072aabfee866342d9f7f4aac7d13450ddf jdk7u11-b06
+80a3d0bcd3d4c9e83b75416178bdd60a2d23ebbc jdk7u11-b07
+e7c55def6796d3c426631b5717084ef122908847 jdk7u11-b08
+2412f7b8551ede5296cb6e1d6189f40aad9eeffe jdk7u13-b09
diff -r c2d5141baeda -r 6e8081c44ae9 get_source.sh
--- a/get_source.sh Tue Dec 04 17:28:07 2012 -0800
+++ b/get_source.sh Thu Feb 14 02:27:23 2013 +0000
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
#
# Get clones of all nested repositories
-sh ./make/scripts/hgforest.sh clone
+sh ./make/scripts/hgforest.sh clone $*
# Update all existing repositories to the latest sources
sh ./make/scripts/hgforest.sh pull -u
diff -r c2d5141baeda -r 6e8081c44ae9 make/Defs-internal.gmk
--- a/make/Defs-internal.gmk Tue Dec 04 17:28:07 2012 -0800
+++ b/make/Defs-internal.gmk Thu Feb 14 02:27:23 2013 +0000
@@ -322,7 +322,8 @@
JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
- PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
+ PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION) \
+ STATIC_CXX=$(STATIC_CXX)
ifdef ARCH_DATA_MODEL
COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
diff -r c2d5141baeda -r 6e8081c44ae9 make/jprt.properties
--- a/make/jprt.properties Tue Dec 04 17:28:07 2012 -0800
+++ b/make/jprt.properties Thu Feb 14 02:27:23 2013 +0000
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -79,20 +79,17 @@
${jprt.my.test.target.set:TESTNAME=jdk_util}, \
${jprt.my.test.target.set:TESTNAME=jdk_io}, \
${jprt.my.test.target.set:TESTNAME=jdk_net}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_nio1}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_nio2}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_nio3}, \
+ ${jprt.my.test.target.set:TESTNAME=jdk_nio}, \
${jprt.my.test.target.set:TESTNAME=jdk_security1}, \
${jprt.my.test.target.set:TESTNAME=jdk_security2}, \
${jprt.my.test.target.set:TESTNAME=jdk_security3}, \
${jprt.my.test.target.set:TESTNAME=jdk_rmi}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_management1}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_management2}, \
+ ${jprt.my.test.target.set:TESTNAME=jdk_management}, \
+ ${jprt.my.test.target.set:TESTNAME=jdk_jmx}, \
${jprt.my.test.target.set:TESTNAME=jdk_text}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_tools1}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_tools2}, \
+ ${jprt.my.test.target.set:TESTNAME=jdk_tools}, \
${jprt.my.test.target.set:TESTNAME=jdk_jfr}, \
- ${jprt.my.test.target.set:TESTNAME=jdk_misc}
+ ${jprt.my.test.target.set:TESTNAME=jdk_other}
# All vm test targets (testset=all)
jprt.vm.all.test.targets= \
@@ -107,6 +104,7 @@
${jprt.my.test.target.set:TESTNAME=jdk_beans1} \
${jprt.my.test.target.set:TESTNAME=jdk_beans2}, \
${jprt.my.test.target.set:TESTNAME=jdk_beans3}, \
+ ${jprt.my.test.target.set:TESTNAME=jdk_jdi}, \
${jprt.my.test.target.set:TESTNAME=jdk_sound}, \
${jprt.my.test.target.set:TESTNAME=jdk_swing}
diff -r c2d5141baeda -r 6e8081c44ae9 make/scripts/hgforest.sh
--- a/make/scripts/hgforest.sh Tue Dec 04 17:28:07 2012 -0800
+++ b/make/scripts/hgforest.sh Thu Feb 14 02:27:23 2013 +0000
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
#
# Shell script for a fast parallel forest command
+command="$1"
+pull_extra_base="$2"
tmp=/tmp/forest.$$
rm -f -r ${tmp}
@@ -35,40 +37,58 @@
# Only look in specific locations for possible forests (avoids long searches)
pull_default=""
-if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
+repos=""
+repos_extra=""
+if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
subrepos="corba jaxp jaxws langtools jdk hotspot"
if [ -f .hg/hgrc ] ; then
pull_default=`hg paths default`
+ if [ "${pull_default}" = "" ] ; then
+ echo "ERROR: Need initial clone with 'hg paths default' defined"
+ exit 1
+ fi
fi
if [ "${pull_default}" = "" ] ; then
- echo "ERROR: Need initial clone with 'hg paths default' defined"
+ echo "ERROR: Need initial repository to use this script"
exit 1
fi
- repos=""
for i in ${subrepos} ; do
if [ ! -f ${i}/.hg/hgrc ] ; then
repos="${repos} ${i}"
fi
done
+ if [ "${pull_extra_base}" != "" ] ; then
+ subrepos_extra="jdk/src/closed jdk/make/closed jdk/test/closed hotspot/make/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
+ pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
+ pull_extra="${pull_extra_base}/${pull_default_tail}"
+ for i in ${subrepos_extra} ; do
+ if [ ! -f ${i}/.hg/hgrc ] ; then
+ repos_extra="${repos_extra} ${i}"
+ fi
+ done
+ fi
at_a_time=2
+ # Any repos to deal with?
+ if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
+ echo "No repositories to clone."
+ exit
+ fi
else
hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
# Derive repository names from the .hg directory locations
- repos=""
for i in ${hgdirs} ; do
repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
done
at_a_time=8
+ # Any repos to deal with?
+ if [ "${repos}" = "" ] ; then
+ echo "No repositories to process."
+ exit
+ fi
fi
-# Any repos to deal with?
-if [ "${repos}" = "" ] ; then
- echo "No repositories to process."
- exit
-fi
-
-# Echo out what repositories we will process
-echo "# Repos: ${repos}"
+# Echo out what repositories we will clone
+echo "# Repos: ${repos} ${repos_extra}"
# Run the supplied command on all repos in parallel, save output until end
n=0
@@ -77,8 +97,9 @@
n=`expr ${n} '+' 1`
(
(
- if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
- cline="hg $* ${pull_default}/${i} ${i}"
+ if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+ pull_newrepo="`echo ${pull_default}/${i} | sed -e 's@\([^:]/\)//*@\1 at g'`"
+ cline="hg clone ${pull_newrepo} ${i}"
echo "# ${cline}"
( eval "${cline}" )
else
@@ -92,10 +113,29 @@
sleep 5
fi
done
-
# Wait for all hg commands to complete
wait
+if [ "${repos_extra}" != "" ] ; then
+ for i in ${repos_extra} ; do
+ echo "Starting on ${i}"
+ n=`expr ${n} '+' 1`
+ (
+ (
+ pull_newextrarepo="`echo ${pull_extra}/${i} | sed -e 's@\([^:]/\)//*@\1 at g'`"
+ cline="hg clone ${pull_newextrarepo} ${i}"
+ echo "# ${cline}"
+ ( eval "${cline}" )
+ echo "# exit code $?"
+ ) > ${tmp}/repo.${n} 2>&1 ; cat ${tmp}/repo.${n} ) &
+ if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
+ sleep 5
+ fi
+ done
+ # Wait for all hg commands to complete
+ wait
+fi
+
# Cleanup
rm -f -r ${tmp}
diff -r c2d5141baeda -r 6e8081c44ae9 make/scripts/normalizer.pl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/scripts/normalizer.pl Thu Feb 14 02:27:23 2013 +0000
@@ -0,0 +1,208 @@
+#!/usr/bin/perl
+
+#
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Parses java files:
+# 1. Removes from the end of lines spaces and TABs
+# 2. Replaces TABs by spaces
+# 3. Replaces all NewLine separators by Unix NewLine separators
+# 4. Makes one and only one empty line at the end of each file
+
+if ($#ARGV < 0) {
+ &usage;
+
+ die;
+}
+
+use Cwd 'abs_path';
+
+my @extensions = ("java");
+
+# Read options
+my $dirpos = 0;
+
+while ($dirpos < $#ARGV) {
+ if ($ARGV[$dirpos] eq "-e") {
+ @extensions = split(/,/, $ARGV[$dirpos + 1]);
+ } else {
+ last;
+ }
+
+ $dirpos += 2;
+}
+
+if ($dirpos > $#ARGV) {
+ &usage;
+
+ die;
+}
+
+use Cwd;
+my $currdir = getcwd;
+
+my $allfiles = 0;
+
+my $filecount = 0;
+
+my @tabvalues;
+
+# Init tabvalues
+push (@tabvalues, " ");
+
+for (my $i = 1; $i < 8; $i++) {
+ push(@tabvalues, $tabvalues[$i - 1] . " ");
+}
+
+open(FILELIST, ">$currdir/filelist") or die "Failed while open $currdir/filelist: $!\n";
+
+while ($dirpos <= $#ARGV) {
+ use File::Find;
+
+ find(\&parse_file, abs_path($ARGV[$dirpos]));
+
+ $dirpos += 1;
+}
+
+close(FILELIST);
+
+use Cwd 'chdir';
+chdir $currdir;
+
+print "Checked $allfiles file(s)\n";
+print "Modified $filecount file(s)\n";
+print "See results in the file $currdir/filelist\n";
+
+sub parse_file {
+ my $filename = $File::Find::name;
+
+ # Skip directories
+ return if -d;
+
+ # Skip SCCS files
+ return if ($filename =~ /\/SCCS\//);
+
+ # Skip files with invalid extensions
+ my $accepted = 0;
+ foreach my $ext (@extensions) {
+ if ($_ =~ /\.$ext$/i) {
+ $accepted = 1;
+
+ last;
+ }
+ }
+ return if ($accepted == 0);
+
+ use File::Basename;
+ my $dirname = dirname($filename);
+
+ use Cwd 'chdir';
+ chdir $dirname;
+
+ open(FILE, $filename) or die "Failed while open $filename: $!\n";
+
+ # Read file
+ my @content;
+ my $line;
+ my $emptylinescount = 0;
+ my $modified = 0;
+
+ while ($line = <FILE>) {
+ my $originalline = $line;
+
+ # Process line
+
+ # Remove from the end of the line spaces and return character
+ while ($line =~ /\s$/) {
+ chop($line);
+ }
+
+ # Replace TABs
+ for (my $i = 0; $i < length($line); $i++) {
+ if (substr($line, $i, 1) =~ /\t/) {
+ $line = substr($line, 0, $i) . $tabvalues[7 - ($i % 8)] . substr($line, $i + 1);
+ }
+ }
+
+ if (length($line) == 0) {
+ $emptylinescount++;
+ } else {
+ while ($emptylinescount > 0) {
+ push(@content, "");
+
+ $emptylinescount--;
+ }
+
+ push(@content, $line);
+ }
+
+ if ($originalline ne ($line . "\n")) {
+ $modified = 1;
+ }
+
+ }
+
+ $allfiles++;
+
+ if ($emptylinescount > 0) {
+ $modified = 1;
+ }
+
+ close(FILE);
+
+ if ($modified != 0) {
+ # Write file
+ open(FILE, ">$filename") or die "Failed while open $filename: $!\n";
+
+ for (my $i = 0; $i <= $#content; $i++) {
+ print FILE "$content[$i]\n";
+ }
+
+ close(FILE);
+
+ # Print name from current dir
More information about the distro-pkg-dev
mailing list