Skip to content

Commit

Permalink
Build: Implement OpenCore shell checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dakanji authored May 9, 2020
1 parent 36a1549 commit fe7cb46
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore sourced files if any
disable=SC1091
15 changes: 14 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ env:

matrix:
include:
- os: linux
name: "Shellcheck on Linux"
addons:
apt:
packages:
- shellcheck

script:
# Check Parent Dir (Change "*.tool" to "*.{sh,tool}" as required if needed later)
- shellcheck ./*.tool
# Check Sub Dirs (Change "*.tool" to "*.{sh,tool}" as required if needed later)
- shellcheck ./**/*.tool

- os: osx
name: "Build macOS XCODE5"
osx_image: xcode10.2
Expand Down Expand Up @@ -77,7 +90,7 @@ matrix:
name: "Analyze Coverity"
osx_image: xcode11.3
compiler: clang

before_install:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install openssl
- curl -Ls https://entrust.com/root-certificates/entrust_l1k.cer -o ~/entrust_l1k.crt || exit 1
Expand Down
14 changes: 7 additions & 7 deletions Debug/efidebug.tool
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,23 @@
#

RUNDIR=$(dirname "$0")
pushd "${RUNDIR}" >/dev/null
pushd "${RUNDIR}" >/dev/null || exit 1
RUNDIR=$(pwd)
popd >/dev/null
popd >/dev/null || exit 1

cd "$RUNDIR"
cd "$RUNDIR" || exit 1

find_gdb() {
if [ "${GDB}" = "" ]; then
GDB=$(which ggdb)
GDB=$(command -v ggdb)
fi

if [ "${GDB}" = "" ]; then
GDB=$(which gdb-multiarch)
GDB=$(command -v gdb-multiarch)
fi

if [ "${GDB}" = "" ]; then
GDB=$(which gdb)
GDB=$(command -v gdb)
fi
}

Expand All @@ -52,7 +52,7 @@ find_lldb() {
fi

if [ "${LLDB}" = "" ]; then
LLDB=$(which lldb)
LLDB=$(command -v lldb)
fi
}

Expand Down
8 changes: 4 additions & 4 deletions Docs/BuildDocs.tool
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ abort() {

cd "$(dirname "$0")" || abort "Wrong directory"

if [ "$(which latexdiff)" = "" ]; then
if [ "$(command -v latexdiff)" = "" ]; then
abort "latexdiff is missing, check your TeX Live installation"
fi

if [ "$(which pdflatex)" = "" ]; then
if [ "$(command -v pdflatex)" = "" ]; then
abort "pdflatex is missing, check your TeX Live installation"
fi

rm -f *.aux *.log *.out *.pdf *.toc
rm -f ./*.aux ./*.log ./*.out ./*.pdf ./*.toc

pdflatex -draftmode Configuration.tex || \
abort "Unable to create configuration pdf"
Expand All @@ -26,7 +26,7 @@ pdflatex Configuration.tex || \

cd Differences || abort "Unable to process annotations"

rm -f *.aux *.log *.out *.pdf *.toc
rm -f ./*.aux ./*.log ./*.out ./*.pdf ./*.toc

latexdiff -s ONLYCHANGEDPAGE PreviousConfiguration.tex ../Configuration.tex \
> Differences.tex || \
Expand Down
4 changes: 2 additions & 2 deletions macbuild.tool
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package() {
fi

local ver
ver=$(cat Include/OpenCore.h | grep OPEN_CORE_VERSION | sed 's/.*"\(.*\)".*/\1/' | grep -E '^[0-9.]+$')
ver=$(grep OPEN_CORE_VERSION ./Include/OpenCore.h | sed 's/.*"\(.*\)".*/\1/' | grep -E '^[0-9.]+$')
if [ "$ver" = "" ]; then
echo "Invalid version $ver"
fi
Expand Down Expand Up @@ -68,7 +68,7 @@ package() {
cp -r "${selfdir}/Utilities/disklabel/disklabel" tmp/Utilities/ || exit 1
cp -r "${selfdir}/Utilities/icnspack/icnspack" tmp/Utilities/ || exit 1
pushd tmp || exit 1
zip -qry -FS ../"OpenCore-${ver}-${2}.zip" * || exit 1
zip -qry -FS ../"OpenCore-${ver}-${2}.zip" ./* || exit 1
popd || exit 1
rm -rf tmp || exit 1
popd || exit 1
Expand Down

0 comments on commit fe7cb46

Please sign in to comment.