File: program-wrapper

package info (click to toggle)
alsa-driver 0.9%2B0beta12-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,524 kB
  • ctags: 29
  • sloc: sh: 982; makefile: 283
file content (44 lines) | stat: -rw-r--r-- 1,376 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
#
# Copyright (c) 2001 Masato Taruishi <taru@debian.org>
#
# wrapper program to invoke correct version of alsa programs
#
# If you want to install several versions of same program using
# diffent versions of ALSA, then this wrapper is just for you.

# Usage:
#
# 1. creates several versions of one program with suffix which is a major
#    version of ALSA such as 0.5, 0.9. (for example, aplay-0.5,
#    aplay-0.9).
#
# 2. creates a symlink named its program name without suffix
#    to this wrapper (i.e. /usr/share/alsa-base/program-wrapper)
#    in a same directory as a program with suffix.
#    For example: /usr/bin/aplay -> /usr/share/alsa-base/program-wrapper 
#                 /usr/bin/aplay-0.5, /usr/bin/aplay-0.9.
#
# In the above example, /usr/bin/aplay executes an apropriate version from
# /usr/bin/aplay-0.5 and /usr/bin/aplay-0.9. It depends on an environment
# of a machine. If ALSA 0.9 is installed in the machine, /usr/bin/aplay-0.9
# is executed, simillary if ALSA 0.5 is installed, /usr/bin/aplay-0.5 is
# executed.

program=$0

. /usr/share/alsa-base/snd-dev-utils

get_alsa_version

if [ "$alsa_major_version" = "none" ]; then
  echo "No ALSA driver installed" >&2
  exit 1
fi

if [ ! -x "$program-$alsa_major_version" ]; then
  echo "No $program for ALSA $alsa_major_version found" >&2
  exit 1
fi

exec "$program-$alsa_major_version" "$@"