Skip to content

Commit 1da2e8d

Browse files
targosrichardlau
authored andcommitted
tools: fix dep_updaters dir updates
Replace directories instead of just copying to take removed files into account. PR-URL: #51294 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent b264dda commit 1da2e8d

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

tools/dep_updaters/update-c-ares.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ cp "$DEPS_DIR/cares/cares.gyp" "$WORKSPACE/cares"
6363
cp "$DEPS_DIR/cares/"*.gn "$DEPS_DIR/cares/"*.gni "$WORKSPACE/cares"
6464

6565
echo "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

tools/dep_updaters/update-nghttp3.sh

+1-1
Original file line numberDiff line numberDiff 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

tools/dep_updaters/update-ngtcp2.sh

+2-3
Original file line numberDiff line numberDiff 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

tools/dep_updaters/update-uvwasi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ mv "$WORKSPACE/"*.gyp "$WORKSPACE/"*.gn "$WORKSPACE/"*.gni "$DEPS_DIR/uvwasi/"
6868
cd "$DEPS_DIR/uvwasi/"
6969

7070
echo "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"
7373
cp "$UVWASI_ZIP/LICENSE" "$DEPS_DIR/uvwasi/"
7474
rm -rf "$UVWASI_ZIP"
7575

tools/dep_updaters/utils.sh

+8
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)