public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] using python in installation scripts
@ 2009-04-16  7:55 Amit Dor-Shifer
  2009-04-16  8:17 ` Zac Medico
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Dor-Shifer @ 2009-04-16  7:55 UTC (permalink / raw
  To: gentoo-portage-dev

I want to read/write an XML file while an ebuild executes. Since I'm 
unaware of any XML support in bash, I'm thinking of using python: I'd 
write some python code and bundle it somehow into the package, so that 
is shall be usable from pkg_XXX scripts.

I browsed the tree and couldn't find other ebuilds that use python (nor 
perl, for that matter),  so I'm doing a sanity check: is this a wrong 
path to follow? Appreciate comments. 10x.
Amit



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

* Re: [gentoo-portage-dev] using python in installation scripts
  2009-04-16  7:55 [gentoo-portage-dev] using python in installation scripts Amit Dor-Shifer
@ 2009-04-16  8:17 ` Zac Medico
  2009-04-17  6:17   ` Alec Warner
  0 siblings, 1 reply; 5+ messages in thread
From: Zac Medico @ 2009-04-16  8:17 UTC (permalink / raw
  To: gentoo-portage-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Amit Dor-Shifer wrote:
> I want to read/write an XML file while an ebuild executes. Since I'm
> unaware of any XML support in bash, I'm thinking of using python: I'd
> write some python code and bundle it somehow into the package, so that
> is shall be usable from pkg_XXX scripts.
> 
> I browsed the tree and couldn't find other ebuilds that use python (nor
> perl, for that matter),  so I'm doing a sanity check: is this a wrong
> path to follow? Appreciate comments. 10x.
> Amit

You can use whatever you like as long as you declare it in your
build-time dependencies (DEPEND). If you require that python be
built with the xml USE flag then you should set EAPI="2" and
DEPEND="dev-lang/python[xml]".
- --
Thanks,
Zac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)

iEYEARECAAYFAknm6YAACgkQ/ejvha5XGaM8SwCffZqf1k/jo0R5drk9IN0zwM6o
p0YAn0x0bAGJEe6fNwVJ/pSgRLVSCdrS
=Z5Nu
-----END PGP SIGNATURE-----



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

* Re: [gentoo-portage-dev] using python in installation scripts
  2009-04-16  8:17 ` Zac Medico
@ 2009-04-17  6:17   ` Alec Warner
  2009-04-17  6:19     ` Nirbheek Chauhan
  2009-04-19  5:50     ` Amit Dor-Shifer
  0 siblings, 2 replies; 5+ messages in thread
From: Alec Warner @ 2009-04-17  6:17 UTC (permalink / raw
  To: gentoo-portage-dev

On Thu, Apr 16, 2009 at 1:17 AM, Zac Medico <zmedico@gentoo.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Amit Dor-Shifer wrote:
>> I want to read/write an XML file while an ebuild executes. Since I'm
>> unaware of any XML support in bash, I'm thinking of using python: I'd
>> write some python code and bundle it somehow into the package, so that
>> is shall be usable from pkg_XXX scripts.
>>
>> I browsed the tree and couldn't find other ebuilds that use python (nor
>> perl, for that matter),  so I'm doing a sanity check: is this a wrong
>> path to follow? Appreciate comments. 10x.
>> Amit
>
> You can use whatever you like as long as you declare it in your
> build-time dependencies (DEPEND). If you require that python be
> built with the xml USE flag then you should set EAPI="2" and
> DEPEND="dev-lang/python[xml]".

Slight caveat, you can do whatever you want as long as it isn't in
global scope.  Putting a python script in FILESDIR or bundling it with
the package is standard procedure, I know a bunch of tcl stuff used to
use tcl to install itself and distutils.eclass for example runs
setup.py to install things, so its nothing new.

-A

> - --
> Thanks,
> Zac
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.11 (GNU/Linux)
>
> iEYEARECAAYFAknm6YAACgkQ/ejvha5XGaM8SwCffZqf1k/jo0R5drk9IN0zwM6o
> p0YAn0x0bAGJEe6fNwVJ/pSgRLVSCdrS
> =Z5Nu
> -----END PGP SIGNATURE-----
>
>



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

* Re: [gentoo-portage-dev] using python in installation scripts
  2009-04-17  6:17   ` Alec Warner
@ 2009-04-17  6:19     ` Nirbheek Chauhan
  2009-04-19  5:50     ` Amit Dor-Shifer
  1 sibling, 0 replies; 5+ messages in thread
From: Nirbheek Chauhan @ 2009-04-17  6:19 UTC (permalink / raw
  To: gentoo-portage-dev

On Fri, Apr 17, 2009 at 11:47 AM, Alec Warner <antarus@gentoo.org> wrote:
> Slight caveat, you can do whatever you want as long as it isn't in
> global scope.  Putting a python script in FILESDIR or bundling it with
> the package is standard procedure, I know a bunch of tcl stuff used to
> use tcl to install itself and distutils.eclass for example runs
> setup.py to install things, so its nothing new.
>

Or if the script is small, you can do `python - <<<"print help"` etc.

-- 
~Nirbheek Chauhan



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

* Re: [gentoo-portage-dev] using python in installation scripts
  2009-04-17  6:17   ` Alec Warner
  2009-04-17  6:19     ` Nirbheek Chauhan
@ 2009-04-19  5:50     ` Amit Dor-Shifer
  1 sibling, 0 replies; 5+ messages in thread
From: Amit Dor-Shifer @ 2009-04-19  5:50 UTC (permalink / raw
  To: gentoo-portage-dev

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

Great. 10x!
Amit

Alec Warner wrote:
>  On Thu, Apr 16, 2009 at 1:17 AM, Zac Medico <zmedico@gentoo.org> wrote:
> Amit Dor-Shifer wrote:
> >>> I want to read/write an XML file while an ebuild executes. Since I'm
> >>> unaware of any XML support in bash, I'm thinking of using python: I'd
> >>> write some python code and bundle it somehow into the package, so that
> >>> is shall be usable from pkg_XXX scripts.
> >>>
> >>> I browsed the tree and couldn't find other ebuilds that use python 
> (nor
> >>> perl, for that matter),  so I'm doing a sanity check: is this a wrong
> >>> path to follow? Appreciate comments. 10x.
> >>> Amit
> You can use whatever you like as long as you declare it in your
> build-time dependencies (DEPEND). If you require that python be
> built with the xml USE flag then you should set EAPI="2" and
> DEPEND="dev-lang/python[xml]".
>
> > Slight caveat, you can do whatever you want as long as it isn't in
> > global scope.  Putting a python script in FILESDIR or bundling it with
> > the package is standard procedure, I know a bunch of tcl stuff used to
> > use tcl to install itself and distutils.eclass for example runs
> > setup.py to install things, so its nothing new.
>
> > -A
>
> >
> >



[-- Attachment #2: Type: text/html, Size: 1879 bytes --]

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

end of thread, other threads:[~2009-04-19  5:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16  7:55 [gentoo-portage-dev] using python in installation scripts Amit Dor-Shifer
2009-04-16  8:17 ` Zac Medico
2009-04-17  6:17   ` Alec Warner
2009-04-17  6:19     ` Nirbheek Chauhan
2009-04-19  5:50     ` Amit Dor-Shifer

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