public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Tom Wijsman <TomWij@gentoo.org>
To: vapier@gentoo.org
Cc: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH 1/3 v2] Have repoman check if the packages to unpack rare archive formats from SRC_URI are present in DEPEND (bug #205909).
Date: Mon, 20 Jan 2014 03:23:48 +0100	[thread overview]
Message-ID: <20140120032348.429ed4d3@TOMWIJ-GENTOO> (raw)
In-Reply-To: <201401190438.32666.vapier@gentoo.org>

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

On Sun, 19 Jan 2014 04:38:31 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> On Friday 17 January 2014 18:03:57 Tom Wijsman wrote:
> > ---
> 
> please shorten your commit summary and move more content to the body

Right, I'm used to writing this on the command line; I'll try to look
into setting up an editor or a GUI (gitg, ...) to do my commit messages.
 
> > +getNonSystemArchiveDepends.archivers = {
> 
> it is super weird to attach to the object like this.  some might even
> say wrong.  

It a function, this makes it a static function variable.

What is weird here? It works properly, what would be wrong?

> move it into the class definition.
> def getNonSystemArchiveDepends(fetchlist, eapi):
> 	...
> 
> 	ARCHIVERS = {
> 		...
> 	}

That makes it a non-static function variable? This is a regression.

> > +	re.compile('.*\.7[zZ]$'):"app-arch/p7zip",
> 
> regexes should always use raw strings.  there should also be a space
> after the colon in dicts.  so you want:
> 
> 	re.compile(r'.*\.7[zZ]$'): 'app-arch/p7zip',

Raw strings are a solution when \ forms a problem, which is not the
case here. The colon has no space after it in the rest of repoman near
it, hence I left it out; is there a coding standard we're trying to
respect here? Can you refer it to me?

> > +	re.compile('.*\.lzma$'):"app-arch/lzma-utils",
> xz-utils, not lzma-utils

http://dev.gentoo.org/~ulm/pms/5/pms.html

Please see "unpack" in PMS "11.3.3.13 Misc Commands", quote:

"lzma-compressed files (*.lzma). Ebuilds must ensure that LZMA Utils is
installed."

The TODO comment that had a PMS reference was near it before, but with
the refactor it has since moved; I'll put back the reference to it.

> > +	re.compile('.*\.(bz2?|tbz2)$'):"app-arch/bzip2",
> > +
> > re.compile('.*\.(tar(\.(bz2?|gz|Z))?|tbz2|t[bg]z)?$'):"app-arch/tar",
> > +	re.compile('.*\.(gz|tar\.Z|t[bg]z|[zZ])$'):"app-arch/gzip",
> > +	re.compile('.*\.tar.xz$'):"app-arch/tar",
> 
> requiring people list gzip, tar, and bzip2 is a significant policy
> change (which i'm inclined to say is wrong).  it needs discussion on
> the dev mailing list first.

Please see "unpack" in PMS "11.3.3.13 Misc Commands", example quote:

"gzip-compressed tar files (*.tar.gz, *.tgz, *.tar.Z, *.tbz). Ebuilds
must ensure that GNU gzip and GNU tar are installed."

To spare on mail length, I don't quote the rest of that enumeration.

> > +def checkArchiveDepends(atoms, catpkg, relative_path, \
> > +	system_set_atoms, needed_unpack_depends, stats, fails):
> 
> you don't need the \ there because you have paren already to gather
> things.
> 
> > +	for entry in needed_unpack_depends[catpkg]:
> > +		if entry not in [atom.cp for atom in atoms if
> > atom != "||"]:
> > +			stats['unpack.' + mytype + '.missing'] += 1
> > +			fails['unpack.' + mytype +
> > '.missing'].append( \
> > +				relative_path + ": %s is missing
> > in %s" % \
> > +				(entry, mytype))
> 
> i know existing style doesn't follow it, but imo we should avoid
> string concatenation.  it makes the code harder to read imo.
> 
> 	key = 'unpack.%s.missing' % mytype
> 	stats[key] += 1
> 	fails[key].append(...)
> 
> > +def eapi_has_xz_utils(eapi):
> > +	return eapi not in ("0", "1", "2")
> 
> i would use "eapi_supports_xz_archives" unless there's a pre-existing
> style -mike

Good idea, I'll take these last ones into account in the next version.

Thank you everyone for the reviews so far.

-- 
With kind regards,

Tom Wijsman (TomWij)
Gentoo Developer

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  reply	other threads:[~2014-01-20  2:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16  0:07 [gentoo-portage-dev] Repoman patches for bugs #205909, #245305 and #482084 Tom Wijsman
2014-01-16  0:07 ` [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) Tom Wijsman
2014-01-16  1:44   ` Alec Warner
2014-01-16 21:18     ` Tom Wijsman
2014-01-16 21:23       ` Alexander Berntsen
2014-01-16 21:52         ` Tom Wijsman
2014-01-16 22:22           ` Alexander Berntsen
2014-01-16 23:02             ` Tom Wijsman
2014-01-17  6:14               ` Alec Warner
2014-01-17 23:35                 ` Tom Wijsman
2014-01-17  0:33     ` Tom Wijsman
2014-01-16  7:03   ` Sebastian Luther
2014-01-16 21:40     ` Tom Wijsman
2014-01-17  8:35       ` Sebastian Luther
2014-01-17 23:00         ` Tom Wijsman
2014-01-18  6:49           ` Sebastian Luther
2014-01-17  8:28   ` Sebastian Luther
2014-01-17 16:40     ` Tom Wijsman
2014-01-17 23:03   ` [gentoo-portage-dev] [PATCH 1/3 v2] " Tom Wijsman
2014-01-19  9:38     ` Mike Frysinger
2014-01-20  2:23       ` Tom Wijsman [this message]
2014-01-20  2:43         ` Alec Warner
2014-01-21 15:32           ` Tom Wijsman
2014-01-16  0:07 ` [gentoo-portage-dev] [PATCH 2/3] Have repoman check that a package directory contains at least one ebuild (bug #245305) Tom Wijsman
2014-01-16  1:07   ` Jesus Rivero (Neurogeek)
2014-01-16  1:45     ` Alec Warner
2014-01-17 21:36   ` [gentoo-portage-dev] [PATCH 2/3 v2] " Tom Wijsman
2014-01-17 22:34     ` Jesus Rivero (Neurogeek)
2014-01-16  0:07 ` [gentoo-portage-dev] [PATCH 3/3] Have repoman deprecate G2CONF for the GNOME team. (bug #482084) Tom Wijsman
2014-01-16  1:23   ` Jesus Rivero (Neurogeek)
2014-01-16 21:56     ` Tom Wijsman
2014-01-19  9:26   ` Mike Frysinger
2014-01-19  9:28   ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140120032348.429ed4d3@TOMWIJ-GENTOO \
    --to=tomwij@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox