lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 0d89ef3 07/28: Install sudo without using sud


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0d89ef3 07/28: Install sudo without using sudo
Date: Wed, 12 May 2021 18:14:43 -0400 (EDT)

branch: master
commit 0d89ef312f337c04fc629660e5e828c6b7f6abfa
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Install sudo without using sudo
    
    Installing sudo using sudo is not very useful, as it is not going to
    work unless sudo is already installed, so check if it is and install it
    directly, counting on having sufficient privileges to do it in this
    case, if it isn't.
---
 .github/workflows/ci.yml | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 792cb7b..e33ad99 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -48,11 +48,23 @@ jobs:
       - name: Install required packages
         run: |
           export DEBIAN_FRONTEND=noninteractive
+
+          # We don't really need it with the currently used container, as we're
+          # running as root inside it anyhow, but this allows to keep using the
+          # same commands as before, with the standard Ubuntu container where
+          # using sudo is required.
+          if ! command -v sudo > /dev/null; then
+            apt-get -q -o=Dpkg::Use-Pty=0 update
+            apt-get -qq install sudo
+          else
+            sudo apt-get -q -o=Dpkg::Use-Pty=0 update
+          fi
+
           packages="\
             automake bc bsdmainutils bzip2 curl cvs default-jre \
             g++-multilib git jing libarchive-tools \
             libtool libxml2-utils libxslt1-dev make patch pkg-config rsync \
-            shellcheck sudo trang unzip wget xsltproc xvfb zsh"
+            shellcheck trang unzip wget xsltproc xvfb zsh"
 
           if ${{ matrix.mingw }}
           then
@@ -65,7 +77,6 @@ jobs:
             packages="$packages clang libc++abi-dev libc++-dev"
           fi
 
-          sudo apt-get -q -o=Dpkg::Use-Pty=0 update
           sudo apt-get -qq install $packages
 
       - name: Checkout



reply via email to

[Prev in Thread] Current Thread [Next in Thread]