Gentoo Archives: gentoo-commits

From: "Matti Bickel (mabi)" <mabi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in x11-libs/fox-wrapper/files: fox-wrapper-3.sh
Date: Sun, 01 Mar 2009 22:58:18
Message-Id: E1Ldubw-0005oF-Jt@stork.gentoo.org
1 mabi 09/03/01 22:58:16
2
3 Added: fox-wrapper-3.sh
4 Log:
5 1.7 support, dropped 1.2,1.5
6 (Portage version: 2.1.6.7/cvs/Linux ppc)
7
8 Revision Changes Path
9 1.1 x11-libs/fox-wrapper/files/fox-wrapper-3.sh
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/fox-wrapper/files/fox-wrapper-3.sh?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/x11-libs/fox-wrapper/files/fox-wrapper-3.sh?rev=1.1&content-type=text/plain
13
14 Index: fox-wrapper-3.sh
15 ===================================================================
16 #!/bin/bash
17 # Copyright 1999-2005 Gentoo Foundation
18 # Distributed under the terms of the GNU General Public License v2
19 # $Header: /var/cvsroot/gentoo-x86/x11-libs/fox-wrapper/files/fox-wrapper-3.sh,v 1.1 2009/03/01 22:58:16 mabi Exp $
20
21 # Based on the am-wrapper.sh script (sys-devel/automake-wrapper-1-r1)
22 #
23 # Executes the correct fox-config version, based on the value of WANT_FOX.
24 # All versions of fox after 1.0.x ship with a fox-config script
25 #
26 #
27 # Stable branches first, in descending order, then unstable branches.
28 # After a new stable branch, prepend the new version and bump (or remove)
29 # the last unstable branch
30 #
31 vers="1.6 1.4 1.7"
32 bindir=/usr/bin
33
34 if [ "${0##*/}" = "fox-wrapper.sh" ] ; then
35 echo "fox-wrapper: Don't call this script directly, use fox-config instead" >&2
36 exit 1
37 fi
38
39 if [ -z "${WANT_FOX}" ] ; then
40 echo "fox-wrapper: Set the WANT_FOX variable to the desired version of fox, e.g.:" >&2
41 echo " WANT_FOX=\"1.6\" fox-config $@"
42 exit 1
43 fi
44
45 for v in ${vers} ; do
46 eval binary_${v/./_}="fox-${v}-config"
47 done
48
49 #
50 # Check the WANT_FOX setting
51 #
52 for v in ${vers} x ; do
53 if [ "${v}" = "x" ] ; then
54 echo "fox-wrapper: WANT_FOX was set to an invalid version ${WANT_FOX}" >&2
55 echo " Valid values of WANT_FOX are: ${vers// /, }"
56 exit 1
57 fi
58
59 if [ "${WANT_FOX}" = "${v}" ] ; then
60 binary="binary_${v/./_}"
61 binary="${!binary}"
62 break
63 fi
64 done
65
66 if [ "${WANT_FOXWRAPPER_DEBUG}" ] ; then
67 echo "fox-wrapper: DEBUG: WANT_FOX is set to ${WANT_FOX}" >&2
68 echo "fox-wrapper: DEBUG: will execute <$binary>" >&2
69 fi
70
71 #
72 # for further consistency
73 #
74 for v in ${vers} ; do
75 mybin="binary_${v/./_}"
76 if [ "${binary}" = "${!mybin}" ] ; then
77 export WANT_FOX="${v}"
78 fi
79 done
80
81 #
82 # Now try to run the binary
83 #
84 if [ ! -x "${bindir}/${binary}" ] ; then
85 echo "fox-wrapper: $binary is missing or not executable." >&2
86 echo " Please try emerging the correct version of fox, i.e.:" >&2
87 echo " emerge '=x11-libs/${binary/-config/}*'" >&2
88 exit 1
89 fi
90
91 "$binary" "$@"