Gentoo Archives: gentoo-portage-dev

From: Tom Wijsman <TomWij@g.o>
To: vapier@g.o
Cc: gentoo-portage-dev@l.g.o
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 02:24:54
Message-Id: 20140120032348.429ed4d3@TOMWIJ-GENTOO
In Reply to: 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). by Mike Frysinger
1 On Sun, 19 Jan 2014 04:38:31 -0500
2 Mike Frysinger <vapier@g.o> wrote:
3
4 > On Friday 17 January 2014 18:03:57 Tom Wijsman wrote:
5 > > ---
6 >
7 > please shorten your commit summary and move more content to the body
8
9 Right, I'm used to writing this on the command line; I'll try to look
10 into setting up an editor or a GUI (gitg, ...) to do my commit messages.
11
12 > > +getNonSystemArchiveDepends.archivers = {
13 >
14 > it is super weird to attach to the object like this. some might even
15 > say wrong.
16
17 It a function, this makes it a static function variable.
18
19 What is weird here? It works properly, what would be wrong?
20
21 > move it into the class definition.
22 > def getNonSystemArchiveDepends(fetchlist, eapi):
23 > ...
24 >
25 > ARCHIVERS = {
26 > ...
27 > }
28
29 That makes it a non-static function variable? This is a regression.
30
31 > > + re.compile('.*\.7[zZ]$'):"app-arch/p7zip",
32 >
33 > regexes should always use raw strings. there should also be a space
34 > after the colon in dicts. so you want:
35 >
36 > re.compile(r'.*\.7[zZ]$'): 'app-arch/p7zip',
37
38 Raw strings are a solution when \ forms a problem, which is not the
39 case here. The colon has no space after it in the rest of repoman near
40 it, hence I left it out; is there a coding standard we're trying to
41 respect here? Can you refer it to me?
42
43 > > + re.compile('.*\.lzma$'):"app-arch/lzma-utils",
44 > xz-utils, not lzma-utils
45
46 http://dev.gentoo.org/~ulm/pms/5/pms.html
47
48 Please see "unpack" in PMS "11.3.3.13 Misc Commands", quote:
49
50 "lzma-compressed files (*.lzma). Ebuilds must ensure that LZMA Utils is
51 installed."
52
53 The TODO comment that had a PMS reference was near it before, but with
54 the refactor it has since moved; I'll put back the reference to it.
55
56 > > + re.compile('.*\.(bz2?|tbz2)$'):"app-arch/bzip2",
57 > > +
58 > > re.compile('.*\.(tar(\.(bz2?|gz|Z))?|tbz2|t[bg]z)?$'):"app-arch/tar",
59 > > + re.compile('.*\.(gz|tar\.Z|t[bg]z|[zZ])$'):"app-arch/gzip",
60 > > + re.compile('.*\.tar.xz$'):"app-arch/tar",
61 >
62 > requiring people list gzip, tar, and bzip2 is a significant policy
63 > change (which i'm inclined to say is wrong). it needs discussion on
64 > the dev mailing list first.
65
66 Please see "unpack" in PMS "11.3.3.13 Misc Commands", example quote:
67
68 "gzip-compressed tar files (*.tar.gz, *.tgz, *.tar.Z, *.tbz). Ebuilds
69 must ensure that GNU gzip and GNU tar are installed."
70
71 To spare on mail length, I don't quote the rest of that enumeration.
72
73 > > +def checkArchiveDepends(atoms, catpkg, relative_path, \
74 > > + system_set_atoms, needed_unpack_depends, stats, fails):
75 >
76 > you don't need the \ there because you have paren already to gather
77 > things.
78 >
79 > > + for entry in needed_unpack_depends[catpkg]:
80 > > + if entry not in [atom.cp for atom in atoms if
81 > > atom != "||"]:
82 > > + stats['unpack.' + mytype + '.missing'] += 1
83 > > + fails['unpack.' + mytype +
84 > > '.missing'].append( \
85 > > + relative_path + ": %s is missing
86 > > in %s" % \
87 > > + (entry, mytype))
88 >
89 > i know existing style doesn't follow it, but imo we should avoid
90 > string concatenation. it makes the code harder to read imo.
91 >
92 > key = 'unpack.%s.missing' % mytype
93 > stats[key] += 1
94 > fails[key].append(...)
95 >
96 > > +def eapi_has_xz_utils(eapi):
97 > > + return eapi not in ("0", "1", "2")
98 >
99 > i would use "eapi_supports_xz_archives" unless there's a pre-existing
100 > style -mike
101
102 Good idea, I'll take these last ones into account in the next version.
103
104 Thank you everyone for the reviews so far.
105
106 --
107 With kind regards,
108
109 Tom Wijsman (TomWij)
110 Gentoo Developer
111
112 E-mail address : TomWij@g.o
113 GPG Public Key : 6D34E57D
114 GPG Fingerprint : C165 AF18 AB4C 400B C3D2 ABF0 95B2 1FCD 6D34 E57D

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies