Github messages for voidlinux
 help / color / mirror / Atom feed
From: kruceter <kruceter@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
Date: Sun, 05 Feb 2023 03:18:21 +0100	[thread overview]
Message-ID: <20230205021821.LhpA2NC5dqJJgm3eTD9qtZOV-CiPer4oP5LPCHN-PYo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-42082@inbox.vuxu.org>

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

New comment by kruceter on void-packages repository

https://github.com/void-linux/void-packages/issues/42082#issuecomment-1416903038

Comment:
There are only few instances of pkgname being modified. I am not sure what to do with it, but here is my ugly attempt:

```diff
diff --git a/common/xbps-src/shutils/update_check.sh b/common/xbps-src/shutils/update_check.sh
index c5a9f745ba..f00edb50d0 100644
--- a/common/xbps-src/shutils/update_check.sh
+++ b/common/xbps-src/shutils/update_check.sh
@@ -1,7 +1,7 @@
 # vim: set ts=4 sw=4 et:
 
 update_check() {
-    local i p url pkgurlname rx found_version consider
+    local i p url pkgurlname rx found_version consider pkgnameoverride
     local update_override=$XBPS_SRCPKGDIR/$XBPS_TARGET_PKG/update
     local original_pkgname=$pkgname
     local pkgname=$sourcepkg
@@ -10,6 +10,9 @@ update_check() {
 
     if [ -r $update_override ]; then
         . $update_override
+        if [ "$pkgname" != "$original_pkgname" ]; then
+            pkgnameoverride=1
+        fi
         if [ "$XBPS_UPDATE_CHECK_VERBOSE" ]; then
             echo "using $XBPS_TARGET_PKG/update overrides" 1>&2
         fi
@@ -121,10 +124,14 @@ update_check() {
                 pkgurlname="$(printf %s "$url" | cut -d/ -f4)"
                 url="https://launchpad.net/$pkgurlname/+download";;
             *cpan.*)
-                pkgname=${pkgname#perl-};;
+                if [ ! "$pkgnameoverride" ]; then
+                    pkgname=${pkgname#perl-}
+                fi ;;
             *pythonhosted.org*)
-                pkgname=${pkgname#python-}
-                pkgname=${pkgname#python3-}
+                if [ ! "$pkgnameoverride" ]; then
+                    pkgname=${pkgname#python-}
+                    pkgname=${pkgname#python3-}
+                fi
                 url="https://pypi.org/simple/$pkgname";;
             *github.com*)
                 pkgurlname="$(printf %s "$url" | cut -d/ -f4,5)"
```

And update-check shows the following:

```
using python3-gnupg/update overrides
fetching https://github.com/vsajip/python-gnupg/tags and scanning with /archive/refs/tags/(v?|\Qpython-gnupg\E-)?\K[\d.]+(?=\.tar\.gz")
fetching https://pypi.org/simple/python-gnupg and scanning with (?<!-)\b\Qpython-gnupg\E[-_]?((src|source)[-_])?v?\K([^-/_\s]*?\d[^-/_\s]*?)(?=(?:[-_.](?:src|source|orig))?\.(?:[jt]ar|shar|t[bglx]z|tbz2|zip))\b
found version 0.3.3
found version 0.3.4
found version 0.3.5
found version 0.3.6
found version 0.3.7
found version 0.3.8
found version 0.3.9
found version 0.4.0
found version 0.4.1
found version 0.4.2
found version 0.4.3
found version 0.4.4
found version 0.4.4.1
found version 0.4.5
found version 0.4.6
found version 0.4.7
found version 0.4.8
found version 0.4.9
found version 0.5.0
```

  reply	other threads:[~2023-02-05  2:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 22:25 [ISSUE] " paper42
2023-02-05  2:18 ` kruceter [this message]
2023-02-05  2:18 ` kruceter
2023-02-07 14:36 ` sgn
2023-02-18 20:27 ` Chocimier
2023-05-20  1:51 ` github-actions
2023-06-03  2:01 ` [ISSUE] [CLOSED] " github-actions

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=20230205021821.LhpA2NC5dqJJgm3eTD9qtZOV-CiPer4oP5LPCHN-PYo@z \
    --to=kruceter@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

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

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