Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] ci: add step to verify the functionality of update-check
@ 2023-07-08 19:07 classabbyamp
  2023-07-08 19:22 ` Chocimier
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 19:07 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 2448 bytes --]

From 0d3f691e816bd4fe3f6191781733d5a32d7f5b5a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/2] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 17 +++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..dc4943c74f3e
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=42
+	} | tee /tmp/update-check.log
+	grep -q 'NO VERSION' /tmp/update-check.log && err=42
+done < /tmp/templates
+
+exit $err

From 7ce8a8cba1b31ba33ace1db8f9a3402086ae5106 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 2/2] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
@ 2023-07-08 19:22 ` Chocimier
  2023-07-08 19:56 ` [PR PATCH] [Updated] " classabbyamp
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Chocimier @ 2023-07-08 19:22 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#issuecomment-1627472189

Comment:
Not against, but if package got updated, it means somebody tracks updates.

It may be more fruitful to report `NO VERSION found for` in void-updates.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
  2023-07-08 19:22 ` Chocimier
@ 2023-07-08 19:56 ` classabbyamp
  2023-07-08 19:56 ` classabbyamp
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 19:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 9379 bytes --]

From 4260bf7f4cf453e54f902ba6bb787928d45d453a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/8] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 25 +++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..8a05eb59abed
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+if ! command -v curl; then
+	xbps-install -Su chroot-curl
+fi
+
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		./xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q '^NO VERSION|^=> ERROR:' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 7107af5da07b6cfddfcefa15a9aac01633d5ee78 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/8] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From 06aad78cdd1afeb6a3c3faf3834df3ac0d780ff6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/8] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From 162d6d22ab80173e70b857ebf0a1a3260a6e3e76 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:53:43 -0400
Subject: [PATCH 4/8] common/xbps-src/shutils/update-check: support chroot-curl

---
 common/xbps-src/shutils/update_check.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index 882764100577..9bd9a5112ab8 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -23,8 +23,12 @@ update_check() {
         return 0
     fi
 
-    if ! type curl >/dev/null 2>&1; then
-        echo "ERROR: cannot find \`curl' executable!"
+    if type curl >/dev/null 2>&1; then
+        CURL=curl
+    elif type chroot-curl >/dev/null 2>&1; then
+        CURL=chroot-curl
+    else
+        echo "ERROR: cannot find \`curl' or \`chroot-curl' executable!"
         return 1
     fi
 
@@ -97,7 +101,7 @@ update_check() {
                 echo "(folder) fetching $urlpfx and scanning with $rx" 1>&2
             fi
             skipdirs=
-            curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" |
+            $CURL -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" |
                 grep -Po -i "$rx" |
                 # sort -V places 1.1/ before 1/, but 1A/ before 1.1A/
                 sed -e 's:$:A:' -e 's:/A$:A/:' | sort -Vru | sed -e 's:A/$:/A:' -e 's:A$::' |
@@ -203,7 +207,7 @@ update_check() {
         if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "fetching $url and scanning with $rx" 1>&2
         fi
-        curl -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" |
+        $CURL -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" |
             grep -Po -i "$rx"
         fetchedurls[$url]=yes
     done |

From d6070680f432577f820b13d9c33d142cc0669b27 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 5/8] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From ca853c2eebf5c1da4b8a68812a66d16f6f8cbaf0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 6/8] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From 3f90800cac47d5a40365e7cc29a503fdff795f5b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 7/8] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

From 4bc6e68cb20f8885b3ce7bf7dd8ea94478471979 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:51 -0400
Subject: [PATCH 8/8] megazeux: tmp for testing

---
 srcpkgs/megazeux/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/megazeux/template b/srcpkgs/megazeux/template
index 77cce87718a1..a3e7382dad28 100644
--- a/srcpkgs/megazeux/template
+++ b/srcpkgs/megazeux/template
@@ -1,7 +1,7 @@
 # Template file for 'megazeux'
 pkgname=megazeux
 version=2.92f
-revision=1
+revision=2
 build_style=configure
 configure_script="./config.sh"
 configure_args="--platform unix --enable-release --bindir /usr/lib/megazeux

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
  2023-07-08 19:22 ` Chocimier
  2023-07-08 19:56 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-07-08 19:56 ` classabbyamp
  2023-07-08 19:58 ` [PR PATCH] [Updated] " classabbyamp
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 19:56 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#issuecomment-1627478059

Comment:
If we report `NO VERSION found` here while a package is being updated, then it can be fixed (or, as of now, disabled) while the package is being updated.

`NO VERSION found` is also reported in https://repo-default.voidlinux.org/void-updates/void-updates/_log.txt already but that's kinda hidden.

also, this could let reviewers check if there are further updates available

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (2 preceding siblings ...)
  2023-07-08 19:56 ` classabbyamp
@ 2023-07-08 19:58 ` classabbyamp
  2023-07-08 20:19 ` classabbyamp
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 19:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 8684 bytes --]

From 4260bf7f4cf453e54f902ba6bb787928d45d453a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/7] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 25 +++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..8a05eb59abed
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+if ! command -v curl; then
+	xbps-install -Su chroot-curl
+fi
+
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		./xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q '^NO VERSION|^=> ERROR:' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 7107af5da07b6cfddfcefa15a9aac01633d5ee78 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/7] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From 06aad78cdd1afeb6a3c3faf3834df3ac0d780ff6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/7] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From 162d6d22ab80173e70b857ebf0a1a3260a6e3e76 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:53:43 -0400
Subject: [PATCH 4/7] common/xbps-src/shutils/update-check: support chroot-curl

---
 common/xbps-src/shutils/update_check.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index 882764100577..9bd9a5112ab8 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -23,8 +23,12 @@ update_check() {
         return 0
     fi
 
-    if ! type curl >/dev/null 2>&1; then
-        echo "ERROR: cannot find \`curl' executable!"
+    if type curl >/dev/null 2>&1; then
+        CURL=curl
+    elif type chroot-curl >/dev/null 2>&1; then
+        CURL=chroot-curl
+    else
+        echo "ERROR: cannot find \`curl' or \`chroot-curl' executable!"
         return 1
     fi
 
@@ -97,7 +101,7 @@ update_check() {
                 echo "(folder) fetching $urlpfx and scanning with $rx" 1>&2
             fi
             skipdirs=
-            curl -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" |
+            $CURL -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$urlpfx" |
                 grep -Po -i "$rx" |
                 # sort -V places 1.1/ before 1/, but 1A/ before 1.1A/
                 sed -e 's:$:A:' -e 's:/A$:A/:' | sort -Vru | sed -e 's:A/$:/A:' -e 's:A$::' |
@@ -203,7 +207,7 @@ update_check() {
         if [ -n "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "fetching $url and scanning with $rx" 1>&2
         fi
-        curl -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" |
+        $CURL -H 'Accept: text/html,application/xhtml+xml,application/xml,text/plain,application/rss+xml' -A "xbps-src-update-check/$XBPS_SRC_VERSION" --max-time 10 -Lsk "$url" |
             grep -Po -i "$rx"
         fetchedurls[$url]=yes
     done |

From d6070680f432577f820b13d9c33d142cc0669b27 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 5/7] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From ca853c2eebf5c1da4b8a68812a66d16f6f8cbaf0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 6/7] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From 3f90800cac47d5a40365e7cc29a503fdff795f5b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 7/7] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (3 preceding siblings ...)
  2023-07-08 19:58 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-07-08 20:19 ` classabbyamp
  2023-07-08 20:26 ` classabbyamp
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 20:19 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 6527 bytes --]

From 5e3173dbfab5427ccb9d0828e13071341599cda9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/6] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..22cfdf4af923
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Su curl
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q '^NO VERSION|^=> ERROR:' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From e4fc4b6261c10ac1feb94d1865e3120cceaa39ed Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/6] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From fb66dda7ed7b82242bc228089555bca5507b5726 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/6] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From cf0ac780d693adf6ed5e79074a163a4330976086 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 4/6] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From 088804bec7ccff74e4203c8157e8e447d7853dbb Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 5/6] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From c66f3d03a415c87f5f1d354575a0b6ccb0593808 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 6/6] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (4 preceding siblings ...)
  2023-07-08 20:19 ` classabbyamp
@ 2023-07-08 20:26 ` classabbyamp
  2023-07-08 20:45 ` classabbyamp
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 20:26 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7093 bytes --]

From d516c99cafaeab2316c43d1505ef41ed09496ff9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/7] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..4e0eb244a298
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q '^NO VERSION|^=> ERROR:' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 48b3f2d956e436c4b2b51680a022a495ab2fd35a Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/7] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From d5be20384ed7098a69cf02451248eb29d7bb53d4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/7] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From 7113719bad4a992e58ddec4dc67d5eedaa07b5e9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 4/7] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From bfed196e49a25e2f276294f5129dfc5d908ef40c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 5/7] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From c631f7d2eeeaff7253a5a03a60390b4818729fbb Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 6/7] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

From 26cd2c855ea5b1e44497385ad82c7cfdf9afe26c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 16:25:48 -0400
Subject: [PATCH 7/7] asdfhashdfjsahdjf

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index dac1e038fed8..35e5de3b01ed 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,4 +1,4 @@
-# Template file for 'chezmoi'
+# Template file for 'chez'
 pkgname=chezmoi
 version=2.34.3
 revision=2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (5 preceding siblings ...)
  2023-07-08 20:26 ` classabbyamp
@ 2023-07-08 20:45 ` classabbyamp
  2023-07-08 20:52 ` Chocimier
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 20:45 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7098 bytes --]

From 6ef363f2cd1420f2a38eb373d8e9bdd382725a8c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/7] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..01f8c6833e94
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q '^NO VERSION|^=> ERROR:' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From a0d7b4dc7ad70fbbe6866da580f829796e6ee4a8 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/7] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From d5d8f2ad6d55022445d8ed934d2fd256391a48c7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/7] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From c5ee14d1d55f650d4fe2030e6eeb386ab212233f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 4/7] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From e442dff24eee3c648f280c1b812e0d7630b971ae Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 5/7] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From 330cc220b306be11ecb79fad9d398174249f116c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 6/7] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

From 3118be70f5549094612683f9cb35df0442d523d7 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 16:25:48 -0400
Subject: [PATCH 7/7] asdfhashdfjsahdjf

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index dac1e038fed8..35e5de3b01ed 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,4 +1,4 @@
-# Template file for 'chezmoi'
+# Template file for 'chez'
 pkgname=chezmoi
 version=2.34.3
 revision=2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (6 preceding siblings ...)
  2023-07-08 20:45 ` classabbyamp
@ 2023-07-08 20:52 ` Chocimier
  2023-07-08 20:55 ` [PR PATCH] [Updated] " classabbyamp
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: Chocimier @ 2023-07-08 20:52 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#issuecomment-1627487040

Comment:
I didn't knew about _log.txt, thanks.

Shouldn't this go into lint job rather than x86_64 build?

Ack overall for checking new packages.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (7 preceding siblings ...)
  2023-07-08 20:52 ` Chocimier
@ 2023-07-08 20:55 ` classabbyamp
  2023-07-08 21:01 ` classabbyamp
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 20:55 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7086 bytes --]

From ad5871ce73ec368984dfdb5c93d8979724bde298 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/7] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..237d3c0d244f
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 33d299ed0ed7d3a9b82b8828527ec374133df343 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/7] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From cc5bdafbfffbc8cc102ec3618a01a64981e34948 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/7] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From 02149cc039384fdb586486b84bd781bc5a49a0ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:06:16 -0400
Subject: [PATCH 4/7] chezmoi: temp for testing

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index 074ef8b8c602..dac1e038fed8 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.34.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From 439bb671983932f7b8ac66dcc5596da210c7d563 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:48 -0400
Subject: [PATCH 5/7] 66: tmp for testing

---
 srcpkgs/66/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/66/template b/srcpkgs/66/template
index 89677d007138..008fc0c77828 100644
--- a/srcpkgs/66/template
+++ b/srcpkgs/66/template
@@ -1,7 +1,7 @@
 # Template file for '66'
 pkgname=66
 version=0.6.2.0
-revision=4
+revision=5
 build_style=configure
 configure_args="--prefix=/usr
  --with-sysdeps=${XBPS_CROSS_BASE}/usr/lib/skalibs/sysdeps

From 0ee3fa06ab2e613621e8b3aacfbb39e200a47bac Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:55:50 -0400
Subject: [PATCH 6/7] rock64-base: tmp for testing

---
 srcpkgs/rock64-base/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/rock64-base/template b/srcpkgs/rock64-base/template
index 6f885e79783f..38502d54288d 100644
--- a/srcpkgs/rock64-base/template
+++ b/srcpkgs/rock64-base/template
@@ -1,7 +1,7 @@
 # Template file for 'rock64-base'
 pkgname=rock64-base
 version=0.1
-revision=1
+revision=2
 archs="aarch64*"
 build_style=meta
 # Linux 5.10 used for USB3 support and stability

From 2a87dc78df58f9dfdc667c714b1cb330aa6e3dcf Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 16:25:48 -0400
Subject: [PATCH 7/7] asdfhashdfjsahdjf

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index dac1e038fed8..35e5de3b01ed 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,4 +1,4 @@
-# Template file for 'chezmoi'
+# Template file for 'chez'
 pkgname=chezmoi
 version=2.34.3
 revision=2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (8 preceding siblings ...)
  2023-07-08 20:55 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-07-08 21:01 ` classabbyamp
  2023-07-08 21:04 ` classabbyamp
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 21:01 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 4559 bytes --]

From ad5871ce73ec368984dfdb5c93d8979724bde298 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/3] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..237d3c0d244f
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 33d299ed0ed7d3a9b82b8828527ec374133df343 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/3] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..1de4b5004c81 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || exit 0
 
   # Build changed packages.
   build:

From cc5bdafbfffbc8cc102ec3618a01a64981e34948 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/3] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (9 preceding siblings ...)
  2023-07-08 21:01 ` classabbyamp
@ 2023-07-08 21:04 ` classabbyamp
  2023-07-08 21:09 ` [PR REVIEW] " mhmdanas
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 21:04 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#issuecomment-1627489051

Comment:
> Shouldn't this go into lint job rather than x86_64 build?

this is out of convenience, because the lint job does not run in a void container but instead on the ubuntu host. I've attempted to bring it over to a void container like the build CI but xlint was doing something weird with the escaping of backreferences in a sed. it works as-is but in void it does not resolve the backreference properly (see [here](https://github.com/void-linux/void-packages/actions/runs/5029165174/jobs/9020547621?pr=43949#step:7:22))

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR REVIEW] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (10 preceding siblings ...)
  2023-07-08 21:04 ` classabbyamp
@ 2023-07-08 21:09 ` mhmdanas
  2023-07-08 21:11 ` [PR PATCH] [Updated] " classabbyamp
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: mhmdanas @ 2023-07-08 21:09 UTC (permalink / raw)
  To: ml

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

New review comment by mhmdanas on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#discussion_r1257356549

Comment:
```suggestion
      - run: common/travis/xlint.sh || exit
```

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (11 preceding siblings ...)
  2023-07-08 21:09 ` [PR REVIEW] " mhmdanas
@ 2023-07-08 21:11 ` classabbyamp
  2023-07-08 23:02 ` classabbyamp
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 21:11 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 4557 bytes --]

From ad5871ce73ec368984dfdb5c93d8979724bde298 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/3] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index eb4fb7c85be9..4c338bc328aa 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..237d3c0d244f
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 2da73d9b614e3eea72eb6704d72ff0bba410df6c Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:30:14 -0400
Subject: [PATCH 2/3] ci: make xlint non-fatal

sometimes xlint has false-positives that could lead to packages waiting
to be merged for longer because of the failed CI status. xlint issues
are already reported via annotation so this should be fine.
---
 .github/workflows/build.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 4c338bc328aa..63f4030e86fb 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -31,7 +31,7 @@ jobs:
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
       - run: common/travis/fetch-xtools.sh
-      - run: common/travis/xlint.sh
+      - run: common/travis/xlint.sh || true
 
   # Build changed packages.
   build:

From b08fe88742f499be48b40b8121f7d0b45a24ad51 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 3/3] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (12 preceding siblings ...)
  2023-07-08 21:11 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-07-08 23:02 ` classabbyamp
  2023-07-09  6:35 ` classabbyamp
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-08 23:02 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 3601 bytes --]

From 4eadea8c56d2531bbd752747371d2f2f6effe8a0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/2] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 22 ++++++++++++++++++++++
 2 files changed, 31 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 657712414657..2856661aca5e 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..237d3c0d244f
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	{
+		/hostrepo/xbps-src update-check "$pkg" 2>&1 || err=1
+	} | tee /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49dbfdfc84f9eba94f42b1d7a75b79f235602fc0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 2/2] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (13 preceding siblings ...)
  2023-07-08 23:02 ` classabbyamp
@ 2023-07-09  6:35 ` classabbyamp
  2023-09-06  0:49 ` classabbyamp
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-07-09  6:35 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 3607 bytes --]

From 529bbc67fffd78a1e70c69fc91fb718c7ee3bce9 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 1/2] ci: add step to verify the functionality of update-check

---
 .github/workflows/build.yaml         |  9 +++++++++
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 657712414657..2856661aca5e 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -120,3 +120,12 @@ jobs:
           cd /
           "$here/common/travis/check-install.sh" "$BOOTSTRAP" "$ARCH"
           )
+
+      - name: Verify update-check
+        if: matrix.config.arch == 'x86_64' # no point in running this multiple times
+        run: |
+          (
+          here="$(pwd)"
+          cd /
+          "$here/common/travis/verify-update-check.sh"
+          )
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 000000000000..b5624921306d
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From c85e2aff6b2c3ac05405af53206282ad9affffc1 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 2/2] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index 63f10f354582..56ded0559d49 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc..882764100577 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (14 preceding siblings ...)
  2023-07-09  6:35 ` classabbyamp
@ 2023-09-06  0:49 ` classabbyamp
  2023-09-06  0:50 ` classabbyamp
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:49 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 6704 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/4] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/4] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/4] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/4] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (15 preceding siblings ...)
  2023-09-06  0:49 ` classabbyamp
@ 2023-09-06  0:50 ` classabbyamp
  2023-09-06  0:51 ` classabbyamp
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:50 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7349 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/5] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/5] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/5] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/5] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From be905add641def692473e94e268434d66e3142ad Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/5] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (16 preceding siblings ...)
  2023-09-06  0:50 ` classabbyamp
@ 2023-09-06  0:51 ` classabbyamp
  2023-09-06  0:54 ` classabbyamp
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:51 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 8260 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/6] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/6] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/6] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/6] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From be905add641def692473e94e268434d66e3142ad Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/6] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From fa6453722ca76954db3a43c5286049bbe97fb4e5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:51:50 -0400
Subject: [PATCH 6/6] fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0a09dc201b967..a9b56e6e5d992 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,9 +47,8 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: |
-          common/travis/xlint.sh
-          common/travis/verify-update-check.sh
+      - run: common/travis/xlint.sh
+      - run: common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (17 preceding siblings ...)
  2023-09-06  0:51 ` classabbyamp
@ 2023-09-06  0:54 ` classabbyamp
  2023-09-06  0:56 ` classabbyamp
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:54 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 9539 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/7] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/7] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/7] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/7] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From be905add641def692473e94e268434d66e3142ad Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/7] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From fa6453722ca76954db3a43c5286049bbe97fb4e5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:51:50 -0400
Subject: [PATCH 6/7] fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0a09dc201b967..a9b56e6e5d992 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,9 +47,8 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: |
-          common/travis/xlint.sh
-          common/travis/verify-update-check.sh
+      - run: common/travis/xlint.sh
+      - run: common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:

From 83dc03164fd3b72b860f67959e6f5caf5528caf6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:53:55 -0400
Subject: [PATCH 7/7] fixup! fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml         | 2 +-
 common/travis/verify-update-check.sh | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index a9b56e6e5d992..622e6b61da5a2 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep
+          xbps-install -y grep curl
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
index b5624921306d4..902ebc0d6b445 100755
--- a/common/travis/verify-update-check.sh
+++ b/common/travis/verify-update-check.sh
@@ -5,7 +5,6 @@
 
 set -e
 
-xbps-install -Syu curl grep
 export XBPS_UPDATE_CHECK_VERBOSE=yes
 err=0
 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (18 preceding siblings ...)
  2023-09-06  0:54 ` classabbyamp
@ 2023-09-06  0:56 ` classabbyamp
  2023-09-06  0:58 ` classabbyamp
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:56 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 10538 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/8] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/8] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From ae1d050054319d760b74a684d63c19aef93ab442 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/8] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  4 +++-
 common/travis/verify-update-check.sh | 21 +++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..0a09dc201b967 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,7 +47,9 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - run: |
+          common/travis/xlint.sh
+          common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..b5624921306d4
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+xbps-install -Syu curl grep
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From 49ac3e811f36cdaf2b494ce7ff7984f33bb24e89 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/8] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From be905add641def692473e94e268434d66e3142ad Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/8] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

From fa6453722ca76954db3a43c5286049bbe97fb4e5 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:51:50 -0400
Subject: [PATCH 6/8] fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 0a09dc201b967..a9b56e6e5d992 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,9 +47,8 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: |
-          common/travis/xlint.sh
-          common/travis/verify-update-check.sh
+      - run: common/travis/xlint.sh
+      - run: common/travis/verify-update-check.sh
 
   # Build changed packages.
   build:

From 83dc03164fd3b72b860f67959e6f5caf5528caf6 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:53:55 -0400
Subject: [PATCH 7/8] fixup! fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml         | 2 +-
 common/travis/verify-update-check.sh | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index a9b56e6e5d992..622e6b61da5a2 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep
+          xbps-install -y grep curl
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
index b5624921306d4..902ebc0d6b445 100755
--- a/common/travis/verify-update-check.sh
+++ b/common/travis/verify-update-check.sh
@@ -5,7 +5,6 @@
 
 set -e
 
-xbps-install -Syu curl grep
 export XBPS_UPDATE_CHECK_VERBOSE=yes
 err=0
 

From dd5a745932bd967c516b823899b2cebf26055671 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:56:41 -0400
Subject: [PATCH 8/8] fixup! fixup! .github/workflows/build.yaml: verify the
 functionality of update-check

---
 .github/workflows/build.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 622e6b61da5a2..d860feff70d38 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -47,8 +47,12 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
-      - run: common/travis/verify-update-check.sh
+      - name: Run lints
+        run: |
+          rv=0
+          common/travis/xlint.sh || rv=1
+          common/travis/verify-update-check.sh || rv=1
+          exit $rv
 
   # Build changed packages.
   build:

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (19 preceding siblings ...)
  2023-09-06  0:56 ` classabbyamp
@ 2023-09-06  0:58 ` classabbyamp
  2023-09-06  1:00 ` classabbyamp
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  0:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7772 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/5] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/5] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From 1a51229c85226aa4fef0716c464e008259af164f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/5] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  9 +++++++--
 common/travis/verify-update-check.sh | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..d860feff70d38 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep
+          xbps-install -y grep curl
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir
@@ -47,7 +47,12 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - name: Run lints
+        run: |
+          rv=0
+          common/travis/xlint.sh || rv=1
+          common/travis/verify-update-check.sh || rv=1
+          exit $rv
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..902ebc0d6b445
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From bbe2c9d4063a01f743572d47421f32c113ba1ebf Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/5] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

From 362cad78b9b92ed030e49b2f43f6e14ebbc762df Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:50:04 -0400
Subject: [PATCH 5/5] chezmoi:

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index f046f669df41c..7ecf6f84aef19 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.38.0
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (20 preceding siblings ...)
  2023-09-06  0:58 ` classabbyamp
@ 2023-09-06  1:00 ` classabbyamp
  2023-09-06  1:00 ` [PR PATCH] [Updated] " classabbyamp
  2023-09-08  8:33 ` [PR PATCH] [Merged]: " classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  1:00 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/44927#issuecomment-1707498039

Comment:
ok this now runs the update-check lint in the lint job, now that xlint can run with bash as sh (thanks btw!)

example here: https://github.com/void-linux/void-packages/actions/runs/6091407376/job/16527947208?pr=44927

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Updated] ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (21 preceding siblings ...)
  2023-09-06  1:00 ` classabbyamp
@ 2023-09-06  1:00 ` classabbyamp
  2023-09-08  8:33 ` [PR PATCH] [Merged]: " classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-06  1:00 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages update-check-ci
https://github.com/void-linux/void-packages/pull/44927

ci: add step to verify the functionality of update-check
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-update-check-ci-44927.patch --]
[-- Type: text/x-diff, Size: 7127 bytes --]

From 483e9dd8afb78f1eea69587fe4e9d7968497ae7b Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:09:52 -0400
Subject: [PATCH 1/4] common/travis: remove XLINT variable

it seems to do nothing
---
 common/travis/prepare.sh | 2 --
 common/travis/xlint.sh   | 2 --
 2 files changed, 4 deletions(-)

diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh
index 550fbd7598d0b..46072e9f81ea9 100755
--- a/common/travis/prepare.sh
+++ b/common/travis/prepare.sh
@@ -2,8 +2,6 @@
 #
 # prepare.sh
 
-[ "$XLINT" ] && exit 0
-
 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
 echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
 echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
diff --git a/common/travis/xlint.sh b/common/travis/xlint.sh
index 790791ef17339..0b2d12d0b0d04 100755
--- a/common/travis/xlint.sh
+++ b/common/travis/xlint.sh
@@ -2,8 +2,6 @@
 #
 # xlint.sh
 
-[ "$XLINT" ] || exit 0
-
 EXITCODE=0
 read base tip < /tmp/revisions
 

From 409594eb8c162d404648ca429de543de8d33a5ef Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 5 Sep 2023 20:10:28 -0400
Subject: [PATCH 2/4] .github/workflows/build.yaml: run xlint in a void
 container

---
 .github/workflows/build.yaml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 82463955ee984..df91320404f3b 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -20,17 +20,33 @@ jobs:
     name: Lint templates
     runs-on: ubuntu-latest
 
-    env:
-      PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
-      XLINT: '1'
-      LICENSE_LIST: common/travis/license.lst
+    container:
+      image: 'ghcr.io/void-linux/void-buildroot-musl:20230904R2'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
+        LICENSE_LIST: common/travis/license.lst
 
     steps:
+      - name: Prepare container
+        run: |
+          # switch to repo-ci mirror
+          mkdir -p /etc/xbps.d && cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
+          sed -i 's|repo-default|repo-ci|g' /etc/xbps.d/*-repository-*.conf
+          # Sync and upgrade once, assume error comes from xbps update
+          xbps-install -Syu || xbps-install -yu xbps
+          # Upgrade again (in case there was a xbps update)
+          xbps-install -yu
+          # install tools needed for lints
+          xbps-install -y grep
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
+      - name: Create hostrepo and prepare masterdir
+        run: |
+         ln -s "$(pwd)" /hostrepo &&
+         common/travis/set_mirror.sh &&
+         common/travis/prepare.sh &&
+         common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/fetch-xbps.sh
-      - run: common/travis/fetch-xtools.sh
       - run: common/travis/xlint.sh
 
   # Build changed packages.

From 1a51229c85226aa4fef0716c464e008259af164f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:05:19 -0400
Subject: [PATCH 3/4] .github/workflows/build.yaml: verify the functionality of
 update-check

---
 .github/workflows/build.yaml         |  9 +++++++--
 common/travis/verify-update-check.sh | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100755 common/travis/verify-update-check.sh

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index df91320404f3b..d860feff70d38 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -37,7 +37,7 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
           # install tools needed for lints
-          xbps-install -y grep
+          xbps-install -y grep curl
       - name: Clone and checkout
         uses: classabbyamp/treeless-checkout-action@v1
       - name: Create hostrepo and prepare masterdir
@@ -47,7 +47,12 @@ jobs:
          common/travis/prepare.sh &&
          common/travis/fetch-xtools.sh
       - run: common/travis/changed_templates.sh
-      - run: common/travis/xlint.sh
+      - name: Run lints
+        run: |
+          rv=0
+          common/travis/xlint.sh || rv=1
+          common/travis/verify-update-check.sh || rv=1
+          exit $rv
 
   # Build changed packages.
   build:
diff --git a/common/travis/verify-update-check.sh b/common/travis/verify-update-check.sh
new file mode 100755
index 0000000000000..902ebc0d6b445
--- /dev/null
+++ b/common/travis/verify-update-check.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# runs update-check on all changed templates, then errors only if there was an
+# issue with the update-check. does not error if further updates are available,
+# as there may be a good reason not to update to those versions
+
+set -e
+
+export XBPS_UPDATE_CHECK_VERBOSE=yes
+err=0
+
+while read -r pkg; do
+	/bin/echo -e "\x1b[34mVerifying update-check of $pkg:\x1b[0m"
+	./xbps-src update-check "$pkg" 2>&1 > /tmp/update-check.log || err=1
+	cat /tmp/update-check.log
+	if grep -q 'NO VERSION' /tmp/update-check.log; then
+		echo "::warning file=srcpkgs/$pkg/template,line=1,title=update-check failed::verify and fix update-check for $pkg"
+	fi
+done < /tmp/templates
+
+exit $err

From bbe2c9d4063a01f743572d47421f32c113ba1ebf Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 8 Jul 2023 15:34:58 -0400
Subject: [PATCH 4/4] common/xbps-src/shutils/update_check: add ability to
 disable update-check

useful for cases where update checking does not make sense or is
impossible
---
 Manual.md                               | 4 ++++
 common/xbps-src/shutils/update_check.sh | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/Manual.md b/Manual.md
index bbe6d869c6170..0a68f088f6a25 100644
--- a/Manual.md
+++ b/Manual.md
@@ -905,6 +905,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`.
 part that follows numeric part of version directory
 in url. Defaults to `(|\.x)`.
 
+- `disabled` can be set to disable update checking for the package,
+in cases where checking for updates is impossible or does not make sense.
+This should be set to a string describing why it is disabled.
+
 <a id="patches"></a>
 ### Handling patches
 
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index e656cf06fbcc2..8827641005777 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -13,6 +13,9 @@ update_check() {
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
+        if [ -n "$disabled" ]; then
+            echo "update-check DISABLED for $original_pkgname: $disabled" 1>&2
+        fi
     elif [ -z "$distfiles" ]; then
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "NO DISTFILES found for $original_pkgname" 1>&2

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PR PATCH] [Merged]: ci: add step to verify the functionality of update-check
  2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
                   ` (22 preceding siblings ...)
  2023-09-06  1:00 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-09-08  8:33 ` classabbyamp
  23 siblings, 0 replies; 25+ messages in thread
From: classabbyamp @ 2023-09-08  8:33 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

ci: add step to verify the functionality of update-check
https://github.com/void-linux/void-packages/pull/44927

Description:
runs update-check on all changed templates, then errors only if there was an issue with the update-check. does not error if further updates are available, as there may be a good reason not to update to those versions

example output: 
![image](https://github.com/void-linux/void-packages/assets/5366828/e3d8d36d-c22a-4095-a570-4defd5c29747)


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



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-09-08  8:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-08 19:07 [PR PATCH] ci: add step to verify the functionality of update-check classabbyamp
2023-07-08 19:22 ` Chocimier
2023-07-08 19:56 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 19:56 ` classabbyamp
2023-07-08 19:58 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 20:19 ` classabbyamp
2023-07-08 20:26 ` classabbyamp
2023-07-08 20:45 ` classabbyamp
2023-07-08 20:52 ` Chocimier
2023-07-08 20:55 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 21:01 ` classabbyamp
2023-07-08 21:04 ` classabbyamp
2023-07-08 21:09 ` [PR REVIEW] " mhmdanas
2023-07-08 21:11 ` [PR PATCH] [Updated] " classabbyamp
2023-07-08 23:02 ` classabbyamp
2023-07-09  6:35 ` classabbyamp
2023-09-06  0:49 ` classabbyamp
2023-09-06  0:50 ` classabbyamp
2023-09-06  0:51 ` classabbyamp
2023-09-06  0:54 ` classabbyamp
2023-09-06  0:56 ` classabbyamp
2023-09-06  0:58 ` classabbyamp
2023-09-06  1:00 ` classabbyamp
2023-09-06  1:00 ` [PR PATCH] [Updated] " classabbyamp
2023-09-08  8:33 ` [PR PATCH] [Merged]: " classabbyamp

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).