Project

General

Profile

Bug #3353 ยป test-fgrep.sh

Richard PALO, 2013-10-06 04:41 PM

 
1
#!/bin/sh
2

    
3
libdir="/usr/lib/amd64"
4
gpg_error_libs="-lgpg-error"
5

    
6
# libgcrypt values.
7
libs="-lgcrypt"
8

    
9
    libdirs=""
10
    libs_final="$libs"
11

    
12
    # Set up `libdirs'.
13
    if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/lib"; then
14
	libdirs="-L$libdir"
15
    fi
16

    
17
    # Set up `libs_final'.
18
    libs_final="$libs_final $gpg_error_libs"
19

    
20
    tmp=""
21
    for i in $libdirs $libs_final; do
22
       if echo "$tmp" | fgrep -v -- "$i" >/dev/null; then
23
           tmp="$tmp $i"
24
       fi
25
    done
26
    echo "fgrep:" $tmp
27

    
28
    tmp=""
29
    for i in $libdirs $libs_final; do
30
       if echo "$tmp" | /usr/xpg4/bin/fgrep -v -- "$i" >/dev/null; then
31
           tmp="$tmp $i"
32
       fi
33
    done
34
    echo "/usr/xpg4/bin/fgrep:" $tmp
    (1-1/1)