scripts/package in rvm-1.0.5 vs scripts/package in rvm-1.0.6
- old
+ new
@@ -5,12 +5,12 @@
rvm_base_except="selector"
source "$rvm_scripts_path/base"
# Tools to make managing ruby dependencies inside of rvm easier.
args=($*)
-action="${args[0]}"
-library="${args[1]}"
+action="${args[0]:-""}"
+library="${args[1]:-""}"
args="$(echo ${args[@]:2})"
install_package() {
__rvm_db "${package}_url" "package_url"
@@ -189,15 +189,18 @@
sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make install
fi
)
}
-if [[ ! -z "$library" ]] ; then
- if [[ " readline iconv curl openssl zlib autoconf ncurses pkgconfig gettext glib mono llvm libxml2 " =~ "$library" ]] ; then
- ${library}
- else
- "$rvm_scripts_path/log" "error" "Package '${library}' is unknown."
- fi
+if [[ -n "$library" ]] ; then
+ case $library in
+ readline|iconv|curl|openssl|zlib|autoconf|ncurses|pkgconfig|gettext|glib|mono|llvm|libxml2)
+ ${library}
+ ;;
+ *)
+ "$rvm_scripts_path/log" "error" "Package '${library}' is unknown."
+ ;;
+ esac
else
"$rvm_scripts_path/log" "info" "Usage: 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2}'"
exit 1
fi