[gentoo-portage-dev] [PATCH v2] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI 4. Fixes bug 379491.

2014-01-15 Thread Chris Reffett
---
 pym/repoman/checks.py | 29 +
 1 file changed, 29 insertions(+)

diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 85aa065..5c55b0d 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck):
re = re.compile(r'(^|.*\b)hasq\b')
error = errors.HASQ_ERROR
 
+# EAPI 2 checks
+class Eapi01UndefinedPhases(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   src_configprepare_re = re.compile(r'\s*src_(configure|prepare)\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return eapi in ('0', '1')
+
+   def check(self, num, line):
+   m = self.src_configprepare__re.match(line)
+   if m is not None:
+   return (%s % m.group(1)) + \
+phase is not defined in EAPI=0/1 on line: %d
+
+
 # EAPI-3 checks
 class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
@@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck):
return ('%s' % m.group(1)) + \
 has been deprecated in EAPI=3 on line: %d
 
+# EAPI 4 checks
+class Eapi0123UndefinedPhases(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   pkg_pretend_re = re.compile(r'\s*pkg_pretend\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return eapi in ('0', '1', '2', '3')
+
+   def check(self, num, line):
+   m = self.pkg_pretend_re.match(line)
+   if m is not None:
+   return (%s % m.group(1)) + \
+phase is not defined in EAPI  4 on line: %d
+
 # EAPI-4 checks
 class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
-- 
1.8.5.1




Re: [gentoo-portage-dev] [PATCH] Document bugzilla workflow

2014-01-15 Thread Sebastian Luther
Am 15.01.2014 17:20, schrieb Tom Wijsman:
 On Wed, 15 Jan 2014 07:29:19 +0100
 Sebastian Luther sebastianlut...@gmx.de wrote:
 
 Am 15.01.2014 04:11, schrieb Tom Wijsman:


 I send the first mail with this wording 8 days ago. Enough time to
 comment on it. I'd prefer to discuss it on the list.
 
 Yes, but not all comments were discussed yet, therefore (dis)agreement
 on them is missing; and this last thing rather became a topic of
 discussion due to the work clashes that we saw happen twice.
 
I'd say the clashes occurred because nobody mentioned at all what they
are working on. Since people started using IN_PROGRESS to mean I'm
working on it, this shouldn't happen again.
 
 Yes, I see some commit messages not refer to bugs which is something we
 will want to avoid; think this might need to go into the commit policy.
 
There's nothing wrong with fixing/implementing something that nobody
filed a bug about.


 The way it was is to not care about them at all. There was no
 agreement on the the other thread if these things should be used or
 not. So I left it vague so everyone could use it, but they are not
 forced to.
 
 Hmm, could this result in conflicting usage of these?

Maybe, but I'd first see if the usage patterns converge to something
that makes everyone happy.
 
 +There are a number of bugs named [TRACKER] * that collect bugs
 +for specific topics. Confirmed bugs should be marked as blocking
 +these tracker bugs if appropriate.

 For clarity, it should be mentioned that this does not mean to block
 the tracker for the next version; this could be misinterpreted.

 Considering that the tracker gets renamed, I'm not sure what you mean
 here.
 
 As you are confused yourself by misinterpreting what you have written,
 you demonstrate the case for the need of clarity here; this is not
 about the next version tracker or it being renamed at all, it's about
 all other trackers that are not version trackers. The part of the
 policy quoted here doesn't make that clear, it had me puzzling for a
 moment too when I first read that; I think you were puzzled too now...
 

Sorry, I failed to properly read what you quoted.

I think once you know that these other trackers exist, it's clear. If
you want something added there, that's fine with me too.


Sebastian



Re: [gentoo-portage-dev] [PATCH] Document bugzilla workflow

2014-01-15 Thread Sebastian Luther
Am 15.01.2014 19:41, schrieb Tom Wijsman:
 Yes, I see some commit messages not refer to bugs which is 
 something we will want to avoid; think this might need to go
 into the commit policy.
 
 There's nothing wrong with fixing/implementing something that
 nobody filed a bug about.
 
 Sorry, consider the common case where a bug was filed but the
 commit message does not refer to that bug. Also note that I am
 trying to refer to the ChangeLog of Portage itself, not that of the
 ebuild; thus I mean the commit messages for the Portage repo, not
 to the Portage tree.
 
Not sure if we're talking about the same things.

1) If you fix something that has a bug, you should refer to that in
the git commit message.
2) There's nothing wrong with a git commit message that does not refer
to a bug, if there is no bug filed.

 The whole point of documenting it in a workflow is to make it
 converge;

Not the converge I meant.

What I meant was to allow people to test different styles and hope
that the one that works best will be adopted by everyone at some
point. Once that happens you can document that style.

 if you instead leave things unclear or undocumented, you have no 
 guaranteed convergence and might even see a disconvergence.

Yes, maybe. One then needs to see if that is a problem and if it is
then force everyone to use one style.

 
 It's already making people unhappy right now; because as it is 
 documented now, it is turned from the meaningful experience that
 the previous Portage team had before to something that is
 meaningless. It is a regression in checking the list of bugs that
 block the tracker, as the states of the bugs no longer have a value
 as it is documented now.
 
Previously the bug state was not used at all. There is no regression.




[gentoo-portage-dev] [PATCH v3] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI 4. Fixes bug 379491.

2014-01-15 Thread Chris Reffett
---
 pym/repoman/checks.py | 29 +
 1 file changed, 29 insertions(+)

Ignore v2, I apparently didn't commit all of my changes and so that patch
won't work. Undid the compression of the src_prepare/src_configure regex,
because the way that the regex is set up means that it would output prepare
phase is not defined in EAPI... instead of src_prepare and I feel that
it's more intuitive to match the full name of the function instead of tacking
src_ in front of the output.


diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 85aa065..c6860d8 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck):
re = re.compile(r'(^|.*\b)hasq\b')
error = errors.HASQ_ERROR
 
+# EAPI 2 checks
+class Eapi01UndefinedPhases(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   src_configprepare_re = 
re.compile(r'\s*(src_configure|src_prepare)\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return eapi in ('0', '1')
+
+   def check(self, num, line):
+   m = self.src_configprepare_re.match(line)
+   if m is not None:
+   return ('%s' % m.group(1)) + \
+phase is not defined in EAPI  2 on line: %d
+
+
 # EAPI-3 checks
 class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
@@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck):
return ('%s' % m.group(1)) + \
 has been deprecated in EAPI=3 on line: %d
 
+# EAPI 4 checks
+class Eapi0123UndefinedPhases(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   pkg_pretend_re = re.compile(r'\s*(pkg_pretend)\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return eapi in ('0', '1', '2', '3')
+
+   def check(self, num, line):
+   m = self.pkg_pretend_re.match(line)
+   if m is not None:
+   return ('%s' % m.group(1)) + \
+phase is not defined in EAPI  4 on line: %d
+
 # EAPI-4 checks
 class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
-- 
1.8.5.1




[gentoo-portage-dev] [PATCH v4] Add repoman check to warn if src_prepare/src_configure are used in EAPI 0/1 and if pkg_pretend is used in EAPI 4. Fixes bug 379491.

2014-01-15 Thread Chris Reffett
---
 pym/repoman/checks.py | 31 ++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index 85aa065..c814fa7 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -15,7 +15,7 @@ import repoman.errors as errors
 import portage
 from portage.eapi import eapi_supports_prefix, eapi_has_implicit_rdepend, \
eapi_has_src_prepare_and_src_configure, eapi_has_dosed_dohard, \
-   eapi_exports_AA
+   eapi_exports_AA, eapi_has_pkg_pretend
 
 class LineCheck(object):
Run a check on a line of an ebuild.
@@ -731,6 +731,21 @@ class DeprecatedHasq(LineCheck):
re = re.compile(r'(^|.*\b)hasq\b')
error = errors.HASQ_ERROR
 
+# EAPI 2 checks
+class UndefinedSrcPrepareSrcConfigurePhases(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   src_configprepare_re = 
re.compile(r'\s*(src_configure|src_prepare)\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return not eapi_has_src_prepare_and_src_configure(eapi)
+
+   def check(self, num, line):
+   m = self.src_configprepare_re.match(line)
+   if m is not None:
+   return ('%s' % m.group(1)) + \
+phase is not defined in EAPI  2 on line: %d
+
+
 # EAPI-3 checks
 class Eapi3DeprecatedFuncs(LineCheck):
repoman_check_name = 'EAPI.deprecated'
@@ -745,6 +760,20 @@ class Eapi3DeprecatedFuncs(LineCheck):
return ('%s' % m.group(1)) + \
 has been deprecated in EAPI=3 on line: %d
 
+# EAPI 4 checks
+class UndefinedPkgPretendPhase(LineCheck):
+   repoman_check_name = 'EAPI.incompatible'
+   pkg_pretend_re = re.compile(r'\s*(pkg_pretend)\s*\(\)')
+
+   def check_eapi(self, eapi):
+   return not eapi_has_pkg_pretend(eapi)
+
+   def check(self, num, line):
+   m = self.pkg_pretend_re.match(line)
+   if m is not None:
+   return ('%s' % m.group(1)) + \
+phase is not defined in EAPI  4 on line: %d
+
 # EAPI-4 checks
 class Eapi4IncompatibleFuncs(LineCheck):
repoman_check_name = 'EAPI.incompatible'
-- 
1.8.5.1




[gentoo-portage-dev] [PATCH 2/3] Have repoman check that a package directory contains at least one ebuild (bug #245305).

2014-01-15 Thread Tom Wijsman
---
 bin/repoman   | 8 
 man/repoman.1 | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/bin/repoman b/bin/repoman
index 9b703dc..3263ceb 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -330,6 +330,7 @@ qahelp = {
SRC_URI.mirror: A uri listed in profiles/thirdpartymirrors is found 
in SRC_URI,
ebuild.syntax: Error generating cache entry for ebuild; typically 
caused by ebuild syntax error or digest verification failure,
ebuild.output: A simple sourcing of the ebuild produces output; this 
breaks ebuild policy.,
+   ebuild.missing: A package directory must at least contain one ebuild 
or be treecleaned.,
ebuild.nesteddie: Placing 'die' inside ( ) prints an error, but 
doesn't stop the ebuild.,
variable.invalidchar: A variable contains an invalid character that 
is not part of the ASCII character set,
variable.readonly: Assigning a readonly variable,
@@ -1466,6 +1467,13 @@ for x in effective_scanlist:
can_force = False
continue
 
+   if len(ebuildlist) == 0:
+   stats[ebuild.missing] += 1
+   fails[ebuild.missing].append(%s must at least contain one  
% x + \
+   ebuild or be treecleaned.)
+   can_force = False
+   continue
+
# Sort ebuilds in ascending order for the KEYWORDS.dropped check.
ebuildlist = sorted(pkgs.values())
ebuildlist = [pkg.pf for pkg in ebuildlist]
diff --git a/man/repoman.1 b/man/repoman.1
index e739d56..2bf3765 100644
--- a/man/repoman.1
+++ b/man/repoman.1
@@ -301,6 +301,9 @@ Ebuilds that exist but have not been added to cvs
 .B ebuild.output
 A simple sourcing of the ebuild produces output; this breaks ebuild policy.
 .TP
+.B ebuild.missing
+A package directory must at least contain one ebuild or be treecleaned.
+.TP
 .B ebuild.patches
 PATCHES variable should be a bash array to ensure white space safety
 .TP
-- 
1.8.5.2




[gentoo-portage-dev] Repoman patches for bugs #205909, #245305 and #482084.

2014-01-15 Thread Tom Wijsman
In reply, you will find three repoman patches; PATCH 1 is a bit more complex
which I will detail here, the other two patches should be fairly trivial.

In the first patch I need to use the @system set, as I only want to check
DEPEND for packages not in the @system set; thus here is kept in mind that
the @system set could possible change, in which case the check continues to
work. After checking up with Arfrever, a first version that I came up with is

 +from portage._sets.profiles import PackagesSystemSet
 +system_set_atoms = PackagesSystemSet(portage.settings.profiles).getAtoms()

but I am not sure if this is appropriate when used in other repositories.
Arfrever warned me about this but I think I do not fully understand that.

Both archive_formats* variables are based on the PMS specifications.

The rest of the code has comments and should be trivial to understand.

For the check name we came up with unpack.DEPEND.missing; most of the
checks are two words, so, I don't know if three words is permitted. At least
repoman runs without complaining or bailing out because of this.

There's still a TODO left in the code that leaves me in doubt on how to
properly ask the keywords to Portage; seems that I still need to learn to
find my way through the documentation, but I guess after getting pointed to
it a few times it will become easier.

These are my first patches to the Repoman code, all three patches introduce a 
new warning / error, therefore it might be possible that I missed something.
Grepping on an existing warning I saw the man page needs to be updated; since
I never did that before, feel free to check if the syntax of that is right.

Thank you for taking your time to review these.

--
 bin/repoman   | 63 
+++
 man/repoman.1 | 10 ++
 pym/repoman/checks.py | 10 ++
 3 files changed, 83 insertions(+)

 [PATCH 1/3] Have repoman check if the packages to unpack rare archive
 formats from SRC_URI are present in DEPEND (bug #205909).

 [PATCH 2/3] Have repoman check that a package directory contains at least
 one ebuild (bug #245305).

 [PATCH 3/3] Have repoman deprecate G2CONF for the GNOME team. (bug #482084).

-- 
With kind regards,

Tom Wijsman (TomWij)
Gentoo Developer

E-mail address  : tom...@gentoo.org
GPG Public Key  : 6D34E57D
GPG Fingerprint : C165 AF18 AB4C 400B C3D2  ABF0 95B2 1FCD 6D34 E57D



Re: [gentoo-portage-dev] [PATCH 3/3] Have repoman deprecate G2CONF for the GNOME team. (bug #482084).

2014-01-15 Thread Jesus Rivero (Neurogeek)
On Jan 15, 2014 7:08 PM, Tom Wijsman tom...@gentoo.org wrote:

 ---
  bin/repoman   |  2 ++
  man/repoman.1 |  3 +++
  pym/repoman/checks.py | 10 ++
  3 files changed, 15 insertions(+)

 diff --git a/bin/repoman b/bin/repoman
 index 3263ceb..6754edd 100755
 --- a/bin/repoman
 +++ b/bin/repoman
 @@ -318,6 +318,7 @@ qahelp = {
 EAPI.incompatible: Ebuilds that use features that are only
available with a different EAPI,
 EAPI.unsupported: Ebuilds that have an unsupported EAPI
version (you must upgrade portage),
 SLOT.invalid: Ebuilds that have a missing or invalid SLOT
variable value,
 +   G2CONF.deprecated: G2CONF is deprecated, see Gentoo bug
#482084 and the GNOME team policies,
 HOMEPAGE.missing: Ebuilds that have a missing or empty
HOMEPAGE variable,
 HOMEPAGE.virtual: Virtuals that have a non-empty HOMEPAGE
variable,
 PDEPEND.suspect: PDEPEND contains a package that usually only
belongs in DEPEND.,
 @@ -382,6 +383,7 @@ qawarnings = set((
  dependency.badtilde,
  DESCRIPTION.toolong,
  EAPI.deprecated,
 +G2CONF.deprecated,
  HOMEPAGE.virtual,
  LICENSE.deprecated,
  LICENSE.virtual,
 diff --git a/man/repoman.1 b/man/repoman.1
 index 2bf3765..7ec43d5 100644
 --- a/man/repoman.1
 +++ b/man/repoman.1
 @@ -227,6 +227,9 @@ Syntax error in RESTRICT (usually an extra/missing
space/parenthesis)
  .B SLOT.invalid
  Ebuilds that have a missing or invalid SLOT variable value
  .TP
 +.B G2CONF.deprecated
 +G2CONF is deprecated, see Gentoo bug #482084 and the GNOME team policies
 +.TP
  .B SRC_URI.mirror
  A uri listed in profiles/thirdpartymirrors is found in SRC_URI
  .TP
 diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
 index 85aa065..c2608b0 100644
 --- a/pym/repoman/checks.py
 +++ b/pym/repoman/checks.py
 @@ -799,6 +799,16 @@ class PortageInternalVariableAssignment(LineCheck):
 e += ' on line: %d'
 return e

 +class DeprecateG2CONF(LineCheck):
 +   repoman_check_name = 'G2CONF.deprecated'
 +   re = re.compile(r'.*G2CONF.*')
 +
 +   def check(self, num, line):
 +   Run the check on line and return error if there is
one
 +   m = self.re.match(line)
 +   if m is not None:
 +   return (G2CONF on line %d is deprecated, see
Gentoo bug #482084.)
Are you missing the line number interpolation here? or %d is supposed to be
returned?
 +
  _base_check_classes = (InheritEclass, LineCheck, PhaseCheck)
  _constant_checks = None

 --
 1.8.5.2


Other than that, Looks good to me.


Re: [gentoo-portage-dev] [PATCH 1/3] Have repoman check if the packages to unpack rare archive formats from SRC_URI are present in DEPEND (bug #205909).

2014-01-15 Thread Alec Warner
On Wed, Jan 15, 2014 at 4:07 PM, Tom Wijsman tom...@gentoo.org wrote:

 ---
  bin/repoman   | 53 +
  man/repoman.1 |  4 
  2 files changed, 57 insertions(+)


I urge you to not author new checks like this. /usr/bin/repoman is already
a mess.

Write these checks as functions, put them in a different file, and just
call them from the giant messy loop. At least that way the checks are self
contained (great for avoiding things like variable re-use or shadowing).

-A



 diff --git a/bin/repoman b/bin/repoman
 index d1542e9..9b703dc 100755
 --- a/bin/repoman
 +++ b/bin/repoman
 @@ -36,6 +36,9 @@ pym_path =
 osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), pym)
  sys.path.insert(0, pym_path)
  import portage
  portage._internal_caller = True
 +
 +from portage._sets.profiles import PackagesSystemSet
 +system_set_atoms = PackagesSystemSet(portage.settings.profiles).getAtoms()
  portage._disable_legacy_globals()

  try:
 @@ -300,6 +303,7 @@ qahelp = {
 inherit.missing: Ebuild uses functions from an eclass but does
 not inherit it,
 inherit.unused: Ebuild inherits an eclass but does not use it,
 java.eclassesnotused: With virtual/jdk in DEPEND you must
 inherit a java eclass,
 +   unpack.DEPEND.missing: A rare archive format was used in
 SRC_URI, but its package to unpack it is missing in DEPEND.,
 wxwidgets.eclassnotused: Ebuild DEPENDs on x11-libs/wxGTK
 without inheriting wxwidgets.eclass,
 KEYWORDS.dropped: Ebuilds that appear to have dropped KEYWORDS
 for some arch,
 KEYWORDS.missing: Ebuilds that have a missing or empty KEYWORDS
 variable,
 @@ -399,6 +403,7 @@ qawarnings = set((
  metadata.warning,
  portage.internal,
  repo.eapi.deprecated,
 +unpack.DEPEND.missing,
  usage.obsolete,
  upstream.workaround,
  LIVEVCS.stable,
 @@ -479,6 +484,25 @@ ruby_deprecated = frozenset([
 ruby_targets_ree18,
  ])

 +# TODO: Add functionality to support checking for deb2targz on platforms
 where
 +#   GNU binutils is absent; see PMS 5, section 11.3.3.13.
 +archive_formats = {
 +   \.7[zZ]:app-arch/p7zip,
 +   \.(bz2?|tbz2):app-arch/bzip2,
 +   \.jar:app-arch/unzip,
 +   \.(LH[aA]|lha|lzh):app-arch/lha,
 +   \.lzma:app-arch/lzma-utils,
 +   \.(rar|RAR):app-arch/unrar,
 +   \.(tar(\.(bz2?|gz|Z))?|tbz2|t[bg]z)?:app-arch/tar,
 +   \.(gz|tar\.Z|t[bg]z|[zZ]):app-arch/gzip,
 +   \.(zip|ZIP):app-arch/unzip,
 +}
 +
 +archive_formats_eapi_3_to_5 = {
 +   \.tar.xz:app-arch/tar,
 +   \.xz:app-arch/xz-utils,
 +}
 +
  metadata_xml_encoding = 'UTF-8'
  metadata_xml_declaration = '?xml version=1.0 encoding=%s?' % \
 (metadata_xml_encoding,)
 @@ -1559,6 +1583,7 @@ for x in effective_scanlist:
 fetchlist_dict = portage.FetchlistDict(checkdir, repoman_settings,
 portdb)
 myfiles_all = []
 src_uri_error = False
 +   needed_unpack_depends = {}
 for mykey in fetchlist_dict:
 try:
 myfiles_all.extend(fetchlist_dict[mykey])
 @@ -1573,7 +1598,22 @@ for x in effective_scanlist:
 stats[SRC_URI.syntax] += 1
 fails[SRC_URI.syntax].append(
 %s.ebuild SRC_URI: %s % (mykey,
 e))
 +
 +   # Compare each SRC_URI entry against archive_formats; if
 one of the
 +   # extensions match, we remember which archive depends are
 needed to
 +   # check them later on.
 +   needed_unpack_depends[mykey] = []
 +   for file_extension in archive_formats or \
 +   ((re.match('[345]$', eapi) is not None) \
 +   and file_extension in
 archive_formats_eapi_3_to_5):
 +   for entry in fetchlist_dict[mykey]:
 +   if re.match('.*%s$' % file_extension,
 entry) is not None:
 +   format =
 archive_formats[file_extension]
 +
 +   if format not in
 needed_unpack_depends[mykey]:
 +
 needed_unpack_depends[mykey].append(format)
 del fetchlist_dict
 +
 if not src_uri_error:
 # This test can produce false positives if SRC_URI could
 not
 # be parsed for one or more ebuilds. There's no point in
 @@ -2010,6 +2050,17 @@ for x in effective_scanlist:
 atoms = None
 badsyntax.append(str(e))

 +   if atoms and mytype == 'DEPEND':
 +   # We check whether the needed archive
 dependencies are present
 +   # in DEPEND, which were determined from
 SRC_URI.
 +   for entry in needed_unpack_depends[catdir
 + '/' + y]:
 +   if entry not in system_set_atoms
 and entry \
 +  

Re: [gentoo-portage-dev] [PATCH 1/3] Have repoman check if the packages to unpack rare archive formats from SRC_URI are present in DEPEND (bug #205909).

2014-01-15 Thread Sebastian Luther
Am 16.01.2014 01:07, schrieb Tom Wijsman:
 ---
  bin/repoman   | 53 +
  man/repoman.1 |  4 
  2 files changed, 57 insertions(+)
 
 diff --git a/bin/repoman b/bin/repoman
 index d1542e9..9b703dc 100755
 --- a/bin/repoman
 +++ b/bin/repoman
 @@ -36,6 +36,9 @@ pym_path = 
 osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), pym)
  sys.path.insert(0, pym_path)
  import portage
  portage._internal_caller = True
 +
 +from portage._sets.profiles import PackagesSystemSet
 +system_set_atoms = PackagesSystemSet(portage.settings.profiles).getAtoms()
  portage._disable_legacy_globals()
  

You should be using repoman_settings instead of portage.settings.

Considering the later use, you don't need PackagesSystemSet set here,
just use a set. And use atom.cp instead of the atoms.

  try:
 @@ -300,6 +303,7 @@ qahelp = {
   inherit.missing: Ebuild uses functions from an eclass but does not 
 inherit it,
   inherit.unused: Ebuild inherits an eclass but does not use it,
   java.eclassesnotused: With virtual/jdk in DEPEND you must inherit a 
 java eclass,
 + unpack.DEPEND.missing: A rare archive format was used in SRC_URI, 
 but its package to unpack it is missing in DEPEND.,
   wxwidgets.eclassnotused: Ebuild DEPENDs on x11-libs/wxGTK without 
 inheriting wxwidgets.eclass,
   KEYWORDS.dropped: Ebuilds that appear to have dropped KEYWORDS for 
 some arch,
   KEYWORDS.missing: Ebuilds that have a missing or empty KEYWORDS 
 variable,
 @@ -399,6 +403,7 @@ qawarnings = set((
  metadata.warning,
  portage.internal,
  repo.eapi.deprecated,
 +unpack.DEPEND.missing,
  usage.obsolete,
  upstream.workaround,
  LIVEVCS.stable,
 @@ -479,6 +484,25 @@ ruby_deprecated = frozenset([
   ruby_targets_ree18,
  ])
  
 +# TODO: Add functionality to support checking for deb2targz on platforms 
 where
 +#   GNU binutils is absent; see PMS 5, section 11.3.3.13.
 +archive_formats = {
 + \.7[zZ]:app-arch/p7zip,
 + \.(bz2?|tbz2):app-arch/bzip2,
 + \.jar:app-arch/unzip,
 + \.(LH[aA]|lha|lzh):app-arch/lha,
 + \.lzma:app-arch/lzma-utils,
 + \.(rar|RAR):app-arch/unrar,
 + \.(tar(\.(bz2?|gz|Z))?|tbz2|t[bg]z)?:app-arch/tar,
 + \.(gz|tar\.Z|t[bg]z|[zZ]):app-arch/gzip,
 + \.(zip|ZIP):app-arch/unzip,
 +}
 +
 +archive_formats_eapi_3_to_5 = {
 + \.tar.xz:app-arch/tar,
 + \.xz:app-arch/xz-utils,
 +}
 +
  metadata_xml_encoding = 'UTF-8'
  metadata_xml_declaration = '?xml version=1.0 encoding=%s?' % \
   (metadata_xml_encoding,)
 @@ -1559,6 +1583,7 @@ for x in effective_scanlist:
   fetchlist_dict = portage.FetchlistDict(checkdir, repoman_settings, 
 portdb)
   myfiles_all = []
   src_uri_error = False
 + needed_unpack_depends = {}
   for mykey in fetchlist_dict:
   try:
   myfiles_all.extend(fetchlist_dict[mykey])
 @@ -1573,7 +1598,22 @@ for x in effective_scanlist:
   stats[SRC_URI.syntax] += 1
   fails[SRC_URI.syntax].append(
   %s.ebuild SRC_URI: %s % (mykey, e))
 +
 + # Compare each SRC_URI entry against archive_formats; if one of 
 the
 + # extensions match, we remember which archive depends are 
 needed to
 + # check them later on.
 + needed_unpack_depends[mykey] = []
 + for file_extension in archive_formats or \
 + ((re.match('[345]$', eapi) is not None) \

Use portage.eapi for the line above. You may have to add a new function
to portage.eapi.

 + and file_extension in 
 archive_formats_eapi_3_to_5):
 + for entry in fetchlist_dict[mykey]:
 + if re.match('.*%s$' % file_extension, entry) is 
 not None:
 + format = archive_formats[file_extension]

As these regex are used frequently, they should be compiled using
re.compile.

 +
 + if format not in 
 needed_unpack_depends[mykey]:
 + 
 needed_unpack_depends[mykey].append(format)

I'd make needed_unpack_depends[mykey] a set. Then you can just add()
instead of checking and appending.

   del fetchlist_dict
 +
   if not src_uri_error:
   # This test can produce false positives if SRC_URI could not
   # be parsed for one or more ebuilds. There's no point in
 @@ -2010,6 +2050,17 @@ for x in effective_scanlist:
   atoms = None
   badsyntax.append(str(e))
  
 + if atoms and mytype == 'DEPEND':

Use if atoms and buildtime: here.

 + # We check whether the needed archive 
 dependencies are present
 + # in DEPEND, which were determined from SRC_URI.
 + for entry in