~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to gnulib-tests/test-exclude8.sh

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# Test suite for exclude.
3
 
# Copyright (C) 2010-2011 Free Software Foundation, Inc.
 
3
# Copyright (C) 2010-2012 Free Software Foundation, Inc.
4
4
# This file is part of the GNUlib Library.
5
5
#
6
6
# This program is free software: you can redistribute it and/or modify
16
16
# You should have received a copy of the GNU General Public License
17
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
 
19
 
TMP=excltmp.$$
20
 
LIST=flist.$$
21
 
ERR=0
 
19
. "${srcdir=.}/init.sh"; path_prepend_ .
 
20
fail=0
22
21
 
23
22
# Test escaped metacharacters.
24
23
 
25
 
cat > $LIST <<'EOT'
 
24
cat > in <<'EOT'
26
25
f\*e
27
26
b[a\*]r
28
27
EOT
29
28
 
30
 
cat > $TMP <<'EOT'
 
29
cat > expected <<'EOT'
31
30
f*e: 1
32
31
file: 0
33
32
bar: 1
34
33
EOT
35
34
 
36
 
./test-exclude$EXEEXT -wildcards $LIST -- 'f*e' 'file' 'bar' |
37
 
 tr -d '\015' | diff -c $TMP - || ERR=1
38
 
 
39
 
rm -f $TMP $LIST
40
 
exit $ERR
 
35
test-exclude -wildcards in -- 'f*e' 'file' 'bar' > out || exit $?
 
36
 
 
37
# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr
 
38
# does not understand '\r'.
 
39
case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac
 
40
 
 
41
# normalize output
 
42
LC_ALL=C tr -d "$cr" < out > k && mv k out
 
43
 
 
44
compare expected out || fail=1
 
45
 
 
46
Exit $fail