Skip Menu |

This queue is for tickets about the CPANPLUS-Dist-Gentoo CPAN distribution.

Report information
The Basics
Id: 41483
Status: resolved
Priority: 0/
Queue: CPANPLUS-Dist-Gentoo

People
Owner: Nobody in particular
Requestors: kentfredric [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.03
Fixed in: 0.04



Subject: Alternative Ebuild Emission Format(s)
I've just started using your module since it turned up in the perl-experimental overlay, however, there are a few improvements that could be made. The notation of the ebuild emissions emits, for starters, redundant data. Specifying SRC_URI is not nessecary, and specifying the module author tends to do the trick. category/package/package-pv.ebuild : MODULE_AUTHOR=AUTHORHERE # Ie, INGY, SIMON, etc inherit perl-module and that generally is enough for the perl-module eclass to work out the origin. Given this, S and HOMEPAGE, are also unnecessary. Additionally, appending SRC_TEST="do" would be helpful for packages that support tests. Finally, the bog standard Gentoo Copyright header should be generated. You may wish to permit the user to specify their own header, so that users running their own overlays can append $Id$ strings relative to their distribution method. If there was a way to template the whole ebuild, that would be nice, but I understand thats a bit far fetched. This is perl, v5.10.0 built for x86_64-linux Linux ember 2.6.27-gentoo-r4 #3 SMP PREEMPT Fri Nov 28 11:36:04 NZDT 2008 x86_64 Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz GenuineIntel GNU/Linux CPANPLUS-Dist-Gentoo-0.03
Hello, Show quoted text
> I've just started using your module since it turned up in the > perl-experimental overlay, however, there are a few improvements that > could be made. > > The notation of the ebuild emissions emits, for starters, redundant data. > > Specifying SRC_URI is not nessecary, and specifying the module author > tends to do the trick.
Okay. Show quoted text
> Additionally, appending > > SRC_TEST="do" > > would be helpful for packages that support tests.
I tend to think that tests should be run only if the test USE flag is set. Does SRC_TEST handles this? Show quoted text
> Finally, the bog standard Gentoo Copyright header should be generated.
I didn't know the ebuild format was copyrighted by Gentoo. Show quoted text
> You may wish to permit the user to specify their own header, so that > users running their own overlays can append $Id$ strings relative to > their distribution method.
Sounds sensible. This could also allow the user to specify the copyright. Would that be good enough? Show quoted text
> If there was a way to template the whole ebuild, that would be nice, but > I understand thats a bit far fetched.
If there's a real need for it, then I may have to resort to this, yes. But for now I'd try to keep it as simple as possible. Many thanks for your suggestions. Vincent.
From: kentfredric [...] gmail.com
On Sat Dec 06 09:00:02 2008, VPIT wrote: Show quoted text
> > Additionally, appending > > > > SRC_TEST="do" > > > > would be helpful for packages that support tests.
> > I tend to think that tests should be run only if the test USE flag is > set. Does SRC_TEST handles this?
In the ebuild phase, src_test is controlled by the FEATURES test flag. if FEATURES =~ /test/ and defined src_test, src_test is then executed. Setting SRC_TEST="do" enables the "default" test kit to be run for the ebuild as follows: perl-module_src_test() { if [ "${SRC_TEST}" == "do" ]; then perlinfo if [ -f Makefile ]; then make test || die "test failed" elif [ -f Build ]; then perl Build test || die "test failed" fi fi } If this testing operation is not what you want, you simply define src_test() in the ebuild and it runs that instead. the "test" useflag is for something different entirely, the primary purpose of that is to allow downloading of additional files for the tests, or, in some cases, depending on tools required to perform tests. ( For a good example, see dev-perl/Data-UUID/Data-UUID-1.148.ebuild ) Show quoted text
>
> > Finally, the bog standard Gentoo Copyright header should be generated.
> > I didn't know the ebuild format was copyrighted by Gentoo.
I'm not sure if the format itself is copyrighted, but often, individual ebuilds are. Its not standard to copy ebuilds that are generated directly into mainline, but its feasible that a generated ebuild will be used as a starting point, and then applied minor modifications to make it suitable, and pasting the notice in as an afterthought is rather annoying. Additionally, the EChangelog utility plays with these and makes sure the copyright dates are recent to when the file was last modified, which is quite convenient. Show quoted text
>
> > You may wish to permit the user to specify their own header, so that > > users running their own overlays can append $Id$ strings relative to > > their distribution method.
> > Sounds sensible. This could also allow the user to specify the > copyright. Would that be good enough?
Yeah, that makes perfect sense to me, arbitrary prepend file or something, if its easy to configure, or easy to add in a script that remembers your chosen parameter, that would be ideal. Show quoted text
> > If there was a way to template the whole ebuild, that would be nice, but > > I understand thats a bit far fetched.
> > If there's a real need for it, then I may have to resort to this, yes. > But for now I'd try to keep it as simple as possible. >
Thanks for producing this module, I've been using g-cpan instead for a while, and the codebase behind that is a huge unwieldy monster making it unmaintainable and any minor improvements a nightmare -- Kent.
I've just released 0.04, crashing soon a CPAN mirror near you. The S, SRC_URI and HOMEPAGE stuff actually uncovered a bug in 0.03. It used to try to fetch the source tarballs on the CPAN mirror through the modules/by-module path, but this gives only access to distributions that contains a module listed in the module list. Since that list is far for being exhaustive, that prevented many dists from being fetched by end users. I couldn't see it because after the ebuilds are generated, the source tarballs are copied to the distdir, so the mirror path hadn't to be used by ebuild/emerge. The solution was to use the modules/by-authors/id/X/XY/XYZ path, which lead to all distributions. While testing, I used the wrong module version and endend up thinking the perl-module eclass had the same issue. I realized that was wrong only after uploading the new version. There's no harm, and I'll rely completely on the eclass in the next one. I guess this calls for writing a real testsuite. :) Show quoted text
> In the ebuild phase, src_test is controlled by the FEATURES test flag. > if FEATURES =~ /test/ and defined src_test, src_test is then executed.
Oh, okay, that's great. I've added it. Thanks for elaborating. Show quoted text
> Yeah, that makes perfect sense to me, arbitrary prepend file or > something, if its easy to configure, or easy to add in a script that > remembers your chosen parameter, that would be ideal. >
I've added two 'header' and 'footer' dist-opts. The new samples/g-cpanp script show how to use them with cpan2dist. Show quoted text
> Thanks for producing this module, I've been using g-cpan instead for a > while, and the codebase behind that is a huge unwieldy monster making it > unmaintainable and any minor improvements a nightmare > > -- Kent.
Many thanks for your suggestions, and feel free to ping me anytime. Vincent.