From 122437115dd0099246ce26866d808c75b36345b3 Mon Sep 17 00:00:00 2001 From: davidovki Date: Tue, 7 Feb 2023 11:35:22 +0000 Subject: [PATCH] Remove bash-only features for sh scripts Fix order of CC arguments to aid in linking on newer versions --- build.sh | 10 +++++----- rose-mklink | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 960eac8..11974c7 100755 --- a/build.sh +++ b/build.sh @@ -1,15 +1,15 @@ -#!/bin/bash +#!/bin/sh CC=clang SRC=rose.c REQS= #./plugins/*/*.c -DEPS=('webkit2gtk-4.0') +DEPS='webkit2gtk-4.0' -INCS=`pkg-config --cflags ${DEPS[@]}` -LIBS=`pkg-config --libs ${DEPS[@]}` +INCS=`pkg-config --cflags ${DEPS}` +LIBS=`pkg-config --libs ${DEPS}` # Optional adblocking depends on https://github.com/jun7/wyebadblock WYEBAB='-L/usr/lib/wyebrowser/adblock.so' cp -f config.def.h config.h -$CC $INCS $LIBS $REQS $SRC $WYEBAB -o rose +$CC $INCS $REQS $SRC -o rose $LIBS $WYEBAB diff --git a/rose-mklink b/rose-mklink index 2aaba72..f016aae 100755 --- a/rose-mklink +++ b/rose-mklink @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh test "$1" = "--help" || test -z "$1" && { - echo -e "usage: rose-mklink \n" - echo "Create a /usr/bin link to a website." + printf "%s\n" "usage: rose-mklink " \ + "Create a /usr/bin link to a website." exit } @@ -12,6 +12,6 @@ test -z "$2" || { exit 1 } - echo -e "#!/bin/sh\n\nrose $2" > /usr/bin/$1 + printf "#!/bin/sh\n\nrose %s" "$2" > /usr/bin/$1 chmod +x /usr/bin/$1 }