diff options
author | Alexis Ballier <aballier@gentoo.org> | 2008-04-07 21:29:18 +0000 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2008-04-07 21:29:18 +0000 |
commit | dbe935224ed3bb986f7f1176686c6a33e1365804 (patch) | |
tree | 05ba04b8c2b45265b7d57d915ae7ae9d0b5385b9 /app-admin/eselect-unison | |
parent | Stable on alpha, bug #216765 (diff) | |
download | historical-dbe935224ed3bb986f7f1176686c6a33e1365804.tar.gz historical-dbe935224ed3bb986f7f1176686c6a33e1365804.tar.bz2 historical-dbe935224ed3bb986f7f1176686c6a33e1365804.zip |
Initial import. eselect module for SLOTted net-misc/unison by Martin von Gagern <Martin.vGagern@gmx.net>, bug #207746
Package-Manager: portage-2.1.5_rc2
Diffstat (limited to 'app-admin/eselect-unison')
-rw-r--r-- | app-admin/eselect-unison/ChangeLog | 11 | ||||
-rw-r--r-- | app-admin/eselect-unison/Manifest | 14 | ||||
-rw-r--r-- | app-admin/eselect-unison/eselect-unison-0.1.ebuild | 25 | ||||
-rw-r--r-- | app-admin/eselect-unison/files/unison.eselect-0.1 | 152 | ||||
-rw-r--r-- | app-admin/eselect-unison/metadata.xml | 5 |
5 files changed, 207 insertions, 0 deletions
diff --git a/app-admin/eselect-unison/ChangeLog b/app-admin/eselect-unison/ChangeLog new file mode 100644 index 000000000000..3b323f49fb77 --- /dev/null +++ b/app-admin/eselect-unison/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for app-admin/eselect-unison +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-unison/ChangeLog,v 1.1 2008/04/07 21:29:17 aballier Exp $ + +*eselect-unison-0.1 (07 Apr 2008) + + 07 Apr 2008; Alexis Ballier <aballier@gentoo.org> + +files/unison.eselect-0.1, +metadata.xml, +eselect-unison-0.1.ebuild: + Initial import. eselect module for SLOTted net-misc/unison by Martin von + Gagern <Martin.vGagern@gmx.net>, bug #207746 + diff --git a/app-admin/eselect-unison/Manifest b/app-admin/eselect-unison/Manifest new file mode 100644 index 000000000000..61d96e30a982 --- /dev/null +++ b/app-admin/eselect-unison/Manifest @@ -0,0 +1,14 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +AUX unison.eselect-0.1 3722 RMD160 da78d270779e69cd0f9523d959dd0dc10bd81188 SHA1 70333c6a2eadaa16dbddec57a0e9f9b09d75cfca SHA256 9eea518e9ab85cd53c9c9a989d032a80b6b117f15ff258b904a6cb0b2775cec1 +EBUILD eselect-unison-0.1.ebuild 673 RMD160 08414a25d22be95ac0d73ec8e9e22b747d32d00b SHA1 7fd2aeabf679d4da14e64327323ebc791e766885 SHA256 2fde1b50e309ed199d0e30da790b3be6e50cd495efa003a2a7a00fdd7cd6a757 +MISC ChangeLog 505 RMD160 525305c99bf9ef0276c3382e01d1be774eb7d201 SHA1 c4b52c58573ba9db32d91c60b631976a33f170b1 SHA256 9651533ce10c6f423edb4a835e0969079f1d45d0551604fb531330a02a7d2242 +MISC metadata.xml 155 RMD160 dfaa057e679b01302a807c75a32a910098b26809 SHA1 94024f83dcacbb53e92be090dd0f994ec93dc90d SHA256 118048376ebb76f57628b0819f3de4856e73959c2578c88715d37ea2d1e0af81 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iEYEARECAAYFAkf6kjsACgkQvFcC4BYPU0raWgCgs4R22A9cvRImEPkFYldCGN19 +AhcAn3QCb2qimcqsSpS4A5F6agrshmHK +=VSX5 +-----END PGP SIGNATURE----- diff --git a/app-admin/eselect-unison/eselect-unison-0.1.ebuild b/app-admin/eselect-unison/eselect-unison-0.1.ebuild new file mode 100644 index 000000000000..839565d5b447 --- /dev/null +++ b/app-admin/eselect-unison/eselect-unison-0.1.ebuild @@ -0,0 +1,25 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-unison/eselect-unison-0.1.ebuild,v 1.1 2008/04/07 21:29:17 aballier Exp $ + +inherit eutils + +DESCRIPTION="unison module for eselect" +HOMEPAGE="http://www.gentoo.org/proj/en/eselect/" +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="" +DEPEND="" +RDEPEND=">=app-admin/eselect-1.0.5" + +src_install() { + local MODULEDIR="/usr/share/eselect/modules" + local MODULE="unison" + dodir ${MODULEDIR} + insinto ${MODULEDIR} + newins "${FILESDIR}/${MODULE}.eselect-${PVR}" ${MODULE}.eselect || die "failed to install" +} diff --git a/app-admin/eselect-unison/files/unison.eselect-0.1 b/app-admin/eselect-unison/files/unison.eselect-0.1 new file mode 100644 index 000000000000..26d68521a597 --- /dev/null +++ b/app-admin/eselect-unison/files/unison.eselect-0.1 @@ -0,0 +1,152 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: unison.eselect-0.1,v 1.1 2008/04/07 21:29:18 aballier Exp $ + +DESCRIPTION="Manage /usr/bin/unison versions" +MAINTAINER="ml@gentoo.org" +SVN_DATE='$Date: 2008/04/07 21:29:18 $' +VERSION=$(svn_date_to_version "${SVN_DATE}" ) + +# find a list of unison symlink targets, best first +find_targets() { + local f + for f in "${ROOT}"/usr/bin/unison-[0-9]*; do + if [[ -f ${f} ]] ; then + echo "${f##*/unison-}" + fi + done | tac +} + +# find version number of currently symlinked version +identify_target() { + local f + f="$(canonicalise "${ROOT}"/usr/bin/unison)" + echo "${f##*/unison-}" +} + +# try to remove the unison symlink +remove_symlinks() { + rm -f "${ROOT}"/usr/bin/unison &>/dev/null +} + +# set the unison symlink +set_symlinks() { + local target="${1}" targets + if is_number "${target}" && [[ ${target} -ge 1 ]] ; then + targets=( $(find_targets ) ) + target=${targets[$(( ${target} - 1 ))]} + fi + if [[ -f "${ROOT}/usr/bin/unison-${target}" ]] ; then + remove_symlinks + ln -s "unison-${target}" "${ROOT}/usr/bin/unison" || \ + die "Could not set ${target} /usr/bin/unison symlink" + else + die -q "Target \"${target}\" doesn't appear to be valid!" + fi +} + +### show action ### + +describe_show() { + echo "Show the current unison version" +} + +do_show() { + [[ -z "${@}" ]] || die -q "Too many parameters" + + write_list_start "Current unison verson:" + if [[ -L "${ROOT}/usr/bin/unison" ]] ; then + write_kv_list_entry "$(identify_target)" "" + elif [[ -e "${ROOT}/usr/bin/unison" ]] ; then + write_kv_list_entry "(not a symlink)" "" + else + write_kv_list_entry "(unset)" "" + fi +} + +### list action ### + +describe_list() { + echo "List available unison versions" +} + +do_list() { + [[ -z "${@}" ]] || die -q "Too many parameters" + + local i targets current + targets=( $(find_targets ) ) + current=$(identify_target) + if [[ -n ${targets[@]} ]] ; then + for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do + [[ ${targets[${i}]} == ${current} ]] && \ + targets[${i}]="${targets[${i}]} $(highlight '*' )" + done + write_list_start "Available unison versions:" + write_numbered_list "${targets[@]}" + else + write_kv_list_entry "(none found)" "" + fi +} + +### set action ### + +describe_set() { + echo "Set a new unison version" +} + +describe_set_options() { + echo "target : Target version number or index from 'list' action" +} + +describe_set_parameters() { + echo "<target>" +} + +do_set() { + if [[ -z "${1}" ]] ; then + die -q "You didn't give me a version number" + + elif [[ -n "${2}" ]] ; then + die -q "Too many parameters" + + elif [[ -L "${ROOT}/usr/bin/unison" ]] ; then + if ! remove_symlinks ; then + die -q "Can't remove existing version symlink" + elif ! set_symlinks "${1}" ; then + die -q "Can't set new version" + fi + + elif [[ -e "${ROOT}/usr/bin/unison" ]] ; then + die -q "${ROOT}/usr/bin/unison seems to be from an old ebuild, please remove manually" + + else + set_symlinks "${1}" || die -q "Can't set new version" + fi +} + +### update action ### + +describe_update() { + echo "Automatically update the unison version number" +} + +describe_update_options() { + echo "--if-unset : Do not override currently selected version" +} + +do_update() { + [[ -z "${1}" ]] || ( [[ -z "${2}" ]] && [[ "${1}" == "--if-unset" ]] ) || \ + die -q "Usage error" + + if [[ -L "${ROOT}/usr/bin/unison" ]] ; then + [[ ${1} == "--if-unset" ]] && return + remove_symlinks || die -q "Can't remove existing symlink" + fi + if [[ -e "${ROOT}/usr/bin/unison" ]] ; then + die -q "${ROOT}/usr/bin/unison seems to be from an old ebuild, please remove manually" + elif ! [[ -z $(find_targets ) ]] ; then + set_symlinks 1 || die -q "Can't set a new version" + fi +} + +# vim: set ft=eselect : diff --git a/app-admin/eselect-unison/metadata.xml b/app-admin/eselect-unison/metadata.xml new file mode 100644 index 000000000000..2193d772e351 --- /dev/null +++ b/app-admin/eselect-unison/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>ml</herd> +</pkgmetadata> |