Bug 242329

Summary: GitLab doesn't seem to require GL_COMMIT any more
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: New ---    
Severity: Affects Only Me CC: dave, jbeich, ports-bugs, saper
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Yuri Victorovich freebsd_committer 2019-11-30 23:08:01 UTC
The framework prints: GL_COMMIT is a required 40 character hash for use USE_GITLAB

But the tarball URL doesn't contain commit any more.
> MASTER_SITES=https://gitlab.com/${PORTNAME}/${PORTNAME}/-/archive/${DISTVERSIONFULL}/
is sufficient.

Testcase: port audio/zrythm
Comment 1 Jan Beich freebsd_committer 2019-12-01 10:32:16 UTC
Looks like ${GL_COMMIT} is stripped if archive name matches ${GH_PROJECT}-${GH_TAGNAME} e.g.,

$ fetch https://code.videolan.org/videolan/dav1d/-/archive/0.5.1/dav1d-0.5.1.tar.gz
$ tar tvf dav1d-0.5.1.tar.gz
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-0.5.1/

$ fetch https://code.videolan.org/videolan/dav1d/-/archive/0.5.1/0.5.1.tar.gz
$ tar tvf 0.5.1.tar.gz | head -1
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-0.5.1-bb160f09fa7ad132f4b6a014ac8e168b913ee3ab/

$ fetch https://code.videolan.org/videolan/dav1d/-/archive/bb160f0/dav1d-bb160f0.tar.gz
$ tar tvf dav1d-bb160f0.tar.gz | head -1
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-bb160f0/

$ fetch https://code.videolan.org/videolan/dav1d/-/archive/0.5.1/foo.tar.gz
$ tar tvf foo.tar.gz
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-0.5.1-bb160f09fa7ad132f4b6a014ac8e168b913ee3ab/

$ fetch https://code.videolan.org/videolan/dav1d/-/archive/bb160f0/bar.tar.gz
$ tar tvf bar.tar.gz
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-bb160f0-bb160f09fa7ad132f4b6a014ac8e168b913ee3ab/

$ fetch -o qux.tar.gz https://code.videolan.org/videolan/dav1d/-/archive/bb160f0/dav1d-0.5.1.tar.gz
$ tar tvf qux.tar.gz
drwxrwxr-x  0 root   root        0 Oct 25 19:38 dav1d-bb160f0-bb160f09fa7ad132f4b6a014ac8e168b913ee3ab/
Comment 2 Yuri Victorovich freebsd_committer 2019-12-01 15:34:46 UTC
https://gitlab.com doesn't accept URLs with hashes as the FreeBSD framework constructs them, and ports become unfetchable. But other GitLab installations work as before and do accept hashes.
Comment 3 David Griffith 2020-03-31 18:40:55 UTC
Poking around at Gitlab's website, I find that this works to download a tarball of an arbitrary commit:


You can substitute ${PORTVERSION} for ${GL_COMMIT} in the above URL and it also works.  The file size for a downloaded tarball using ${PORTVERSION} differs from the same tarball (contents anyways) obtained by using ${GL_COMMIT}.

This difference in file sizes is causing me some confusion because the file deposited in /usr/ports/distfiles has a different filesize from what I get by using git-archive(1) or what NetBSD downloads for use with pkgsrc.  I'm not sure how relevant this is, but I was pointed to this bug from https://lists.freebsd.org/pipermail/freebsd-ports/2020-March/118073.html
Comment 4 Marcin CieĊ›lak 2020-04-03 12:26:06 UTC
David - I have tried to fetch three URLs:


I get two different files:

SHA1 (frotz-2.51.tar.gz) = 54aa50d36b6ae402d063c0fb64e990e50557ed1e
SHA1 (frotz-73eec90ebb159ed687b74cbaf81e135c3e7e390b.tar.gz) = 07620780e46fc23160f60c4f0b7e0a4edaad4e7e
SHA1 (frotz.tar.gz) = 07620780e46fc23160f60c4f0b7e0a4edaad4e7e

The difference is in the directory name:

for i in frotz*.tar.gz; do echo -n "$i "; tar tf "$i" | grep 'frotz-[^/]*/$'; done

frotz-2.51.tar.gz frotz-2.51/
frotz-73eec90ebb159ed687b74cbaf81e135c3e7e390b.tar.gz frotz-73eec90ebb159ed687b74cbaf81e135c3e7e390b/
frotz.tar.gz frotz-73eec90ebb159ed687b74cbaf81e135c3e7e390b/

Asking for a branch name (like "master") will cause the directory to be named like this:


Therefore the sizes and the hashes have to be different...