Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 105253 Details for
Bug 159790
app-eselect/eselect-init-0.1 (new ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
init.eselect
init.eselect (text/plain), 2.45 KB, created by
Ryan Hope
on 2007-01-02 16:23:16 UTC
(
hide
)
Description:
init.eselect
Filename:
MIME Type:
Creator:
Ryan Hope
Created:
2007-01-02 16:23:16 UTC
Size:
2.45 KB
patch
obsolete
># Copyright 1999-2005 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Id: kernel.eselect 342 2006-11-08 22:20:47Z kugelfang $ > >DESCRIPTION="Manage /sbin/init symlink" >MAINTAINER="rmh3093@gmail.com" > >init_progs="einit jinit initng sysvinit" > ># find a list of init symlink targets >find_targets() { > for f in $init_progs ; do > [[ -f ${ROOT}/sbin/${f} ]] && echo $(basename ${f} ) > done >} > ># try to remove the kernel symlink >remove_symlink() { > rm "${ROOT}/sbin/init" >} > ># set the kernel symlink >set_symlink() { > target=${1} > if is_number "${target}" ; then > targets=( $(find_targets ) ) > target=${targets[$(( ${target} - 1 ))]} > fi > if [[ -z ${target} ]] ; then > die -q "Target \"${1}\" doesn't appear to be valid!" > elif [[ -f "${ROOT}/sbin/${target}" ]] ; then > ln -s "${ROOT}/sbin/${target}" "/sbin/init" > else > die -q "Target \"${1}\" doesn't appear to be valid!" > fi >} > >### show action ### > >describe_show() { > echo "Show the current init symlink" >} > >do_show() { > local init > > write_list_start "Current init symlink:" > if [[ -L "${ROOT}/sbin/init" ]] ; then > init=$(canonicalise ${ROOT}/sbin/init ) > write_kv_list_entry "${init%/}" "" > else > write_kv_list_entry "(unset)" "" > fi >} > >### list action ### > >describe_list() { > echo "List available init symlink targets" >} > >do_list() { > targets=( $(find_targets ) ) > write_list_start "Available init symlink targets:" > if [[ -n ${targets[@]} ]] ; then > local i > for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do > [[ ${targets[${i}]} == $(basename $(canonicalise ${ROOT}/sbin/init)) ]] && \ > targets[${i}]="${targets[${i}]} $(highlight '*' )" > done > write_numbered_list "${targets[@]}" > else > write_kv_list_entry "(none found)" "" > fi >} > >### set action ### > >describe_set() { > echo "Set a new init symlink target" >} > >describe_set_parameters() { > echo "<target>" >} > >describe_set_options() { > echo "target : Target name or number (from 'list' action)" >} > >do_set() { > if [[ -z ${1} ]] ; then > # no parameter > die -q "You didn't tell me what to set the symlink to" > > elif [[ -L "${ROOT}/sbin/init" ]] ; then > # existing symlink > if ! remove_symlink ; then > die -q "Couldn't remove existing symlink" > elif ! set_symlink "${1}" ; then > die -q "Couldn't set a new symlink" > fi > > elif [[ -e "${ROOT}/sbin/init" ]] ; then > # we have something strange > die -q "Sorry, ${ROOT}/sbin/init confuses me" > > else > set_symlink "${1}" || die -q "Couldn't set a new symlink" > fi >} > ># vim: set ft=eselect :
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 159790
:
105252
| 105253 |
105254