Re: [gentoo-portage-dev] [PATCH] grabfile_package: support -* in profile "packages" files (bug 610670)

2017-02-23 Thread Zac Medico
On 02/23/2017 09:03 AM, Joakim Tjernlund wrote:
> On Thu, 2017-02-23 at 07:52 -0800, Brian Dolbec wrote:
>> On Thu, 23 Feb 2017 11:53:15 +
>> Joakim Tjernlund  wrote:
>>
>>> On Thu, 2017-02-23 at 02:52 -0800, Zac Medico wrote:
 Support -* in order to make it easier to create profiles for
 minimal systems (especially those built entirely from binary
 packages).  
>>>
>>> Would be nice, but I don't get what the "packages" file is?
>>
>>
>> That would be the 'packages' file (list of required packages)that are
>> required for that specific profile.   This patch would allow to
>> override that packages file  to build an image that only contained the
>> minimum runtime pkgs required to perform the tasks it is suppose to.
>> The idea being you would not need gcc, automake, ... or even portage or
>> possibly python.  The built image could of course be considered more
>> secure not having a compiler, etc... not to mention smaller.
> 
> Many of the packages files in /usr/portage/profiles already contain -* so
> I guess this must be another packages file?
> in /etc/portage or possibly /usr/portage/packges/ ?
> 
>   Jocke
> 

Here's an example:

https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/base/packages

Files like that define the @system set.
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] grabfile_package: support -* in profile "packages" files (bug 610670)

2017-02-23 Thread Joakim Tjernlund
On Thu, 2017-02-23 at 07:52 -0800, Brian Dolbec wrote:
> On Thu, 23 Feb 2017 11:53:15 +
> Joakim Tjernlund  wrote:
> 
> > On Thu, 2017-02-23 at 02:52 -0800, Zac Medico wrote:
> > > Support -* in order to make it easier to create profiles for
> > > minimal systems (especially those built entirely from binary
> > > packages).  
> > 
> > Would be nice, but I don't get what the "packages" file is?
> 
> 
> That would be the 'packages' file (list of required packages)that are
> required for that specific profile.   This patch would allow to
> override that packages file  to build an image that only contained the
> minimum runtime pkgs required to perform the tasks it is suppose to.
> The idea being you would not need gcc, automake, ... or even portage or
> possibly python.  The built image could of course be considered more
> secure not having a compiler, etc... not to mention smaller.

Many of the packages files in /usr/portage/profiles already contain -* so
I guess this must be another packages file?
in /etc/portage or possibly /usr/portage/packges/ ?

  Jocke


Re: [gentoo-portage-dev] [PATCH] grabfile_package: support -* in profile "packages" files (bug 610670)

2017-02-23 Thread Zac Medico
On 02/23/2017 07:52 AM, Brian Dolbec wrote:
> On Thu, 23 Feb 2017 11:53:15 +
> Joakim Tjernlund  wrote:
> 
>> On Thu, 2017-02-23 at 02:52 -0800, Zac Medico wrote:
>>> Support -* in order to make it easier to create profiles for
>>> minimal systems (especially those built entirely from binary
>>> packages).  
>>
>> Would be nice, but I don't get what the "packages" file is?
> 
> 
> That would be the 'packages' file (list of required packages)that are
> required for that specific profile.   This patch would allow to
> override that packages file  to build an image that only contained the
> minimum runtime pkgs required to perform the tasks it is suppose to.
> The idea being you would not need gcc, automake, ... or even portage or
> possibly python.  The built image could of course be considered more
> secure not having a compiler, etc... not to mention smaller.
> 
> 
> Zac, looks fine to me.

Thanks, merged:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=f4b0714010f1237280fd48dcb65989679917d20a
-- 
Thanks,
Zac



Re: [gentoo-portage-dev] [PATCH] grabfile_package: support -* in profile "packages" files (bug 610670)

2017-02-23 Thread Brian Dolbec
On Thu, 23 Feb 2017 11:53:15 +
Joakim Tjernlund  wrote:

> On Thu, 2017-02-23 at 02:52 -0800, Zac Medico wrote:
> > Support -* in order to make it easier to create profiles for
> > minimal systems (especially those built entirely from binary
> > packages).  
> 
> Would be nice, but I don't get what the "packages" file is?


That would be the 'packages' file (list of required packages)that are
required for that specific profile.   This patch would allow to
override that packages file  to build an image that only contained the
minimum runtime pkgs required to perform the tasks it is suppose to.
The idea being you would not need gcc, automake, ... or even portage or
possibly python.  The built image could of course be considered more
secure not having a compiler, etc... not to mention smaller.


Zac, looks fine to me.


> 
> > 
> > X-Gentoo-Bug: 610670
> > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=610670
> > ---
> >  pym/portage/util/__init__.py | 9 -
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/pym/portage/util/__init__.py
> > b/pym/portage/util/__init__.py index c2c871f..45710ba 100644
> > --- a/pym/portage/util/__init__.py
> > +++ b/pym/portage/util/__init__.py
> > @@ -478,13 +478,20 @@ def grabfile_package(myfilename,
> > compatlevel=0, recursive=0, eapi = read_corresponding_eapi_file(
> > myfilename, default=eapi_default)
> > mybasename = os.path.basename(myfilename)
> > +   is_packages_file = mybasename == 'packages'
> > atoms = []
> > for pkg, source_file in pkgs:
> > pkg_orig = pkg
> > # for packages and package.mask files
> > if pkg[:1] == "-":
> > +   if is_packages_file and pkg == '-*':
> > +   if remember_source_file:
> > +   atoms.append((pkg,
> > source_file))
> > +   else:
> > +   atoms.append(pkg)
> > +   continue
> > pkg = pkg[1:]
> > -   if pkg[:1] == '*' and mybasename == 'packages':
> > +   if pkg[:1] == '*' and is_packages_file:
> > pkg = pkg[1:]
> > try:
> > pkg = Atom(pkg,
> > allow_wildcard=allow_wildcard,  
> 



-- 
Brian Dolbec 




Re: [gentoo-portage-dev] [PATCH] grabfile_package: support -* in profile "packages" files (bug 610670)

2017-02-23 Thread Joakim Tjernlund
On Thu, 2017-02-23 at 02:52 -0800, Zac Medico wrote:
> Support -* in order to make it easier to create profiles for
> minimal systems (especially those built entirely from binary
> packages).

Would be nice, but I don't get what the "packages" file is?

> 
> X-Gentoo-Bug: 610670
> X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=610670
> ---
>  pym/portage/util/__init__.py | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
> index c2c871f..45710ba 100644
> --- a/pym/portage/util/__init__.py
> +++ b/pym/portage/util/__init__.py
> @@ -478,13 +478,20 @@ def grabfile_package(myfilename, compatlevel=0, 
> recursive=0,
>   eapi = read_corresponding_eapi_file(
>   myfilename, default=eapi_default)
>   mybasename = os.path.basename(myfilename)
> + is_packages_file = mybasename == 'packages'
>   atoms = []
>   for pkg, source_file in pkgs:
>   pkg_orig = pkg
>   # for packages and package.mask files
>   if pkg[:1] == "-":
> + if is_packages_file and pkg == '-*':
> + if remember_source_file:
> + atoms.append((pkg, source_file))
> + else:
> + atoms.append(pkg)
> + continue
>   pkg = pkg[1:]
> - if pkg[:1] == '*' and mybasename == 'packages':
> + if pkg[:1] == '*' and is_packages_file:
>   pkg = pkg[1:]
>   try:
>   pkg = Atom(pkg, allow_wildcard=allow_wildcard,