From a45d8355ac39e6cda0c5ad1ed56e1305b0c14f93 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Thu, 20 Jan 2022 19:31:29 +0530 Subject: [PATCH] deno: Disable `deno upgrade` Currently Deno doesn't currently provide prebuilt binaries for Android. But when it will do, it will allow users to upgrade Deno by using `deno upgrade`. This might break existing deno installation. So just encourage people to not use this --- packages/deno/build.sh | 2 +- packages/deno/cli-tools-upgrade.rs.patch | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 packages/deno/cli-tools-upgrade.rs.patch diff --git a/packages/deno/build.sh b/packages/deno/build.sh index 3259b6eb5..f0bf15c9f 100644 --- a/packages/deno/build.sh +++ b/packages/deno/build.sh @@ -5,7 +5,7 @@ TERMUX_PKG_MAINTAINER="@termux" _COMMIT=1259a3f48c00e95a8bb0964e4dabfa769a20bcde _COMMIT_DATE=2022.01.19 TERMUX_PKG_VERSION=1.17.3p${_COMMIT_DATE//./} -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/denoland/deno.git TERMUX_PKG_GIT_BRANCH=main TERMUX_PKG_DEPENDS="libffi" diff --git a/packages/deno/cli-tools-upgrade.rs.patch b/packages/deno/cli-tools-upgrade.rs.patch new file mode 100644 index 000000000..9a0a28c22 --- /dev/null +++ b/packages/deno/cli-tools-upgrade.rs.patch @@ -0,0 +1,23 @@ +--- ./cli/tools/upgrade.rs.orig 2022-01-20 19:18:16.459123964 +0530 ++++ ./cli/tools/upgrade.rs 2022-01-20 19:27:18.071118123 +0530 +@@ -22,6 +22,7 @@ + + const RELEASE_URL: &str = "https://github.com/denoland/deno/releases"; + ++#[cfg(not(target_os = "android"))] + pub async fn upgrade(upgrade_flags: UpgradeFlags) -> Result<(), AnyError> { + let mut client_builder = Client::builder(); + +@@ -135,6 +136,12 @@ + Ok(()) + } + ++#[cfg(target_os = "android")] ++pub async fn upgrade(upgrade_flags: UpgradeFlags) -> Result<(), AnyError> { ++ println!("You are currently using Deno packaged by the Termux repo. To upgrade Deno, wait for the packagers to update it. This is done to prevent you from breaking your installation."); ++ std::process::exit(1); ++} ++ + async fn get_latest_release_version( + client: &Client, + ) -> Result {