File: source-date-epoch

package info (click to toggle)
gprbuild 2018-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,248 kB
  • sloc: ada: 68,368; xml: 4,043; makefile: 423; sh: 365; ansic: 97; cpp: 89; fortran: 62
file content (26 lines) | stat: -rw-r--r-- 567 bytes parent folder | download
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
#!/bin/sh

# When SOURCE_DATE_EPOCH is defined in the environment,
# and the date it contains is older than an Ada source,
# gcc (>= 7.1.0-9) writes SOURCE_DATE_EPOCH in the .ali file
# instead of the actual source file timestamp.
# gprbuild/2017 detects the mismatch and insists on recompiling.

set -C -e -f -u

cd "$ADTTMP"

cat > a.adb <<EOF
procedure A is
begin
   null;
end A;
EOF
cat > p.gpr <<EOF
project P is
   for Main use ("a.adb");
end P;
EOF
export SOURCE_DATE_EPOCH=100
gprbuild -v p.gpr
! (gprbuild -vh p.gpr | grep "different time stamp for a\.adb")