From 2b24eeb56e3591b4a64b653e36a42dfba7bbfd72 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Thu, 28 Jul 2022 10:11:14 +0200 Subject: [PATCH 1/2] transifex-cli: update to 1.3.0 --- srcpkgs/transifex-cli/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/transifex-cli/template b/srcpkgs/transifex-cli/template index 999b461c7c51..c8d753ad7226 100644 --- a/srcpkgs/transifex-cli/template +++ b/srcpkgs/transifex-cli/template @@ -1,6 +1,6 @@ # Template file for 'transifex-cli' pkgname=transifex-cli -version=1.2.1 +version=1.3.0 revision=1 wrksrc="cli-${version}" build_style=go @@ -12,7 +12,7 @@ license="Apache-2.0" homepage="https://github.com/transifex/cli" changelog="https://github.com/transifex/cli/releases" distfiles="https://github.com/transifex/cli/archive/refs/tags/v${version}.tar.gz" -checksum=f8a76381294cdd75872de5b69acf2781d912e3a7e5e870bc41f0ee358715a3be +checksum=e1cbf24e4c0dcb08d3d13c543e36156b50d420e6cc6198f30fba354016f4fd32 post_install() { mv ${DESTDIR}/usr/bin/{cli,transifex} From 0d8cf6bb9c1f3f33dcadb08c0dd4addc88615e2c Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Thu, 28 Jul 2022 16:20:07 +0200 Subject: [PATCH 2/2] transifex-cli: disable self-updates --- .../patches/disable-self-updates.patch | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 srcpkgs/transifex-cli/patches/disable-self-updates.patch diff --git a/srcpkgs/transifex-cli/patches/disable-self-updates.patch b/srcpkgs/transifex-cli/patches/disable-self-updates.patch new file mode 100644 index 000000000000..14d266daae84 --- /dev/null +++ b/srcpkgs/transifex-cli/patches/disable-self-updates.patch @@ -0,0 +1,98 @@ +diff --git a/internal/txlib/update.go b/internal/txlib/update.go +index 98b6f6d..463e801 100644 +--- a/internal/txlib/update.go ++++ b/internal/txlib/update.go +@@ -2,12 +2,6 @@ package txlib + + import ( + "fmt" +- "os" +- +- "github.com/blang/semver" +- "github.com/fatih/color" +- "github.com/manifoldco/promptui" +- "github.com/rhysd/go-github-selfupdate/selfupdate" + ) + + type UpdateCommandArguments struct { +@@ -18,79 +12,6 @@ type UpdateCommandArguments struct { + } + + func UpdateCommand(arguments UpdateCommandArguments) error { +- if arguments.Debug { +- selfupdate.EnableLog() +- } +- // Gets the version from txlib +- version := arguments.Version +- +- current, err := semver.Parse(version) +- if err != nil { +- return err +- } +- +- latest, _, err := selfupdate.DetectLatest("transifex/cli") +- if err != nil { +- return err +- } +- if arguments.Check { +- if current.GE(latest.Version) { +- fmt.Println("Congratulations, you are up to date with v", version) +- } else { +- fmt.Printf( +- "There is a new latest release for you"+ +- " v%s -> v%s", current, latest.Version.String(), +- ) +- fmt.Println() +- fmt.Println( +- "Use `tx update` or `tx update --no-interactive` " + +- "command to update to the latest version.") +- fmt.Println("If you want to download and install it manually, " + +- "you can get the asset from") +- fmt.Println(latest.AssetURL) +- } +- } else { +- if current.GE(latest.Version) { +- fmt.Println("Congratulations, you are up to date with v", version) +- } else { +- fmt.Printf( +- "There is a new latest release for you v"+ +- " v%s -> v%s", current, latest.Version.String(), +- ) +- // Show prompt if there is no no-interactive flag +- if !arguments.NoInteractive { +- prompt := promptui.Prompt{ +- Label: "Do you want to update", +- IsConfirm: true, +- } +- +- _, err := prompt.Run() +- +- if err != nil { +- fmt.Println("Update Cancelled") +- return nil +- } +- } +- +- exe, err := os.Executable() +- if err != nil { +- fmt.Println("Could not locate executable path") +- return err +- } +- +- msg := fmt.Sprintf("# Updating to v%s", latest.Version) +- fmt.Println(msg) +- if err != nil { +- return err +- } +- // Update executable +- if err := selfupdate.UpdateTo(latest.AssetURL, exe); err != nil { +- return err +- } +- color.Green("Successfully updated to version v%s", latest.Version) +- +- } +- +- } ++ fmt.Println("This version cannot perform self-updates") + return nil + }