Skip to content

Commit

Permalink
fixup! tools: add script to update c-ares
Browse files Browse the repository at this point in the history
  • Loading branch information
richardlau committed Oct 29, 2021
1 parent db9a04e commit ab9566b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tools/update-cares.sh
Expand Up @@ -24,28 +24,28 @@ cleanup () {

trap cleanup INT TERM EXIT

ARES_REF=cares-$(echo $ARES_VERSION | tr . _)
ARES_TARBALL=c-ares-$ARES_VERSION.tar.gz
ARES_REF="cares-$(echo $ARES_VERSION | tr . _)"
ARES_TARBALL="c-ares-$ARES_VERSION.tar.gz"

cd "$WORKSPACE"

echo "Fetching c-ares source archive"
curl -sL -o $ARES_TARBALL https://github.com/c-ares/c-ares/releases/download/$ARES_REF/$ARES_TARBALL
gzip -dc $ARES_TARBALL | tar xf -
rm $ARES_TARBALL
curl -sL -o "$ARES_TARBALL" "https://github.com/c-ares/c-ares/releases/download/$ARES_REF/$ARES_TARBALL"
gzip -dc "$ARES_TARBALL" | tar xf -
rm "$ARES_TARBALL"
mv "c-ares-$ARES_VERSION" cares

echo "Removing tests"
rm -rf $WORKSPACE/cares/test
rm -rf "$WORKSPACE/cares/test"

echo "Copying existing .gitignore, config and gyp files"
cp -R $DEPS_DIR/cares/config $WORKSPACE/cares
cp $DEPS_DIR/cares/.gitignore $WORKSPACE/cares
cp $DEPS_DIR/cares/cares.gyp $WORKSPACE/cares
cp -R "$DEPS_DIR/cares/config" "$WORKSPACE/cares"
cp "$DEPS_DIR/cares/.gitignore" "$WORKSPACE/cares"
cp "$DEPS_DIR/cares/cares.gyp" "$WORKSPACE/cares"

echo "Replacing existing c-ares"
rm -rf $DEPS_DIR/cares
mv $WORKSPACE/cares $DEPS_DIR/
rm -rf "$DEPS_DIR/cares"
mv "$WORKSPACE/cares" "$DEPS_DIR/"

echo "All done!"
echo ""
Expand Down

0 comments on commit ab9566b

Please sign in to comment.