From 3a0c9ae2876e13678d3f73a9ab37a3bd9f9b9801 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 30 Jun 2017 10:34:06 -0400 Subject: [PATCH] 2411: Maintain copyright header in structure.sql. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/api/Rakefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/api/Rakefile b/services/api/Rakefile index 9d3d8f314c..3136cdd9af 100644 --- a/services/api/Rakefile +++ b/services/api/Rakefile @@ -37,10 +37,17 @@ namespace :db do require 'tempfile' origfnm = File.expand_path('../db/structure.sql', __FILE__) tmpfnm = Tempfile.new 'structure.sql', File.expand_path('..', origfnm) + copyright_done = false begin tmpfile = File.new tmpfnm, 'w' origfile = File.new origfnm origfile.each_line do |line| + if !copyright_done + if !/Copyright .* Arvados/ + tmpfile.write "-- Copyright (C) The Arvados Authors. All rights reserved.\n--\n-- SPDX-License-Identifier: AGPL-3.0\n\n" + end + copyright_done = true + end if /^SET lock_timeout = 0;/ =~ line # Avoid edit wars between versions that do/don't write this line. next -- 2.30.2