Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devuan and rvm. Patched #3482

Closed
aleskandro opened this issue Aug 5, 2015 · 1 comment
Closed

Devuan and rvm. Patched #3482

aleskandro opened this issue Aug 5, 2015 · 1 comment
Milestone

Comments

@aleskandro
Copy link

Hi all, I installed rvm on devuan and noted that it doesn't recognize devuan as a debian distro because of missing of /etc/debian_version (It uses /etc/devuan_version). I solved it creating a patch to add devuan compatibility to rvm.
I don't know what is the best way to commit it so I upload it here: http://pastebin.com/xQRSkyxW

--- scripts/functions/detect_system     2015-08-05 15:29:50.124352334 +0200
+++ scripts/functions/detect_system     2015-08-05 15:39:00.640372870 +0200
@@ -58,6 +58,12 @@
         _system_version="$(\command \cat /etc/debian_version | \command \awk -F. '{print $1}' | head -n 1)"
         _system_arch="$( dpkg --print-architecture )"
       elif
+       [[ -f /etc/devuan_version ]]
+      then
+        _system_name="Devuan"
+        _system_version="$(\command \cat /etc/devuan_version | \command \awk -F. '{print $1}' | head -n 1)"
+        _system_arch="$( dpkg --print-architecture )"
+      elif
         [[ -f /etc/os-release ]] &&
         GREP_OPTIONS="" \command \grep "ID=debian" /etc/os-release >/dev/null
       then
--- scripts/functions/requirements/devuan       1970-01-01 01:00:00.000000000 +0100
+++ scripts/functions/requirements/devuan       2015-08-05 15:39:00.636372869 +0200
@@ -0,0 +1,141 @@
+#!/usr/bin/env bash
+
+# AMD64, i386, ARM.
+requirements_devuan_arch()
+{
+  __architecture="$(dpkg --print-architecture)"
+}
+
+# Queries the dpkg system for packages that are installed only asking about
+# the package name and it's arch.  This package will fall back to :all for
+# cases where we cannot get an arch specific package (such is the case
+# for a few packages.)
+
+requirements_devuan_lib_installed()
+{
+  dpkg-query -s "${1}:${__architecture}" >/dev/null 2>&1 ||
+  dpkg-query -s "${1}:all"               >/dev/null 2>&1 ||
+  dpkg-query -s "$1" 2>/dev/null | __rvm_grep "Architecture: ${__architecture}" >/dev/null ||
+  dpkg-query -s "$1" 2>/dev/null | __rvm_grep "Architecture: all"               >/dev/null ||
+  return $?
+}
+
+# Informs us if a package is even available on the distro we are working
+# with, this is more of a transitional method kind of like Ubuntu
+# has a transitional git-core package right now.  This will allow us
+# to continue to support older versions of Ubuntu while enforcing newer
+# packages on newer Ubuntu.
+
+requirements_devuan_lib_available()
+{
+  apt-cache show "$1" >/dev/null 2>&1 || return $?
+}
+
+requirements_devuan_libs_install()
+{
+  __rvm_try_sudo apt-get --no-install-recommends --yes install "$@" || return $?
+}
+
+requirements_devuan_update_system()
+{
+  __rvm_try_sudo apt-get --quiet --yes update ||
+  {
+    \typeset __ret=$?
+    case ${__ret} in
+      (100)
+        rvm_error "There has been error while updating 'apt-get', please give it some time and try again later.
+404 errors should be fixed for rvm to proceed. Check your sources configured in:
+    /etc/apt/sources.list
+    /etc/apt/sources.list.d/*.list
+"
+        ;;
+    esac
+    return ${__ret}
+  }
+}
+
+requirements_devuan_define_java()
+{
+  update-alternatives --list ${1:-java} >/dev/null 2>&1 ||
+    requirements_check_fallback \
+      openjdk-7-jre-headless openjdk-7-jdk oracle-j2sdk1.7 \
+      openjdk-6-jre-headless opendjk-6-jdk oracle-j2sdk1.6
+}
+
+requirements_devuan_define()
+{
+  \typeset __architecture
+  requirements_devuan_arch
+
+  case "$1" in
+    (rvm)
+      requirements_check bash curl patch bzip2 ca-certificates gawk
+      ;;
+
+    (jruby*)
+      requirements_check g++
+      if
+        is_head_or_disable_binary "$1"
+      then
+        requirements_devuan_define_java javac
+        requirements_check_fallback git git-core
+        if is_jruby_post17 "$1"
+        then __rvm_which mvn >/dev/null || requirements_check_fallback maven maven2
+        else __rvm_which ant >/dev/null || requirements_check ant
+        fi
+      else
+        requirements_devuan_define_java java
+      fi
+      ;;
+
+    (ir*)
+      requirements_check curl mono-2.0-devel
+      ;;
+
+    (opal)
+      requirements_check nodejs npm
+      ;;
+
+    (rbx*head|rubinius*head)
+      requirements_check_fallback git git-core
+      requirements_ubuntu_libs_default clang llvm
+      rvm_configure_flags+=( --cc=clang --cxx=clang++ )
+      ;;
+
+    (rbx*|rubinius*)
+      requirements_ubuntu_libs_default clang llvm llvm-dev libedit-dev
+      rvm_configure_flags+=( --cc=clang --cxx=clang++ )
+      ;;
+
+    (*-head)
+      requirements_check_fallback git git-core
+      requirements_ubuntu_libs_default g++ gcc
+      ;;
+
+    (*)
+      # Also ran by *-head.
+      requirements_ubuntu_libs_default g++ gcc
+      ;;
+  esac
+}
+
+requirements_ubuntu_libs_default()
+{
+  requirements_check "$@" \
+    make libc6-dev patch openssl ca-certificates libreadline6 \
+    libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev \
+    libsqlite3-dev sqlite3 autoconf \
+    libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
+}
+
+requirements_ubuntu_define()
+{
+  __lib_type=devuan
+  requirements_devuan_define "$@"
+}
+
+requirements_mint_define()
+{
+  __lib_type=devuan
+  requirements_devuan_define "$@"
+}
havenwood added a commit to havenwood/rvm-1 that referenced this issue Aug 11, 2015
Applied the patch from rvm#3482 as a pull request.
havenwood added a commit to havenwood/rvm-1 that referenced this issue Aug 11, 2015
Applied the patch from rvm#3482 as a pull request.
havenwood added a commit to havenwood/rvm-1 that referenced this issue Aug 11, 2015
Applied the patch from rvm#3482 as a pull request.
@havenwood
Copy link
Member

@aleskandro After confirming it's all working well on a fresh Devuan install I merged your patch in the commit above.

Thanks!

@pkuczynski pkuczynski modified the milestone: rvm-1.27.0 Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants