The file was committed with mode 100644 so Linux clones couldn't execute it directly; the CI path that invokes it as /tmp/scoutfs-notify/apply.sh <target> was getting 'Permission denied'. The ci/apply-notify-patches.sh shim now also chmod +x defensively, but fixing the stored mode is the right place to handle it.
27 lines
690 B
Bash
Executable File
27 lines
690 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Apply the scoutfs-notify patch series to a scoutfs working tree.
|
|
#
|
|
# Usage: apply.sh /path/to/scoutfs
|
|
#
|
|
set -euo pipefail
|
|
|
|
HERE=$(cd "$(dirname "$0")" && pwd)
|
|
TREE="${1:?usage: $0 /path/to/scoutfs}"
|
|
|
|
if [ ! -d "$TREE/.git" ]; then
|
|
echo "error: $TREE is not a git working tree" >&2
|
|
echo "hint: use 'patch -p1' directly for tarball trees (see README)" >&2
|
|
exit 2
|
|
fi
|
|
|
|
BASE="$(head -n1 "$HERE/base.txt" | awk '{print $1}')"
|
|
if [ -n "$BASE" ]; then
|
|
if ! git -C "$TREE" rev-parse --verify "$BASE" >/dev/null 2>&1; then
|
|
echo "warning: base '$BASE' not found in target tree" >&2
|
|
fi
|
|
fi
|
|
|
|
cd "$TREE"
|
|
git am --3way --keep-cr "$HERE"/patches/*.patch
|