From 278ca5bb6dae14261aba208e1a4a5c352a4d90ac Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Tue, 24 Feb 2015 15:53:59 +0000
Subject: [PATCH] Delete script to update copyrights

---
 /dev/null |  102 ---------------------------------------------------
 1 files changed, 0 insertions(+), 102 deletions(-)

diff --git a/opendj-server-legacy/copyright.rb b/opendj-server-legacy/copyright.rb
deleted file mode 100755
index 17cecc1..0000000
--- a/opendj-server-legacy/copyright.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'fileutils'
-
-# Automate copyright update with year 2015, using 'svn status' to retrieve modified files.
-# Only modified files (with 'M' mark) are updated.
-#
-class Copyright
-
-  def updated_files
-    files = []
-    puts "Get modified files from svn..."
-    lines = `svn st`
-    puts "There are #{lines.split("\n").size} files to update."
-    lines.split("\n").each { |line|
-      mod, file = line.split(" ")
-      if mod=="M"
-        files << file
-      end
-    }
-    files
-  end
-
-  def process(file)
-    is_replaced = nil
-    File.open(file) { |source|
-      content = source.read
-      is_replaced = update_copyright(content)
-      if is_replaced
-        File.open(file + ".copy", "w+") { |f| f.write(content) }
-        #puts `head -n 27 #{file}`
-        #puts("content:\n" + content.split("\n")[20..27].join("\n"))
-      else
-        puts "WARN : no replacement"
-      end
-    }
-    if is_replaced
-      FileUtils.mv(file + ".copy", file, :verbose => false)
-    end
-  end
-
-
-  def update_copyright(content)
-    # handle FG copyright with 1 date
-    pattern = /(^\s+\*\s+)Copyright (\d+) ForgeRock,? AS/i
-    mdata = content.match(pattern)
-    if !mdata.nil?
-      if  mdata[2]!="2015"
-        replace = '\1Copyright \2-2015 ForgeRock AS'
-        is_replaced = content.gsub!(pattern, replace)
-      else
-        is_replaced = true # no action needed
-      end
-    end
-
-    # handle FG copyright with 2 dates
-    pattern = /(^\s+\*\s+)Copyright (\d+)-(\d+) ForgeRock,? AS/i
-    replace = '\1Copyright \2-2015 ForgeRock AS'
-    is_replaced = content.gsub!(pattern, replace)
-
-    if is_replaced.nil?
-      # handle FG portions copyright with 2 dates
-      pattern = /(^\s+\*\s+)Portions Copyright (\d+)-(\d+) ForgeRock,? AS/i
-      replace = '\1Portions Copyright \2-2015 ForgeRock AS'
-      is_replaced = content.gsub!(pattern, replace)
-    end
-
-    if is_replaced.nil?
-      # handle FG portions copyright with 1 date
-      pattern = /(^\s+\*\s+)Portions Copyright (\d+) ForgeRock,? AS/i
-      mdata = content.match(pattern)
-      if !mdata.nil? && mdata[2]!="2015"
-        replace = '\1Portions Copyright \2-2015 ForgeRock AS'
-        is_replaced = content.gsub!(pattern, replace)
-      end
-      if is_replaced.nil?
-        # Handle no FG portions
-        pattern = /(^\s+\*)(\s+)Copyright (\d+-?\d*)\s(.*)$\n\s+\*\/$/i
-        replace = '\1\2Copyright \3 \4' + "\n\\1\\2Portions Copyright 2015 ForgeRock AS\n\\1/"
-        is_replaced = content.gsub!(pattern, replace)
-      end
-    end
-    is_replaced
-  end
-
-  def run(args)
-    if args.size==0
-      files = updated_files
-    else
-      files = args
-    end
-    files.each { |file|
-      puts "Processing file #{file}"
-      process(file)
-    }
-  end
-
-end
-
-# Launch copyright update
-Copyright.new.run(ARGV)
-

--
Gitblit v1.10.0