Files
scoutfs-notify/apply.sh
William Gill 0d7c6a6203 apply.sh: set executable bit in git index
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.
2026-04-22 16:12:24 -05:00

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