Remove sudo from apt-get

echo to stderr
This commit is contained in:
Didactic Drunk 2021-06-01 10:13:28 -07:00
parent 7bbb393ef5
commit 0c4f5b3ad9
3 changed files with 18 additions and 10 deletions

View File

@ -8,7 +8,6 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
@ -16,8 +15,14 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: apt update
run: apt update
- name: Install lsb_release
run: apt-get install -y lsb-release
- name: lsb_release
run: lsb_release -a
- name: Install wget - name: Install wget
run: sudo apt-get install wget run: apt-get install -y wget
- name: setenv DEBUG - name: setenv DEBUG
run: echo "SODIUM_BUILD_DEBUG=1" >> $GITHUB_ENV run: echo "SODIUM_BUILD_DEBUG=1" >> $GITHUB_ENV
- name: setenv BUILD_DIR - name: setenv BUILD_DIR
@ -30,4 +35,7 @@ jobs:
run: shards build -Dpreview_mt run: shards build -Dpreview_mt
- name: Run format - name: Run format
run: crystal tool format --check run: crystal tool format --check
- name: Failed
if: ${{ failure() }}
run: "[ -f libsodium_install.out ] && cat libsodium_install.out"

View File

@ -17,13 +17,13 @@ if `pkg-config libsodium --exists`; then
PKG_VER=`pkg-config libsodium --modversion` PKG_VER=`pkg-config libsodium --modversion`
if [ $(version "$PKG_VER") -ge $(version "$MIN_LIBSODIUM_VERSION") ]; then if [ $(version "$PKG_VER") -ge $(version "$MIN_LIBSODIUM_VERSION") ]; then
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using packaged libsodium." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using packaged libsodium." 1>&2
else else
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "System packaged libsodium is too old." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "System packaged libsodium is too old." 1>&2
export LIBSODIUM_INSTALL=1 export LIBSODIUM_INSTALL=1
fi fi
else else
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Missing libsodium system package." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Missing libsodium system package." 1>&2
export LIBSODIUM_INSTALL=1 export LIBSODIUM_INSTALL=1
fi fi

View File

@ -12,7 +12,7 @@ set -e
#export LIBSODIUM_INSTALL="1" #export LIBSODIUM_INSTALL="1"
if [ "$LIBSODIUM_INSTALL" != "1" ]; then if [ "$LIBSODIUM_INSTALL" != "1" ]; then
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Skipping libsodium build." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Skipping libsodium build." 1>&2
exit 0 exit 0
fi fi
@ -40,8 +40,8 @@ if [ ! -f "$LIBSODIUM_INSTALL_PATH/include/sodium.h" ]; then
SHA=`openssl sha256 -hex < "$TGZ_FILENAME" | sed 's/^.* //'` SHA=`openssl sha256 -hex < "$TGZ_FILENAME" | sed 's/^.* //'`
if [ "$SHA" != "$LIBSODIUM_SHA256" ]; then if [ "$SHA" != "$LIBSODIUM_SHA256" ]; then
echo "SHA256 sum doesn't match." echo "SHA256 sum doesn't match." 1>&2
echo "$SHA" != "$LIBSODIUM_SHA256" echo "$SHA" != "$LIBSODIUM_SHA256" 1>&2
exit 1 exit 1
fi fi
@ -64,11 +64,11 @@ if [ ! -f "$LIBSODIUM_INSTALL_PATH/include/sodium.h" ]; then
touch .make.install.done touch .make.install.done
fi fi
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Finished building libsodium." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Finished building libsodium." 1>&2
else else
# find "$LIBSODIUM_INSTALL_PATH" # find "$LIBSODIUM_INSTALL_PATH"
[ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using already built libsodium." [ ! -z "$SODIUM_BUILD_VERBOSE" ] && echo "Using already built libsodium." 1>&2
fi fi
exit 0 exit 0