File: make-report.sh

package info (click to toggle)
uim 1%3A1.8.6-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 42,636 kB
  • ctags: 20,583
  • sloc: lisp: 357,026; ansic: 78,114; cpp: 27,847; sh: 12,638; makefile: 2,534; asm: 333; ruby: 288
file content (49 lines) | stat: -rwxr-xr-x 1,333 bytes parent folder | download | duplicates (14)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh

MYNAME=`whoami`
ADDR="sigscheme-ja@googlegroups.com"
TMPDIR=/tmp
TMPFILE=$TMPDIR/sigscheme-report.$$
PERL=perl
MAKE=
OPTS="--enable-euccn --enable-eucjp --enable-euckr --enable-sjis"
#OPTS="$OPTS --enable-maintainer-mode"

for cmd in gmake gnumake make; do
  if $cmd --version 2>/dev/null | grep -q GNU; then
    MAKE=$cmd
    break
  fi
done

if test "x$MAKE" != x && $PERL -v >/dev/null; then
  (./configure $OPTS && $MAKE clean >/dev/null && $MAKE >/dev/null \
   && $MAKE check && echo 'all tests passed') 2>&1 | tee $TMPFILE
  if grep -q 'all tests passed' $TMPFILE; then
    result='PASS'
  else
    result='FAIL'
  fi
  pkg=`perl -ne 'print $1 if /^Package:\s+(.+)$/' $TMPFILE`
  host=`perl -ne 'print $1 if /^host \(compile for\):\s+(.+)$/' $TMPFILE`
  compiler=`perl -ne 'print $1 if /^Compiler:\s+(.+)$/' $TMPFILE`
  compiler_ver=`perl -ne 'print $1 if /^Compiler version:\s+(.+)$/' $TMPFILE`

  cat >report.mail <<EOT
To: ${ADDR}
Subject: ${result}: ${pkg} ${host} ${compiler} ${compiler_ver}

EOT

  #cat $TMPFILE >>report.mail
  # Hide reporter's private information.
  sed -e "s/\\/${MYNAME}\\//\\/<username>\\//g" $TMPFILE >>report.mail

  rm -f $TMPFILE
  echo
  echo "File 'report.mail' has been created. Please send it to us."
  exit 0
else
  echo "GNU make or Perl not found. Install them."
  exit 1
fi