Re: [gentoo-portage-dev] gentoolkit.git repository reorganized

2015-10-29 Thread Mike Frysinger
On 22 Oct 2015 12:54, Paul Varner wrote:
> Mike, I know you're busy with other stuff, but if you ever want to see a
> new gentoolkit/gentoolkit-dev release, consider this your authorization
> to just do it.  The README.dev files state how to make releases.

thanks, i think this will help a lot

> Since, the tools have dwindled down in gentoolkit-dev, I do think it
> does make sense to keep it in the same repo and merge the packages
> together behind a USE flag.  I will revert the commit, that emptied the
> genttolkit-dev branch and ask mgorny to nuke the new gentoolkit-dev
> repository.
> 
> As I get time, I will work towards moving the gentoolkit-dev tools into
> gentoolkit and putting them behind a USE flag in the ebuild.

i'm no distutils expert, and every time i try to do something "fancy",
i get frustrated by the module :).  do people know of examples where
you can do optional installs with a flag ?  a cookbook sort of entry
here would help and i could take care of merging in say ekeyword.
-mike


signature.asc
Description: Digital signature


Re: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222)

2015-10-29 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Yep, looks good.

- -- 
Alexander
berna...@gentoo.org
https://secure.plaimi.net/~alexander
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQIcBAEBCgAGBQJWMecxAAoJENQqWdRUGk8B7JAP/i8pU6Geolcqk4yXK3g3CVjb
fRSB6/XKXYR1xjtWKhwO61FIAuxFk1FM6LvALPR/vQfu+eySBC9LXbhHsLf2c6y4
GphEt+OAI17wKXOiyum6OeIyiETaOrcgLa3hLEkCuXvjIxdfDymZwPHyeuqeDX6t
gqcmC8NZ+tyL97tkv8fYBT/c7T7o6REkQpfkcXre8cIQnY8r+yV8/CgadEaUipEh
dQunq3NmVi6YzmLlHj/t32zuYj8ZSMwOJ0UO3BTNLlGwSE7S2abM8cmTu5CVvGoS
ojnx/BKrekjGgcvK4HhbcDsZIZRqP1ca5wwVrLc6mw2ge7Qy9GRGs6OdeWdLGQFx
MCHUFZww8Ek3X3ngn7WHIaEEUgMrFqw01wsbQNZ0ZAf74d5QGzAGdAvg5DNAKydS
T8Kh8engDYof7o+uJa6HovWZJFgks6fdY2+kDl5NQSQgDAg2JdyvabM2Sc1AsTT1
ZYeogh3ccVtyHbI4Ipxa4mTs/1bjU6wI5TaO+oquaOHO4IQpRVCs4uylaAGbd0jg
ef3MSGZgrJW/EG7ytygT9cClBUDADf3kJGbm2jZVCbFDM0QX/X0xzv06ByD0XD/i
ZdA0PtoFUs5JNx1LKtwjrsO8lcc+OyMoBLnmht3ziuWDczicDDRezgjm2kmC4f1W
jacjcqxuhpyKHg1YF707
=sZRy
-END PGP SIGNATURE-



[gentoo-portage-dev] [PATCH 1/2] chpathtool: drop optparse compat logic

2015-10-29 Thread Mike Frysinger
We don't support python 2.6 anymore, so drop the non-argparse logic.
---
 bin/chpathtool.py | 45 +++--
 1 file changed, 11 insertions(+), 34 deletions(-)

diff --git a/bin/chpathtool.py b/bin/chpathtool.py
index 842f1f4..73c7a5f 100755
--- a/bin/chpathtool.py
+++ b/bin/chpathtool.py
@@ -7,18 +7,12 @@ doc = """Helper tool for converting installed files to custom 
prefixes.
 In other words, eprefixy $D for Gentoo/Prefix."""
 __doc__ = doc
 
-
+import argparse
 import io
 import os
 import stat
 import sys
 
-try:
-   from argparse import ArgumentParser
-except ImportError:
-   ArgumentParser = None
-   from optparse import OptionParser
-
 CONTENT_ENCODING = 'utf_8'
 FS_ENCODING = 'utf_8'
 
@@ -152,33 +146,16 @@ def chpath_inplace_symlink(filename, st, old, new):
 
 def main(argv):
 
-   if ArgumentParser is not None:
-   parser = ArgumentParser(description=doc)
-   parser.add_argument('location', default=None,
-   help='root directory (e.g. $D)')
-   parser.add_argument('old', default=None,
-   help='original build prefix (e.g. /)')
-   parser.add_argument('new', default=None,
-   help='new install prefix (e.g. $EPREFIX)')
-   opts = parser.parse_args(argv)
-
-   location, old, new = opts.location, opts.old, opts.new
-   else:
-   # Argument parsing compatibility for Python 2.6 using optparse.
-   parser = OptionParser(description=doc,
-   usage="usage: %prog [-h] location old new\n\n" 
+ \
-   "  location: root directory (e.g. $D)\n" + \
-   "  old:  original build prefix (e.g. /)\n" 
+ \
-   "  new:  new install prefix (e.g. 
$EPREFIX)")
-
-   (opts, args) = parser.parse_args()
-
-   if len(args) != 3:
-   parser.print_usage()
-   parser.error("%s: error: expected 3 arguments, 
got %i"
-   % (__file__, len(args)))
-
-   location, old, new = args[0:3]
+   parser = argparse.ArgumentParser(description=doc)
+   parser.add_argument('location', default=None,
+   help='root directory (e.g. $D)')
+   parser.add_argument('old', default=None,
+   help='original build prefix (e.g. /)')
+   parser.add_argument('new', default=None,
+   help='new install prefix (e.g. $EPREFIX)')
+   opts = parser.parse_args(argv)
+
+   location, old, new = opts.location, opts.old, opts.new
 
is_text_file = IsTextFile()
 
-- 
2.5.2




[gentoo-portage-dev] [PATCH 2/2] _argparse: punt the module

2015-10-29 Thread Mike Frysinger
Since we don't support python 2.6 anymore, there's no need to wrap
argparse, so switch all the users to the standard library for it.
---
 bin/binhost-snapshot |  4 ++--
 bin/ebuild   |  4 ++--
 bin/egencache|  4 ++--
 bin/fixpackages  |  4 ++--
 bin/glsa-check   |  4 ++--
 bin/install.py   |  4 ++--
 bin/portageq |  6 +++---
 bin/quickpkg |  4 ++--
 bin/xattr-helper.py  |  4 ++--
 bin/xpak-helper.py   |  4 ++--
 pym/_emerge/main.py  |  4 ++--
 pym/portage/_emirrordist/main.py |  4 ++--
 pym/portage/emaint/main.py   |  6 ++
 pym/portage/sync/controller.py   |  1 -
 pym/portage/tests/__init__.py|  4 ++--
 pym/portage/util/_argparse.py| 42 
 pym/repoman/argparser.py |  4 ++--
 17 files changed, 31 insertions(+), 76 deletions(-)
 delete mode 100644 pym/portage/util/_argparse.py

diff --git a/bin/binhost-snapshot b/bin/binhost-snapshot
index 3a34643..4130e75 100755
--- a/bin/binhost-snapshot
+++ b/bin/binhost-snapshot
@@ -2,6 +2,7 @@
 # Copyright 2010-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+import argparse
 import io
 import os
 import sys
@@ -17,7 +18,6 @@ if 
osp.isfile(osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), ".porta
sys.path.insert(0, 
osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), "pym"))
 import portage
 portage._internal_caller = True
-from portage.util._argparse import ArgumentParser
 
 def parse_args(argv):
prog_name = os.path.basename(argv[0])
@@ -45,7 +45,7 @@ def parse_args(argv):
"write Packages index with\n" + \
" snapshot_uri"
 
-   parser = ArgumentParser(usage=usage)
+   parser = argparse.ArgumentParser(usage=usage)
parser.add_argument('--hardlinks',
help='create hardlinks (y or n, default is y)',
choices=('y', 'n'),
diff --git a/bin/ebuild b/bin/ebuild
index ad52ed5..59fced0 100755
--- a/bin/ebuild
+++ b/bin/ebuild
@@ -4,6 +4,7 @@
 
 from __future__ import print_function
 
+import argparse
 import platform
 import signal
 import sys
@@ -48,13 +49,12 @@ from portage import _shell_quote
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.const import VDB_PATH
-from portage.util._argparse import ArgumentParser
 from _emerge.Package import Package
 from _emerge.RootConfig import RootConfig
 
 description = "See the ebuild(1) man page for more info"
 usage = "Usage: ebuild   [command] ..."
-parser = ArgumentParser(description=description, usage=usage)
+parser = argparse.ArgumentParser(description=description, usage=usage)
 
 force_help = "When used together with the digest or manifest " + \
"command, this option forces regeneration of digests for all " + \
diff --git a/bin/egencache b/bin/egencache
index 67fca73..6407a44 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -5,6 +5,7 @@
 # unicode_literals for compat with TextIOWrapper in Python 2
 from __future__ import print_function, unicode_literals
 
+import argparse
 import platform
 import signal
 import stat
@@ -54,7 +55,6 @@ from portage.const import TIMESTAMP_FORMAT
 from portage.manifest import guessManifestFileType
 from portage.package.ebuild._parallel_manifest.ManifestScheduler import 
ManifestScheduler
 from portage.util import cmp_sort_key, writemsg_level
-from portage.util._argparse import ArgumentParser
 from portage.util._async.run_main_scheduler import run_main_scheduler
 from portage.util._eventloop.global_event_loop import global_event_loop
 from portage import cpv_getkey
@@ -81,7 +81,7 @@ if sys.hexversion >= 0x300:
 
 def parse_args(args):
usage = "egencache [options]  ... [atom] ..."
-   parser = ArgumentParser(usage=usage)
+   parser = argparse.ArgumentParser(usage=usage)
 
actions = parser.add_argument_group('Actions')
actions.add_argument("--update",
diff --git a/bin/fixpackages b/bin/fixpackages
index 8a0c444..70ca9fc 100755
--- a/bin/fixpackages
+++ b/bin/fixpackages
@@ -4,6 +4,7 @@
 
 from __future__ import print_function
 
+import argparse
 import os
 import sys
 
@@ -14,7 +15,6 @@ import portage
 portage._internal_caller = True
 from portage import os
 from portage.output import EOutput
-from portage.util._argparse import ArgumentParser
 from textwrap import wrap
 from portage._global_updates import _global_updates
 mysettings = portage.settings
@@ -25,7 +25,7 @@ description = """The fixpackages program performs package 
move updates on
configuration files, installed packages, and binary packages."""
 description = " ".join(description.split())
 
-parser = ArgumentParser(description=description)
+parser = argparse.ArgumentParser(description=description)
 parser.parse_args()
 
 if mysettings['ROOT'] != 

Re: [gentoo-portage-dev] gentoolkit.git repository reorganized

2015-10-29 Thread Michał Górny
On Thu, 29 Oct 2015 21:06:33 -0700
Brian Dolbec  wrote:

> On Thu, 29 Oct 2015 17:37:26 -0400
> Mike Frysinger  wrote:
> 
> > On 22 Oct 2015 12:54, Paul Varner wrote:  
> > > Mike, I know you're busy with other stuff, but if you ever want to
> > > see a new gentoolkit/gentoolkit-dev release, consider this your
> > > authorization to just do it.  The README.dev files state how to
> > > make releases.  
> > 
> > thanks, i think this will help a lot
> >   
> > > Since, the tools have dwindled down in gentoolkit-dev, I do think it
> > > does make sense to keep it in the same repo and merge the packages
> > > together behind a USE flag.  I will revert the commit, that emptied
> > > the genttolkit-dev branch and ask mgorny to nuke the new
> > > gentoolkit-dev repository.
> > > 
> > > As I get time, I will work towards moving the gentoolkit-dev tools
> > > into gentoolkit and putting them behind a USE flag in the ebuild.  
> > 
> > i'm no distutils expert, and every time i try to do something "fancy",
> > i get frustrated by the module :).  do people know of examples where
> > you can do optional installs with a flag ?  a cookbook sort of entry
> > here would help and i could take care of merging in say ekeyword.
> > -mike  
> 
> Have a look at layman's setup.py.  It parses IUSE to set the installed
> files via setup.py.  It may not be the best method, but it does work.
> 
> The layman ebuild sets deps acording to the ISUE flags and setup.py
> sets the installed modules on the python side.

Sorry, what?! That's a huge QA violation. There is *NO* guarantee that
USE will be exported. In fact, it is only exported because of poor
design inside Portage that could result in the variable getting lost
otherwise.

-- 
Best regards,
Michał Górny



pgpE6AaN9BPow.pgp
Description: OpenPGP digital signature


Re: [gentoo-portage-dev] gentoolkit.git repository reorganized

2015-10-29 Thread Brian Dolbec
On Thu, 29 Oct 2015 17:37:26 -0400
Mike Frysinger  wrote:

> On 22 Oct 2015 12:54, Paul Varner wrote:
> > Mike, I know you're busy with other stuff, but if you ever want to
> > see a new gentoolkit/gentoolkit-dev release, consider this your
> > authorization to just do it.  The README.dev files state how to
> > make releases.
> 
> thanks, i think this will help a lot
> 
> > Since, the tools have dwindled down in gentoolkit-dev, I do think it
> > does make sense to keep it in the same repo and merge the packages
> > together behind a USE flag.  I will revert the commit, that emptied
> > the genttolkit-dev branch and ask mgorny to nuke the new
> > gentoolkit-dev repository.
> > 
> > As I get time, I will work towards moving the gentoolkit-dev tools
> > into gentoolkit and putting them behind a USE flag in the ebuild.
> 
> i'm no distutils expert, and every time i try to do something "fancy",
> i get frustrated by the module :).  do people know of examples where
> you can do optional installs with a flag ?  a cookbook sort of entry
> here would help and i could take care of merging in say ekeyword.
> -mike

Have a look at layman's setup.py.  It parses IUSE to set the installed
files via setup.py.  It may not be the best method, but it does work.

The layman ebuild sets deps acording to the ISUE flags and setup.py
sets the installed modules on the python side.

-- 
Brian Dolbec 




Re: [gentoo-portage-dev] [PATCH 2/2] _argparse: punt the module

2015-10-29 Thread Zac Medico
On 10/29/2015 08:57 PM, Mike Frysinger wrote:
> Since we don't support python 2.6 anymore, there's no need to wrap
> argparse, so switch all the users to the standard library for it.

Both patches look good.
-- 
Thanks,
Zac