[aur-general] Git sparse checkouts
Hi All, I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to clone the whole git repo (seems wasteful and I think half the code there is dead) and the only part that I'm interested in is the mpris2 folder. The only way I've found of checking out part of a repo in is to use the sparse checkout trick. The question I have is whether or not it's OK to use this in a PKGBUILD or not, what say ye wise men?! PKGBUILD below for reference (depends on pkgs I haven't uploaded yet if you try building) Thanks Simon -- # Contributor: sausageandeggs <sausageandeggs@archlinux.us> pkgname=kupfer-mpris2-plugin pkgver=20111221 pkgrel=1 pkgdesc="Control mpris compatable media players from Kupfer" arch=(any) url="https://github.com/hugosenari/Kupfer-Plugins" license=('GPL') depends=('mpris2-git') makedepends=('git') _gitroot="git://github.com/hugosenari/Kupfer-Plugins" _gitname="Kupfer-Plugins" build() { cd "${srcdir}" msg "Connecting to GIT server..." if [ -d ${_gitname} ] ; then cd ${_gitname} && git pull ${_gitname} master msg "The local files are updated." else mkdir ${_gitname} cd ${_gitname} git init git remote add ${_gitname} ${_gitroot} git config core.sparsecheckout true echo mpris2-player >> .git/info/sparse-checkout git pull ${_gitname} master fi msg "GIT checkout done or server timeout" } package(){ cd "${srcdir}/${_gitname}" install -d ${pkgdir}/usr/share/kupfer/kupfer/plugin install mpris2-player/* ${pkgdir}/usr/share/kupfer/kupfer/plugin/ }
On Wed, Dec 21, 2011 at 4:37 AM, Simon Stoakley <sausageandeggs@archlinux.us> wrote:
Hi All, I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to clone the whole git repo (seems wasteful and I think half the code there is dead) and the only part that I'm interested in is the mpris2 folder. The only way I've found of checking out part of a repo in is to use the sparse checkout trick. The question I have is whether or not it's OK to use this in a PKGBUILD or not, what say ye wise men?! PKGBUILD below for reference (depends on pkgs I haven't uploaded yet if you try building)
Thanks Simon --
# Contributor: sausageandeggs <sausageandeggs@archlinux.us>
pkgname=kupfer-mpris2-plugin pkgver=20111221 pkgrel=1 pkgdesc="Control mpris compatable media players from Kupfer" arch=(any) url="https://github.com/hugosenari/Kupfer-Plugins" license=('GPL') depends=('mpris2-git') makedepends=('git')
_gitroot="git://github.com/hugosenari/Kupfer-Plugins" _gitname="Kupfer-Plugins"
build() { cd "${srcdir}"
msg "Connecting to GIT server..."
if [ -d ${_gitname} ] ; then cd ${_gitname} && git pull ${_gitname} master msg "The local files are updated." else mkdir ${_gitname} cd ${_gitname} git init git remote add ${_gitname} ${_gitroot} git config core.sparsecheckout true echo mpris2-player >> .git/info/sparse-checkout git pull ${_gitname} master fi msg "GIT checkout done or server timeout" }
package(){ cd "${srcdir}/${_gitname}" install -d ${pkgdir}/usr/share/kupfer/kupfer/plugin install mpris2-player/* ${pkgdir}/usr/share/kupfer/kupfer/plugin/ }
AFAIK this will still clone the whole repository. The only difference is that it will populate only part of the working directory. So you're only saving on some local decompression, not on transfer volume.
On Wed, 21 Dec 2011 03:37:53 +0000, Simon Stoakley <sausageandeggs@archlinux.us> wrote:
Hi All, I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to clone the whole git repo (seems wasteful and I think half the code there is dead) and the only part that I'm interested in is the mpris2 folder. The only way I've found of checking out part of a repo in is to use the sparse checkout trick. The question I have is whether or not it's OK to use this in a PKGBUILD or not, what say ye wise men?! PKGBUILD below for reference (depends on pkgs I haven't uploaded yet if you try building)
Thanks Simon
Hi, I don't think git allows you to clone just part of a repo (unlike SVN), but what I usually do is to reduce the clone depth: git clone git://url.com/repo --depth 1 The --depth switch will make git to clone only the most recent history, because when compiling, you are hardly interested in previous commits. It usually makes the clone operation significantly faster and saves a lot of bandwidth. Cheers, Dan -- ---- Dan Vrátil dan@progdan.cz Tel.: +420 732 326 870 Jabber: progdan@jabber.cz
On 12/21/2011 02:02 AM, Dan Vrátil wrote:
On Wed, 21 Dec 2011 03:37:53 +0000, Simon Stoakley <sausageandeggs@archlinux.us> wrote:
Hi All, I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to clone the whole git repo (seems wasteful and I think half the code there is dead) and the only part that I'm interested in is the mpris2 folder. The only way I've found of checking out part of a repo in is to use the sparse checkout trick. The question I have is whether or not it's OK to use this in a PKGBUILD or not, what say ye wise men?! PKGBUILD below for reference (depends on pkgs I haven't uploaded yet if you try building)
Thanks Simon
Hi,
I don't think git allows you to clone just part of a repo (unlike SVN), but what I usually do is to reduce the clone depth: git clone git://url.com/repo --depth 1
The --depth switch will make git to clone only the most recent history, because when compiling, you are hardly interested in previous commits. It usually makes the clone operation significantly faster and saves a lot of bandwidth.
Cheers, Dan
If the PKGBUILD is supposed to be for some specific release of this package, and it's only available through git, then you need to find a mirror that allows for git archive (even if they only allow tarring with no compression). Because with git clone --depth you can only get the latest. However, if it's a traditional -git package then --depth should work fine.
The day was 21/12/11 18:21 when , Matthew Monaco had this to say......:
On 12/21/2011 02:02 AM, Dan Vrátil wrote:
On Wed, 21 Dec 2011 03:37:53 +0000, Simon Stoakley <sausageandeggs@archlinux.us> wrote:
Hi All, I'm uploading a pkg for an mpris2 plugin for Kupfer. I don't want to clone the whole git repo (seems wasteful and I think half the code there is dead) and the only part that I'm interested in is the mpris2 folder. The only way I've found of checking out part of a repo in is to use the sparse checkout trick. The question I have is whether or not it's OK to use this in a PKGBUILD or not, what say ye wise men?! PKGBUILD below for reference (depends on pkgs I haven't uploaded yet if you try building)
Thanks Simon
Hi,
I don't think git allows you to clone just part of a repo (unlike SVN), but what I usually do is to reduce the clone depth: git clone git://url.com/repo --depth 1
The --depth switch will make git to clone only the most recent history, because when compiling, you are hardly interested in previous commits. It usually makes the clone operation significantly faster and saves a lot of bandwidth.
Cheers, Dan
If the PKGBUILD is supposed to be for some specific release of this package, and it's only available through git, then you need to find a mirror that allows for git archive (even if they only allow tarring with no compression). Because with git clone --depth you can only get the latest. However, if it's a traditional -git package then --depth should work fine.
I think I'm just going to grab the code , put it in my own git repo and grab it from there, can't find any sort of license though so I'm going to email the author. Does anyone know what the usual procedure is if the code is unlicensed? --
On Wednesday 21 Dec 2011 20:07:42 full-english@live.co.uk wrote:
Does anyone know what the usual procedure is if the code is unlicensed?
This will almost certainly vary by jurisdiction. In England and Wales at least (as far as I understand it) no code is "unlicensed" - copyright is automatic and there is just an implicit default licence which is restrictive (i.e. you can't copy it). This is why you should always stick a licence on your code, especially if you don't care who uses it ;-) Contacting the author is the best way to go. HTH, Pete.
The day was 21/12/11 20:43 when , Peter Lewis had this to say......:
On Wednesday 21 Dec 2011 20:07:42 full-english@live.co.uk wrote:
Does anyone know what the usual procedure is if the code is unlicensed?
This will almost certainly vary by jurisdiction. In England and Wales at least (as far as I understand it) no code is "unlicensed" - copyright is automatic and there is just an implicit default licence which is restrictive (i.e. you can't copy it). This is why you should always stick a licence on your code, especially if you don't care who uses it ;-)
Contacting the author is the best way to go.
HTH,
Pete.
Thanks Pete, I've contacted the author so I'll wait and see what he says. Wandering slightly off topic do you know how things stand with using/packaging "unlicensed" code (AUR/PKGBUILDS/Pkgs etc.). If the default is restrictive then surely that would be prohibited as well? I'm going to ask the almighty Google but just wandered if you/anyone knows Thanks Simon --
On Wednesday 21 Dec 2011 23:12:38 full-english@live.co.uk wrote:
Does anyone know what the usual procedure is if the code is unlicensed?
This will almost certainly vary by jurisdiction. In England and Wales at least (as far as I understand it) no code is "unlicensed" - copyright is automatic and there is just an implicit default licence which is restrictive (i.e. you can't copy it). This is why you should always stick a licence on your code, especially if you don't care who uses it ;-)
Thanks Pete, I've contacted the author so I'll wait and see what he says. Wandering slightly off topic do you know how things stand with using/packaging "unlicensed" code (AUR/PKGBUILDS/Pkgs etc.). If the default is restrictive then surely that would be prohibited as well?
Oh, well the AUR doesn't redistribute code, just scripts (which you write) for installing code and a link to upstream (this one way in which it differs from our binary repos). There's nothing wrong with putting a PKGBUILD in the AUR in your case, as far as I can see. HTH, Pete.
participants (6)
-
Dan Vrátil
-
full-english@live.co.uk
-
Jan Steffens
-
Matthew Monaco
-
Peter Lewis
-
Simon Stoakley