Github messages for voidlinux
 help / color / mirror / Atom feed
From: duskmoss <duskmoss@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] PopCorn: avoid double runs, use snooze timefile
Date: Mon, 30 Sep 2024 21:46:35 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-52428@inbox.vuxu.org> (raw)

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

There is a new pull request by duskmoss against master on the void-packages repository

https://github.com/duskmoss/void-packages popcorn-snooze
https://github.com/void-linux/void-packages/pull/52428

PopCorn: avoid double runs, use snooze timefile
as discussed on #xbps, current will run twice at the snooze time (snooze invocation, then the chpst invocation) and will always run at system start.  

new only runs at system start if haven't run in last day, and doesn't run twice when snooze fires.

#### Testing the changes
- I tested the changes in this PR: **YES** 

#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
x86_64


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

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

From daf90785e44915ddd19fe106607b6f0d0e91cd7a Mon Sep 17 00:00:00 2001
From: Moss Hope <duskmoss@proton.me>
Date: Mon, 30 Sep 2024 12:39:59 -0700
Subject: [PATCH] PopCorn: avoid double runs, use snooze timefile

---
 srcpkgs/PopCorn/files/popcorn/run | 8 ++++++--
 srcpkgs/PopCorn/template          | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/PopCorn/files/popcorn/run b/srcpkgs/PopCorn/files/popcorn/run
index 4236e0c4bfa5fe..151ea86a7deb19 100644
--- a/srcpkgs/PopCorn/files/popcorn/run
+++ b/srcpkgs/PopCorn/files/popcorn/run
@@ -6,5 +6,9 @@
 : ${PORT:=8001}
 
 exec 2>&1
-chpst -u _popcorn:_popcorn popcorn --server $SERVER --port $PORT
-exec chpst -u _popcorn:_popcorn snooze popcorn --server $SERVER --port $PORT
+
+[ ! -d /var/cache/popcorn ] && mkdir -p /var/cache/popcorn
+chown _popcorn:_popcorn /var/cache/popcorn
+
+exec chpst -u _popcorn:_popcorn snooze -s 1d -t /var/cache/popcorn/snooze -- sh -c \
+	"popcorn --server $SERVER --port $PORT; : > /var/cache/popcorn/snooze"
diff --git a/srcpkgs/PopCorn/template b/srcpkgs/PopCorn/template
index 8ddf3183fbb668..06b227f9ed223d 100644
--- a/srcpkgs/PopCorn/template
+++ b/srcpkgs/PopCorn/template
@@ -1,7 +1,7 @@
 # Template file for 'PopCorn'
 pkgname=PopCorn
 version=0.4
-revision=11
+revision=12
 build_style=go
 go_import_path=github.com/the-maldridge/popcorn
 go_package="${go_import_path}/cmd/popcorn

             reply	other threads:[~2024-09-30 19:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30 19:46 duskmoss [this message]
2024-09-30 20:32 ` duskmoss
2024-09-30 21:45 ` [PR PATCH] [Updated] " duskmoss
2024-10-01 12:09 ` abenson
2024-10-01 17:26 ` duskmoss
2024-10-01 17:45 ` duskmoss
2024-10-01 18:57 ` abenson
2024-10-01 18:59 ` abenson
2024-10-01 19:22 ` duskmoss
2024-11-01  3:02 ` [PR PATCH] [Merged]: " classabbyamp

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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-52428@inbox.vuxu.org \
    --to=duskmoss@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).