Github messages for voidlinux
 help / color / mirror / Atom feed
From: Goorzhel <Goorzhel@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: flyctl-0.0.351
Date: Sun, 24 Jul 2022 21:40:56 +0200	[thread overview]
Message-ID: <20220724194056.c2mh8qjt2TPdUUgaa7tZOwHaOlTdIspnDOuMOImtKnw@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-37950@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

There is an updated pull request by Goorzhel against master on the void-packages repository

https://github.com/Goorzhel/void-packages flyctl
https://github.com/void-linux/void-packages/pull/37950

New package: flyctl-0.0.351
`flyctl` is a command-line interface for fly.io.

fly.io is [somewhat](https://xeiaso.net/blog/fly.io-heroku-replacement) like Heroku.

#### Testing the changes
- I tested the changes in this PR **briefly**.

```
❯ ./xbps-src pkg flyctl
<...>
❯ xi -y flyctl
<...>
❯ which flyctl
/usr/bin/flyctl
❯ flyctl version
flyctl v0.0.0-1657391288+dev linux/amd64 Commit: <commit> BuildDate: 2022-07-09T18:28:08Z
```

That `<commit>` seems to be a problem even if I build inside a git repo:
```
❯ gh repo clone superfly/flyctl
<...>
❯ cd flyctl
❯ make
<...>
❯ bin/flyctl version
flyctl v0.0.0-1657392531+dev linux/amd64 Commit: <commit> BuildDate: 2022-07-09T18:48:51Z
```

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements).


A patch file from https://github.com/void-linux/void-packages/pull/37950.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-flyctl-37950.patch --]
[-- Type: text/x-diff, Size: 4699 bytes --]

From fd6310a2cc02f8772ea6dee3eba4363948236f87 Mon Sep 17 00:00:00 2001
From: Antonio Gurgel <antonio@goorzhel.com>
Date: Sun, 24 Jul 2022 12:40:48 -0700
Subject: [PATCH] New package: flyctl-0.0.351

---
 .../0001-Suppress-update-mechanism.patch      | 96 +++++++++++++++++++
 srcpkgs/flyctl/template                       | 26 +++++
 2 files changed, 122 insertions(+)
 create mode 100644 srcpkgs/flyctl/patches/0001-Suppress-update-mechanism.patch
 create mode 100644 srcpkgs/flyctl/template

diff --git a/srcpkgs/flyctl/patches/0001-Suppress-update-mechanism.patch b/srcpkgs/flyctl/patches/0001-Suppress-update-mechanism.patch
new file mode 100644
index 000000000000..9bce10353f4c
--- /dev/null
+++ b/srcpkgs/flyctl/patches/0001-Suppress-update-mechanism.patch
@@ -0,0 +1,96 @@
+From efa554240713f81a838dc6d9e3cefa739e4da563 Mon Sep 17 00:00:00 2001
+From: Antonio Gurgel <antonio@goorzhel.com>
+Date: Sun, 24 Jul 2022 12:35:32 -0700
+Subject: [PATCH] Suppress update mechanism
+
+---
+ internal/command/version/update.go  | 50 -----------------------------
+ internal/command/version/version.go |  1 -
+ internal/update/update.go           |  2 +-
+ 3 files changed, 1 insertion(+), 52 deletions(-)
+ delete mode 100644 internal/command/version/update.go
+
+diff --git a/internal/command/version/update.go b/internal/command/version/update.go
+deleted file mode 100644
+index 7a9f1378..00000000
+--- a/internal/command/version/update.go
++++ /dev/null
+@@ -1,50 +0,0 @@
+-package version
+-
+-import (
+-	"context"
+-	"errors"
+-	"fmt"
+-
+-	"github.com/blang/semver"
+-	"github.com/spf13/cobra"
+-
+-	"github.com/superfly/flyctl/internal/buildinfo"
+-	"github.com/superfly/flyctl/internal/cache"
+-	"github.com/superfly/flyctl/internal/command"
+-	"github.com/superfly/flyctl/internal/update"
+-	"github.com/superfly/flyctl/iostreams"
+-)
+-
+-func newUpdate() *cobra.Command {
+-	const (
+-		short = "Checks for available updates and automatically updates"
+-
+-		long = `Checks for update and if one is available, runs the appropriate
+-command to update the application.`
+-	)
+-
+-	return command.New("update", short, long, runUpdate)
+-}
+-
+-func runUpdate(ctx context.Context) error {
+-	release, err := update.LatestRelease(ctx, cache.FromContext(ctx).Channel())
+-	switch {
+-	case err != nil:
+-		return fmt.Errorf("failed determining latest release: %w", err)
+-	case release == nil:
+-		return fmt.Errorf("failed querying latest release information: %w", err)
+-	}
+-
+-	latest, err := semver.ParseTolerant(release.Version)
+-	if err != nil {
+-		return fmt.Errorf("error parsing latest release version number %q: %w",
+-			release.Version, err)
+-	}
+-
+-	if buildinfo.Version().GTE(latest) {
+-		return errors.New("no available update")
+-	}
+-
+-	io := iostreams.FromContext(ctx)
+-	return update.UpgradeInPlace(ctx, io, release.Prerelease)
+-}
+diff --git a/internal/command/version/version.go b/internal/command/version/version.go
+index 5ca34ed1..282b79eb 100644
+--- a/internal/command/version/version.go
++++ b/internal/command/version/version.go
+@@ -41,7 +41,6 @@ number and build date.`
+ 
+ 	version.AddCommand(
+ 		newInitState(),
+-		newUpdate(),
+ 	)
+ 
+ 	return version
+diff --git a/internal/update/update.go b/internal/update/update.go
+index ffb3022c..66134bef 100644
+--- a/internal/update/update.go
++++ b/internal/update/update.go
+@@ -41,7 +41,7 @@ func Check() bool {
+ 	case !cmdutil.IsTerminal(os.Stdout), !cmdutil.IsTerminal(os.Stderr):
+ 		return false
+ 	default:
+-		return true
++		return false
+ 	}
+ }
+ 
+-- 
+2.37.1
+
diff --git a/srcpkgs/flyctl/template b/srcpkgs/flyctl/template
new file mode 100644
index 000000000000..b3b0fcb78265
--- /dev/null
+++ b/srcpkgs/flyctl/template
@@ -0,0 +1,26 @@
+# Template file for 'flyctl'
+pkgname=flyctl
+version=0.0.351
+revision=1
+build_style=go
+build_helper=qemu
+go_import_path="github.com/superfly/flyctl"
+go_ldflags="
+ -X github.com/superfly/flyctl/internal/buildinfo.environment=production
+ -X github.com/superfly/flyctl/internal/buildinfo.version=$version
+ -X github.com/superfly/flyctl/internal/buildinfo.commit=df8c42a
+"
+short_desc="Command line tools for fly.io services"
+maintainer="Antonio Gurgel <antonio@goorzhel.com>"
+license="Apache-2.0"
+homepage="https://github.com/superfly/flyctl"
+distfiles="https://github.com/superfly/flyctl/archive/refs/tags/v${version}.tar.gz"
+checksum=fc6fe8fbdd5c6d4b8cea4216770c111a78b06264255345d20c9c768593b6033c
+
+pre_build() {
+	local _date
+	if [ "$SOURCE_DATE_EPOCH" ]; then
+		_date="$(date --utc --date "@$SOURCE_DATE_EPOCH" +"%Y-%m-%dT%H:%M:%SZ")"
+		go_ldflags+=" -X github.com/superfly/flyctl/internal/buildinfo.buildDate=${_date}"
+	fi
+}

  parent reply	other threads:[~2022-07-24 19:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09 18:52 [PR PATCH] " Goorzhel
2022-07-09 18:53 ` classabbyamp
2022-07-09 18:57 ` [PR REVIEW] " classabbyamp
2022-07-09 19:21 ` [PR PATCH] [Updated] " Goorzhel
2022-07-09 19:51 ` Goorzhel
2022-07-09 20:01 ` Goorzhel
2022-07-09 20:02 ` Goorzhel
2022-07-09 20:02 ` Goorzhel
2022-07-09 20:08 ` Goorzhel
2022-07-10  0:24 ` [PR REVIEW] " CameronNemo
2022-07-10  0:41 ` classabbyamp
2022-07-10  1:46 ` [PR PATCH] [Updated] " Goorzhel
2022-07-10  1:46 ` Goorzhel
2022-07-10  1:57 ` classabbyamp
2022-07-12  7:12 ` [PR PATCH] [Updated] " Goorzhel
2022-07-12  7:12 ` Goorzhel
2022-07-12  7:13 ` Goorzhel
2022-07-21  6:30 ` Goorzhel
2022-07-21 13:32 ` classabbyamp
2022-07-24 19:39 ` [PR PATCH] [Updated] " Goorzhel
2022-07-24 19:39 ` Goorzhel
2022-07-24 19:40 ` Goorzhel
2022-07-24 19:40 ` Goorzhel [this message]
2022-08-06 21:01 ` Goorzhel
2022-08-06 21:01 ` [PR PATCH] [Closed]: " Goorzhel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220724194056.c2mh8qjt2TPdUUgaa7tZOwHaOlTdIspnDOuMOImtKnw@z \
    --to=goorzhel@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).