diff options
author | B. Watson <urchlay@slackware.uk> | 2024-10-09 23:32:39 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-10-12 11:34:45 +0700 |
commit | 70291c1bf60c7771c3f5d0572b0eed5af60e51b2 (patch) | |
tree | fead31668e532c97fc3c7f52cb55b3ef0c12bcdb | |
parent | 45feb76a7855e5c7e07ead23566e2018c1036e37 (diff) |
system/mongo-tools: Add error checking (set -e).
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | system/mongo-tools/mongo-tools.SlackBuild | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/system/mongo-tools/mongo-tools.SlackBuild b/system/mongo-tools/mongo-tools.SlackBuild index 73e95600edb6..f4f2578e5fc0 100644 --- a/system/mongo-tools/mongo-tools.SlackBuild +++ b/system/mongo-tools/mongo-tools.SlackBuild @@ -61,6 +61,8 @@ else LIBDIRSUFFIX="" fi +set -e + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP @@ -74,10 +76,20 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# 20241009 bkw: if GOROOT is unset (e.g. just after installing +# google-go-lang) or set to a nonexistent dir (just after upgrading +# it), go ahead and source the go profile script. Avoids forcing users +# to jump through an unnecessary hoop, while allowing advanced users +# to manually set GOROOT to a specific version of go for whatever reason. +[ "$GOROOT" = "" ] || [ -d "$GOROOT" ] || source /etc/profile.d/go.sh + #export GO111MODULE="off" export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" go mod download github.com/fsnotify/fsnotify -go run build.go -ldflags="$SLKCFLAGS" build + +# 20241009 bkw: || true because this step fails, although it doesn't affect +# the final package. +go run build.go -ldflags="$SLKCFLAGS" build || true # next block taken from mongo-tools build script for i in bsondump mongostat mongofiles mongoexport mongoimport mongorestore mongodump mongotop; do |