~martijnbraam/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH createaport] Strip leading `v` from package versions

Details
Message ID
<20230222101517.16241-1-hugo@whynothugo.nl>
DKIM signature
missing
Download raw message
Patch: +4 -0
Many projects add a leading `v` to tags for versions. However, the
contents of tarballs don't include this, so `$builddir` ends up being
`package-v1.0.0`, but the real path is actually `package-1.0.0`.

I haven't seem any scenarios where a leading `v` is present but this
doesn't uphold.

That aside, APKBUILD conventions seem to align with removing the leading
`v`.
---
 createaport/forge.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/createaport/forge.py b/createaport/forge.py
index 4733ded..2d5bef2 100644
--- a/createaport/forge.py
+++ b/createaport/forge.py
@@ -27,6 +27,10 @@ def get_forge_info(aport):
            aport = get_forge_info_gitlab(aport)
        elif 'chromium/issues/detail?id=332189 -->' in raw:
            aport = get_forge_info_sourcehut(aport)

    if aport.pkgver.startswith("v"):
        aport.pkgver = aport.pkgver[1:]

    return aport


-- 
2.39.2
Details
Message ID
<1527e9cd-93eb-9295-c4e5-4e5d02630775@brixit.nl>
In-Reply-To
<20230222101517.16241-1-hugo@whynothugo.nl> (view parent)
DKIM signature
missing
Download raw message
Thanks, applied :)

On 2/22/23 11:15, Hugo Osvaldo Barrera wrote:
> Many projects add a leading `v` to tags for versions. However, the
> contents of tarballs don't include this, so `$builddir` ends up being
> `package-v1.0.0`, but the real path is actually `package-1.0.0`.
>
> I haven't seem any scenarios where a leading `v` is present but this
> doesn't uphold.
>
> That aside, APKBUILD conventions seem to align with removing the leading
> `v`.
> ---
>   createaport/forge.py | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/createaport/forge.py b/createaport/forge.py
> index 4733ded..2d5bef2 100644
> --- a/createaport/forge.py
> +++ b/createaport/forge.py
> @@ -27,6 +27,10 @@ def get_forge_info(aport):
>               aport = get_forge_info_gitlab(aport)
>           elif 'chromium/issues/detail?id=332189 -->' in raw:
>               aport = get_forge_info_sourcehut(aport)
> +
> +    if aport.pkgver.startswith("v"):
> +        aport.pkgver = aport.pkgver[1:]
> +
>       return aport
>   
>   
Reply to thread Export thread (mbox)