Skip to content

Commit

Permalink
app-admin/eselect-guile: bump to 1.2. EAPI 4, fix 'update ifunset' bu…
Browse files Browse the repository at this point in the history
…g (it was ignored currently). Remove 'GUILE_LOAD_PATH' from env.d file, as it breaks the not eselect'd guile version. Drop pkg_prerm phase.

(Portage version: 2.2.0_alpha134/git/Linux i686, signed Manifest commit with key 0xBE63A96F)
  • Loading branch information
Cyprien Nicolas (fulax) committed Oct 2, 2012
1 parent edf6e67 commit fdf334c
Show file tree
Hide file tree
Showing 5 changed files with 393 additions and 7 deletions.
12 changes: 12 additions & 0 deletions app-admin/eselect-guile/ChangeLog
@@ -0,0 +1,12 @@
# ChangeLog for app-admin/eselect-guile
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $

*eselect-guile-1.2 (02 Oct 2012)

02 Oct 2012; Cyprien Nicolas <c.nicolas+bugs@gmail.com> +files/1.2/guile.eselect,
+files/1.2/guile.eselect.5, +eselect-guile-1.2.ebuild:
version bump: EAPI 4, fix 'update ifunset' bug (it was ignored currently).
Remove 'GUILE_LOAD_PATH' from env.d file, as it breaks the not eselect'd
guile version. Drop pkg_prerm phase.

18 changes: 11 additions & 7 deletions app-admin/eselect-guile/Manifest
@@ -1,18 +1,22 @@
-----BEGIN PGP SIGNED MESSAGE----- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256 Hash: SHA256


AUX 1.2/guile.eselect 6592 SHA256 e16c01e9510a136cc27ef67ab29f8fd8632ab5e1c7ba341144312286f88b8c6a SHA512 25f1d7c32bcc16d3f6b30a54716c4f18afcf745d4f90398ae3fccb4fb2e11ae95e5bc8e8e60d2b47a21aa265b07f9be56bf52b754fbe45ea82e7ffec2f19d724 WHIRLPOOL 8131ef9d0f217fa8591d15a9ed23be9e85828401ec03d10f621eeead0eb5839b485129d2e9311a10f5b0f40c82b60951b64d1087e98f3d727b6f51fb6f93d0e3
AUX 1.2/guile.eselect.5 2151 SHA256 46b7081a330ad7df1cc31373a387b14eed342d837b2171c1c907a301f323426c SHA512 cf6aac63f57bd45eea97726cc08ea309c135adac6af97acf6c21a9ae8eaa11210808e0bb4d0169e7d154fc0fda079ba82a1969c307d21d98e889c6214746eb72 WHIRLPOOL 116861079d361ba099bec11430a639a717f625b0b28d22bb8479d5d0b1b3ddcf2e198be8bd75671adf25cdca2393045b1c432e779a1edff95b7d0147d9e51cd5
AUX guile.eselect 6624 SHA256 6f48397694cdf0b79c529529b54eed9b2901225e0e0e25d0031467a403f184a2 SHA512 4122e1d899a29b70e904ed8e514aae38bda1593303c52dfabdb0bf292262a0d0c161860a677807ca1110a11a15b6a2d028641268848474ba7e026ac094a69ad7 WHIRLPOOL 170beb82fd974aefdb66e2fab54b57a41b8d5f1c415d039af51fff23ee785f612ae783f18cab297919cdfc76a09018a45dd87ab170ba1957953f0725f0393854 AUX guile.eselect 6624 SHA256 6f48397694cdf0b79c529529b54eed9b2901225e0e0e25d0031467a403f184a2 SHA512 4122e1d899a29b70e904ed8e514aae38bda1593303c52dfabdb0bf292262a0d0c161860a677807ca1110a11a15b6a2d028641268848474ba7e026ac094a69ad7 WHIRLPOOL 170beb82fd974aefdb66e2fab54b57a41b8d5f1c415d039af51fff23ee785f612ae783f18cab297919cdfc76a09018a45dd87ab170ba1957953f0725f0393854
AUX guile.eselect.5 2151 SHA256 46b7081a330ad7df1cc31373a387b14eed342d837b2171c1c907a301f323426c SHA512 cf6aac63f57bd45eea97726cc08ea309c135adac6af97acf6c21a9ae8eaa11210808e0bb4d0169e7d154fc0fda079ba82a1969c307d21d98e889c6214746eb72 WHIRLPOOL 116861079d361ba099bec11430a639a717f625b0b28d22bb8479d5d0b1b3ddcf2e198be8bd75671adf25cdca2393045b1c432e779a1edff95b7d0147d9e51cd5 AUX guile.eselect.5 2151 SHA256 46b7081a330ad7df1cc31373a387b14eed342d837b2171c1c907a301f323426c SHA512 cf6aac63f57bd45eea97726cc08ea309c135adac6af97acf6c21a9ae8eaa11210808e0bb4d0169e7d154fc0fda079ba82a1969c307d21d98e889c6214746eb72 WHIRLPOOL 116861079d361ba099bec11430a639a717f625b0b28d22bb8479d5d0b1b3ddcf2e198be8bd75671adf25cdca2393045b1c432e779a1edff95b7d0147d9e51cd5
EBUILD eselect-guile-1.1.ebuild 884 SHA256 8745981ef0e2256a8434b3a5a4ac9846ceaa229acff442611cbc2467a1816b8d SHA512 a874112d2e369abe4a30e6c9845a30f3d24b8f85f338a7125412cb4d0df1e12021e44a73a1a72c9315b2c80739cb4a3f59548aab490b3ad8dee4f59e4aa9e8eb WHIRLPOOL ba7503eb77e8a0665f437ae58e1bcae497333133a87f482dacaa37fca3d596a3b8333eb854a46b755ebd6ca4428abc12032c1d4419f333135b9de3f3593e29fb EBUILD eselect-guile-1.1.ebuild 884 SHA256 8745981ef0e2256a8434b3a5a4ac9846ceaa229acff442611cbc2467a1816b8d SHA512 a874112d2e369abe4a30e6c9845a30f3d24b8f85f338a7125412cb4d0df1e12021e44a73a1a72c9315b2c80739cb4a3f59548aab490b3ad8dee4f59e4aa9e8eb WHIRLPOOL ba7503eb77e8a0665f437ae58e1bcae497333133a87f482dacaa37fca3d596a3b8333eb854a46b755ebd6ca4428abc12032c1d4419f333135b9de3f3593e29fb
EBUILD eselect-guile-1.2.ebuild 885 SHA256 df165cea0b538873031cad66615ef486101b084b5dc82ad0a4f69d4d2a4f6230 SHA512 a9ef1aac461075c12180c2e1d95877aacce5c54701d6a2e123f619b4f8d9583875f1de6e9dec9a0f7b34df816654b476f410d737a69ed7a8ef09356b99c4e610 WHIRLPOOL 27fd9bd0a9d7a35a8205ffddccc0592c66c5fdbef6d9a7029ba69cdc1468106386e9e949cb6dbf9abfb457d32e9663bdeebea29811dad9944237d8eeaab445ec
MISC ChangeLog 491 SHA256 37d8a4bfd9d8ba0a58a97db8218a142fc761e85ae2362c452b62dbaaee3b3702 SHA512 cc814b86fcdb640c3c00b69161f1f10f6035fc7aafd43f751ea04d337b8c19f3eb25dd73949fab2200a41c5c5ffc69df343a182d17698ca75358e21afe140bc0 WHIRLPOOL bf90a6c60bbd9a4eb1ee73e0072913c5931462cb62de5dbf3e3d05df2545df889ea55a5cc0edafc1f8766e478d2ad719c932da58a697f42cfeb654b8b781602c
MISC metadata.xml 159 SHA256 61c7b86c8f64d194ff9e03f62b4007e0c69db2054d09e3ccdbbf6dbc0c78024b SHA512 bcfa99017ea0f4cd68e5aeea8d6404b81821f3b0e714ae1ed109ca21b4d254ff5a6219a42b439f19571ad0883ff4573e462829d59fc8822e96820a2b28dcfe91 WHIRLPOOL 61d0709506e75a8d87b10acd314e48e6c239c58a08b5f5f5ea33778973fd8e00416b1a2580a6a97b5eda690d4e9ece0a423b4e55e2fc8a1c3706670a546ee879 MISC metadata.xml 159 SHA256 61c7b86c8f64d194ff9e03f62b4007e0c69db2054d09e3ccdbbf6dbc0c78024b SHA512 bcfa99017ea0f4cd68e5aeea8d6404b81821f3b0e714ae1ed109ca21b4d254ff5a6219a42b439f19571ad0883ff4573e462829d59fc8822e96820a2b28dcfe91 WHIRLPOOL 61d0709506e75a8d87b10acd314e48e6c239c58a08b5f5f5ea33778973fd8e00416b1a2580a6a97b5eda690d4e9ece0a423b4e55e2fc8a1c3706670a546ee879
-----BEGIN PGP SIGNATURE----- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux) Version: GnuPG v2.0.19 (GNU/Linux)


iQEcBAEBCAAGBQJQOgynAAoJED15R4++Y6lv824IALqEWLrz6lsO91Y95QPYEudV iQEcBAEBCAAGBQJQa0zNAAoJED15R4++Y6lvVFQH/313/GPpZhJR0GPnIL/d44S5
iD96yzOF0zQ4zCCNKRpUMu2FvekrYQ/w81gIKm2MHyCO9oR79cof4UkoefRTLql3 bmW/1/sbi3WnKfldeq2N1+bG6BXhZt0lhgqioZcJHVu6hrmqsfXDBtDQ5uiYJOxs
uGbMVfpD2beu2RDDMN/sy4XCa8lb6gQsNftSUcftmp3dROJkWUPGpy7UJQS+uRTN DDDsXMCD/HJmNhuSyqsfKgKD3Ly0qfG5fAEN/+9h1pB5A9HN4QtFadkxxd1Jv67A
G1VsZZD/Z9pMeNnlrHAFQDpC4TxceGdNyVaGI6xRstDIwGyrOa8m0bbY30BHh2fX lMwfc4ynDinIg3qLaNcTAyU9SCCcxcv+jWs/SeDDkSWlib0lOW60Ea39OisSSrbT
6SRe1jxS/ITItO5U6d2/cL/vr4tyLIJqvPZBiCFdX155sm4ix9pSQnxauG1vFU3v BVvUJj6wDg+uvaiOM62atAC5NQrOWSlj21gYNrTG1XE22ON4qWJmuI1k78nlwxAN
UjQOAGMp/8Nm0uxgyvQejdAz1TmR1djrWNPDXjn1NST7bFHPZeYF8bEFxGVDN9I= u+dZTuHuJTjhUjxU/utZtFBn5zWe1r6ZVl2D6h0BIw1ROLjAcoA89bnlADG6Lsg=
=JQkn =ZElM
-----END PGP SIGNATURE----- -----END PGP SIGNATURE-----
29 changes: 29 additions & 0 deletions app-admin/eselect-guile/eselect-guile-1.2.ebuild
@@ -0,0 +1,29 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

DESCRIPTION="Manage multiple Guile versions on one system"
HOMEPAGE="http://www.gentoo.org/proj/en/lisp/scheme/"
#SRC_URI="mirror://gentoo/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~ia64-hpux ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
IUSE=""

# Versions prior to guile-1.8.8-r2 aren't properly slotted
DEPEND=""
RDEPEND=">=app-admin/eselect-1.2.6
!<dev-scheme/guile-1.8.8-r2"

# We don't have any source directory to work on.
S="${T}"

src_install() {
insinto /usr/share/eselect/modules
doins "${FILESDIR}"/${PV}/guile.eselect
doman "${FILESDIR}"/${PV}/guile.eselect.5
#dodoc ChangeLog
}
247 changes: 247 additions & 0 deletions app-admin/eselect-guile/files/1.2/guile.eselect
@@ -0,0 +1,247 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: $
#
# DOCUMENTATION
# Following actions possible
# * show do_show()
# * list do_list()
# * set do_set()
# * update do_update()
# * clean do_clean()
#
# Behaviour:
# do_show():
# Checks if /usr/bin/guile is a link and if the target exists,
# if yes, it outputs the currently linked Guile version.
# If it is no symlink, the user is told so, the same if there is
# no /usr/bin/guile or the target does not exist.
# do_list(): List all available versions of GNU Guile
# do_set(): Set a version to be target of the symlink.
# do_update(): Set the target to the highest version available
# (optionally: only if not set)
# do_clean(): Remove all set symlinks (for pkg_prerm)

DESCRIPTION="Manage /usr/bin/guile* versions"
MAINTAINER="scheme@gentoo.org"
SVN_DATE='$Date: $'
VERSION=$(svn_date_to_version "${SVN_DATE}")

BINARYLIST="guile-snarf guile-config guile-tools guile guild"
MANPAGELIST="guile"

find_targets() {
# Return the list of available Guile binaries
local j
for j in "${EROOT}"/usr/bin/guile-[0-9]*; do
[[ -f ${j} ]] && basename ${j}
done
}

remove_envfile() {
# When cleaning symlinks this takes care of the info documentation settings
rm -f "${EROOT}/etc/env.d/50guile"
}

set_envfile() {
# Define INFOPATH environment variable in env file
[[ -d ${EROOT}/usr/share/info/guile-$1 ]] || return 1
echo "INFOPATH=${EPREFIX}/usr/share/info/guile-$1" >"${EROOT}/etc/env.d/50guile"
}

remove_symlinks() {
# Remove existing symlinks to binaries, man pages,
# m4 file, and the env file (own function)
local f
for f in ${BINARYLIST}; do
rm -f "${EROOT}/usr/bin/${f}"
done
for f in ${MANPAGELIST}; do
rm -f "${EROOT}"/usr/share/man/man1/${f}.1*
done
rm -f "${EROOT}"/usr/share/aclocal/guile.m4
remove_envfile
}

set_bin_symlinks() {
# Set symlinks to binaries in /usr/bin/
local target=${1} f
for f in ${BINARYLIST}; do
# set symlink only if target binary actually exists
if [[ -f ${EROOT}/usr/bin/${f}-${target} ]]; then
ln -s "${f}-${target}" "${EROOT}/usr/bin/${f}" || die \
"Couldn't set ${f}-${target} ${EROOT}/usr/bin/${f} symlink"
fi
done
}

set_m4_symlinks() {
# Set symlink to guile.m4
local target=${1}
if [[ -f ${EROOT}/usr/share/aclocal/guile-${target}.m4 ]]; then
ln -s "guile-${target}.m4" "${EROOT}"/usr/share/aclocal/guile.m4 \
|| die "Couldn't set guile-${target}.m4 guile.m4 symlink"
fi
}

set_man_symlinks() {
# Set symlinks to man pages
local target=${1} extension f i
for f in ${MANPAGELIST}; do
for i in "${EROOT}"/usr/share/man/man1/${f}-${target}.1*; do
if [[ -f ${i} ]]; then
# target file exists; determine compress extension
extension=${i##*/${f}-${target}.1}
ln -s "${f}-${target}.1${extension}" \
"${EROOT}/usr/share/man/man1/${f}.1${extension}"
fi
done
done
}

set_symlinks() {
# Set symlinks to binaries and man pages, update info path
local target=$1 targets major
# target may be specified by its name or its index
if is_number "${target}"; then
# numeric index, find the target's name
targets=( $(find_targets) )
[[ ${target} -ge 1 && ${target} -le ${#targets[@]} ]] \
|| die -q "Number out of range: ${1}"
target=${targets[target-1]}
fi

# is the target valid, i.e. does a Guile binary with this name exist?
[[ -f ${EROOT}/usr/bin/${target} ]] \
|| die -q "Target \"${1}\" doesn't appear to be valid!"

echo "Switching guile to ${target} ..."
remove_symlinks || die -q "Couldn't remove existing symlink"

major=${target#guile-}
set_bin_symlinks "${major}"
set_m4_symlinks "${major}"
set_man_symlinks "${major}"
set_envfile "${major}"

# update /etc/profile.env from /etc/env.d files
do_action env update noldconfig

return 0
}

test_for_root() {
# checks if the user has rights to modify /usr/bin/
[[ -w ${EROOT}/usr/bin ]] || die -q "You need root privileges!"
}

### show action ###

describe_show() {
echo "Show the current target of the Guile symlink"
}

do_show() {
[[ $# -gt 0 ]] && die -q "Too many parameters"

write_list_start "Current target of Guile symlink:"
if [[ -L ${EROOT}/usr/bin/guile && -e ${EROOT}/usr/bin/guile ]]; then
write_kv_list_entry \
"$(basename "$(readlink "${EROOT}/usr/bin/guile")")" ""
elif [[ -e ${EROOT}/usr/bin/guile ]]; then
write_kv_list_entry \
"(not a symlink or target of symlink does not exist)" ""
else
write_kv_list_entry "(unset)" ""
fi
}

### list action ###

describe_list() {
echo "List available Guile symlink targets"
}

do_list() {
[[ $# -gt 0 ]] && die -q "Too many parameters"

local i targets
targets=( $(find_targets) )

for (( i = 0; i < ${#targets[@]}; i++ )); do
# Highlight the currently chosen version
[[ ${targets[i]} = \
$(basename "$(readlink "${EROOT}/usr/bin/guile")") ]] \
&& targets[i]=$(highlight_marker "${targets[i]}")
done
write_list_start "Available Guile symlink targets:"
write_numbered_list -m "(none found)" "${targets[@]}"
}

### set action ###

describe_set() {
echo "Set a new Guile symlink"
}

describe_set_options() {
echo "target : Target name or number (from 'list' action)"
}

describe_set_parameters() {
echo "<target>"
}

do_set() {
[[ -z $1 ]] && die -q "You didn't tell me what to set the symlink to"
[[ $# -gt 1 ]] && die -q "Too many parameters"
test_for_root

if [[ -e ${EROOT}/usr/bin/guile && ! -L ${EROOT}/usr/bin/guile ]]; then
die -q "${EROOT}/usr/bin/guile exists but is not a symlink"
fi

set_symlinks "${1}" || die -q "Couldn't set a new symlink"
}

### update action ###

describe_update() {
echo "Automatically update the Guile symlink"
}

describe_update_options() {
echo "ifunset : Do not override currently set version"
}

do_update() {
[[ -z $1 || $1 = ifunset || $1 = --if-unset ]] || die -q "Usage error"
[[ $# -gt 1 ]] && die -q "Too many parameters"

[[ $# -eq 1 && -L ${EROOT}/usr/bin/guile ]] && return 0

test_for_root

if [[ -L ${EROOT}/usr/bin/guile ]]; then
# this is not redundant: "update" is called in pkg_postrm() of guile
# and should clean up any dead symlinks if no valid target exists
remove_symlinks || die -q "Couldn't remove existing symlink"
elif [[ -e ${EROOT}/usr/bin/guile ]]; then
die -q "${EROOT}/usr/bin/guile exists but is not a symlink"
fi

local targets=( $(find_targets) )
if [[ ${#targets[@]} -gt 0 ]]; then
set_symlinks "${targets[${#targets[@]}-1]}" \
|| die -q "Couldn't set a new symlink"
fi
}

### Clean action
describe_clean() {
echo "Remove any existing symlinks"
}

do_clean() {
remove_symlinks
}

0 comments on commit fdf334c

Please sign in to comment.