#!/bin/sh

# This script may be used in the com.adacore.xmlada.debian branch
# after propagation of changes from com.adacore.xmlada.

# README file is modified manually

rm -f .gitattributes .gitignore

find -name ".cvsignore" -print0 | xargs -r0 mtn drop

find -name "*.ad[bs]" -print0 | xargs -r0 sed -i -e "\
/^-- As a special exception under Section 7 of GPL version 3, you are granted --\$/\
{N;N;N;N;N;N;s/^\
-- As a special exception under Section 7 of GPL version 3, you are granted --\n\
-- additional permissions described in the GCC Runtime Library Exception,   --\n\
-- version 3\.1, as published by the Free Software Foundation\.               --\n\
--                                                                          --\n\
-- You should have received a copy of the GNU General Public License and    --\n\
-- a copy of the GCC Runtime Library Exception along with this program;     --\n\
-- see the files COPYING3 and COPYING\.RUNTIME respectively\.  If not, see    --\
\$/\
-- You should have received a copy of the GNU General Public License along  --\n\
-- with this program;  see the file COPYING3.  If not, see                  --\
/}"

# Check if something has been forgotten.
grep -ir "gcc runtime library exception" .
grep -ir "gnat exception" .
grep -ir "gnat-modified"
