Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37041779
en ru br
ALT Linux repositórios
S:1.4.27-alt1
5.0: 1.4.14-alt1
4.1: 1.4.11-alt1
4.0: 1.4.10-alt2
3.0: 1.4.6-alt1

Group :: Desenvolvimento/C
RPM: gcc-common

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

#!/bin/sh
#
# $Id$
# Copyright (C) 2000-2004 Dmitry V. Levin <ldv@altlinux.org>
# Copyright (C) 2003-2004 Stanislav Ievlev <inger@altlinux.org>
#
# GNU Compiler Collection (GCC) version selection utility.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

PROG="${0##*/}"

: ${TARGET:=@TARGET@}
: ${BINDIR:=/usr/bin}
: ${COMPILERS:='cpp gcc g++ g77 gcj chill tree1'}
: ${ALT_LIST:='/usr/bin/alternatives-list'}
: ${ALT_AUTO:='/usr/bin/alternatives-auto'}
: ${ALT_MANUAL:='/usr/bin/alternatives-manual'}
: ${ALT_UPDATE:='/usr/bin/alternatives-update'}

get_candidates()
{
cat /etc/alternatives/packages.d/*|grep "^$1"|cut -f2
}

Usage()
{
[ "$1" = 0 ] || exec >&2
local args='display|auto'
local n
for n in `get_candidates "$BINDIR/$TARGET-gcc" |sed -ne "s,$BINDIR/$TARGET-gcc-\\(.*\)$,\\1,pg" |sort -u`; do
args="$args|$n"
done
echo "Usage: $PROG {$args}"
exit $1
}

case "$1" in
help|usage|--help|--usage)
Usage 0
;;
display)
for n in $COMPILERS; do
if [ -f "$BINDIR/$TARGET-$n" ]; then
$ALT_LIST "$BINDIR/$TARGET-$n"
fi
done
;;
auto)
for n in $COMPILERS; do
if [ -f "$BINDIR/$TARGET-$n" ]; then
$ALT_AUTO "$BINDIR/$TARGET-$n" >/dev/null 2>&1
fi
done
$ALT_UPDATE
;;
*)
[ -f "$BINDIR/$TARGET-gcc-$1" ] || Usage 1

for n in $COMPILERS; do
if [ -f "$BINDIR/$TARGET-$n" -a -f "$BINDIR/$TARGET-$n-$1" ]; then
$ALT_MANUAL "$BINDIR/$TARGET-$n" "$BINDIR/$TARGET-$n-$1" >/dev/null
fi
done
$ALT_UPDATE
;;
esac
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009