FS#67012 - [pacman] PKGBUILD handle git-lfs repository
Attached to Project:
Pacman
Opened by bartus (bartus) - Tuesday, 16 June 2020, 00:00 GMT
Last edited by Allan McRae (Allan) - Tuesday, 16 June 2020, 00:25 GMT
Opened by bartus (bartus) - Tuesday, 16 June 2020, 00:00 GMT
Last edited by Allan McRae (Allan) - Tuesday, 16 June 2020, 00:25 GMT
|
Details
I would like to point to an obscure case in which source
array refers to `git-lfs` repository.
Currently we use `git clone --mirror` https://git.archlinux.org/pacman.git/tree/scripts/libmakepkg/source/git.sh.in#n51 to fetch content of the git repo, there should be one extra step afterwards: determine and pull git lfs objects. I cant provide full implementation, but working rudimental sketch would look like this: * https://github.com/bartoszek/pacman/pull/1/files |
This task depends upon
I've extracted `git-lfs` protocol form my AUR/openimagedenoise-{develop,git} packages and push it to AUR as `makepkg-git-lfs-proto`.
It adds `{download,extract}_git-lfs` functions which are wrappers for `{download,extract}-git` with additional `git lfs {init,fetch}` calls.
https://aur.archlinux.org/packages/makepkg-git-lfs-proto
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=openimagedenoise-develop
It works fine, but has to be installed before calling `makepkg` (`makepkg -s` won't work as `download_sources` is called before `handle_deps` installs `makepkg-git-lfs-proto`)
Moreover it requires including `git-lfs::git-lfs` in VCSCLIENTS array in `makepkg.conf`.
It would work better if was merged in to `pacman` (I've tried to push patch to `pacman-dev` but got rejected by pacman-dev-owner)
Regarding my investigate if it can be made transparent to package maintainers, by hiding `git lfs {init,fetch}` in `download_git` function.
It was confirmed by `git-lfs` devs that it can be easily determined if any refs has git-lfs object referenced, but this solution would require abusing VCSCLIENTS array by including two packages for git (VCSCLIENTS=('git::git','git::git-lfs'). Beside abusing VCSCLIENTS array, hidden implementation would also requires changes to `get_vcsclient` allowing it to return multiple executables, and changes to `executable_vsc` to allow examination of more than one vcs client binary presence.
https://github.com/bartoszek/pacman/pull/1/files
https://github.com/git-lfs/git-lfs/issues/4161