public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Initial review for github-snapshot.eclass
@ 2011-05-31 14:24 Michał Górny
  2011-05-31 18:41 ` William Hubbs
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Michał Górny @ 2011-05-31 14:24 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 666 bytes --]

Hello all,

As I suggested earlier, I'm attaching an example implementation
of github-snapshot.eclass.

All the eclass does is providing a default src_unpack() unpacking
the github snapshot into ${S}. Right now it simply does call default
src_unpack() and then does a fuzzy `mv' but that can change
in the future.

The eclass doesn't modify S or SRC_URI itself. An ebuild using it
should look like the following:

#v+
EAPI=4

inherit github-snapshot

DESCRIPTION="Random github package"
HOMEPAGE="https://github.com/foo/bar"
SRC_URI="http://github.com/foo/${PN}/tarball/${P} -> ${P}.tar.gz"

# [...]
#v-

-- 
Best regards,
Michał Górny

[-- Attachment #1.2: github-snapshot.eclass --]
[-- Type: application/x-shellscript, Size: 816 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
@ 2011-05-31 18:41 ` William Hubbs
  2011-05-31 18:47   ` Michał Górny
  2011-05-31 18:56 ` [gentoo-dev] " Diego Elio Pettenò
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: William Hubbs @ 2011-05-31 18:41 UTC (permalink / raw
  To: gentoo-dev

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

Hi,

If you use this eclass, how should your ebuild specify the commit you
want to take the snapshot from? Your example doesn't show how to do
that.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 18:41 ` William Hubbs
@ 2011-05-31 18:47   ` Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2011-05-31 18:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: williamh

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

On Tue, 31 May 2011 13:41:03 -0500
William Hubbs <williamh@gentoo.org> wrote:

> If you use this eclass, how should your ebuild specify the commit you
> want to take the snapshot from? Your example doesn't show how to do
> that.

It's specified in SRC_URI, like usual.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* [gentoo-dev] Re: Initial review for github-snapshot.eclass
  2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
  2011-05-31 18:41 ` William Hubbs
@ 2011-05-31 18:56 ` Diego Elio Pettenò
  2011-05-31 19:07 ` [gentoo-dev] " Mike Gilbert
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Diego Elio Pettenò @ 2011-05-31 18:56 UTC (permalink / raw
  To: gentoo-dev

Il giorno mar, 31/05/2011 alle 16.24 +0200, Michał Górny ha scritto:
> 
> The eclass doesn't modify S or SRC_URI itself. An ebuild using it
> should look like the following: 

I have some doubts about using the unbound mv there tbh.

What happens if I need GitHub snapshots from two separate projects? It
would probably be better to provide a function to translate a mask into
a single directory and provide a default src_unpack following that.

-- 
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/





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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
  2011-05-31 18:41 ` William Hubbs
  2011-05-31 18:56 ` [gentoo-dev] " Diego Elio Pettenò
@ 2011-05-31 19:07 ` Mike Gilbert
  2011-05-31 19:23   ` Michał Górny
  2011-05-31 19:28 ` William Hubbs
  2011-05-31 20:40 ` Brian Harring
  4 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2011-05-31 19:07 UTC (permalink / raw
  To: gentoo-dev

On Tue, May 31, 2011 at 10:24 AM, Michał Górny <mgorny@gentoo.org> wrote:
> Hello all,
>
> As I suggested earlier, I'm attaching an example implementation
> of github-snapshot.eclass.
>

case ${EAPI:-0} in
	0|1) die "EAPI ${EAPI} unsupported.";;
	2|3|4) ;;
	*) die "github-snapshot.eclass API in EAPI ${EAPI} not yet established."
esac

Why are EAPI 0 and 1 unsupported? I don't see anything that would need
EAPI 2 features.



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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 19:07 ` [gentoo-dev] " Mike Gilbert
@ 2011-05-31 19:23   ` Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2011-05-31 19:23 UTC (permalink / raw
  To: gentoo-dev; +Cc: floppymaster

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

On Tue, 31 May 2011 15:07:17 -0400
Mike Gilbert <floppymaster@gmail.com> wrote:

> case ${EAPI:-0} in
> 	0|1) die "EAPI ${EAPI} unsupported.";;
> 	2|3|4) ;;
> 	*) die "github-snapshot.eclass API in EAPI ${EAPI} not yet
> established." esac
> 
> Why are EAPI 0 and 1 unsupported? I don't see anything that would need
> EAPI 2 features.

I don't see a reason to support them. They don't provide src_prepare()
which increases amount of code required by user to handle them.
Moreover, github snapshots require EAPI2 arrows in SRC_URI anyway.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
                   ` (2 preceding siblings ...)
  2011-05-31 19:07 ` [gentoo-dev] " Mike Gilbert
@ 2011-05-31 19:28 ` William Hubbs
  2011-05-31 19:45   ` Michał Górny
  2011-05-31 20:40 ` Brian Harring
  4 siblings, 1 reply; 10+ messages in thread
From: William Hubbs @ 2011-05-31 19:28 UTC (permalink / raw
  To: gentoo-dev

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

On Tue, May 31, 2011 at 04:24:23PM +0200, Michał Górny wrote:
> EAPI=4
> 
> inherit github-snapshot
> 
> DESCRIPTION="Random github package"
> HOMEPAGE="https://github.com/foo/bar"

bar is actually ${PN}.

> SRC_URI="http://github.com/foo/${PN}/tarball/${P} -> ${P}.tar.gz"

The first ${P} above isn't right, because that is where the tag of the
snapshot goes.

Regards,

William

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 19:28 ` William Hubbs
@ 2011-05-31 19:45   ` Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2011-05-31 19:45 UTC (permalink / raw
  To: gentoo-dev; +Cc: williamh

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

On Tue, 31 May 2011 14:28:00 -0500
William Hubbs <williamh@gentoo.org> wrote:

> On Tue, May 31, 2011 at 04:24:23PM +0200, Michał Górny wrote:
> > EAPI=4
> > 
> > inherit github-snapshot
> > 
> > DESCRIPTION="Random github package"
> > HOMEPAGE="https://github.com/foo/bar"
> 
> bar is actually ${PN}.

AFAIK it is a bad practice to use any variables in HOMEPAGE. Reason
unknown, vim highlights this in red.

> > SRC_URI="http://github.com/foo/${PN}/tarball/${P} -> ${P}.tar.gz"
> 
> The first ${P} above isn't right, because that is where the tag of the
> snapshot goes.

This is a slightly modified copy-paste from an ebuild. In this
particular example, the tag was same as ${P}.

It is just an example. It's supposed to shortly show what needs to be
changed and what needs not. My main intent is not to suggest creating
additional variables like GITHUB_TAG and so on.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
                   ` (3 preceding siblings ...)
  2011-05-31 19:28 ` William Hubbs
@ 2011-05-31 20:40 ` Brian Harring
  2011-05-31 20:52   ` Michał Górny
  4 siblings, 1 reply; 10+ messages in thread
From: Brian Harring @ 2011-05-31 20:40 UTC (permalink / raw
  To: gentoo-dev

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

On Tue, May 31, 2011 at 04:24:23PM +0200, Michał Górny wrote:
> Hello all,
> 
> As I suggested earlier, I'm attaching an example implementation
> of github-snapshot.eclass.
> 
> All the eclass does is providing a default src_unpack() unpacking
> the github snapshot into ${S}. Right now it simply does call default
> src_unpack() and then does a fuzzy `mv' but that can change
> in the future.
> 
> The eclass doesn't modify S or SRC_URI itself. An ebuild using it
> should look like the following:

A function to generate a github url for SRC_URI is likely warranted; 
should they ever grow mirrors/change their scheme, we can change it 
in one spot.

Plus it makes it easier for ebuild devs to specify the url ;)

~brian

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [gentoo-dev] Initial review for github-snapshot.eclass
  2011-05-31 20:40 ` Brian Harring
@ 2011-05-31 20:52   ` Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2011-05-31 20:52 UTC (permalink / raw
  To: gentoo-dev; +Cc: ferringb

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

On Tue, 31 May 2011 13:40:42 -0700
Brian Harring <ferringb@gmail.com> wrote:

> A function to generate a github url for SRC_URI is likely warranted; 
> should they ever grow mirrors/change their scheme, we can change it 
> in one spot.
> 
> Plus it makes it easier for ebuild devs to specify the url ;)

I thought about simply pushing mirror://github-snapshot/ instead to
handle future possibilities.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

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

end of thread, other threads:[~2011-05-31 20:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 14:24 [gentoo-dev] Initial review for github-snapshot.eclass Michał Górny
2011-05-31 18:41 ` William Hubbs
2011-05-31 18:47   ` Michał Górny
2011-05-31 18:56 ` [gentoo-dev] " Diego Elio Pettenò
2011-05-31 19:07 ` [gentoo-dev] " Mike Gilbert
2011-05-31 19:23   ` Michał Górny
2011-05-31 19:28 ` William Hubbs
2011-05-31 19:45   ` Michał Górny
2011-05-31 20:40 ` Brian Harring
2011-05-31 20:52   ` Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox