-
Notifications
You must be signed in to change notification settings - Fork 28.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa64ff6
commit fec21fc
Showing
3 changed files
with
87 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
set -e | ||
# Shell script to update nghttp2 in the source treee to specific version | ||
|
||
BASE_DIR="$( pwd )"/ | ||
DEPS_DIR="$BASE_DIR"deps/ | ||
LLHTTP_VERSION=$1 | ||
|
||
if [ "$#" -le 0 ]; then | ||
echo "Error: Please provide an llhttp version to update to." | ||
echo "Error: To download directly from GitHub, use the organization/repository syntax, without the .git suffix." | ||
exit 1 | ||
fi | ||
|
||
cleanup () { | ||
EXIT_CODE=$? | ||
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE" | ||
exit $EXIT_CODE | ||
} | ||
|
||
echo "Making temporary workspace ..." | ||
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
trap cleanup INT TERM EXIT | ||
|
||
cd "$WORKSPACE" | ||
|
||
if echo $LLHTTP_VERSION | grep -s "/" > /dev/null; then # Download a release | ||
REPO=git@github.com:$LLHTTP_VERSION.git | ||
BRANCH=$2 | ||
[ -z $BRANCH ] && BRANCH=main | ||
|
||
echo "Cloning llhttp source archive $REPO ..." | ||
git clone $REPO llhttp | ||
cd llhttp | ||
echo "Checking out branch $BRANCH ..." | ||
git checkout $BRANCH | ||
|
||
echo "Building llhtttp ..." | ||
npm install | ||
make release | ||
|
||
echo "Copying llhtttp release ..." | ||
rm -rf $DEPS_DIR/llhttp | ||
cp -a release $DEPS_DIR/llhttp | ||
else | ||
echo "Download llhttp release $LLHTTP_VERSION ..." | ||
curl -sL -o llhttp.tar.gz "https://github.com/nodejs/llhttp/archive/refs/tags/release/v$LLHTTP_VERSION.tar.gz" | ||
gzip -dc llhttp.tar.gz | tar xf - | ||
|
||
echo "Copying llhtttp release ..." | ||
rm -rf $DEPS_DIR/llhttp | ||
cp -a llhttp-release-v$LLHTTP_VERSION $DEPS_DIR/llhttp | ||
fi | ||
|
||
echo "" | ||
echo "All done!" | ||
echo "" | ||
echo "Please git add llhttp, commit the new version:" | ||
echo "" | ||
echo "$ git add -A deps/llhttp" | ||
echo "$ git commit -m \"deps: update nghttp2 to $LLHTTP_VERSION\"" | ||
echo "" |