Skip to content

Commit 32b336a

Browse files
committed
Improve port upgrading experience
1 parent eb15b60 commit 32b336a

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ See [the vcpkg docs](https://github.com/microsoft/vcpkg/blob/master/docs/example
128128

129129
Installing additional dependencies will not update any existing dependencies by default. We do not update/upgrade by default because this could cause unexpected rebuilds that could potentially take hours (in the case of LLVM). To update dependencies, pass the `--upgrade-ports` option to the build script along with the respective options affecting vcpkg triplet selection (like `--release`).
130130

131+
You must specify the exact package/ports you want to upgrade. If the port does not exist, this will fail.
132+
131133
## Useful manual vcpkg commands
132134

133135
Sometimes it is useful to run vcpkg commands manually for testing a single package. Ideally, someone who wants to do this would read the [vcpkg documentation](https://github.com/microsoft/vcpkg/tree/master/docs), but below we list some commonly used commands. Inspecting the output of the build script will also show all of the vcpkg commands executed.

build_dependencies.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ while [[ $# -gt 0 ]] ; do
8282
esac
8383
shift
8484
done
85-
msg "Passing extra args to 'vcpkg install':"
85+
msg "Passing extra args to vcpkg:"
8686
msg " " "${VCPKG_ARGS[@]}"
8787

8888
function die_if_not_installed {
@@ -238,9 +238,20 @@ if [[ ${UPGRADE_PORTS} == "true" ]]; then
238238
(
239239
set -x
240240
# shellcheck disable=SC2046
241-
"${vcpkg_dir}/vcpkg" upgrade "${extra_vcpkg_args[@]}" "${overlays[@]}" --no-dry-run --allow-unsupported
241+
"${vcpkg_dir}/vcpkg" upgrade "${extra_vcpkg_args[@]}" "${overlays[@]}" --allow-unsupported "${VCPKG_ARGS[@]}" || exit 1
242+
243+
set +x
244+
read -p "Are you sure? If so, enter 'y' " -n 1 -r
245+
echo ""
246+
if [[ $REPLY =~ ^[Yy]$ ]]
247+
then
248+
set -x
249+
# shellcheck disable=SC2046
250+
"${vcpkg_dir}/vcpkg" upgrade "${extra_vcpkg_args[@]}" "${overlays[@]}" --no-dry-run --allow-unsupported "${VCPKG_ARGS[@]}" || exit 1
251+
fi
242252
)
243-
) || exit 1
253+
)
254+
exit 0
244255
fi
245256

246257
deps=()

0 commit comments

Comments
 (0)