Mercurial > octave
annotate build-aux/mk-hg-id.sh @ 25054:6652d3823428 stable
maint: Update copyright dates in all source files.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 30 Mar 2018 09:19:05 -0400 |
parents | 194eb4bd202b |
children | 7b2312def76b |
rev | line source |
---|---|
21976 | 1 #! /bin/sh |
2 # | |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
3 # Copyright (C) 2016-2018 John W. Eaton |
21976 | 4 # |
5 # This file is part of Octave. | |
6 # | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
7 # Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
8 # under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
9 # the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
10 # (at your option) any later version. |
21976 | 11 # |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
12 # Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
13 # WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22020
diff
changeset
|
15 # GNU General Public License for more details. |
21976 | 16 # |
17 # You should have received a copy of the GNU General Public License | |
18 # along with Octave; see the file COPYING. If not, see | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
19 # <https://www.gnu.org/licenses/>. |
21976 | 20 |
21 # Generate a header file that provides the public symbols from Octave's | |
22 # autoconf-generated config.h file. See the notes at the top of the | |
23 # generated octave-config.h file for more details. | |
24 | |
25 set -e | |
26 | |
27 if [ $# -ne 1 ] && [ $# -ne 2 ]; then | |
28 echo "usage: mk-hg-id.sh SRCDIR [--disable]" 1>&2 | |
29 exit 1 | |
30 fi | |
31 | |
32 srcdir="$1" | |
33 | |
34 hg_id=HG-ID | |
35 move_if_change="$srcdir/build-aux/move-if-change" | |
36 | |
37 if [ $# -eq 2 ] && [ x"$2" = x--disable ]; then | |
38 echo "hg-id-disabled" > ${hg_id}-t | |
39 ${move_if_change} ${hg_id}-t ${hg_id} | |
40 elif [ -d $srcdir/.hg ]; then | |
41 ( cd $srcdir && hg identify --id || echo "unknown" ) > ${hg_id}-t | |
42 ${move_if_change} ${hg_id}-t ${hg_id} | |
43 elif [ ! -f $srcdir/${hg_id} ]; then | |
22020
e154d23b2fd1
maint: reduce multiple mentions of the HG-ID file name and contents
Mike Miller <mtmiller@octave.org>
parents:
21976
diff
changeset
|
44 echo "WARNING: $srcdir/${hg_id} is missing!" 1>&2 |
21976 | 45 echo "unknown" > ${hg_id}-t && mv ${hg_id}-t ${hg_id} |
46 else | |
22020
e154d23b2fd1
maint: reduce multiple mentions of the HG-ID file name and contents
Mike Miller <mtmiller@octave.org>
parents:
21976
diff
changeset
|
47 echo "preserving existing ${hg_id} file" 1>&2 |
21976 | 48 if [ "x$srcdir" != "x." ] && [ -f $srcdir/${hg_id} ] && [ ! -f ${hg_id} ]; then |
49 cp ${srcdir}/${hg_id} ${hg_id} | |
50 touch -r ${srcdir}/${hg_id} ${hg_id} | |
51 fi | |
52 fi | |
53 | |
54 if [ "`cat ${hg_id}`" = "hg-id-disabled" ]; then | |
22020
e154d23b2fd1
maint: reduce multiple mentions of the HG-ID file name and contents
Mike Miller <mtmiller@octave.org>
parents:
21976
diff
changeset
|
55 echo "WARNING: ${hg_id} is 'hg-id-disabled'" 1>&2 |
21976 | 56 fi |
57 | |
58 cat ${hg_id} |