Regarding the replacement script, here is a Ruby script we might try
next time we have to go through a similar exercise:
# Scans files - with a given extension - recursively from the current
# directory replacing the old copyright/license header statement with a
# new version
def munge_file(fn, oh, nh)
puts "processing <#{fn}>"
eoh = Regexp.escape(oh)
new_contents = File.read(fn).gsub(Regexp.new(eoh), nh)
File.open(fn, 'w') do |file|
file.puts(new_contents)
end
end
if(!ARGV[0])
STDERR.puts "usage: <file extension> <old header file> <new
header file>"
exit 0
end
ext = ARGV[0]
old_header = File.read(ARGV[1])
new_header = File.read(ARGV[2])
Dir["**/*.#{ext}"].each do |filename|
munge_file( filename, old_header, new_header)
end
This is run from the command line like this:
>ruby replaceheaders.rb oldheader.txt newheader.txt
Luciano Resende wrote:
Hi Jeremy
I have done necessary updates on das and sample/das files and
provided a
patch to http://issues.apache.org/jira/browse/TUSCANY-620. I'm having
some
issues around running the perl script to update the xml resources and
will
try to finish those tomorrow....
- Luciano
On 7/19/06, Jeremy Boynes <[EMAIL PROTECTED]> wrote:
On Jul 19, 2006, at 11:50 AM, Jeremy Boynes wrote:
> Is this is good time to do this to the trunk (thinking that most
> people will not have any work that will conflict)?
>
> I'll see if the tools work and if there are no issues think about
> doing this later this week.
We had a problem with some of the files not having license headers in
them :-(
so I modified Roy's script to be a little more aggressive and replace
everything before the "package" statement with the new header.
I ran these on a few files and they seemed to do the right thing but
additional review would be appreciated.
--
Jeremy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]