File tree Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Expand file tree Collapse file tree 5 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,7 @@ cp "$DEPS_DIR/cares/cares.gyp" "$WORKSPACE/cares"
6363cp " $DEPS_DIR /cares/" * .gn " $DEPS_DIR /cares/" * .gni " $WORKSPACE /cares"
6464
6565echo " Replacing existing c-ares"
66- rm -rf " $DEPS_DIR /cares"
67- mv " $WORKSPACE /cares" " $DEPS_DIR /"
66+ replace_dir " $DEPS_DIR /cares" " $WORKSPACE /cares"
6867
6968# Update the version number on maintaining-dependencies.md
7069# and print the new version as the last line of the script as we need
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ autoreconf -i
5959
6060./configure --prefix=" $PWD /build" --enable-lib-only
6161
62- cp -R lib/ * " $DEPS_DIR /ngtcp2/nghttp3/lib/ "
62+ replace_dir " $DEPS_DIR /ngtcp2/nghttp3/lib" " lib "
6363
6464# Update the version number on maintaining-dependencies.md
6565# and print the new version as the last line of the script as we need
Original file line number Diff line number Diff line change @@ -63,9 +63,8 @@ autoreconf -i
6363
6464./configure --prefix=" $PWD /build" --enable-lib-only
6565
66- cp -R lib/* " $DEPS_DIR /ngtcp2/ngtcp2/lib/"
67-
68- cp -R crypto/* " $DEPS_DIR /ngtcp2/ngtcp2/crypto/"
66+ replace_dir " $DEPS_DIR /ngtcp2/ngtcp2/lib" " lib"
67+ replace_dir " $DEPS_DIR /ngtcp2/ngtcp2/crypto" " crypto"
6968
7069# Update the version number on maintaining-dependencies.md
7170# and print the new version as the last line of the script as we need
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ mv "$WORKSPACE/"*.gyp "$WORKSPACE/"*.gn "$WORKSPACE/"*.gni "$DEPS_DIR/uvwasi/"
6868cd " $DEPS_DIR /uvwasi/"
6969
7070echo " Copying new files to deps folder"
71- cp -r " $UVWASI_ZIP / include" " $DEPS_DIR /uvwasi/ "
72- cp -r " $UVWASI_ZIP / src" " $DEPS_DIR /uvwasi/ "
71+ replace_dir " $DEPS_DIR /uvwasi/ include" " $UVWASI_ZIP /include "
72+ replace_dir " $DEPS_DIR /uvwasi/ src" " $UVWASI_ZIP /src "
7373cp " $UVWASI_ZIP /LICENSE" " $DEPS_DIR /uvwasi/"
7474rm -rf " $UVWASI_ZIP "
7575
Original file line number Diff line number Diff line change @@ -77,3 +77,11 @@ log_and_verify_sha256sum() {
7777 fi
7878 fi
7979}
80+
81+ # This function replaces the directory of a dependency with the new one.
82+ replace_dir () {
83+ old_dir=" $1 "
84+ new_dir=" $2 "
85+ rm -rf " $old_dir "
86+ mv " $new_dir " " $old_dir "
87+ }
You can’t perform that action at this time.
0 commit comments