summaryrefslogtreecommitdiffstats
path: root/scripts/update-m4.sh
blob: e0d500d5bed4d6ee66babd5d8d38c86a4ab9416f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
#
# Script to update M4 files from Gnulib, GNU Autoconf Archive, and GNU Coreutils
#
# Copyright (C) 2023  P. J. McDermott
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.  This file is offered as-is,
# without any warranty.

set -eu

SV_CGIT='https://git.savannah.gnu.org/cgit'

for f in m4/gl_*.m4; do
	wget -O "${f}" "${SV_CGIT}/gnulib.git/plain/m4/${f#m4/gl_}"
done

for f in m4/ax_*.m4; do
	wget -O "${f}" "${SV_CGIT}/autoconf-archive.git/plain/${f}"
done

wget -O - "${SV_CGIT}/coreutils.git/plain/configure.ac" | sed -n '
		/^# Copyright /,/^dnl Written /{
			p;
			s/^dnl Written .*$//p;
		};
		/^# gl_GCC_VERSION_IFELSE/,/^$/p;
	' | sed '$d' 1>'m4/gcc_version.m4'