comparison tools/mk-hg-id.sh @ 4590:5b5c47cd2111

Add file with hg id of MXE-Octave to dist package (bug #52794). * tools/mk-hg-id.sh: New file copied (mostly) from Octave sources. * Makefile.in: Call shell script, copy HG-ID in make dist * binary-dist-rules.mk: Copy HG-ID to dist directory. * dist-files.mk: add mk-hg-id.sh to dist files
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 03 Jan 2018 14:18:12 +0100
parents
children
comparison
equal deleted inserted replaced
4589:7d8660f7bb61 4590:5b5c47cd2111
1 #! /bin/sh
2 #
3 # Copyright (C) 2016-2018 John W. Eaton
4 #
5 # This file is part of Octave.
6 #
7 # Octave is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # Octave is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
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
19 # <http://www.gnu.org/licenses/>.
20
21 # Generate a file that holds the hg id of the mxe-octave source tree.
22
23 # set -e
24
25 if [ $# -ne 1 ]; then
26 echo "usage: mk-hg-id.sh SRCDIR" 1>&2
27 exit 1
28 fi
29
30 srcdir="$1"
31
32 hg_id=HG-ID
33
34 if [ -d $srcdir/.hg ]; then
35 ( cd $srcdir && hg identify --id || echo "unknown" ) > ${hg_id}-t && mv ${hg_id}-t ${hg_id}
36 elif [ ! -f $srcdir/${hg_id} ]; then
37 echo "WARNING: $srcdir/${hg_id} is missing!" 1>&2
38 echo "unknown" > ${hg_id}-t && mv ${hg_id}-t ${hg_id}
39 else
40 echo "preserving existing ${hg_id} file" 1>&2
41 if [ "x$srcdir" != "x." ] && [ -f $srcdir/${hg_id} ] && [ ! -f ${hg_id} ]; then
42 cp ${srcdir}/${hg_id} ${hg_id}
43 fi
44 fi
45