diff options
| author | Théo Zimmermann | 2019-06-06 11:22:09 +0200 |
|---|---|---|
| committer | Théo Zimmermann | 2019-06-17 18:08:32 +0200 |
| commit | 1a9c769ed363ee2f2784e7252af72e6c1e2fbcc6 (patch) | |
| tree | fd541cee60cbab8da21f69591209363e414183bd | |
| parent | 35472e260eb609438eda7de9744a104ef8ef906d (diff) | |
Adapt change-header script to handle shebangs in addition to Emacs comments.
Remove other types of lines before copyright headers.
| -rwxr-xr-x | dev/tools/change-header | 19 | ||||
| -rwxr-xr-x | doc/sphinx/conf.py | 3 | ||||
| -rw-r--r-- | doc/tools/coqrst/coqdomain.py | 3 | ||||
| -rwxr-xr-x | doc/tools/coqrst/notations/fontsupport.py | 3 |
4 files changed, 11 insertions, 17 deletions
diff --git a/dev/tools/change-header b/dev/tools/change-header index 472a075dbd..59c6f43958 100755 --- a/dev/tools/change-header +++ b/dev/tools/change-header @@ -13,22 +13,19 @@ newheader=$2 if [ ! -f $oldheader ]; then echo Cannot read file $oldheader; exit 1; fi if [ ! -f $newheader ]; then echo Cannot read file $newheader; exit 1; fi -n=`wc -l $oldheader | sed -e "s/ *\([0-9]*\).*/\1/g"` -nsucc=`expr $n + 1` - -linea='(* -*- coding:utf-8 -*- *)' -lineb='(* -*- compile-command: "make -C ../.. bin/coqdoc" -*- *)' +n=$(wc -l $oldheader | sed -e "s/ *\([0-9]*\).*/\1/g") +nsucc=$(expr $n + 1) modified=0 kept=0 for i in $(git grep --name-only --fixed-strings "$(head -1 $oldheader)"); do - headline=`head -n 1 $i` - if `echo $headline | grep "(\* -\*- .* \*)" > /dev/null`; then - # Has emacs header + headline=$(head -n 1 $i) + if $(echo $headline | grep "(\* -\*- .* \*)" > /dev/null) || $(echo $headline | grep "^#\!" > /dev/null); then + # Has header head -n +$nsucc $i | tail -n $n > $i.head.tmp$$ hasheadline=1 - nnext=`expr $nsucc + 1` + nnext=$(expr $nsucc + 1) else head -n +$n $i > $i.head.tmp$$ hasheadline=0 @@ -44,9 +41,9 @@ for i in $(git grep --name-only --fixed-strings "$(head -1 $oldheader)"); do cat $newheader >> $i.tmp$$ tail -n +$nnext $i >> $i.tmp$$ mv $i.tmp$$ $i - modified=`expr $modified + 1` + modified=$(expr $modified + 1) else - kept=`expr $kept + 1` + kept=$(expr $kept + 1) fi rm $i.head.tmp$$ done diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 53309cd313..5aeaba9f3a 100755 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -1,8 +1,7 @@ #!/usr/bin/env python3 -# -*- coding: utf-8 -*- ########################################################################## ## # The Coq Proof Assistant / The Coq Development Team ## -## v # INRIA, CNRS and contributors - Copyright 1999-2018 ## +## v # INRIA, CNRS and contributors - Copyright 1999-2019 ## ## <O___,, # (see CREDITS file for the list of authors) ## ## \VV/ ############################################################### ## // # This file is distributed under the terms of the ## diff --git a/doc/tools/coqrst/coqdomain.py b/doc/tools/coqrst/coqdomain.py index 4bdfac7c42..6c32a4968c 100644 --- a/doc/tools/coqrst/coqdomain.py +++ b/doc/tools/coqrst/coqdomain.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- ########################################################################## ## # The Coq Proof Assistant / The Coq Development Team ## -## v # INRIA, CNRS and contributors - Copyright 1999-2018 ## +## v # INRIA, CNRS and contributors - Copyright 1999-2019 ## ## <O___,, # (see CREDITS file for the list of authors) ## ## \VV/ ############################################################### ## // # This file is distributed under the terms of the ## diff --git a/doc/tools/coqrst/notations/fontsupport.py b/doc/tools/coqrst/notations/fontsupport.py index cc983565ff..f0df7f1c01 100755 --- a/doc/tools/coqrst/notations/fontsupport.py +++ b/doc/tools/coqrst/notations/fontsupport.py @@ -1,8 +1,7 @@ #!/usr/bin/env python2 -# -*- coding: utf-8 -*- ########################################################################## ## # The Coq Proof Assistant / The Coq Development Team ## -## v # INRIA, CNRS and contributors - Copyright 1999-2018 ## +## v # INRIA, CNRS and contributors - Copyright 1999-2019 ## ## <O___,, # (see CREDITS file for the list of authors) ## ## \VV/ ############################################################### ## // # This file is distributed under the terms of the ## |
