3 # Copyright (c) 2015-present, Facebook, Inc.
6 # This source code is licensed under the MIT license found in the
7 # LICENSE file in the root directory of this source tree.
10 # Applies a patch series maintained with the `quilt` tool
12 # The format is straightforward: if you have `foo.patch` and `bar.patch`,
13 # applied in that order, `patches/` contains:
19 # The 'series' file contains:
26 # Quilt uses the presence of a patches/ subdir to identify the root, similar
27 # to how Hack uses `.hhconfig` - so, to use quilt with an out-of-source patch
28 # dir is a little bit of work:
31 # $ cd ~/code/hhvm/build/third-party/fb-mysql/bundled_fbmysqlclient-prefix/src/bundled_fbmysqlclient/
32 # $ ln -s ~/code/hhvm/third-party/fb-mysql/patches
33 # $ export QUILT_PATCHES=$(pwd)/patches
36 # The essential commands are `quilt add`, `quilt refresh`, `quilt push`, and
40 if [ ! -d "$QUILT_PATCHES" ]; then
41 echo "Usage: $0 /path/to/patches"
47 cat "$QUILT_PATCHES/series" |
while read PATCH_FILE
; do
48 echo "Applying patch $PATCH_FILE..."
49 patch -p1 < "$QUILT_PATCHES/$PATCH_FILE"
50 echo "... applied patch $PATCH_FILE."
52 echo "Applied all patches!"