echo $*
echo
echo "Usage:"
- echo " libxfs-apply --source <repodir> --commit <commit_id>"
+ echo " libxfs-apply [--verbose] --source <repodir> --commit <commit_id>"
echo " libxfs-apply --patch <patchfile>"
echo
echo "libxfs-apply should be run in the destination git repository."
REPO=
PATCH=
COMMIT_ID=
+VERBOSE=
GUILT=0
while [ $# -gt 0 ]; do
--source) REPO=$2 ; shift ;;
--patch) PATCH=$2; shift ;;
--commit) COMMIT_ID=$2 ; shift ;;
+ --verbose) VERBOSE=true ;;
*) usage ;;
esac
shift
if [ -n "$REPO" -o -n "$COMMIT_ID" ]; then
usage "Need to specify either patch or source repo/commit"
fi
+ VERBOSE=true
elif [ -z "$REPO" -o -z "$COMMIT_ID" ]; then
usage "Need to specify both source repo and commit id"
fi
local _patch=$1
local _libxfs_files=""
- lsdiff $_patch | grep -q "a/libxfs/"
+ [ -n "$VERBOSE" ] || lsdiff $_patch | grep -q "a/libxfs/"
if [ $? -ne 0 ]; then
fail "Doesn't look like an xfsprogs patch with libxfs changes"
fi
local _patch=$1
local _libxfs_files=""
- lsdiff $_patch | grep -q "a/fs/xfs/libxfs/"
+ [ -n "$VERBOSE" ] || lsdiff $_patch | grep -q "a/fs/xfs/libxfs/"
if [ $? -ne 0 ]; then
fail "Doesn't look like a kernel patch with libxfs changes"
fi
filter_xfsprogs_patch $_patch > $_new_patch
fi
- echo "Filtered patch for $REPO contains:"
- lsdiff $_new_patch
+ if [ -n "$VERBOSE" ]; then
+ echo "Filtered patch from $REPO contains:"
+ lsdiff $_new_patch
+ fi
# Ok, now apply with guilt or patch; either may fail and require a force
# and/or a manual reject fixup
if [ $GUILT -eq 1 ]; then
- echo "$REPO looks like a guilt directory."
+ [ -n "$VERBOSE" ] || echo "$REPO looks like a guilt directory."
PATCHES=`guilt applied | wc -l`
- if [ $PATCHES -gt 0 ]; then
+ if [ -n "$VERBOSE" -a $PATCHES -gt 0 ]; then
echo -n "Top patch is: "
guilt top
fi