Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
@ 2023-02-04 22:25 paper42
  2023-02-05  2:18 ` kruceter
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: paper42 @ 2023-02-04 22:25 UTC (permalink / raw)
  To: ml

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

New issue by paper42 on void-packages repository

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

Description:
```
%: echo pkgname=python-gnupg > srcpkgs/python3-gnupg/update
%: ./xbps-src update-check python3-gnupg
...
python3-gnupg-0.4.9 -> python3-gnupg-2.2.0
python3-gnupg-0.4.9 -> python3-gnupg-2.3.0
python3-gnupg-0.4.9 -> python3-gnupg-2.3.1
```
`update-check` strips away the `python-` prefix and tries to check for package updates in https://pypi.org/project/gnupg/ instead of https://pypi.org/project/python-gnupg/. `update-check` shouldn't modify `$pkgname` if it's set in the `update` file.

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

* Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
@ 2023-02-05  2:18 ` kruceter
  2023-02-05  2:18 ` kruceter
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kruceter @ 2023-02-05  2:18 UTC (permalink / raw)
  To: ml

[-- 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
```

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

* Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
  2023-02-05  2:18 ` kruceter
@ 2023-02-05  2:18 ` kruceter
  2023-02-07 14:36 ` sgn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: kruceter @ 2023-02-05  2:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2839 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 outputs 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
```

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

* Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
  2023-02-05  2:18 ` kruceter
  2023-02-05  2:18 ` kruceter
@ 2023-02-07 14:36 ` sgn
  2023-02-18 20:27 ` Chocimier
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sgn @ 2023-02-07 14:36 UTC (permalink / raw)
  To: ml

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

New comment by sgn on void-packages repository

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

Comment:
IMO, we shouldn't change `pkgname` in `update`, we should change `site` instead.

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

* Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: Chocimier @ 2023-02-18 20:27 UTC (permalink / raw)
  To: ml

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

New comment by Chocimier on void-packages repository

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

Comment:
`if [ "$pkgname" != "$original_pkgname" ]; then pkgnameoverride=1; fi` doesn't work for just avoiding trimming, that is, final pkgname equal to pkgname in template.

Working solution would be to:

1. source `update` file second time in clean subshell and see if it sets any `pkgname`
2. add dedicated `no_trim_pkgname` variable
3. document setting dummy prefix, so it will be trimmed - python3-snappy sets `pkgname="python-python-snappy"` (my preferred)

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

* Re: update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
                   ` (3 preceding siblings ...)
  2023-02-18 20:27 ` Chocimier
@ 2023-05-20  1:51 ` github-actions
  2023-06-03  2:01 ` [ISSUE] [CLOSED] " github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2023-05-20  1:51 UTC (permalink / raw)
  To: ml

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

New comment by github-actions[bot] on void-packages repository

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

Comment:
Issues become stale 90 days after last activity and are closed 14 days after that.  If this issue is still relevant bump it or assign it.

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

* Re: [ISSUE] [CLOSED] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file
  2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
                   ` (4 preceding siblings ...)
  2023-05-20  1:51 ` github-actions
@ 2023-06-03  2:01 ` github-actions
  5 siblings, 0 replies; 7+ messages in thread
From: github-actions @ 2023-06-03  2:01 UTC (permalink / raw)
  To: ml

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

Closed issue by paper42 on void-packages repository

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

Description:
```
%: echo pkgname=python-gnupg > srcpkgs/python3-gnupg/update
%: ./xbps-src update-check python3-gnupg
...
python3-gnupg-0.4.9 -> python3-gnupg-2.2.0
python3-gnupg-0.4.9 -> python3-gnupg-2.3.0
python3-gnupg-0.4.9 -> python3-gnupg-2.3.1
```
`update-check` strips away the `python-` prefix and tries to check for package updates in https://pypi.org/project/gnupg/ instead of https://pypi.org/project/python-gnupg/. `update-check` shouldn't modify `$pkgname` if it's set in the `update` file.

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

end of thread, other threads:[~2023-06-03  2:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-04 22:25 [ISSUE] update-check shouldn't strip away pkgname prefixes when pkgname is set in the update file paper42
2023-02-05  2:18 ` kruceter
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

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