Sha256: 1f84618c7c161f2ec46518acc01335fe5841ed0358c6bd4f4e20e7abcd1fae28

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

#!/bin/sh -e

. /rebuild/re-build-bootstrap-utils

dep_install()
{
    if has_app dnf; then
        dnf install -y $*
        #cleaning to make image smaller
        dnf clean all
    elif has_app yum; then
        yum install -y $*
        #cleaning to make image smaller
        yum clean all
    elif has_app apt-get; then
        apt-get update
        apt-get install -y $*
        #cleaning to make image smaller
        apt-get clean
    elif has_app apk; then
        apk update
        apk add $*
    elif has_app zypper; then
        zypper install -y $*
        #cleaning to make image smaller
        zypper clean
    elif has_app urpmi; then
        urpmi sudo
    else
        echo Failed to install "$*", no supported package manager found
        exit 1
    fi
}

configure_sudo()
{
    echo "ALL ALL=(ALL:ALL) NOPASSWD: ALL" > /etc/sudoers
}

try_install_sudo()
{
  if ! has_app sudo; then
    dep_install sudo
  fi

  return $(has_app sudo)
}

# Download may fail unpredictably so we try a few times
try_install_sudo || try_install_sudo || try_install_sudo

configure_sudo

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rbld-1.3.8 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.7 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.6 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.5 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.4 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.3 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.2 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.1 cli/lib/bootstrap/re-build-env-prepare
rbld-1.3.0 cli/lib/bootstrap/re-build-env-prepare
rbld-1.2.0 cli/lib/bootstrap/re-build-env-prepare
rbld-1.1.0 cli/lib/bootstrap/re-build-env-prepare
rbld-1.0.2 cli/lib/bootstrap/re-build-env-prepare
rbld-1.0.1 cli/lib/bootstrap/re-build-env-prepare
rbld-1.0.0 cli/lib/bootstrap/re-build-env-prepare