Skip to content

Instantly share code, notes, and snippets.

@Wolfer
Last active December 21, 2015 00:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
* Package: net-misc/netkit-telnetd-0.17-r10
* Repository: gentoo
* Maintainer: maintainer-needed@gentoo.org
* USE: abi_x86_32 cdistro_CLD cdistro_desktop elibc_glibc kernel_linux userland_GNU x86
* FEATURES: preserve-libs sandbox usersandbox
>>> Unpacking source...
>>> Unpacking netkit-telnet-0.17.tar.gz to /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work
>>> Unpacking netkit-telnet_0.17-36.diff.gz to /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work
* Applying netkit-telnet_0.17-36.diff ... [ ok ]
* Applying netkit-telnetd-0.17-cflags-gnu_source.patch ... [ ok ]
>>> Source unpacked in /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work
>>> Compiling source in /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17 ...
Directories: /usr/bin /usr/sbin /usr/man
Looking for a C compiler... gcc
Checking if gcc accepts gcc warnings... yes
Looking for a C++ compiler... g++
Checking if g++ accepts gcc warnings... yes
Checking if gcc accepts -O2... yes
Checking if g++ accepts -O2... yes
Checking if g++ accepts -fno-rtti... yes
Checking if g++ accepts -fno-exceptions... yes
Checking for BSD signal semantics... yes
Checking for ncurses... yes
Checking for GNU libc... yes
Checking for forkpty... -lutil
Checking for logwtmp... -lutil
Checking for snprintf declaration... ok
Checking for snprintf implementation... ok
Generating MCONFIG...
make -j3
(cd telnet && make)
(cd telnetd && make)
(cd telnetlogin && make)
make[1]: Вход в каталог `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnet'
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE commands.cc -c
make[1]: Вход в каталог `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnetlogin'
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs telnetlogin.c -c
make[1]: Вход в каталог `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnetd'
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE telnetd.c -c
telnetlogin.c: В функции «main»:
telnetlogin.c:135:16: предупреждение: variable «rh» set but not used [-Wunused-but-set-variable]
i686-pc-linux-gnu-gcc -Wl,--as-needed telnetlogin.o -lutil -lutil -o telnetlogin
commands.cc: В функции «int shell(int, const char**)»:
commands.cc:1350:49: предупреждение: missing sentinel in function call [-Wformat]
commands.cc:1352:29: предупреждение: missing sentinel in function call [-Wformat]
commands.cc: В функции «int setescape(int, const char**)»:
commands.cc:1284:40: предупреждение: ignoring return value of «char* fgets(char*, int, FILE*)», declared with attribute warn_unused_result [-Wunused-result]
commands.cc: В функции «int tn(int, const char**)»:
commands.cc:1651:71: предупреждение: ignoring return value of «char* fgets(char*, int, FILE*)», declared with attribute warn_unused_result [-Wunused-result]
make[1]: Выход из каталога `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnetlogin'
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE state.c -c
state.c: В функции «suboption»:
state.c:1206:10: предупреждение: сравнение различных указательных типов без приведения типов [по умолчанию включена]
state.c: В функции «send_status»:
state.c:1367:5: предупреждение: ignoring return value of «fwrite», declared with attribute warn_unused_result [-Wunused-result]
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE termstat.c -c
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE slc.c -c
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE sys_term.c -c
sys_term.c: В функции «start_login»:
sys_term.c:669:12: предупреждение: ignoring return value of «write», declared with attribute warn_unused_result [-Wunused-result]
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE utility.c -c
utility.c: В функции «nextitem»:
utility.c:212:2: предупреждение: при возврате результата указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c: В функции «printsub»:
utility.c:893:8: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utility.c:898:8: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utility.c:903:8: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utility.c: В функции «netwrite»:
utility.c:1165:3: предупреждение: при передаче аргумента 1 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «char *»
utility.c:1165:3: предупреждение: при передаче аргумента 2 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «char *»
utility.c:1165:3: предупреждение: при передаче аргумента 3 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «const char *»
utility.c:1165:3: предупреждение: при передаче аргумента 4 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «const char * const»
utility.c:1219:3: предупреждение: при передаче аргумента 1 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «const char *»
utility.c:1219:3: предупреждение: при передаче аргумента 2 «nextitem»: указуемые типы различаются знаковостью [-Wpointer-sign]
utility.c:156:1: замечание: expected «const unsigned char *» but argument is of type «const char * const»
utility.c: В функции «sendurg»:
utility.c:1259:9: предупреждение: ignoring return value of «fwrite», declared with attribute warn_unused_result [-Wunused-result]
utility.c: В функции «fatal»:
utility.c:354:2: предупреждение: ignoring return value of «write», declared with attribute warn_unused_result [-Wunused-result]
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE global.c -c
i686-pc-linux-gnu-gcc -O2 -march=i686 -O2 -march=i686 -pipe -Wall -Wno-trigraphs '-DISSUE_FILE="/etc/issue.net"' -DPARANOID_TTYS -DNO_REVOKE -DKLUDGELINEMODE -DDIAGNOSTICS -DLOGIN_WRAPPER=\"/usr/sbin/telnetlogin\" -D_GNU_SOURCE setproctitle.c -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE main.cc -c
commands.cc:1833:52: предупреждение: «srlen» may be used uninitialized in this function [-Wuninitialized]
i686-pc-linux-gnu-gcc -Wl,--as-needed telnetd.o state.o termstat.o slc.o sys_term.o utility.o global.o setproctitle.o -lutil -lutil -o telnetd
make[1]: Выход из каталога `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnetd'
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE network.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE ring.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE sys_bsd.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE telnet.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE terminal.cc -c
telnet.cc: В функции «const char* gettermname()»:
telnet.cc:638:7: предупреждение: неиспользуемая переменная «err» [-Wunused-variable]
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE tn3270.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE utilities.cc -c
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE genget.cc -c
utilities.cc: В функции «void printsub(int, unsigned char*, int)»:
utilities.cc:586:45: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utilities.cc:591:47: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utilities.cc:596:45: предупреждение: формат не является строковой константой, и не заданы аргументы форматирования [-Wformat-security]
utilities.cc: В функции «void ExitString(const char*, int)»:
utilities.cc:673:46: предупреждение: ignoring return value of «size_t fwrite(const void*, size_t, size_t, FILE*)», declared with attribute warn_unused_result [-Wunused-result]
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE environ.cc -c
telnet.cc: At global scope:
telnet.cc:611:12: предупреждение: «int my_setupterm(const char*, int, int*)» определена, но нигде не используется [-Wunused-function]
i686-pc-linux-gnu-g++ -O2 -march=i686 -O2 -march=i686 -pipe -fno-rtti -fno-exceptions -Wall -Wno-trigraphs -DUSE_TERMIO -DKLUDGELINEMODE -D_GNU_SOURCE netlink.cc -c
i686-pc-linux-gnu-g++ -Wl,--as-needed commands.o main.o network.o ring.o sys_bsd.o telnet.o terminal.o tn3270.o utilities.o genget.o environ.o netlink.o -lncurses -o telnet
make[1]: Выход из каталога `/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17/telnet'
make -j3
make: Цель `all' не требует выполнения команд.
>>> Source compiled.
>>> Test phase [not enabled]: net-misc/netkit-telnetd-0.17-r10
>>> Install netkit-telnetd-0.17-r10 into /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/image/ category net-misc
>>> Completed installing netkit-telnetd-0.17-r10 into /var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/image/
strip: i686-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version
usr/sbin/telnetd
usr/bin/telnet
usr/sbin/telnetlogin
ecompressdir: bzip2 -9 /usr/share/man
* checking 16 files for package collisions
>>> Merging net-misc/netkit-telnetd-0.17-r10 to /
* QA Notice: Global shell options changed and were not restored while calling 'post_pkg_preinst'
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: syntax error near unexpected token `('
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: ` *-* | +([[:digit:]]).+([[:digit:]])*)'
* ERROR: net-misc/netkit-telnetd-0.17-r10::gentoo failed:
* error sourcing environment
*
* Call stack:
* misc-functions.sh, line 17: Called source 'preinst_selinux_labels'
* ebuild.sh, line 489: Called die
* The specific snippet of code:
* source "${T}"/environment || \
* die "error sourcing environment"
*
* If you need support, post the output of `emerge --info '=net-misc/netkit-telnetd-0.17-r10::gentoo'`,
* the complete build log and the output of `emerge -pqv '=net-misc/netkit-telnetd-0.17-r10::gentoo'`.
* The complete build log is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment'.
* Working directory: '/usr/lib/portage/pym'
* S: '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17'
!!! post preinst failed; exiting.
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: syntax error near unexpected token `('
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: ` *-* | +([[:digit:]]).+([[:digit:]])*)'
* ERROR: net-misc/netkit-telnetd-0.17-r10::gentoo failed:
* error sourcing environment
*
* Call stack:
* misc-functions.sh, line 17: Called source '/usr/lib/portage/bin/ebuild.sh'
* ebuild.sh, line 489: Called die
* The specific snippet of code:
* source "${T}"/environment || \
* die "error sourcing environment"
*
* If you need support, post the output of `emerge --info '=net-misc/netkit-telnetd-0.17-r10::gentoo'`,
* the complete build log and the output of `emerge -pqv '=net-misc/netkit-telnetd-0.17-r10::gentoo'`.
* The complete build log is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment'.
* Working directory: '/usr/lib/portage/pym'
* S: '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17'
!!! FAILED preinst: 1
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: syntax error near unexpected token `('
/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment: line 2001: ` *-* | +([[:digit:]]).+([[:digit:]])*)'
* ERROR: net-misc/netkit-telnetd-0.17-r10::gentoo failed:
* error sourcing environment
*
* Call stack:
* misc-functions.sh, line 17: Called source '/usr/lib/portage/bin/ebuild.sh'
* ebuild.sh, line 489: Called die
* The specific snippet of code:
* source "${T}"/environment || \
* die "error sourcing environment"
*
* If you need support, post the output of `emerge --info '=net-misc/netkit-telnetd-0.17-r10::gentoo'`,
* the complete build log and the output of `emerge -pqv '=net-misc/netkit-telnetd-0.17-r10::gentoo'`.
* The complete build log is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/temp/environment'.
* Working directory: '/usr/lib/portage/pym'
* S: '/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17'
declare -x ABI_X86="32"
declare -x ALSA_CARDS=""
declare -x APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy proxy_http"
declare -x ARCH="x86"
declare -x AUDIODEV="default"
declare -x BOOTSTRAP_USE="cxx unicode python_targets_python3_2 python_targets_python2_7"
declare -x CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author"
declare -x CBUILD="i686-pc-linux-gnu"
declare -x CDISTRO="CLD desktop"
declare -x CFLAGS="-O2 -march=i686 -pipe"
declare -x CFLAGS_default
declare -x CHOST="i686-pc-linux-gnu"
declare -x CHOST_default="i686-pc-linux-gnu"
declare -x CL="builder client desktop console consolegui"
declare -- CL_CORE_PATCH="/usr/sbin/cl-core-patch"
declare -- CL_UPDATE_PROG="/usr/sbin/cl-core-setup"
declare -x COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
declare -x COLORFGBG="15;0"
declare -x CONFIG_PROTECT="/usr/share/gnupg/qualified.txt /usr/share/config /usr/share/themes/oxygen-gtk/gtk-2.0 /usr/share/themes/oxygen-gtk/gtk-3.0"
declare -x CONFIG_PROTECT_MASK="/etc/gentoo-release /etc/sandbox.d /etc/php/cli-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/fonts/fonts.conf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild /etc/splash"
declare -x CTARGET_default="i686-pc-linux-gnu"
declare -x CXXFLAGS="-O2 -march=i686 -pipe"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-mx1Kk6fYHI,guid=a4d959e4c45050191dc72425520a631f"
declare -x DEFAULT_ABI="default"
declare -x DEFINED_PHASES=" compile install unpack"
declare DEPEND=">=sys-libs/ncurses-5.2
!net-misc/telnet-bsd "
declare DESCRIPTION="Standard Linux telnet client and server"
declare -x DESKTOP_SESSION="default"
declare -x DESTTREE="/usr"
declare -x DIROPTIONS="-m0755"
declare -x DM_CONTROL="/var/run/xdmctl"
declare -x EAPI="0"
declare -x ELIBC="glibc"
declare -- EPATCH_COMMON_OPTS="-g0 -E --no-backup-if-mismatch"
declare -- EPATCH_EXCLUDE=""
declare -- EPATCH_FORCE="no"
declare -- EPATCH_MULTI_MSG="Applying various patches (bugfixes/updates) ..."
declare -- EPATCH_OPTS=""
declare -- EPATCH_SINGLE_MSG=""
declare -- EPATCH_SOURCE="/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/patch"
declare -- EPATCH_SUFFIX="patch.bz2"
declare -x EXEOPTIONS="-m0755"
declare -x FCFLAGS="-O2 -march=i686 -pipe"
declare -x FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
declare -x FFLAGS="-O2 -march=i686 -pipe"
declare -x GCC_SPECS=""
declare -x GEM_HOME="/usr/local/rvm/gems/ruby-2.0.0-p247"
declare -x GEM_PATH="/usr/local/rvm/gems/ruby-2.0.0-p247:/usr/local/rvm/gems/ruby-2.0.0-p247@global"
declare -x GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx"
declare -x GRUB_PLATFORMS="pc"
declare -x GS_LIB="/home/wolfer/.fonts"
declare -x GTK2_RC_FILES="/etc/gtk-2.0/gtkrc:/home/wolfer/.gtkrc-2.0:/home/wolfer/.kde4/share/config/gtkrc-2.0"
declare -x GTK_RC_FILES="/etc/gtk/gtkrc:/home/wolfer/.gtkrc:/home/wolfer/.kde4/share/config/gtkrc"
declare -x GUILE_LOAD_PATH="/usr/share/guile/1.8"
declare HDEPEND=""
declare HOMEPAGE="https://launchpad.net/netkit-telnet"
declare -x INFOPATH="/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/info:/usr/share/binutils-data/i686-pc-linux-gnu/2.23.1/info"
declare -x INHERITED=" multilib toolchain-funcs user eutils"
declare -x INPUT_DEVICES="keyboard mouse evdev mutouch synaptics"
declare -x INSDESTTREE="/etc/xinetd.d"
declare -x INSOPTIONS="-m0644"
declare -x IRBRC="/usr/local/rvm/rubies/ruby-2.0.0-p247/.irbrc"
declare IUSE=""
declare -x IUSE_IMPLICIT="prefix"
declare -x KDE_FULL_SESSION="true"
declare -x KDE_IS_PRELINKED="1"
declare -x KDE_MULTIHEAD="false"
declare -x KDE_SESSION_UID="1000"
declare -x KDE_SESSION_VERSION="4"
declare -x KERNEL="linux"
declare -x KERNEL_ABI="default"
declare -x KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
declare -x KONSOLE_DBUS_SERVICE=":1.37"
declare -x KONSOLE_DBUS_SESSION="/Sessions/3"
declare -x KONSOLE_PROFILE_NAME="Командная оболочка"
declare -x KV="3.10.4-calculate"
declare -x LANG="ru_RU.UTF-8"
declare -x LANGUAGE=""
declare -x LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
declare -x LC_NUMERIC="POSIX"
declare -x LDFLAGS="-Wl,--as-needed"
declare -x LDFLAGS_default
declare -x LIBDIR_default="lib"
declare -x LIBOPTIONS="-m0644"
declare -x LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer"
declare -x LICENSE="BSD"
declare -x LINGUAS="ru"
declare -x LIRC_DEVICES="devinput"
declare -x MAIL="/var/mail/wolfer"
declare -x MAKEOPTS="-j3"
declare -x MANPATH="/usr/local/share/man:/usr/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/4.6.3/man:/usr/share/binutils-data/i686-pc-linux-gnu/2.23.1/man:/usr/lib/php5.4/man/:/usr/share/postgresql/man/:/usr/share/postgresql-9.2/man/"
declare -x MULTILIB_ABIS="default"
declare -x MULTIOSDIRS="../lib"
declare -x MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-2.0.0-p247"
declare -x NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml"
declare -x NPTL_KERN_VER="3.0.0"
declare -x OFFICE_IMPLEMENTATION="libreoffice"
declare -x OPENCL_PROFILE="nvidia"
declare -x OPENGL_PROFILE="nvidia"
declare -- PATCHLEVEL="36"
declare -- PATCH_OVERLAY="/var/lib/layman/calculate/profiles/patches"
declare -x PATH="/usr/local/rvm/gems/ruby-2.0.0-p247/bin:/usr/local/rvm/gems/ruby-2.0.0-p247@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p247/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.6.3"
declare PDEPEND=""
declare -x PHP_TARGETS=""
declare -a PORTAGE_DOCOMPRESS='([0]="/usr/share/doc" [1]="/usr/share/info" [2]="/usr/share/man")'
declare -a PORTAGE_DOCOMPRESS_SKIP='([0]="/usr/share/doc/netkit-telnetd-0.17-r10/html")'
declare -x PORTAGE_NICENESS="19"
declare -x PRELINK_PATH_MASK="/usr/lib/klibc:/usr/lib/libfreebl3.so:/usr/lib/libnssdbm3.so:/usr/lib/libsoftokn3.so:/usr/lib64/gimp/2.0/plug-ins/hot:/usr/lib/*nvidia*:/opt/bin/skype"
declare -x PROFILEHOME=""
declare -x PROFILE_ONLY_VARIABLES="ARCH ELIBC IUSE_IMPLICIT KERNEL USERLAND USE_EXPAND_IMPLICIT USE_EXPAND_UNPREFIXED USE_EXPAND_VALUES_ARCH USE_EXPAND_VALUES_ELIBC USE_EXPAND_VALUES_KERNEL USE_EXPAND_VALUES_USERLAND"
declare -x PROPERTIES=""
declare -x PROVIDE=""
declare -x PYTHONDONTWRITEBYTECODE="1"
declare -x PYTHON_SINGLE_TARGET=""
declare -x PYTHON_TARGETS=""
declare -x QT_GRAPHICSSYSTEM="raster"
declare -x QT_PLUGIN_PATH="/usr/lib/kde4/plugins"
declare -x RDEPEND=">=sys-libs/ncurses-5.2
!net-misc/telnet-bsd "
declare REPOSITORY
declare REQUIRED_USE=""
declare -x RESTRICT=""
declare -x RESUMECOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port=22 ; exec rsync --rsh=\\\"ssh -p\\\${port} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\""
declare -x RUBY_TARGETS=""
declare -x RUBY_VERSION="ruby-2.0.0-p247"
declare -x S="/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/work/netkit-telnet-0.17"
declare -x SANDBOX_DEBUG="0"
declare -x SANDBOX_DENY=""
declare -x SANDBOX_PID="29635"
declare -x SANDBOX_PREDICT="/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/homedir:/dev/crypto:/var/cache/fontconfig"
declare -x SANDBOX_READ="/:/var/tmp"
declare -x SANDBOX_VERBOSE="1"
declare -x SANDBOX_WRITE=":/dev/console:/dev/fd:/dev/full:/dev/null:/dev/pts/:/dev/pty:/dev/shm:/dev/tts:/dev/tty:/dev/vc/:/dev/zero:/proc/self/fd:/tmp/:/usr/lib32/cf:/usr/lib32/conftest:/usr/lib64/cf:/usr/lib64/conftest:/usr/lib/cf:/usr/lib/conftest:/usr/tmp/cf:/usr/tmp/conftest:/var/tmp:/var/tmp/:/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/homedir/.bash_history"
declare -x SDL_AUDIODRIVER="alsa"
declare -x SESSION_MANAGER="local/calculate:@/tmp/.ICE-unix/14322,unix/calculate:/tmp/.ICE-unix/14322"
declare -x SHELL="/bin/bash"
declare -x SHELL_SESSION_ID="a2ea932988b44000bd8bde49f949b120"
declare -x SLOT="0"
declare SRC_URI="mirror://gentoo/netkit-telnet-0.17.tar.gz
mirror://debian/pool/main/n/netkit-telnet/netkit-telnet_0.17-36.diff.gz"
declare -x THEMES="CLD"
declare -x USE="abi_x86_32 cdistro_CLD cdistro_desktop elibc_glibc kernel_linux userland_GNU x86"
declare -x USERLAND="GNU"
declare -x USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND"
declare -x USE_EXPAND_UNPREFIXED="ARCH"
declare -x USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-fbsd amd64-linux arm arm-linux hppa hppa-hpux ia64 ia64-hpux ia64-linux m68k m68k-mint mips ppc ppc64 ppc64-linux ppc-aix ppc-macos ppc-openbsd s390 sh sparc sparc64-freebsd sparc64-solaris sparc-fbsd sparc-solaris x64-freebsd x64-macos x64-openbsd x64-solaris x86 x86-cygwin x86-fbsd x86-freebsd x86-interix x86-linux x86-macos x86-netbsd x86-openbsd x86-solaris x86-winnt"
declare -x USE_EXPAND_VALUES_ELIBC="AIX Cygwin Darwin FreeBSD glibc HPUX Interix mintlib musl NetBSD OpenBSD SunOS uclibc Winnt"
declare -x USE_EXPAND_VALUES_KERNEL="AIX Cygwin Darwin FreeBSD freemint HPUX Interix linux NetBSD OpenBSD SunOS Winnt"
declare -x USE_EXPAND_VALUES_USERLAND="BSD GNU"
declare -x USE_PYTHON="2.7"
declare -x VIDEO_CARDS=""
declare -x WINDOWID="16777242"
declare -x WINDOWPATH="7"
declare -x XCURSOR_THEME="Oxygen_Black"
declare -x XDG_CONFIG_DIRS="/etc/xdg"
declare -x XDG_CURRENT_DESKTOP="KDE"
declare -x XDG_DATA_DIRS="/usr/local/share:/usr/share"
declare -x XDG_SESSION_COOKIE="8e62495c44f11df8a798ed9f001e5722-1376413022.26559-1357368065"
declare -x XDM_MANAGED="method=classic"
declare -x XSESSION="KDE-4"
declare -x XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
declare -x _E_DOCDESTTREE_=""
declare -x _E_EXEDESTTREE_=""
declare -- ___ECLASS_ONCE_EUTILS="recur -_+^+_- spank"
declare -- ___ECLASS_ONCE_MULTILIB="recur -_+^+_- spank"
declare -- ___ECLASS_ONCE_TOOLCHAIN_FUNCS="recur -_+^+_- spank"
declare -- ___ECLASS_ONCE_USER="recur -_+^+_- spank"
declare -- calcver="3.1.1"
declare -- f="*netkit-telnetd*"
declare -- file="/var/tmp/portage/net-misc/netkit-telnetd-0.17-r10/homedir/.rvmrc"
declare -- phase_func
declare -x rvm_alias_expanded
declare -x rvm_bin_flag
declare -x rvm_bin_path="/usr/local/rvm/bin"
declare -x rvm_configure_flags
declare -x rvm_delete_flag
declare -x rvm_docs_type
declare -x rvm_file_name
declare -x rvm_gemstone_package_file
declare -x rvm_gemstone_url
declare -x rvm_hook
declare -- rvm_ignore_rvmrc="0"
declare -x rvm_make_flags
declare -x rvm_niceness
declare -x rvm_nightly_flag
declare -x rvm_only_path_flag
declare -x rvm_path="/usr/local/rvm"
declare -x rvm_prefix="/usr/local"
declare -x rvm_proxy
declare -x rvm_quiet_flag
declare -x rvm_ruby_alias
declare -x rvm_ruby_bits
declare -x rvm_ruby_configure
declare -x rvm_ruby_file
declare -x rvm_ruby_global_gems_path
declare -x rvm_ruby_make
declare -x rvm_ruby_make_install
declare -x rvm_ruby_mode
declare -x rvm_ruby_string
declare -x rvm_ruby_url
declare -- rvm_rubygems_path="/usr/local/rvm/rubygems"
declare -a rvm_saved_env='()'
declare -x rvm_script_name
declare -x rvm_sdk
declare -x rvm_silent_flag
declare -x rvm_sticky_flag
declare -x rvm_system_flag
declare -x rvm_use_flag
declare -x rvm_user_flag
declare -x rvm_version="1.22.1 (stable)"
declare -x rvm_wrapper_name
declare -- rvmrc="/usr/local/.rvmrc"
declare -- script="override_gem"
declare -- userBashrc="/etc/portage/bashrc"
__function_on_stack ()
{
__rvm_string_includes "${FUNCNAME[*]}" "$@" || return $?
}
__function_unset ()
{
if [[ -n "${ZSH_VERSION:-}" ]]; then
unset -f "$1";
else
unset "$1";
fi
}
__list_remote_all_for ()
{
{
__list_remote_rubies_for "$1";
__list_remote_rbx_for "$1";
__list_remote_jruby_for "$1"
} | sort -u
}
__list_remote_jruby_for ()
{
typeset rvm_ruby_url;
rvm_ruby_url="$1";
__rvm_curl -s "http://jruby.org.s3.amazonaws.com/?prefix=downloads/&delimiter=/" | __rvm_grep -oE "<Key>[^<]*</Key>" | __rvm_grep -o '[[:digit:]][^_]*' | __rvm_awk '{print "http://jruby.org.s3.amazonaws.com/downloads/"$1"/jruby-bin-"$1".tar.gz"}' | __rvm_grep "${rvm_ruby_url}"
}
__list_remote_rbx_for ()
{
__rvm_curl -s http://binaries.rubini.us/index.txt | __rvm_grep -E "$1.*\.tar\.bz2$"
}
__list_remote_rubies_for ()
{
typeset rvm_ruby_url;
rvm_ruby_url="$1";
__rvm_awk '/'"${rvm_ruby_url//\//\/}"'/{print}' < $rvm_path/config/remote;
if [[ -f $rvm_user_path/remote ]]; then
__rvm_awk '/'"${rvm_ruby_url//\//\/}"'/{print}' < $rvm_user_path/remote;
fi
}
__rvm_add_to_path ()
{
export PATH;
if (( $# != 2 )) || [[ -z "$2" ]]; then
rvm_error "__rvm_add_to_path requires two parameters";
return 1;
fi;
__rvm_remove_from_path "$2";
case "$1" in
prepend)
PATH="$2:$PATH"
;;
append)
PATH="$PATH:$2"
;;
esac;
if [[ -n "${rvm_user_path_prefix:-}" ]]; then
__rvm_remove_from_path "${rvm_user_path_prefix}";
PATH="${rvm_user_path_prefix}:$PATH";
fi;
builtin hash -r
}
__rvm_after_cd ()
{
typeset rvm_hook;
rvm_hook="after_cd";
if [[ -n "${rvm_scripts_path:-}" || -n "${rvm_path:-}" ]]; then
source "${rvm_scripts_path:-$rvm_path/scripts}/hook";
fi
}
__rvm_array_add_or_update ()
{
typeset _array_name _variable _separator _value _local_value;
typeset -a _array_value_old _array_value_new;
_array_name="$1";
_variable="$2";
_separator="$3";
_value="${4##${_separator}}";
_array_value_new=();
eval "_array_value_old=( \"\${${_array_name}[@]}\" )";
case " ${_array_value_old[*]} " in
*[[:space:]]${_variable}*)
for _local_value in "${_array_value_old[@]}";
do
case "${_local_value}" in
${_variable}*)
_array_value_new+=("${_local_value}${_separator}${_value}")
;;
*)
_array_value_new+=("${_local_value}")
;;
esac;
done
;;
*)
_array_value_new=("${_array_value_old[@]}" "${_variable}${_value}")
;;
esac;
eval "${_array_name}=( \"\${_array_value_new[@]}\" )"
}
__rvm_array_contains ()
{
typeset _search _iterator;
_search="$1";
shift;
for _iterator in "$@";
do
case "${_iterator}" in
${_search})
return 0
;;
esac;
done;
return 1
}
__rvm_array_prepend_or_ignore ()
{
typeset _array_name _variable _separator _value _local_value;
typeset -a _array_value_old _array_value_new;
_array_name="$1";
_variable="$2";
_separator="$3";
_value="$4";
_array_value_new=();
eval "_array_value_old=( \"\${${_array_name}[@]}\" )";
case " ${_array_value_old[*]} " in
*[[:space:]]${_variable}*)
for _local_value in "${_array_value_old[@]}";
do
case "${_local_value}" in
${_variable}*)
rvm_debug "__rvm_array_prepend_or_ignore ${_array_name} ${_variable}\"${_value}${_separator}${_local_value#${_variable}}\"";
_array_value_new+=("${_variable}${_value}${_separator}${_local_value#${_variable}}")
;;
*)
_array_value_new+=("${_local_value}")
;;
esac;
done;
eval "${_array_name}=( \"\${_array_value_new[@]}\" )"
;;
esac
}
__rvm_ask_for ()
{
typeset response;
rvm_warn "$1";
printf "%b" "(anything other than '$2' will cancel) > ";
if read response && [[ "$2" == "$response" ]]; then
return 0;
else
return 1;
fi
}
__rvm_ask_to_trust ()
{
typeset trusted value anykey _rvmrc;
_rvmrc="${1}";
if [[ ! -t 0 || -n "$MC_SID" ]] || (( ${rvm_promptless:=0} == 1 )); then
return 2;
fi;
__rvm_table "NOTICE" <<-TEXT
RVM has encountered a new or modified $(basename "${_rvmrc}") file in the current directory, this is a shell script and therefore may contain any shell commands.
Examine the contents of this file carefully to be sure the contents are safe before trusting it!
Do you wish to trust '${_rvmrc}'?
Choose v[iew] below to view the contents
TEXT
trusted=0;
while (( ! trusted )); do
printf "%b" 'y[es], n[o], v[iew], c[ancel]> ';
builtin read response;
value="$(echo -n "${response}" | \tr '[[:upper:]]' '[[:lower:]]' | __rvm_strip)";
case "${value:-n}" in
v | view)
__rvm_display_rvmrc
;;
y | yes)
trusted=1
;;
n | no)
break
;;
c | cancel)
return 1
;;
esac;
done;
if (( trusted )); then
__rvm_trust_rvmrc "$1";
return 0;
else
__rvm_untrust_rvmrc "$1";
return 1;
fi
}
__rvm_awk ()
{
\awk "$@" || return $?
}
__rvm_become ()
{
typeset string rvm_rvmrc_flag;
string="$1";
rvm_rvmrc_flag=0;
[[ -n "$string" ]] && {
rvm_ruby_string="$string";
rvm_gemset_name=""
};
__rvm_use > /dev/null || return $?;
rvm_ruby_string="${rvm_ruby_string}${rvm_gemset_name:+${rvm_gemset_separator:-'@'}}${rvm_gemset_name:-}";
return 0
}
__rvm_calculate_remote_file ()
{
rvm_remote_server_url="$( __rvm_db "rvm_remote_server_url${3:-}" )";
[[ -n "$rvm_remote_server_url" ]] || {
rvm_debug "rvm_remote_server_url${3:-} not found";
return $1
};
__rvm_system_path "" "${3:-}";
__rvm_ruby_package_file "${4:-}";
__remote_file="${rvm_remote_server_url}/${rvm_remote_server_path}${rvm_ruby_package_file}"
}
__rvm_call_with_restored_umask ()
{
rvm_umask="$(umask)";
if [[ -n "${rvm_stored_umask:-}" ]]; then
umask ${rvm_stored_umask};
fi;
"$@";
umask "${rvm_umask}";
unset rvm_umask
}
__rvm_cd ()
{
typeset old_cdpath ret;
ret=0;
old_cdpath="${CDPATH}";
CDPATH=".";
chpwd_functions="" builtin cd "$@" || ret=$?;
CDPATH="${old_cdpath}";
return $ret
}
__rvm_cd_functions_set ()
{
__rvm_do_with_env_before;
__rvm_project_rvmrc && __rvm_after_cd || true;
__rvm_do_with_env_after;
return 0
}
__rvm_check_pipestatus ()
{
for __iterator in "$@";
do
case "${__iterator}" in
"")
true
;;
0)
true
;;
*)
return ${__iterator}
;;
esac;
done;
return 0
}
__rvm_check_rvmrc_trustworthiness ()
{
(( ${rvm_trust_rvmrcs_flag:-0} == 0 )) || return 0;
[[ -n "$1" ]] || return 1;
typeset _first _second saveIFS;
if [[ -n "${ZSH_VERSION:-}" ]]; then
_first=1;
else
_first=0;
fi;
_second=$(( _first + 1 ));
saveIFS="$IFS";
IFS=';';
typeset -a trust;
trust=($( __rvm_rvmrc_stored_trust "$1" ));
IFS="$saveIFS";
if [[ "${trust[${_second}]:-'#'}" == "$(__rvm_checksum_for_contents "$1")" ]]; then
[[ "${trust[${_first}]}" == '1' ]] || return $?;
else
__rvm_ask_to_trust "$1" || return $?;
fi;
true
}
__rvm_checksum_all ()
{
[[ -n "${_checksum_md5:-}" && -n "${_checksum_sha512:-}" ]]
}
__rvm_checksum_any ()
{
[[ -n "${_checksum_md5:-}" || -n "${_checksum_sha512:-}" ]]
}
__rvm_checksum_calculate_file ()
{
_checksum_md5="$( __rvm_md5_calculate "${1:-}" )";
_checksum_sha512="$( __rvm_sha__calculate 512 "${1:-}" )"
}
__rvm_checksum_for_contents ()
{
typeset __sum;
__sum=$( echo "$1" | \cat - "$1" | __rvm_md5_for_contents ) || {
rvm_error "Neither md5 nor md5sum were found in the PATH";
return 1
};
__sum+=$( echo "$1" | \cat - "$1" | __rvm_sha256_for_contents ) || {
rvm_error "Neither sha256sum nor shasum found in the PATH";
return 1
};
echo ${__sum}
}
__rvm_checksum_none ()
{
[[ -z "${_checksum_md5:-}" && -z "${_checksum_sha512:-}" ]]
}
__rvm_checksum_read ()
{
__rvm_checksum_none || return 0;
typeset _type _value _name;
typeset -a _list;
list=();
for _name in "$@";
do
list+=("$_name");
if [[ "$_name" =~ "?" ]]; then
list+=("${_name%\?*}");
fi;
done;
for _name in "${list[@]}";
do
_checksum_md5="$( "$rvm_scripts_path/db" "$rvm_path/config/md5" "$_name" | head -n 1 )";
[[ -n "${_checksum_md5:-}" ]] || _checksum_md5="$( "$rvm_scripts_path/db" "$rvm_user_path/md5" "$_name" | head -n 1 )";
_checksum_sha512="$( "$rvm_scripts_path/db" "$rvm_path/config/sha512" "$_name" | head -n 1 )";
[[ -n "${_checksum_sha512:-}" ]] || _checksum_sha512="$( "$rvm_scripts_path/db" "$rvm_user_path/sha512" "$_name" | head -n 1 )";
__rvm_checksum_none || return 0;
done;
return 1
}
__rvm_checksum_validate_file ()
{
__rvm_checksum_any || return 1;
if [[ -n "${_checksum_md5:-}" ]]; then
[[ "$(__rvm_md5_calculate "${1:-}")" == "${_checksum_md5:-}" ]] || return 2;
fi;
if [[ -n "${_checksum_sha512:-}" ]]; then
[[ "$(__rvm_sha__calculate 512 "${1:-}")" == "${_checksum_sha512:-}" ]] || return 3;
fi;
return 0
}
__rvm_checksum_write ()
{
[[ -n "${1:-}" ]] || return 1;
__rvm_checksum_any || return 1;
[[ -z "${_checksum_md5:-}" ]] || "$rvm_scripts_path/db" "$rvm_user_path/md5" "${1:-}" "${_checksum_md5:-}";
[[ -z "${_checksum_sha512:-}" ]] || "$rvm_scripts_path/db" "$rvm_user_path/sha512" "${1:-}" "${_checksum_sha512:-}";
return 0
}
__rvm_clean_path ()
{
export PATH;
typeset IFS _iterator_path;
typeset -a _old_path _new_path;
IFS=:;
_old_path=();
_new_path=();
__rvm_custom_separated_array _old_path : "${PATH}";
for _iterator_path in "${_old_path[@]}";
do
case ":${_new_path[*]}:" in
*:${_iterator_path}:*)
true
;;
*)
_new_path+=("${_iterator_path}")
;;
esac;
done;
PATH="${_new_path[*]}";
builtin hash -r
}
__rvm_cleanse_variables ()
{
__rvm_unset_ruby_variables;
if [[ ${rvm_sticky_flag:-0} -eq 1 ]]; then
export rvm_gemset_name;
else
unset rvm_gemset_name;
fi;
unset rvm_configure_flags rvm_patch_names rvm_make_flags;
unset rvm_env_string rvm_ruby_string rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_bin_flag rvm_import_flag rvm_export_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_sticky_flag rvm_rvmrc_flag rvm_gems_flag rvm_only_path_flag rvm_docs_flag rvm_dump_environment_flag rvm_ruby_alias rvm_static_flag rvm_archive_extension rvm_hook rvm_ruby_name rvm_remote_flag;
__rvm_load_rvmrc
}
__rvm_cleanup_tmp ()
{
if [[ -d "${rvm_tmp_path}/" ]]; then
case "${rvm_tmp_path%\/}" in
*tmp)
__rvm_rm_rf "${rvm_tmp_path}/${1:-$$}*"
;;
esac;
fi;
return 0
}
__rvm_conditionally_add_bin_path ()
{
[[ ":${PATH}:" =~ ":${rvm_bin_path}:" ]] || {
case "${rvm_ruby_string:-"system"}" in
system)
PATH="$PATH:${rvm_bin_path}"
;;
*)
PATH="${rvm_bin_path}:$PATH"
;;
esac;
builtin hash -r
}
}
__rvm_conditionally_do_with_env ()
{
if (( __rvm_env_loaded > 0 )); then
"$@";
else
__rvm_do_with_env "$@";
fi
}
__rvm_curl ()
{
( __rvm_which curl > /dev/null || {
rvm_error "RVM requires 'curl'. Install 'curl' first and try again.";
return 200
};
typeset -a __flags;
__flags=(--fail --location --max-redirs 10);
if [[ -n "${rvm_proxy:-}" ]]; then
__flags+=(--proxy "${rvm_proxy:-}");
fi;
__rvm_curl_output_control;
unset curl;
__rvm_debug_command \curl "${__flags[@]}" "$@" || return $? )
}
__rvm_curl_output_control ()
{
if (( ${rvm_quiet_curl_flag:-0} == 1 )); then
__flags+=("--silent" "--show-error");
else
if [[ " $*" =~ " -s" || " $*" =~ " --silent" ]]; then
[[ " $*" =~ " -S" || " $*" =~ " -sS" || " $*" =~ " --show-error" ]] || {
__flags+=("--show-error")
};
fi;
fi
}
__rvm_current_gemcache_dir ()
{
if __rvm_using_gemset_globalcache; then
echo "$rvm_gems_cache_path";
else
echo "${rvm_ruby_gem_home:-"$GEM_HOME"}/cache";
fi;
return 0
}
__rvm_current_gemset ()
{
typeset current_gemset;
current_gemset="${GEM_HOME:-}";
current_gemset="${current_gemset##*${rvm_gemset_separator:-@}}";
if [[ "${current_gemset}" == "${GEM_HOME:-}" ]]; then
echo '';
else
echo "${current_gemset}";
fi
}
__rvm_custom_separated_array ()
{
typeset IFS;
IFS=$2;
if [[ -n "${ZSH_VERSION:-}" ]]; then
eval "$1+=( \${=3} )";
else
eval "$1+=( \$3 )";
fi
}
__rvm_db ()
{
typeset value key variable;
key=${1:-""};
key=${key#go};
variable=${2:-""};
if [[ -f "$rvm_user_path/db" ]]; then
value="$("$rvm_scripts_path/db" "$rvm_user_path/db" "$key")";
fi;
if [[ -z "$value" ]]; then
value="$("$rvm_scripts_path/db" "$rvm_path/config/db" "$key")";
fi;
if [[ -n "$value" ]]; then
if [[ -z "$variable" ]]; then
echo $value;
else
eval "$variable='$value'";
fi;
fi;
return 0
}
__rvm_debug_command ()
{
rvm_debug "Running($#): $*";
"$@" || return $?
}
__rvm_default_flags ()
{
true ${rvm_head_flag:=0} ${rvm_delete_flag:=0}
}
__rvm_detect_system ()
{
unset _system_type _system_name _system_version _system_arch;
export _system_type _system_name _system_version _system_arch;
_system_type="unknown";
_system_name="unknown";
_system_version="unknown";
_system_arch="$(uname -m)";
case "$(uname)" in
Linux | GNU*)
_system_type="linux";
if [[ -f /etc/lsb-release ]] && __rvm_grep "DISTRIB_ID=Ubuntu" /etc/lsb-release > /dev/null; then
_system_name="ubuntu";
_system_version="$(awk -F'=' '$1=="DISTRIB_RELEASE"{print $2}' /etc/lsb-release)";
_system_arch="$( dpkg --print-architecture )";
else
if [[ -f /etc/lsb-release ]] && __rvm_grep "DISTRIB_ID=LinuxMint" /etc/lsb-release > /dev/null; then
_system_name="mint";
_system_version="$(awk -F'=' '$1=="DISTRIB_RELEASE"{print $2}' /etc/lsb-release)";
_system_arch="$( dpkg --print-architecture )";
else
if [[ -f /etc/lsb-release ]] && __rvm_grep "DISTRIB_ID=ManjaroLinux" /etc/lsb-release > /dev/null; then
_system_name="manjaro";
_system_version="$(awk -F'=' '$1=="DISTRIB_RELEASE"{print $2}' /etc/lsb-release)";
else
if [[ -f /etc/os-release ]] && __rvm_grep "ID=opensuse" /etc/os-release > /dev/null; then
_system_name="opensuse";
_system_version="$(awk -F'=' '$1=="VERSION_ID"{gsub(/"/,"");print $2}' /etc/os-release)";
else
if [[ -f /etc/SuSE-release ]]; then
_system_name="suse";
_system_version="$(
__rvm_awk -F'=' '{gsub(/ /,"")} $1~/VERSION/ {version=$2} $1~/PATCHLEVEL/ {patch=$2} END {print version"."patch}' < /etc/SuSE-release
)";
else
if [[ -f /etc/debian_version ]]; then
_system_name="debian";
_system_version="$(\cat /etc/debian_version | __rvm_awk -F. '{print $1}')";
_system_arch="$( dpkg --print-architecture )";
else
if [[ -f /etc/os-release ]] && __rvm_grep "ID=debian" /etc/os-release > /dev/null; then
_system_name="debian";
_system_version="$(awk -F'=' '$1=="VERSION_ID"{gsub(/"/,"");print $2}' /etc/os-release | __rvm_awk -F. '{print $1}')";
_system_arch="$( dpkg --print-architecture )";
else
if [[ -f /etc/fedora-release ]]; then
_system_name="fedora";
_system_version="$(__rvm_grep -Eo '[[:digit:]]+' /etc/fedora-release)";
else
if [[ -f /etc/centos-release ]]; then
_system_name="centos";
_system_version="$(__rvm_grep -Eo '[[:digit:]\.]+' /etc/centos-release | __rvm_awk -F. '{print $1}')";
else
if [[ -f /etc/redhat-release ]]; then
if __rvm_grep -E 'CentOS|ClearOS' /etc/redhat-release > /dev/null; then
_system_name="centos";
else
_system_name="redhat";
fi;
_system_version="$(__rvm_grep -Eo '[[:digit:]\.]+' /etc/redhat-release | __rvm_awk -F. '{print $1}')";
else
if [[ -f /etc/system-release ]] && __rvm_grep "Amazon Linux AMI" /etc/system-release > /dev/null; then
_system_name="amazon";
_system_version="$(__rvm_grep -Eo '[[:digit:]\.]+' /etc/system-release | __rvm_awk -F. '{print $1"."$2}')";
else
if [[ -f /etc/sabayon-release ]]; then
_system_name="sabayon";
_system_version="$(\cat /etc/sabayon-release | __rvm_awk 'NR==1 {print $NF}' | __rvm_awk -F. '{print $1"."$2}')";
else
if [[ -f /etc/gentoo-release ]]; then
_system_name="gentoo";
_system_version="base-$(\cat /etc/gentoo-release | __rvm_awk 'NR==1 {print $NF}' | __rvm_awk -F. '{print $1"."$2}')";
else
if [[ -f /etc/arch-release ]]; then
_system_name="arch";
_system_version="libc-$(ldd --version | __rvm_awk 'NR==1 {print $NF}' | __rvm_awk -F. '{print $1"."$2}')";
else
_system_version="libc-$(ldd --version | __rvm_awk 'NR==1 {print $NF}' | __rvm_awk -F. '{print $1"."$2}')";
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi;
fi
;;
SunOS)
_system_type="sunos";
_system_name="solaris";
_system_version="$(uname -v)";
if __rvm_string_match "${_system_version}" "joyent*"; then
_system_name="smartos";
_system_version="${_system_version#* }";
else
if __rvm_string_match "${_system_version}" "oi*"; then
_system_name="openindiana";
_system_version="${_system_version#* }";
fi;
fi
;;
OpenBSD)
_system_type="bsd";
_system_name="openbsd";
_system_version="$(uname -r)"
;;
Darwin)
_system_type="darwin";
_system_name="osx";
_system_version="$(sw_vers -productVersion | __rvm_awk -F. '{print $1"."$2}')"
;;
FreeBSD)
_system_type="bsd";
_system_name="freebsd";
_system_version="$(uname -r)";
_system_version="${_system_version%%-*}"
;;
DragonFly)
_system_type="bsd";
_system_name="dragonfly";
_system_version="$(uname -r)";
_system_version="${_system_version%%-*}"
;;
*)
return 1
;;
esac;
_system_type="${_system_type//[ \/]/_}";
_system_name="${_system_name//[ \/]/_}";
_system_version="${_system_version//[ \/]/_}";
_system_arch="${_system_arch//[ \/]/_}";
_system_arch="${_system_arch/amd64/x86_64}";
_system_arch="${_system_arch/i[123456789]86/i386}"
}
__rvm_detect_xcode_version ()
{
typeset version_file;
for version_file in /Applications/Xcode.app/Contents/version.plist /Developer/Applications/Xcode.app/Contents/version.plist;
do
if [[ -f $version_file ]]; then
if [[ -x /usr/libexec/PlistBuddy ]]; then
/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" $version_file;
else
__rvm_sed -n '/<key>CFBundleShortVersionString<\/key>/{n; s/^.*>\(.*\)<.*$/\1/; p;}' < $version_file;
fi;
return 0;
fi;
done;
if builtin command -v xcodebuild > /dev/null; then
xcodebuild -version | __rvm_sed -n '/Xcode/ {s/Xcode //; p;}';
return 0;
fi;
return 1
}
__rvm_detect_xcode_version_at_least ()
{
typeset __xcode_version="$(__rvm_detect_xcode_version)";
[[ -n "$__xcode_version" ]] || return 0;
__rvm_version_compare "$__xcode_version" -ge "$1" || return $?;
true
}
__rvm_display_rvmrc ()
{
typeset _rvmrc_base;
_rvmrc_base="$(basename "${_rvmrc}")";
__rvm_table <<-TEXT
The contents of the ${_rvmrc_base} file will now be displayed.
After reading the file, you will be prompted again for 'yes or no' to set the trust level for this particular version of the file.
Note: You will be re-prompted each time the ${_rvmrc_base} file's contents change
changes, and may change the trust setting manually at any time.
TEXT
__rvm_wait_anykey "(( press a key to review the ${_rvmrc_base} file ))";
printf "%b" "${rvm_warn_clr}";
command cat -v "${_rvmrc}";
printf "%b" "${rvm_reset_clr}";
__rvm_table "Viewing of ${_rvmrc} complete." <<-TEXT
Trusting an ${_rvmrc_base} file means that whenever you cd into this directory, RVM will run this ${_rvmrc_base} shell script.
Note that if the contents of the file change, you will be re-prompted to review the file and adjust its trust settings. You may also change the trust settings manually at any time with the 'rvm rvmrc' command.
TEXT
}
__rvm_do_with_env ()
{
typeset result;
__rvm_do_with_env_before;
"$@";
result=$?;
__rvm_do_with_env_after;
return ${result:-0}
}
__rvm_do_with_env_after ()
{
__rvm_teardown
}
__rvm_do_with_env_before ()
{
if [[ -n "${rvm_scripts_path:-}" || -n "${rvm_path:-}" ]]; then
source "${rvm_scripts_path:-"$rvm_path/scripts"}/initialize";
__rvm_setup;
fi
}
__rvm_dotted ()
{
typeset flush __show_nth_dot;
__show_nth_dot=${rvm_show_every_nth_dot:-1};
unset rvm_show_every_nth_dot;
if (( __show_nth_dot == 1 )); then
__show_nth_dot="";
else
__show_nth_dot="if (NR%${__show_nth_dot}==1)";
fi;
if __rvm_awk '{fflush;}' <<< EO 2> /dev/null; then
flush=fflush;
else
flush=flush;
fi;
if (( $# )); then
__rvm_awk 'BEGIN{printf "'"${rvm_notify_clr:-}$*${rvm_reset_clr:-}"'";} {'"$__show_nth_dot"' printf "."; '$flush'} END{print ""}';
else
__rvm_awk '{printf "."; '$flush';} END{if (NR>0) print ""}';
fi
}
__rvm_dotted_run ()
{
typeset __message="$1";
shift;
if [[ -n "${ZSH_VERSION:-}" ]]; then
rvm_log "${__message} - using Zsh, can not show progress, be patient...";
"$@" > "${__log_file}" 2>&1 || return $?;
else
"$@" | tee -a "${__log_file}" | __rvm_dotted "${__message}";
__rvm_check_pipestatus ${PIPESTATUS[@]} ${pipestatus[@]} || return $?;
fi
}
__rvm_ensure_has_environment_files ()
{
typeset environment_id file_name directory identifier variable value variables;
environment_id="$(__rvm_env_string)";
file_name="${rvm_environments_path}/$environment_id";
if [[ ! -d "$rvm_environments_path" ]]; then
\mkdir -p "$rvm_environments_path";
fi;
if [[ ! -s "$file_name" ]] || ! __rvm_grep 'rvm_env_string=' "$file_name" > /dev/null; then
\rm -f "$file_name";
printf "%b" "export PATH ; PATH=\"${rvm_ruby_gem_home}/bin:${rvm_ruby_global_gems_path}/bin:${rvm_ruby_home}/bin:${rvm_bin_path}:\$PATH\"\n" > "$file_name";
for variable in rvm_env_string rvm_path rvm_ruby_string rvm_gemset_name RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC MAGLEV_HOME RBXOPT;
do
eval "export $variable";
eval "value=\${${variable}:-""}";
if [[ -n "$value" ]]; then
printf "export %b ; %b='%b'\n" "${variable}" "${variable}" "${value}" >> "$file_name";
else
printf "unset %b\n" "${variable}" >> "$file_name";
fi;
done;
fi;
if (( ${rvm_create_default_wrappers:=0} == 1 )) || [[ ! -f "$rvm_wrappers_path/$environment_id/ruby" ]]; then
for identifier in "$environment_id" "${environment_id//@*/}@global";
do
rvm_create_default_wrappers=1;
directory="$rvm_wrappers_path/$identifier";
if [[ ! -L "$directory" && ! -d "$directory" ]]; then
\mkdir -p "$directory";
"$rvm_scripts_path/wrapper" "$identifier" &>/dev/null;
fi;
done;
rvm_create_default_wrappers=0;
fi;
return 0
}
__rvm_ensure_is_a_function ()
{
if [[ ${rvm_reload_flag:=0} == 1 ]] || ! is_a_function rvm; then
for script in version selector selector_gemsets cd cli override_gem;
do
if [[ -f "$rvm_scripts_path/$script" ]]; then
source "$rvm_scripts_path/$script";
else
printf "%b" "WARNING:
Could not source '$rvm_scripts_path/$script' as file does not exist.
RVM will likely not work as expected.\n";
fi;
done;
fi
}
__rvm_env_string ()
{
typeset _path _string;
_path="${GEM_HOME:-""}";
_string="${_path//*gems\//}";
_string="${_string//\/*/}";
printf "%b" "${_string:-system}\n"
}
__rvm_every_nth_dot ()
{
typeset result=0;
export rvm_show_every_nth_dot=$1;
shift;
"$@" || result=$?;
unset rvm_show_every_nth_dot;
return $result
}
__rvm_expand_ruby_string ()
{
typeset string current_ruby;
string="$1";
case "${string:-all}" in
all)
"$rvm_scripts_path/list" strings | \tr ' ' "\n"
;;
all-gemsets)
"$rvm_scripts_path/list" gemsets strings
;;
default-with-rvmrc | rvmrc)
"$rvm_scripts_path/tools" path-identifier "$PWD"
;;
all-rubies | rubies)
"$rvm_scripts_path/list" rubies strings
;;
current-ruby | gemsets)
current_ruby="$(__rvm_env_string)";
current_ruby="${current_ruby%@*}";
rvm_silence_logging=1 "$rvm_scripts_path/gemsets" list strings | __rvm_sed "s/ (default)//; s/^/$current_ruby${rvm_gemset_separator:-@}/ ; s/@default// ;"
;;
current)
__rvm_env_string
;;
aliases)
__rvm_awk -F= '{print $string}' < "$rvm_path/config/alias"
;;
*)
__rvm_ruby_strings_exist $( echo "$string" | \tr "," "\n" | __rvm_strip )
;;
esac
}
__rvm_export ()
{
typeset name;
name=${1%%\=*};
builtin export rvm_old_$name=${!name};
export "$@";
return $?
}
__rvm_find ()
{
\find "$@" || return $?
}
__rvm_find_first_file ()
{
typeset _first_file _variable_first_file __file_enum;
_first_file="";
_variable_first_file="$1";
shift;
for __file_enum in "$@";
do
if [[ -f "$__file_enum" ]]; then
eval "$_variable_first_file=\"\$__file_enum\"";
return 0;
fi;
done;
eval "$_variable_first_file=\"\"";
return 1
}
__rvm_fix_group_permissions ()
{
if umask -S | __rvm_grep 'g=rw' > /dev/null; then
chmod -R g+rwX "$@";
fi
}
__rvm_fix_path_from_gem_path ()
{
[[ -n "${GEM_PATH:-}" ]] || return 0;
export PATH;
typeset IFS _iterator_path;
typeset -a _gem_path _new_path;
IFS=:;
_gem_path=();
_new_path=();
__rvm_custom_separated_array _gem_path : "${GEM_PATH}";
for _iterator_path in "${_gem_path[@]}";
do
_new_path+=("${_iterator_path}/bin");
done;
_new_path+=("${MY_RUBY_HOME:-${GEM_HOME/gems/rubies}}/bin");
_new_path+=("${rvm_bin_path}");
PATH="${_new_path[*]}:$PATH";
builtin hash -r
}
__rvm_fix_selected_ruby ()
{
typeset __ret=0;
if (( $# )); then
"$@" || __ret=$?;
fi;
[[ -d "$GEM_HOME" && -d "$MY_RUBY_HOME" ]] || {
if [[ -d ${MY_RUBY_HOME%/*}/defaul ]]; then
__rvm_use default;
else
__rvm_use system;
fi
}
}
__rvm_fold ()
{
if fold -s -w 10 <<< bla > /dev/null; then
fold -s -w $1;
else
fold -w $1;
fi
}
__rvm_gemset_clear ()
{
export rvm_gemset_name;
rvm_gemset_name="";
__rvm_use
}
__rvm_gemset_handle_default ()
{
rvm_gemset_name="@${rvm_gemset_name:-}@";
rvm_gemset_name="${rvm_gemset_name/@default@/@@}";
rvm_gemset_name="${rvm_gemset_name#@}";
rvm_gemset_name="${rvm_gemset_name%@}"
}
__rvm_gemset_pristine ()
{
__rvm_log_command "gemset.pristine-$1" "Making gemset $1 pristine." __rvm_with "$1" "$rvm_scripts_path/gemsets" pristine
}
__rvm_gemset_select ()
{
__rvm_gemset_select_only && __rvm_gemset_select_validation && __rvm_gemset_select_ensure
}
__rvm_gemset_select_cli ()
{
__rvm_gemset_select_cli_validation && __rvm_gemset_select
}
__rvm_gemset_select_cli_validation ()
{
typeset orig_gemset;
if ! builtin command -v gem > /dev/null; then
rvm_log "'gem' command not found, cannot select a gemset.";
return 0;
fi;
orig_gemset="${rvm_gemset_name:-}";
__rvm_gemset_handle_default;
if [[ -z "${rvm_gemset_name:-}" && "$orig_gemset" != "default" && ${rvm_sticky_flag:-0} -eq 1 ]]; then
if [[ -n "${rvm_ruby_gem_home:-}" ]]; then
rvm_gemset_name="$rvm_ruby_gem_home";
else
if [[ -n "${GEM_HOME:-}" ]]; then
rvm_gemset_name="$GEM_HOME";
fi;
fi;
rvm_gemset_name="${rvm_gemset_name##*/}";
rvm_gemset_name="${rvm_gemset_name#*${rvm_gemset_separator:-"@"}}";
fi;
if [[ -z "${rvm_ruby_string:-}" && -n "${GEM_HOME:-}" && -n "${GEM_HOME%@*}" ]]; then
rvm_ruby_string="${GEM_HOME%@*}";
rvm_ruby_string="${rvm_ruby_string##*/}";
fi;
if [[ -z "${rvm_ruby_string:-}" ]]; then
rvm_error "Gemsets can not be used with non rvm controlled rubies (currently).";
return 3;
fi
}
__rvm_gemset_select_ensure ()
{
\mkdir -p "$rvm_ruby_gem_home";
if __rvm_using_gemset_globalcache && [[ ! -L "$rvm_ruby_gem_home/cache" ]]; then
: rvm_gems_cache_path:${rvm_gems_cache_path:=${rvm_gems_path:-"$rvm_path/gems"}/cache};
\mv "$rvm_ruby_gem_home/cache/"*.gem "$rvm_gems_cache_path/" 2> /dev/null;
__rvm_rm_rf "$rvm_ruby_gem_home/cache";
\ln -fs "$rvm_gems_cache_path" "$rvm_ruby_gem_home/cache";
fi
}
__rvm_gemset_select_only ()
{
rvm_ruby_gem_home="${rvm_gems_path:-"$rvm_path/gems"}/$rvm_ruby_string";
: rvm_ignore_gemsets_flag:${rvm_ignore_gemsets_flag:=0}:;
if (( rvm_ignore_gemsets_flag )); then
rvm_ruby_global_gems_path="${rvm_ruby_gem_home}";
rvm_ruby_gem_path="${rvm_ruby_gem_home}";
rvm_gemset_name="";
else
rvm_ruby_global_gems_path="${rvm_ruby_gem_home}${rvm_gemset_separator:-"@"}global";
__rvm_gemset_handle_default;
[[ -z "$rvm_gemset_name" ]] || rvm_ruby_gem_home="${rvm_ruby_gem_home}${rvm_gemset_separator:-"@"}${rvm_gemset_name}";
if [[ "$rvm_gemset_name" == "global" ]]; then
rvm_ruby_gem_path="${rvm_ruby_gem_home}";
else
rvm_ruby_gem_path="${rvm_ruby_gem_home}:${rvm_ruby_global_gems_path}";
fi;
fi;
if [[ -n "${rvm_gemset_name}" ]]; then
rvm_env_string="${rvm_ruby_string}@${rvm_gemset_name}";
else
rvm_env_string=${rvm_ruby_string};
fi;
true
}
__rvm_gemset_select_validation ()
{
if [[ ! -d "${rvm_ruby_gem_home}" ]]; then
if (( ${rvm_gemset_create_on_use_flag:=0} == 0 && ${rvm_create_flag:=0} == 0 && ${rvm_delete_flag:=0} == 0 )); then
rvm_expected_gemset_name="${rvm_gemset_name}";
rvm_gemset_name="";
__rvm_gemset_select_only;
return 2;
fi;
else
if (( ${rvm_delete_flag:=0} == 1 )); then
return 4;
fi;
fi;
case "${rvm_gemset_name}" in
*/*)
rvm_error "Gemsets can not contain path separator '/'.";
return 5
;;
*:*)
rvm_error "Gemsets can not contain PATH separator ':'.";
return 5
;;
esac;
typeset rvm_ruby_gem_home_254;
if [[ -n "${ZSH_VERSION:-}" ]]; then
rvm_ruby_gem_home_254="${rvm_ruby_gem_home[0,254]}";
else
rvm_ruby_gem_home_254="${rvm_ruby_gem_home:0:254}";
fi;
if [[ "${rvm_ruby_gem_home}" != "${rvm_ruby_gem_home_254}" ]]; then
rvm_error "Gemset gem home to long ${#rvm_ruby_gem_home}.";
return 6;
fi
}
__rvm_gemset_use ()
{
if __rvm_gemset_select_cli; then
rvm_log "Using $rvm_ruby_string with gemset ${rvm_gemset_name:-default}";
__rvm_use;
else
if [[ ! -d "$rvm_ruby_gem_home" || -n "${rvm_expected_gemset_name}" ]]; then
if (( ${rvm_gemset_create_on_use_flag:=0} == 1 || ${rvm_create_flag:=0} == 1 )); then
rvm_warn "gemset $rvm_gemset_name is not existing, creating.";
"$rvm_scripts_path/gemsets" create "$rvm_gemset_name";
else
rvm_error "Gemset '${rvm_expected_gemset_name}' does not exist, 'rvm $rvm_ruby_string do rvm gemset create ${rvm_expected_gemset_name}' first, or append '--create'.";
return 2;
fi;
else
rvm_error "Gemset was not given.\n Usage:\n rvm gemset use <gemsetname>\n";
return 1;
fi;
fi
}
__rvm_gemsets_initial ()
{
if (( ${rvm_skip_gemsets_flag:-0} == 0 )); then
__rvm_log_command "gemsets.initial" "$rvm_ruby_string - #importing default gemsets, this may take time" __rvm_with "$rvm_ruby_string" "$rvm_scripts_path/gemsets" initial;
else
mkdir -p "$rvm_gems_path/$rvm_ruby_string/bin" "$rvm_gems_path/$rvm_ruby_string@global/bin";
rvm_log "Skipped importing default gemsets";
fi
}
__rvm_generate_wrappers ()
{
"$rvm_scripts_path/wrapper" "$rvm_ruby_string" --no-links --all
}
__rvm_get_user_shell ()
{
case "$(uname)" in
*BSD | Linux | SunOS | DragonFly)
__rvm_awk -F: "/$USER/"'{print $NF}' < /etc/passwd || {
rvm_error "Error checking user shell via /etc/passwd - make sure this file is world readable.";
return 2
}
;;
Darwin)
typeset __version;
__version="$(dscl localhost -read "/Local/Default/Users/$USER" shell)" || {
rvm_error "Error checking user shell via dscl ... something went wrong, report a bug.";
return 3
};
echo ${__version#*: }
;;
*)
rvm_error "Do not know how to check user shell on '$(uname)'.";
return 1
;;
esac
}
__rvm_grep ()
{
GREP_OPTIONS="" \grep "$@" || return $?
}
__rvm_has_opt ()
{
if [[ -n "${ZSH_VERSION}" ]] && setopt | GREP_OPTIONS="" \grep "^${1}$" > /dev/null 2>&1; then
return 0;
else
if [[ -n "${BASH_VERSION}" ]] && [[ ":$SHELLOPTS:" =~ ":${1}:" ]]; then
return 0;
else
return 1;
fi;
fi
}
__rvm_initialize ()
{
true ${rvm_scripts_path:="$rvm_path/scripts"};
source "$rvm_scripts_path/base";
__rvm_clean_path;
__rvm_conditionally_add_bin_path;
export PATH;
if [[ ! -d "${rvm_tmp_path:-/tmp}" ]]; then
command mkdir -p "${rvm_tmp_path}";
fi;
return 0
}
__rvm_join_array ()
{
typeset IFS;
IFS="$2";
eval "$1=\"\${$3[*]}\""
}
__rvm_load_environment ()
{
typeset string __hook;
string="$1";
if [[ -f "$rvm_environments_path/$string" ]]; then
__rvm_remove_rvm_from_path;
\. "$rvm_environments_path/$string";
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*;
do
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]; then
\. "${__hook}" || true;
fi;
done;
builtin hash -r;
else
if [[ -n "$string" ]]; then
rvm "$string";
else
:;
fi;
fi
}
__rvm_load_project_config ()
{
typeset __gemfile __gem_names _gem _bundle_install __env_vars_prefix __env_vars_file;
__gemfile="";
__gem_names="";
__env_vars_file="";
: rvm_autoinstall_bundler_flag:${rvm_autoinstall_bundler_flag:=0};
case "$1" in
*/.rvmrc)
__rvmrc_warning_display_for_rvmrc "$1";
if __rvm_check_rvmrc_trustworthiness "$1"; then
__rvm_remove_rvm_from_path;
__rvm_conditionally_add_bin_path;
rvm_previous_environment="$(__rvm_env_string)";
rvm_current_rvmrc="$1";
__rvm_ensure_is_a_function;
unset GEM_HOME GEM_PATH;
rvm_ruby_string="${rvm_previous_environment/system/default}" rvm_action=use source "$1";
else
return $?;
fi
;;
*/.versions.conf)
__rvm_ensure_is_a_function;
rvm_previous_environment="$(__rvm_env_string)";
rvm_current_rvmrc="$1";
rvm_ruby_string="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^ruby=/ {s/ruby=//;p;}' )";
[[ -n "${rvm_ruby_string}" ]] || return 2;
rvm_gemset_name="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^ruby-gemset=/ {s/ruby-gemset=//;p;}' )";
rvm_create_flag=1 __rvm_use || return 3;
__env_vars_prefix="env-";
__env_vars_file="$1";
__gem_names="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^ruby-gem-install=/ {s/ruby-gem-install=//;p;}' )";
if [[ -z "${__gem_names:-}" ]]; then
__gem_names=bundler;
else
if [[ ! ",${__gem_names:-}," =~ ",bundler," ]]; then
__gem_names="${__gem_names:-},bundler";
fi;
fi;
_bundle_install="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^ruby-bundle-install=/ {s/ruby-bundle-install=//;p;}' )";
if [[ -n "${_bundle_install}" ]] || [[ "${rvm_autoinstall_bundler_flag:-0}" == 1 ]]; then
if [[ "${_bundle_install}" == true ]]; then
__gemfile="${1%/*}/Gemfile";
else
if [[ -f "${_bundle_install}" ]]; then
__gemfile="${_bundle_install}";
else
if [[ "${rvm_autoinstall_bundler_flag:-0}" == 1 ]]; then
__gemfile="${1%/*}/Gemfile";
fi;
fi;
fi;
fi
;;
*/Gemfile)
__rvm_ensure_is_a_function;
rvm_previous_environment="$(__rvm_env_string)";
rvm_current_rvmrc="$1";
rvm_ruby_string="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^#ruby=/ {s/#ruby=//;p;}' )";
[[ -n "${rvm_ruby_string}" ]] || {
rvm_ruby_string="$( \tr -d '\r' <"$1" | __rvm_sed -n "s/ rescue nil$//; /^\s*ruby/ {s/^\s*ruby//; s/[ ()'\"]//g; p;}" )";
[[ -n "${rvm_ruby_string}" ]] || return 2
};
rvm_gemset_name="$( \tr -d '\r' <"$1" | __rvm_sed -n '/^#ruby-gemset=/ {s/#ruby-gemset=//;p;}' )";
__rvmrc_warning_display_for_Gemfile "$1";
rvm_create_flag=1 __rvm_use || return 3;
__env_vars_prefix="#ruby-env-";
__env_vars_file="$1";
if [[ "${rvm_autoinstall_bundler_flag:-0}" == "1" ]]; then
__gemfile="$1";
__gem_names=bundler;
fi
;;
*/.ruby-version | */.rbfu-version | */.rbenv-version)
__rvm_ensure_is_a_function;
rvm_previous_environment="$(__rvm_env_string)";
rvm_current_rvmrc="$1";
rvm_ruby_string="$( \tr -d '\r' <"$1" )";
[[ -n "${rvm_ruby_string}" ]] || return 2;
if [[ -f "${1%/*}/.ruby-gemset" ]]; then
rvm_gemset_name="$( \tr -d '\r' <"${1%/*}/.ruby-gemset" )";
fi;
rvm_create_flag=1 __rvm_use || return 3;
if [[ -f "${1%/*}/.ruby-env" ]]; then
__env_vars_prefix="";
__env_vars_file="${1%/*}/.ruby-env";
else
if [[ -f "${1%/*}/.rbenv-vars" ]]; then
__env_vars_prefix="";
__env_vars_file="${1%/*}/.rbenv-vars";
fi;
fi;
if [[ "${rvm_autoinstall_bundler_flag:-0}" == 1 && -f "${1%/*}/Gemfile" ]]; then
__gemfile="${1%/*}/Gemfile";
__gem_names=bundler;
fi
;;
*)
rvm_error "Unsupported file format for '$1'";
return 1
;;
esac;
if [[ -n "${__env_vars_file:-}" && -f "${__env_vars_file:-}" ]]; then
__rvm_project_ruby_env_load "${__env_vars_file:-}" "${__env_vars_prefix:-}";
fi;
for _gem in ${__gem_names//,/ };
do
gem list | __rvm_grep "^${_gem} " > /dev/null || gem install "${_gem}";
done;
if [[ -n "${__gemfile:-}" && -f "${__gemfile:-}" ]]; then
bundle install --gemfile="${__gemfile}" | __rvm_grep -vE '^Using|Your bundle is complete';
fi
}
__rvm_load_rvmrc ()
{
typeset _file;
typeset -a rvm_rvmrc_files;
if (( ${rvm_ignore_rvmrc:=0} == 1 )); then
return 0;
fi;
[[ -n "${rvm_stored_umask:-}" ]] || export rvm_stored_umask=$(umask);
rvm_rvmrc_files=("/etc/rvmrc" "$HOME/.rvmrc");
if [[ -n "${rvm_prefix:-}" ]] && ! [[ "$HOME/.rvmrc" -ef "${rvm_prefix}/.rvmrc" ]]; then
rvm_rvmrc_files+=("${rvm_prefix}/.rvmrc");
fi;
for _file in "${rvm_rvmrc_files[@]}";
do
if [[ -s "$_file" ]]; then
if __rvm_grep '^\s*rvm .*$' "$_file" > /dev/null 2>&1; then
rvm_error "
$_file is for rvm settings only.
rvm CLI may NOT be called from within $_file.
Skipping the loading of $_file
";
return 1;
else
source "$_file";
fi;
fi;
done;
return 0
}
__rvm_log_command ()
{
typeset name message _log _command_start _command_name;
typeset -a _command;
name="${1:-}";
message="${2:-}";
shift 2;
_command=("$@");
_command_start="$1";
while (( $# )) && [[ "$1" =~ "=" ]]; do
shift;
done;
_command_name="$1";
[[ ! "${_command_start}" =~ "=" ]] || _command=("env" "${_command[@]}");
(( ${rvm_niceness:-0} == 0 )) || _command=(nice -n $rvm_niceness "${_command[@]}");
__rvm_log_command_caclulate_log_file_name;
rvm_debug "Log file: ${_log}";
[[ -d "${_log%\/*}" ]] || \mkdir -p "${_log%\/*}";
[[ -f "${_log}" ]] || \rm -f "${_log}";
{
printf "%b" "[$(date +'%Y-%m-%d %H:%M:%S')] ${_command_name}\n";
if is_a_function "${_command_name}"; then
typeset -f "${_command_name}";
fi;
printf "%b" "current path: $PWD\n";
printf "%b" "command(${#_command[@]}): ${_command[*]}\n"
} | tee "${_log}" | rvm_debug_stream;
__rvm_log_dotted "${_log}" "$message" "${_command[@]}" || {
typeset result=$?;
rvm_error "Error running '${_command[*]}',
please read ${_log}";
return ${result}
}
}
__rvm_log_command_caclulate_log_file_name ()
{
[[ -n "${rvm_log_timestamp:-}" ]] || __rvm_log_command_caclulate_log_timestamp;
[[ -n "${rvm_log_filesystem:-}" ]] || __rvm_log_command_caclulate_log_filesystem;
[[ -n "${rvm_log_namelen:-}" ]] || __rvm_log_command_caclulate_log_namelen;
name="${name//[ \/]/_}";
_log="${rvm_log_path}/${rvm_log_timestamp}${rvm_ruby_string:+_}${rvm_ruby_string:-}/${name}";
if [[ -n "${ZSH_VERSION:-}" ]]; then
_log="${_log[0,${rvm_log_namelen}]}.log";
else
_log="${_log:0:${rvm_log_namelen}}.log";
fi
}
__rvm_log_command_caclulate_log_filesystem ()
{
export rvm_log_filesystem="$(
mount | __rvm_awk -v rvm_path=$rvm_path '
BEGIN{longest=""; fstype=""}
{if (index(rvm_path,$3)==1 && length($3)>length(longest)){longest=$3; fstype=$5}}
END{print fstype}
'
)";
rvm_debug "Log filesystem: ${rvm_log_filesystem}"
}
__rvm_log_command_caclulate_log_namelen ()
{
case "${rvm_log_filesystem}" in
ecryptfs)
export rvm_log_namelen=138
;;
*)
export rvm_log_namelen=250
;;
esac;
rvm_debug "Log max name length: ${rvm_log_namelen}"
}
__rvm_log_command_caclulate_log_timestamp ()
{
export rvm_log_timestamp="$(date "+%s")";
rvm_debug "Log prefix: ${rvm_log_path}/${rvm_log_timestamp}${rvm_ruby_string:+_}${rvm_ruby_string:-}/"
}
__rvm_log_dotted ()
{
typeset __log_file __message __iterator;
__log_file="$1";
__message="$2";
shift 2;
if [[ -n "${ZSH_VERSION:-}" ]]; then
rvm_log "${__message} - using Zsh, can not show progress, be patient...";
"$@" > "${__log_file}" 2>&1 || return $?;
else
"$@" 2>&1 | tee -a "${__log_file}" | __rvm_dotted "${__message}";
__rvm_check_pipestatus ${PIPESTATUS[@]} ${pipestatus[@]} || return $?;
fi
}
__rvm_make ()
{
\make "$@" || return $?
}
__rvm_md5_calculate ()
{
typeset _sum;
if builtin command -v md5 > /dev/null 2>&1; then
_sum=$(md5 "$@");
echo ${_sum##* };
return 0;
else
if builtin command -v md5sum > /dev/null 2>&1; then
_sum=$(md5sum "$@");
echo ${_sum%% *};
return 0;
else
for _path in /usr/gnu/bin /sbin /bin /usr/bin /usr/sbin;
do
if [[ -x "${_path}/md5" ]]; then
_sum=$(${_path}/md5 "$@");
echo ${_sum##* };
return 0;
else
if [[ -x "${_path}/md5sum" ]]; then
_sum=$(${_path}/md5sum "$@");
echo ${_sum%% *};
return 0;
fi;
fi;
done;
fi;
fi;
rvm_error "Neither md5sum nor md5 found in the PATH";
return 1
}
__rvm_md5_for_contents ()
{
if builtin command -v md5 > /dev/null; then
md5 | __rvm_awk '{print $1}';
else
if builtin command -v md5sum > /dev/null; then
md5sum | __rvm_awk '{print $1}';
else
if builtin command -v openssl > /dev/null; then
openssl md5 | __rvm_awk '{print $1}';
else
return 1;
fi;
fi;
fi;
true
}
__rvm_meta ()
{
rvm_meta_author="Wayne E. Seguin";
rvm_meta_author_email="wayneeseguin@gmail.com";
rvm_meta_authors=("Wayne E. Seguin <wayneeseguin@gmail.com>" "Michal Papis <mpapis@gmail.com>");
rvm_meta_website="https://rvm.io/";
rvm_meta_version="${rvm_version}"
}
__rvm_nuke_rvm_variables ()
{
unset rvm_head_flag $(env | __rvm_awk -F= '/^rvm_/{print $1" "}')
}
__rvm_package_create ()
{
rvm_debug __rvm_package_create:$#: "$@";
case "$1" in
*.tar.bz2)
if [[ -z "${3:-}" ]]; then
${rvm_tar_command:-tar} cjf "$1" "$2";
else
${rvm_tar_command:-tar} cjf "$1" -C "$2" "$3";
fi
;;
*.tar.gz | *.tgz)
if [[ -z "${3:-}" ]]; then
${rvm_tar_command:-tar} czf "$1" "$2";
else
${rvm_tar_command:-tar} czf "$1" -C "$2" "$3";
fi
;;
*)
return 199
;;
esac
}
__rvm_package_extract ()
{
rvm_debug __rvm_package_extract:$#: "$@";
typeset __tempdir __path __file __return;
__return=0;
__tempdir="$( TMPDIR="${rvm_tmp_path}" mktemp -d -t rvm-tmp.XXXXXXXXX )";
__rvm_package_extract_run "$1" "$__tempdir" || __return=$?;
if (( __return == 0 )); then
for __path in "$__tempdir"/*;
do
__file="${__path##*/}";
if [[ -n "${__file}" && -e "$2/${__file}" ]]; then
\rm -rf "$2/${__file}" || __return=$?;
fi;
\mv -f "${__path}" "$2/" || __return=$?;
done;
fi;
if [[ -n "$__tempdir" ]]; then
\rm -rf "$__tempdir";
fi;
return $__return
}
__rvm_package_extract_run ()
{
[[ -d "$2" ]] || mkdir -p "$2";
case "$1" in
*.zip)
unzip -q -o "$1" -d "$2"
;;
*.tar.bz2)
if [[ -n "$ZSH_VERSION" ]]; then
${rvm_tar_command:-tar} xjf "$1" -C "$2" ${=rvm_tar_options:-};
else
${rvm_tar_command:-tar} xjf "$1" -C "$2" ${rvm_tar_options:-};
fi
;;
*.tar.gz | *.tgz)
if [[ -n "$ZSH_VERSION" ]]; then
${rvm_tar_command:-tar} xzf "$1" -C "$2" ${=rvm_tar_options:-};
else
${rvm_tar_command:-tar} xzf "$1" -C "$2" ${rvm_tar_options:-};
fi
;;
*)
return 199
;;
esac && __rvm_fix_group_permissions "$2"/* || return $?
}
__rvm_package_list ()
{
rvm_debug __rvm_package_list:$#: "$@";
case "$1" in
*.zip)
unzip -Z -1 "$1"
;;
*.tar.bz2)
${rvm_tar_command:-tar} tjf "$1"
;;
*.tar.gz | *.tgz)
${rvm_tar_command:-tar} tzf "$1"
;;
*)
return 199
;;
esac
}
__rvm_pager_or_cat_v ()
{
eval "${PAGER:-\cat -v} '$1'"
}
__rvm_parse_args ()
{
typeset _string;
export rvm_ruby_string;
rvm_action="${rvm_action:-""}";
rvm_parse_break=0;
if [[ " $* " =~ " --trace " ]]; then
echo "$@";
__rvm_version;
fi;
while [[ -n "$next_token" ]]; do
rvm_token="$next_token";
if (( $# > 0 )); then
next_token="$1";
shift;
else
next_token="";
fi;
case "$rvm_token" in
[[:alnum:]]* | @*)
case "$rvm_token" in
use)
rvm_action="$rvm_token";
rvm_verbose_flag=1
;;
install | uninstall | reinstall | try_install)
export ${rvm_token}_flag=1;
rvm_action=$rvm_token
;;
gemset)
rvm_action=$rvm_token;
rvm_ruby_gem_home="${GEM_HOME:-""}";
rvm_ruby_args=();
__rvm_parse_args_find_known_flags rvm_ruby_args "$next_token" "$@";
: rvm_ruby_args:${#rvm_ruby_args[@]}:${rvm_ruby_args[*]}:;
next_token="${rvm_ruby_args[__array_start]}";
rvm_gemset_name="${rvm_ruby_args[__array_start+1]}";
case "${next_token:-help}" in
help)
true
;;
clear)
__rvm_gemset_clear
;;
use | delete)
[[ "delete" != "$next_token" ]] || rvm_delete_flag=1;
[[ "use" != "$next_token" ]] || rvm_action+="_$next_token";
case "$rvm_gemset_name" in
*${rvm_gemset_separator:-"@"}*)
rvm_ruby_string="${rvm_gemset_name%%${rvm_gemset_separator:-"@"}*}";
rvm_gemset_name="${rvm_gemset_name##*${rvm_gemset_separator:-"@"}}";
if [[ "${rvm_ruby_string:-""}" != "${rvm_gemset_name:-""}" ]]; then
rvm_ruby_string="$rvm_ruby_string${rvm_gemset_separator:-"@"}$rvm_gemset_name";
fi;
rvm_ruby_gem_home="$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}$rvm_gemset_name"
;;
"")
rvm_error "Gemset was not given.\n Usage:\n rvm gemset $rvm_gemset_name <gemsetname>\n";
return 1
;;
esac
;;
esac;
rvm_parse_break=1
;;
gemdir | gempath | gemhome)
rvm_ruby_args=("$rvm_token");
rvm_action="gemset";
rvm_gemdir_flag=1;
if [[ "system" == "$next_token" ]]; then
rvm_system_flag=1;
next_token="${1:-}";
(( $# == 0 )) || shift;
fi;
if [[ "user" == "$next_token" ]]; then
rvm_user_flag=1;
next_token="${1:-}";
(( $# == 0 )) || shift;
fi
;;
pkg)
rvm_action="$rvm_token";
__rvm_parse_args_find_known_flags rvm_ruby_args "$next_token" "$@";
rvm_parse_break=1
;;
do | exec)
if [[ -z "$next_token" ]]; then
rvm_action="error";
rvm_error_message="'rvm $rvm_token' must be followed by arguments.";
break;
fi;
rvm_action="do";
rvm_ruby_args=("$next_token" "$@");
rvm_parse_break=1
;;
gem | rake | ruby)
[[ "$rvm_token" == "ruby" ]] && case $rvm_action in
install | reinstall | use | remove)
rvm_ruby_string=ruby;
rvm_ruby_strings=ruby;
continue
;;
esac;
rvm_action=error;
rvm_error_message="Please note that \`rvm $rvm_token ...\` was removed, try \`$rvm_token $next_token $*\` or \`rvm all do $rvm_token $next_token $*\` instead."
;;
fetch | version | srcdir | reset | debug | reload | update | monitor | notes | implode | seppuku | question | answer | env | unexport | automount | prepare)
rvm_action=$rvm_token
;;
doctor)
rvm_action=notes
;;
mount)
rvm_action=$rvm_token;
while [[ -n "${next_token:-}" ]] && [[ -x "${next_token:-}" || -d "${next_token:-}" || "${next_token:-}" =~ ^http || "${next_token:-}" =~ tar.bz2$ ]]; do
rvm_ruby_args=("$next_token" "${rvm_ruby_args[@]}");
next_token="${1:-}";
(( $# == 0 )) || shift;
done
;;
rm | remove)
rvm_action="remove";
rvm_remove_flag=1
;;
rtfm | RTFM | rvmrc | usage | help | inspect | list | ls | info | strings | get | current | docs | alias | rubygems | cleanup | tools | disk-usage | snapshot | repair | migrate | downgrade | upgrade | cron | group | switch | which | config-get | requirements | autolibs | osx-ssl-certs | fix-permissions)
case "$rvm_token" in
downgrade)
rvm_action="upgrade"
;;
ls)
rvm_action="list"
;;
usage)
rvm_action="help"
;;
RTFM)
rvm_action="rtfm"
;;
*)
rvm_action="$rvm_token"
;;
esac;
rvm_ruby_args=();
__rvm_parse_args_find_known_flags rvm_ruby_args "$next_token" "$@";
rvm_parse_break=1
;;
user)
rvm_action="tools";
rvm_ruby_args=("$rvm_token" "$next_token" "$@");
rvm_parse_break=1
;;
load-rvmrc)
rvm_action="rvmrc";
rvm_ruby_args=("load" "$next_token" "$@");
rvm_parse_break=1
;;
benchmark | bench)
rvm_action="benchmark"
;;
specs | tests)
rvm_action="rake";
rvm_ruby_args=("${rvm_token/%ss/s}")
;;
export)
if [[ -n "$next_token" ]]; then
rvm_export_args="$next_token$@";
rvm_action="export";
rvm_parse_break=1;
else
rvm_action="error";
rvm_error_message="rvm export must be followed by a NAME=VALUE argument";
fi
;;
alt*)
rvm_action="help";
rvm_ruby_args=("alt.md");
rvm_parse_break=1
;;
wrapper)
rvm_action="wrapper";
rvm_ruby_string="$next_token";
rvm_wrapper_name="$1";
(( $# == 0 )) || shift;
rvm_ruby_args=("$@");
rvm_parse_break=1
;;
reboot | damnit | wtf | argh | BOOM | boom | wth)
rvm_action="reboot"
;;
in)
rvm_token="${next_token}";
next_token="${1:-}";
(( $# == 0 )) || shift;
if __rvm_project_dir_check "$rvm_token"; then
export rvm_in_flag="$rvm_token";
__rvm_rvmrc_tools try_to_read_ruby $rvm_token;
else
export "rvm_in_flag"=1;
fi
;;
*,*)
rvm_ruby_strings="$rvm_token";
[[ -n "${rvm_action:-""}" ]] || rvm_action="ruby"
;;
${rvm_gemset_separator:-"@"}*)
rvm_action="${rvm_action:-use}";
rvm_gemset_name="${rvm_token/*${rvm_gemset_separator:-"@"}/}";
rvm_ruby_string="${rvm_ruby_string:-""}";
rvm_ruby_strings="${rvm_ruby_string}${rvm_gemset_separator:-"@"}${rvm_gemset_name}"
;;
*${rvm_gemset_separator:-"@"}*)
rvm_action="${rvm_action:-use}";
rvm_gemset_name="${rvm_token/*${rvm_gemset_separator:-"@"}/}";
rvm_ruby_string="$rvm_token";
rvm_ruby_strings="$rvm_token"
;;
*+*)
rvm_action="${rvm_action:-use}";
rvm_ruby_alias="${rvm_token/*+/}";
rvm_ruby_string="${rvm_token/+*/}";
rvm_ruby_strings="$rvm_ruby_string"
;;
*-* | +([[:digit:]]).+([[:digit:]])*)
rvm_action="${rvm_action:-use}";
rvm_ruby_string="$rvm_token";
rvm_ruby_strings="$rvm_token"
;;
opal* | jruby* | ree* | kiji* | macruby* | rbx* | rubinius* | goruby | mruby | ironruby* | default* | maglev* | topaz* | tcs* | jamesgolick* | ruby* | system | default | all)
rvm_action="${rvm_action:-use}";
case "$rvm_token" in
rubinius)
rvm_token="rbx"
;;
esac;
rvm_ruby_interpreter="$rvm_token";
rvm_ruby_string="$rvm_token";
rvm_ruby_strings="$rvm_token"
;;
old)
case "${rvm_action:-action-missing}" in
remove)
rvm_ruby_strings="old:${next_token:-}";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
action-missing)
rvm_error_message="what do you want to do with old rubies? rvm can only remove old rubies.";
rvm_action="error"
;;
*)
rvm_error_message="rvm can not $rvm_action old rubies, rvm can only remove old rubies.";
rvm_action="error"
;;
esac
;;
*.rb)
rvm_ruby_args=("$rvm_token");
rvm_ruby_file="$rvm_token";
if [[ -z "${rvm_action:-""}" || "$rvm_action" == "use" ]]; then
rvm_action="ruby";
fi
;;
*.gems)
rvm_file_name="${rvm_token}"
;;
"")
rvm_action="error";
rvm_error_message="Unrecognized command line argument(s): '$@'"
;;
*)
if [[ "gemset" == "$rvm_action" ]]; then
rvm_gemset_name="${rvm_token/.gems/}";
rvm_file_name="$rvm_gemset_name.gems";
else
if [[ -f "$rvm_rubies_path/$rvm_token" || -L "$rvm_rubies_path/$rvm_token" ]]; then
rvm_ruby_string=$rvm_token;
rvm_ruby_strings="$rvm_token";
rvm_action="${rvm_action:-use}";
else
if __rvm_project_dir_check "$rvm_token"; then
__rvm_rvmrc_tools try_to_read_ruby $rvm_token;
else
rvm_action="error";
rvm_error_message="Unrecognized command line argument: '$rvm_token'";
fi;
fi;
fi
;;
esac
;;
-*)
case "$rvm_token" in
-S)
rvm_action="ruby";
rvm_ruby_args=("$rvm_token" "$next_token" "$@");
rvm_parse_break=1
;;
-e)
rvm_action="ruby";
IFS="\n";
rvm_ruby_args=("$rvm_token" "'$next_token $@'");
IFS=" ";
rvm_parse_break=1
;;
-v | --version)
if [[ -z "$next_token" ]]; then
rvm_action="version";
else
rvm_ruby_version="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift;
fi
;;
-n | --name)
rvm_ruby_name="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--branch)
rvm_ruby_repo_branch="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_disable_binary_flag=1
;;
--repository | --repo | --url)
rvm_ruby_repo_url="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_disable_binary_flag=1
;;
-r | --remote | --binary | --latest-binary)
rvm_remote_flag=1;
if [[ "$rvm_token" == "--latest-binary" ]]; then
rvm_latest_binary_flag=1;
fi;
while [[ -n "${next_token:-}" ]] && [[ "${next_token:-}" =~ ^http || "${next_token:-}" =~ tar.bz2$ || "${next_token:-}" =~ ":" ]]; do
rvm_ruby_args=("${rvm_ruby_args[@]}" "$next_token");
next_token="${1:-}";
(( $# == 0 )) || shift;
done
;;
--ree-options)
if [[ -n "$next_token" ]]; then
__rvm_custom_separated_array rvm_ree_options , "${next_token}";
next_token="${1:-}";
(( $# == 0 )) || shift;
else
rvm_action="error";
rvm_error_message="--ree-options *must* be followed by... well... comma,separated,list,of,options.";
fi
;;
--patches | --patch)
export -a rvm_patch_names;
__rvm_custom_separated_array rvm_patch_names , "$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_patch_original_pwd="$PWD";
rvm_disable_binary_flag=1
;;
--arch | --archflags)
rvm_architectures+=("${next_token#-arch }");
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_disable_binary_flag=1
;;
--with-arch=*)
rvm_architectures+=("${rvm_token#--with-arch=}");
rvm_disable_binary_flag=1
;;
--32 | --64)
rvm_architectures+=("${rvm_token#--}");
rvm_disable_binary_flag=1
;;
--universal)
rvm_architectures+=("32" "64");
rvm_disable_binary_flag=1
;;
--bin)
if [[ "update" == "${rvm_action:-""}" ]]; then
rvm_bin_flag=1;
else
rvm_bin_path="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift;
fi
;;
--rdoc | --yard)
rvm_docs_type="$rvm_token";
rvm_docs_type
;;
-f | --file)
rvm_action="ruby";
rvm_ruby_file="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--passenger)
rvm_log "NOTE: If you are using Passenger 3 you no longer need the passenger_ruby,\nuse the wrapper script for your ruby instead (see 'rvm wrapper')";
rvm_wrapper_name="${rvm_token/--/}"
;;
--editor)
rvm_wrapper_name="${rvm_token/--/}"
;;
--symlink)
rvm_warn "--symlink has been removed, please see 'rvm wrapper'.";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
-h | --help)
rvm_action=help
;;
-l | --level)
rvm_ruby_patch_level="p$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--sha | --make | --make-install)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export "rvm_ruby_${rvm_token}"="$next_token";
next_token="${1:-}";
rvm_disable_binary_flag=1;
(( $# == 0 )) || shift
;;
--nice | --sdk | --autoconf-flags | --proxy)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export "rvm_${rvm_token}"="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--disable-llvm | --disable-jit)
rvm_llvm_flag=0
;;
--enable-llvm | --enable-jit)
rvm_llvm_flag=1
;;
--install)
rvm_install_on_use_flag=1
;;
--autolibs=*)
export rvm_autolibs_flag="${rvm_token#*=}"
;;
--color=*)
rvm_pretty_print_flag=${rvm_token#--color=}
;;
--pretty)
rvm_pretty_print_flag=auto
;;
--1.8 | --1.9 | --2.0 | --18 | --19 | --20)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//\./};
export "rvm_${rvm_token}_flag"=1;
rvm_disable_binary_flag=1
;;
--rvmrc | --versions-conf | --ruby-version)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export rvm_rvmrc_flag="${rvm_token}"
;;
--head | --static | --self | --gem | --reconfigure | --default | --force | --export | --summary | --latest | --yaml | --json | --archive | --shebang | --env | --path | --cron | --tail | --delete | --verbose | --import | --sticky | --create | --gems | --docs | --skip-autoreconf | --force-autoconf | --auto-dotfiles | --autoinstall-bundler | --disable-binary | --ignore-gemsets | --skip-gemsets | --debug | --quiet | --silent | --skip-openssl | --fuzzy | --quiet-curl)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export "rvm_${rvm_token}_flag"=1
;;
--auto)
export "rvm_auto_dotfiles_flag"=1;
rvm_warn "Warning, --auto is deprecated in favor of --auto-dotfiles."
;;
--rubygems)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export "rvm_${rvm_token}_version"="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--dump-environment | --verify-downloads | --max-time)
rvm_token=${rvm_token#--};
rvm_token=${rvm_token//-/_};
export "rvm_${rvm_token}_flag"="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
--clang)
export CC=clang
;;
-M)
if [[ -n "$next_token" ]]; then
__rvm_custom_separated_array rvm_make_flags , "${next_token}";
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_disable_binary_flag=1;
else
rvm_action="error";
rvm_error_message="--make *must* be followed by make flags.";
fi
;;
-j)
if [[ -n "$next_token" ]]; then
rvm_make_flags+=(-j$next_token);
next_token="${1:-}";
(( $# == 0 )) || shift;
else
rvm_action="error";
rvm_error_message="-j *must* be followed by an integer (normally the # of CPU's in your machine).";
fi
;;
--with-rubies)
rvm_ruby_strings="$next_token";
next_token="${1:-}";
(( $# == 0 )) || shift
;;
-C | --configure)
if [[ -n "$next_token" ]]; then
__rvm_custom_separated_array rvm_configure_flags , "${next_token}";
next_token="${1:-}";
(( $# == 0 )) || shift;
rvm_disable_binary_flag=1;
else
rvm_action="error";
rvm_error_message="--configure *must* be followed by configure flags.";
fi
;;
--movable)
rvm_movable_flag=1;
rvm_disable_binary_flag=1
;;
--with-* | --without-* | --enable-* | --disable-*)
rvm_configure_flags+=("$rvm_token");
rvm_disable_binary_flag=1
;;
--trace)
export rvm_trace_flag=1;
set -o xtrace;
[[ -n "${ZSH_VERSION:-""}" ]] || {
set -o errtrace;
export PS4="+ \$(date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
}
;;
--)
if [[ "${rvm_action}" == *install ]]; then
rvm_configure_flags+=("$next_token" "$@");
else
rvm_ruby_args=("$next_token" "$@");
fi;
rvm_disable_binary_flag=1;
rvm_parse_break=1
;;
*)
rvm_action="error";
rvm_error_message="Unrecognized command line flag: '$rvm_token'"
;;
esac
;;
*)
if __rvm_project_dir_check "$rvm_token"; then
__rvm_rvmrc_tools try_to_read_ruby "$rvm_token";
else
rvm_action="error";
rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'";
fi
;;
esac;
if [[ -z "${rvm_action:-""}" && -n "${rvm_ruby_string:-""}" ]]; then
rvm_action="use";
fi;
if [[ "error" == "${rvm_action:-""}" || ${rvm_parse_break:-0} -eq 1 || -n "${rvm_error_message:-""}" ]]; then
break;
fi;
done;
: rvm_ruby_args:${#rvm_ruby_args[@]}:${rvm_ruby_args[*]}:;
if [[ -n "${rvm_error_message:-""}" ]]; then
rvm_error "$rvm_error_message ( see: 'rvm usage' )";
unset rvm_error_message;
return 1;
fi
}
__rvm_parse_args_find_known_flags ()
{
typeset _args_array_name _temp_var;
typeset -a _new_args;
_args_array_name="$1";
(( $# == 0 )) || shift;
_new_args=();
while (( $# )); do
case "$1" in
--verify-downloads)
export "rvm_verify_downloads_flag"="${2:-}";
shift
;;
--force | --verbose | --debug | --quiet | --silent | --create)
export "rvm_${1#--}_flag=1"
;;
--only-path)
_temp_var="${1#--}";
export "rvm_${_temp_var//-/_}_flag=1"
;;
--32 | --64)
rvm_architectures+=("${1#--}");
rvm_disable_binary_flag=1
;;
--universal)
rvm_architectures+=("32" "64");
rvm_disable_binary_flag=1
;;
--patches | --patch)
export -a rvm_patch_names;
__rvm_custom_separated_array rvm_patch_names , "${2:-}";
rvm_patch_original_pwd="$PWD";
rvm_disable_binary_flag=1;
shift
;;
--autolibs=*)
export rvm_autolibs_flag="${1#*=}"
;;
--)
shift;
_new_args+=("$@");
shift $#
;;
*)
_new_args+=("$1")
;;
esac;
(( $# == 0 )) || shift;
done;
eval "${_args_array_name}+=( \"\${_new_args[@]}\" )"
}
__rvm_path_match_gem_home_check ()
{
(( ${rvm_silence_path_mismatch_check_flag:-0} == 0 )) || return 0;
[[ -n "${GEM_HOME:-}" ]] || return 0;
case "$PATH" in
$GEM_HOME/bin:*)
true
;;
*:$GEM_HOME/bin:*)
__rvm_path_match_gem_home_check_warning "is not at first place"
;;
*)
__rvm_path_match_gem_home_check_warning "is not available"
;;
esac
}
__rvm_path_match_gem_home_check_warning ()
{
rvm_warn "Warning! PATH is not properly set up, '$GEM_HOME/bin' $1,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ${GEM_HOME##*/}'."
}
__rvm_project_dir_check ()
{
typeset _found_file path_to_check variable variable_default;
typeset -a _valid_files;
path_to_check="$1";
variable="${2:-}";
variable_default="${3:-}";
_valid_files=("$path_to_check" "$path_to_check/.rvmrc" "$path_to_check/.versions.conf" "$path_to_check/.ruby-version" "$path_to_check/.rbfu-version" "$path_to_check/.rbenv-version" "$path_to_check/Gemfile");
__rvm_find_first_file _found_file "${_valid_files[@]}" || true;
if [[ "${_found_file##*/}" == "Gemfile" ]]; then
[[ -s "$_found_file" ]] && {
__rvm_grep "^#ruby=" "$_found_file" > /dev/null || __rvm_grep "^\s*ruby" "$_found_file" > /dev/null
} || _found_file="";
fi;
if [[ -n "$variable" ]]; then
eval "$variable=\"\${_found_file:-$variable_default}\"";
fi;
[[ -n "${_found_file:-$variable_default}" ]] || return $?
}
__rvm_project_ruby_env_check_unload ()
{
if (( ${#rvm_saved_env[@]} > 0 )); then
__rvm_project_ruby_env_load_set_env "" "${rvm_saved_env[@]}";
fi;
rvm_saved_env=()
}
__rvm_project_ruby_env_load ()
{
typeset -a __variables;
export -a rvm_saved_env;
__rvm_project_ruby_env_check_unload;
__rvm_project_ruby_env_load_parse_file "$@";
__rvm_project_ruby_env_load_set_env "rvm_saved_env" "${__variables[@]}"
}
__rvm_project_ruby_env_load_parse_file ()
{
typeset -a __sed_commands;
__sed_commands=();
if [[ -n "${2:-}" ]]; then
__sed_commands+=(-e "/^$2/ !d" -e "s/^$2//");
else
__sed_commands+=(-e "/^#/ d");
fi;
__sed_commands+=(-e 's/`/\\`/g' -e 's/$(/\\$(/g');
__sed_commands+=(-e "/^$/ d");
__rvm_read_lines __variables <( { cat "$1"; echo ""; } | __rvm_sed "${__sed_commands[@]}" )
}
__rvm_project_ruby_env_load_set_env ()
{
typeset __save_to __key __value;
__save_to="$1";
shift;
for __set in "$@";
do
__key="${__set%%=*}";
__value="${__set#*=}";
if [[ -n "${__save_to}" ]]; then
eval "${__save_to}+=( \"\${__key}=\${${__key}}\" )";
fi;
eval "export \${__key}=\"${__value}\"";
done
}
__rvm_project_rvmrc ()
{
export __rvm_project_rvmrc_lock;
: __rvm_project_rvmrc_lock:${__rvm_project_rvmrc_lock:=0};
: __rvm_project_rvmrc_lock:$((__rvm_project_rvmrc_lock+=1));
if (( __rvm_project_rvmrc_lock > 1 )); then
return 0;
fi;
typeset working_dir found_file rvm_trustworthiness_result save_PATH;
working_dir="${1:-"$PWD"}";
save_PATH="${PATH}";
while :; do
if [[ -z "$working_dir" || "$HOME" == "$working_dir" || "${rvm_prefix:-}" == "$working_dir" || "" == "$working_dir" ]]; then
if (( ${rvm_project_rvmrc_default:-0} == 1 )); then
rvm_previous_environment="default";
fi;
if [[ -n "${rvm_previous_environment:-""}" ]]; then
unset GEM_HOME GEM_PATH;
__rvm_remove_rvm_from_path;
__rvm_conditionally_add_bin_path;
__rvm_load_environment "$rvm_previous_environment";
fi;
__rvm_project_ruby_env_check_unload;
unset rvm_current_rvmrc rvm_previous_environment;
break;
else
if __rvm_project_dir_check "$working_dir" found_file && [[ "${found_file}" != "$HOME/.rvmrc" ]]; then
rvm_trustworthiness_result=0;
if [[ "${rvm_current_rvmrc:-""}" != "${found_file}" ]]; then
__rvm_conditionally_do_with_env __rvm_load_project_config "${found_file}" || {
rvm_trustworthiness_result=$?;
PATH="${save_PATH}"
};
fi;
unset __rvm_project_rvmrc_lock;
return "$rvm_trustworthiness_result";
else
working_dir="${working_dir%/*}";
fi;
fi;
done;
unset __rvm_project_rvmrc_lock;
return 1
}
__rvm_read_lines ()
{
typeset IFS;
IFS="
";
if [[ "${2:--}" == "-" ]]; then
eval "$1=( \$( \cat - ) )";
else
eval "$1=( \$( \cat \"\${2:--}\" ) )";
fi
}
__rvm_reboot ()
{
rvm_warn "Do you wish to reboot rvm?\n('yes', or 'no')> ";
typeset response;
response="no";
read response;
if [[ "yes" == "$response" ]]; then
__rvm_cd $rvm_path;
command -v __rvm_reset >> /dev/null 2>&1 || source "$rvm_scripts_path/functions/reset";
__rvm_reset;
\mv "$rvm_archives_path" "$HOME/.archives";
if [[ "/" == "$rvm_path" ]]; then
rvm_error "remove '/' ?!... NO!";
else
if [[ -d "$rvm_path" ]]; then
__rvm_rm_rf "$rvm_path";
fi;
fi;
gem install rvm $rvm_gem_options;
"$rvm_scripts_path/get" latest;
source "$rvm_scripts_path/rvm";
else
rvm_log "Carry on then...";
fi;
return 0
}
__rvm_record_install ()
{
[[ -n "$1" ]] || return;
typeset recorded_ruby_name rvm_install_record_file;
recorded_ruby_name="$( "$rvm_scripts_path/tools" strings "$1" )";
rvm_install_record_file="$rvm_user_path/installs";
[[ -f "$rvm_install_record_file" ]] || \touch "$rvm_install_record_file";
__rvm_sed_i "$rvm_install_record_file" -e "/^$recorded_ruby_name/d";
printf "%b" "$recorded_ruby_name -- ${rvm_configure_flags[*]}\n" >> "$rvm_install_record_file"
}
__rvm_record_ruby_configs ()
{
for dir in "$rvm_path/rubies/"*;
do
if [[ ! -L "${dir}" && ! -s "${dir}/config" && -x "${dir}/bin/ruby" ]]; then
__rvm_ruby_config_save "${dir}/bin/ruby" || {
typeset string="${dir##*/}";
rvm_error " Can not save config data for ruby: '${string}', most likely it is broken installation and you can:
- try fix it: 'rvm reinstall ${string}', OR:
- remove it: 'rvm uninstall ${string} --gems'"
};
fi;
done
}
__rvm_recorded_install_command ()
{
typeset recorded_ruby_name;
recorded_ruby_name="$( "$rvm_scripts_path/tools" strings "$1" )";
recorded_ruby_name=${recorded_ruby_name%%${rvm_gemset_seperator:-"@"}*};
[[ -n "$recorded_ruby_name" ]] || return 1;
if [[ -s "$rvm_user_path/installs" ]] && __rvm_grep "^$recorded_ruby_name " "$rvm_user_path/installs" > /dev/null 2>&1; then
__rvm_grep "^$recorded_ruby_name " "$rvm_user_path/installs" | head -n 1;
else
return 1;
fi
}
__rvm_remote_extension ()
{
case "$1" in
*.tar.*)
rvm_remote_extension="tar${1##*tar}"
;;
jruby-*)
rvm_remote_extension="tar.gz"
;;
*)
rvm_remote_extension="tar.bz2"
;;
esac;
[[ "$2" != "-" ]] || printf "%b" "${rvm_remote_extension}"
}
__rvm_remote_server_path ()
{
typeset _iterator;
_iterator="";
while ! __rvm_remote_server_path_single 0 1 "${_iterator}" "${1:-}"; do
: $(( _iterator+=1 ));
done
}
__rvm_remote_server_path_single ()
{
typeset __remote_file;
__rvm_calculate_remote_file "$@" || return $?;
if [[ -z "${__remote_file:-}" ]]; then
rvm_debug "No remote file name found";
return $1;
else
if file_exists_at_url "${__remote_file}"; then
rvm_debug "Found remote file ${__remote_file}";
printf "%b" "$( __rvm_db "rvm_remote_server_verify_downloads${3:-}" ):${__remote_file}";
else
rvm_debug "Remote file does not exist ${__remote_file}";
return $2;
fi;
fi
}
__rvm_remove_from_array ()
{
typeset _array_name _search _iterator;
typeset -a _temp_array;
_array_name="$1";
_search="$2";
shift 2;
_temp_array=();
for _iterator in "$@";
do
__rvm_string_match "$_iterator" "$_search" || _temp_array+=("$_iterator");
done;
eval "$_array_name=( \"\${_temp_array[@]}\" )"
}
__rvm_remove_from_path ()
{
export PATH;
typeset _value;
_value="${1//+(\/)//}";
if [[ "$PATH" =~ "//" ]]; then
if [[ `uname -s` = "Darwin" ]]; then
PATH="$(sed -E 's#/+#/#g' <<<$PATH)";
else
PATH="$(sed -r 's#/+#/#g' <<<$PATH)";
fi;
fi;
if __rvm_string_match ":$PATH:" "*:${_value}:*"; then
typeset -a _path;
_path=();
__rvm_custom_separated_array _path : "${PATH}";
__rvm_remove_from_array _path "${_value}" "${_path[@]}";
__rvm_join_array PATH : _path;
fi
}
__rvm_remove_install_record ()
{
typeset recorded_ruby_name rvm_install_record_file;
recorded_ruby_name="$( "$rvm_scripts_path/tools" strings "$1" )";
rvm_install_record_file="$rvm_user_path/installs";
if [[ -s "$rvm_install_record_file" ]]; then
__rvm_sed_i "$rvm_install_record_file" -e "/^$recorded_ruby_name/d";
fi
}
__rvm_remove_rvm_from_path ()
{
typeset local_rvm_path;
__rvm_remove_from_path "${rvm_path%/}/*";
__rvm_remove_from_path "${rvm_bin_path}";
while local_rvm_path="$( __rvm_which rvm 2>/dev/null )"; do
__rvm_remove_from_path "${local_rvm_path%/*}";
done;
builtin hash -r
}
__rvm_reset_rvmrc_trust ()
{
if [[ "$1" == all ]]; then
echo "" > "$rvm_user_path/rvmrcs";
else
"$rvm_scripts_path/db" "$rvm_user_path/rvmrcs" "$(__rvm_rvmrc_key "$1")" "delete" > /dev/null 2>&1;
fi
}
__rvm_rm_rf ()
{
__rvm_rm_rf_verbose "$@"
}
__rvm_rm_rf_verbose ()
{
typeset target;
target="${1%%+(/|.)}";
if [[ -n "${ZSH_VERSION:-}" ]]; then
setopt extendedglob;
else
if [[ -n "${BASH_VERSION:-}" ]]; then
shopt -s extglob;
else
rvm_error "What the heck kind of shell are you running here???";
fi;
fi;
case "${target}" in
*(/|.)@(|/Applications|/Developer|/Guides|/Information|/Library|/Network|/System|/User|/Users|/Volumes|/backups|/bdsm|/bin|/boot|/cores|/data|/dev|/etc|/home|/lib|/lib64|/mach_kernel|/media|/misc|/mnt|/net|/opt|/private|/proc|/root|/sbin|/selinux|/srv|/sys|/tmp|/usr|/var))
rvm_debug "__rvm_rm_rf target is not valid - can not remove";
return 1
;;
*)
[[ -n "${target}" ]] || {
rvm_debug "__rvm_rm_rf target not given";
return 1
};
if [[ -d "${target}" ]]; then
\rm -rf "${target}" || {
typeset ret=$?;
rvm_debug "__rvm_rm_rf error removing target dir '${target}'.";
return $ret
};
else
if [[ -f "${target}" || -L "${target}" ]]; then
\rm -f "${target}" || {
typeset ret=$?;
rvm_debug "__rvm_rm_rf error removing target file/link '${target}'.";
return $ret
};
else
rvm_debug "__rvm_rm_rf already gone: $*";
return 0;
fi;
fi
;;
esac
}
__rvm_ruby_config_get ()
{
typeset variable_name ruby_path;
variable_name="$1";
ruby_path="${2:-$rvm_ruby_home/bin/ruby}";
case "${variable_name:---all}" in
--all)
"$ruby_path" -rrbconfig -e 'puts RbConfig::CONFIG.sort.map{|k,v| "#{k}: #{v}" }' 2> /dev/null
;;
*)
"$ruby_path" -rrbconfig -e 'puts RbConfig::CONFIG["'"$variable_name"'"]' 2> /dev/null
;;
esac
}
__rvm_ruby_config_save ()
{
typeset ruby_path config_path default_config_path;
ruby_path="${1:-$rvm_ruby_home/bin/ruby}";
default_config_path="#{RbConfig::CONFIG[\"prefix\"]}/config";
config_path="${2:-$default_config_path}";
"$ruby_path" -rrbconfig -e '\
File.open("'"$config_path"'","w") { |file|
RbConfig::CONFIG.sort.each{|key,value|
file.write("#{key.gsub(/\.|-/,"_")}=\"#{value.gsub("$","\\$")}\"\n")
}
}
' > /dev/null 2>&1
}
__rvm_ruby_package_file ()
{
case "$1" in
*.tar.*)
rvm_ruby_package_file="/$1"
;;
rbx-*)
rvm_ruby_package_file="/${1//rbx-/rubinius-}.$(__rvm_remote_extension "$1" -)"
;;
jruby-*)
typeset __version;
__version="$(
rvm_ruby_string="$1"
__rvm_ruby_string
echo "$rvm_ruby_version"
)";
rvm_ruby_package_file="/${__version}/jruby-bin-${__version}.$(__rvm_remote_extension "$1" -)"
;;
"")
rvm_ruby_package_file=""
;;
*)
rvm_ruby_package_file="/$1.$(__rvm_remote_extension "$1" -)"
;;
esac
}
__rvm_ruby_string ()
{
typeset ruby_string gemset_name expanded_alias_name repo_url branch_name ruby_name;
__rvm_default_flags;
rvm_expanding_aliases=;
true "${rvm_ruby_version:=}" "${rvm_gemset_name:=}" "${rvm_ruby_interpreter:=}" "${rvm_ruby_version:=}" "${rvm_ruby_tag:=}" "${rvm_ruby_patch_level:=}" "${rvm_ruby_revision:=}" ${rvm_gemset_separator:="@"} "${rvm_ruby_string:=}" ${rvm_expanding_aliases:=0} ${rvm_head_flag:=0};
if echo "$rvm_ruby_string" | __rvm_grep "${rvm_gemset_separator}" > /dev/null 2>&1; then
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator}/}";
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator}*/}";
fi;
if (( rvm_expanding_aliases == 0 )) && [[ -n "${rvm_ruby_string}" && "$rvm_ruby_string" != "system" ]]; then
if [[ -f "$rvm_path/config/alias" && -s "$rvm_path/config/alias" ]] && expanded_alias_name="$("$rvm_scripts_path"/db "$rvm_path/config/alias" "$rvm_ruby_string")" && [[ -n "$expanded_alias_name" ]]; then
rvm_ruby_string="$expanded_alias_name";
else
if [[ "$rvm_ruby_string" == default ]]; then
rvm_ruby_string="system";
fi;
fi;
fi;
if echo "$rvm_ruby_string" | __rvm_grep "${rvm_gemset_separator}" > /dev/null 2>&1; then
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator}/}";
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator}*/}";
fi;
ruby_string="${rvm_ruby_string:-}";
gemset_name="${rvm_gemset_name:-}";
repo_url="${rvm_ruby_repo_url:-}";
branch_name="${rvm_ruby_repo_branch:-}";
ruby_name="${rvm_ruby_name:-}";
__rvm_unset_ruby_variables;
rvm_ruby_repo_url="${repo_url:-}";
rvm_ruby_repo_branch="${branch_name:-}";
rvm_ruby_name="$ruby_name";
if [[ -n "$gemset_name" ]]; then
rvm_gemset_name="$gemset_name";
rvm_sticky_flag=1;
fi;
strings=();
__rvm_custom_separated_array strings - "${ruby_string}";
if (( ${#strings[@]} == 0 )); then
if echo "${GEM_HOME:-}" | __rvm_grep "${rvm_gems_path}" > /dev/null 2>&1; then
strings="${GEM_HOME##*\/}";
strings="${strings/%${rvm_gemset_separator:-"@"}*}";
rvm_ruby_string="$strings";
strings=($(echo ${rvm_ruby_string//-/ }));
else
strings=(system);
rvm_ruby_string="system";
fi;
fi;
for string in ${strings[@]};
do
case "$string" in
head)
rvm_ruby_patch_level="";
rvm_ruby_revision="";
rvm_ruby_tag="";
export rvm_head_flag=1
;;
system)
rvm_ruby_interpreter="system";
rvm_ruby_patch_level="";
rvm_ruby_tag="";
rvm_ruby_revision="";
rvm_ruby_version="";
rvm_gemset_name="";
rvm_head_flag=0;
return 0
;;
ext | external)
rvm_ruby_interpreter="ext";
rvm_ruby_patch_level="";
rvm_ruby_tag="";
rvm_ruby_revision="";
rvm_ruby_version="";
rvm_head_flag=0;
rvm_ruby_name="${ruby_string:-${rvm_ruby_string}}";
rvm_ruby_name="${rvm_ruby_name#*-}";
break
;;
nightly | weekly | monthly)
case "${rvm_ruby_interpreter}" in
rbx | rubinius)
rvm_ruby_patch_level="$string"
;;
*)
rvm_ruby_version="$string"
;;
esac;
rvm_nightly_flag=1
;;
nightly* | weekly* | monthly*)
case "${rvm_ruby_interpreter}" in
rbx | rubinius)
rvm_ruby_patch_level="$string"
;;
*)
rvm_ruby_version="$string"
;;
esac
;;
preview*)
rvm_ruby_patch_level="$string"
;;
rc[[:digit:]]*)
rvm_ruby_patch_level="$string"
;;
[[:digit:]].[[:digit:]]* | [[:digit:]][[:digit:]].[[:digit:]]*)
if [[ "${rvm_ruby_interpreter}" == "rbx" ]]; then
if [[ -z "${rvm_ruby_version}" ]]; then
rvm_ruby_version="${string}";
else
if [[ -z "${rvm_ruby_patch_level}" ]]; then
rvm_ruby_patch_level="${string}";
else
rvm_error "Unknown ruby interpreter string component: '$string'.";
return 1;
fi;
fi;
else
case "$string" in
1.8)
rvm_ruby_version="$string.7";
rvm_ruby_revision="";
rvm_ruby_tag=""
;;
1.9)
rvm_ruby_version="$string.3";
rvm_ruby_revision="";
rvm_ruby_tag=""
;;
2.0)
rvm_ruby_version="$string.0";
rvm_ruby_revision="";
rvm_ruby_tag=""
;;
0.+([[:digit:]]) | 0.+([[:digit:]]).+([[:digit:]]) | 1.+([[:digit:]]).+([[:digit:]]) | 2.+([[:digit:]]).+([[:digit:]]) | 1.+([[:digit:]]).+([[:digit:]]).+([[:digit:]]) | 1.+([[:digit:]]))
rvm_ruby_version="$string";
rvm_ruby_revision="";
rvm_ruby_tag=""
;;
1.+([[:digit:]]).+([[:digit:]]).+([[:alnum:]]))
case "${rvm_ruby_interpreter:-""}" in
jruby)
rvm_ruby_version="$string"
;;
*)