~ubuntu-branches/ubuntu/dapper/debianutils/dapper

« back to all changes in this revision

Viewing changes to which

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2004-06-18 21:18:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040618211851-nzleek0ip1zo5rp9
Tags: 2.8.3
Apply patch from Robert Millan to not ship installkernel and
mkboot on non-linux platforms.  closes: #254478.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
set -ef
 
3
 
 
4
ALLMATCHES=0
 
5
 
 
6
while getopts a whichopts
 
7
do
 
8
        case "$whichopts" in
 
9
                a) ALLMATCHES=1 ;;
 
10
                ?) printf "Usage: %s [-a] args\n" $0 ; exit 2 ;;
 
11
        esac
 
12
done
 
13
shift $(($OPTIND - 1))
 
14
 
 
15
if [ "$#" -eq 0 ]; then
 
16
 ALLRET=1
 
17
else
 
18
 ALLRET=0
 
19
fi
 
20
case $PATH in
 
21
 *::) : "not *DIR:" ;;
 
22
  *:) PATH="$PATH:" ;;
 
23
esac
 
24
for PROGRAM in "$@"; do
 
25
 RET=1
 
26
 IFS_SAVE="$IFS"
 
27
 IFS=:
 
28
 case $PROGRAM in
 
29
  */*)
 
30
   if [ -f "$PROGRAM" ] && [ -x "$PROGRAM" ]; then
 
31
    printf '%s\n' "$PROGRAM"
 
32
    RET=0
 
33
   fi
 
34
   ;;
 
35
  *)
 
36
   for ELEMENT in $PATH; do
 
37
    if [ -z "$ELEMENT" ]; then
 
38
     ELEMENT=.
 
39
    fi
 
40
    if [ -f "$ELEMENT/$PROGRAM" ] && [ -x "$ELEMENT/$PROGRAM" ]; then
 
41
     printf '%s\n' "$ELEMENT/$PROGRAM"
 
42
     RET=0
 
43
     [ "$ALLMATCHES" -eq 1 ] || break
 
44
    fi
 
45
   done
 
46
   ;;
 
47
 esac
 
48
 IFS="$IFS_SAVE"
 
49
 if [ "$RET" -ne 0 ]; then
 
50
  ALLRET=1
 
51
 fi
 
52
done
 
53
 
 
54
exit "$ALLRET"