Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10716 - in main/branches/prefix: bin pym/portage pym/repoman
Date: Wed, 18 Jun 2008 15:42:01
Message-Id: E1K8znH-0007qx-94@stork.gentoo.org
1 Author: grobian
2 Date: 2008-06-18 15:41:54 +0000 (Wed, 18 Jun 2008)
3 New Revision: 10716
4
5 Modified:
6 main/branches/prefix/bin/ebuild
7 main/branches/prefix/pym/portage/__init__.py
8 main/branches/prefix/pym/repoman/checks.py
9 Log:
10 Merged from trunk 10709:10715
11
12 | 10710 | Use optparse instead of getopt. |
13 | zmedico | |
14
15 | 10711 | Add a help string for --debug. |
16 | zmedico | |
17
18 | 10712 | Bug #225285 - Add a --skip-manifest option that disables all |
19 | zmedico | interaction with the manifest. |
20
21 | 10713 | Bug #225285 - Add support for persistent options stored in |
22 | zmedico | the EBUILD_DEFAULT_OPTS environment variable (similar to |
23 | | {EMERGE,QUICKPKG}_DEFAULT_OPTS). |
24
25 | 10714 | Add an exemption for x-modular in the "inherit.autotools" |
26 | zmedico | check. Thanks to remi` for reporting. |
27
28 | 10715 | As suggested by remi`, make the 'inherit.autotools' check |
29 | zmedico | only ebuilds that inherit the autotools eclass directly |
30 | | (rather than indirectly through an eclass such as apache-2 |
31 | | or x-modular). |
32
33
34 Modified: main/branches/prefix/bin/ebuild
35 ===================================================================
36 --- main/branches/prefix/bin/ebuild 2008-06-18 08:11:24 UTC (rev 10715)
37 +++ main/branches/prefix/bin/ebuild 2008-06-18 15:41:54 UTC (rev 10716)
38 @@ -3,23 +3,33 @@
39 # Distributed under the terms of the GNU General Public License v2
40 # $Header: /var/cvsroot/gentoo-src/portage/bin/ebuild,v 1.18.2.3 2005/05/07 04:32:59 ferringb Exp $
41
42 -import getopt, os, sys
43 +import optparse
44 +import os
45 +import sys
46
47 -if len(sys.argv) <= 2:
48 - print "Usage: ebuild <ebuild file> <command> [command] ..."
49 - print ""
50 - print "See the ebuild(1) man page for more info"
51 - sys.exit(1)
52 +description = "See the ebuild(1) man page for more info"
53 +usage = "Usage: ebuild <ebuild file> <command> [command] ..."
54 +parser = optparse.OptionParser(description=description, usage=usage)
55
56 +force_help = "When used together with the digest or manifest " + \
57 + "command, this option forces regeneration of digests for all " + \
58 + "distfiles associated with the current ebuild. Any distfiles " + \
59 + "that do not already exist in ${DISTDIR} will be automatically fetched."
60
61 -try:
62 - opts, pargs = getopt.getopt(sys.argv[1:], '', ['debug', 'force'])
63 -except getopt.GetoptError, e:
64 - print e
65 - sys.exit(1)
66 -debug = ("--debug",'') in opts
67 -force = ("--force",'') in opts
68 +parser.add_option("--force", help=force_help, action="store_true", dest="force")
69 +parser.add_option("--debug", help="show debug output",
70 + action="store_true", dest="debug")
71 +parser.add_option("--ignore-default-opts",
72 + action="store_true",
73 + help="do not use the EBUILD_DEFAULT_OPTS environment variable")
74 +parser.add_option("--skip-manifest", help="skip all manifest checks",
75 + action="store_true", dest="skip_manifest")
76
77 +opts, pargs = parser.parse_args(args=sys.argv[1:])
78 +
79 +if len(pargs) < 2:
80 + parser.error("missing required args")
81 +
82 if "merge" in pargs:
83 print "Disabling noauto in features... merge disables it. (qmerge doesn't)"
84 os.environ["FEATURES"] = os.environ.get("FEATURES", "") + " -noauto"
85 @@ -35,6 +45,13 @@
86 sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "pym"))
87 import portage
88
89 +if not opts.ignore_default_opts:
90 + default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split()
91 + opts, pargs = parser.parse_args(default_opts + sys.argv[1:])
92 +
93 +debug = opts.debug
94 +force = opts.force
95 +
96 import portage.util, portage.const
97 import portage.dep
98 portage.dep._dep_check_strict = True
99 @@ -148,6 +165,11 @@
100 tmpsettings["FEATURES"] = " ".join(tmpsettings.features)
101 tmpsettings.backup_changes("FEATURES")
102
103 +if opts.skip_manifest:
104 + tmpsettings["EBUILD_SKIP_MANIFEST"] = "1"
105 + tmpsettings.backup_changes("EBUILD_SKIP_MANIFEST")
106 + portage._doebuild_manifest_exempt_depend += 1
107 +
108 build_dir_phases = set(["setup", "unpack", "compile",
109 "test", "install", "package", "rpm"])
110
111
112 Modified: main/branches/prefix/pym/portage/__init__.py
113 ===================================================================
114 --- main/branches/prefix/pym/portage/__init__.py 2008-06-18 08:11:24 UTC (rev 10715)
115 +++ main/branches/prefix/pym/portage/__init__.py 2008-06-18 15:41:54 UTC (rev 10716)
116 @@ -3316,8 +3316,9 @@
117 if try_mirrors:
118 mymirrors += [x.rstrip("/") for x in mysettings["GENTOO_MIRRORS"].split() if x]
119
120 + skip_manifest = mysettings.get("EBUILD_SKIP_MANIFEST") == "1"
121 pkgdir = mysettings.get("O")
122 - if pkgdir is not None:
123 + if not (pkgdir is None or skip_manifest):
124 mydigests = Manifest(
125 pkgdir, mysettings["DISTDIR"]).getTypeDigests("DIST")
126 else:
127 @@ -4083,6 +4084,8 @@
128 """Verifies checksums. Assumes all files have been downloaded.
129 DEPRECATED: this is now only a compability wrapper for
130 portage.manifest.Manifest()."""
131 + if mysettings.get("EBUILD_SKIP_MANIFEST") == "1":
132 + return 1
133 pkgdir = mysettings["O"]
134 manifest_path = os.path.join(pkgdir, "Manifest")
135 if not os.path.exists(manifest_path):
136
137 Modified: main/branches/prefix/pym/repoman/checks.py
138 ===================================================================
139 --- main/branches/prefix/pym/repoman/checks.py 2008-06-18 08:11:24 UTC (rev 10715)
140 +++ main/branches/prefix/pym/repoman/checks.py 2008-06-18 15:41:54 UTC (rev 10716)
141 @@ -219,6 +219,7 @@
142
143 _iuse_def_re = re.compile(r'^IUSE=.*')
144 _comment_re = re.compile(r'(^|\s*)#')
145 +_inherit_autotools_re = re.compile(r'^\s*inherit\s(.*\s)?autotools(\s|$)')
146 _autotools_funcs = (
147 "eaclocal", "eautoconf", "eautoheader",
148 "eautomake", "eautoreconf", "_elibtoolize")
149 @@ -229,17 +230,15 @@
150 checks = list(_constant_checks)
151 checks.append(EbuildHeader(pkg.mtime))
152 iuse_def = None
153 - inherit_autotools = "autotools" in pkg.inherited
154 - if inherit_autotools:
155 - if "apache-2" in pkg.inherited:
156 - # eautoreconf is called by apache-2_src_unpack(),
157 - # so the ebuild doesn't need to call it.
158 - inherit_autotools = False
159 + inherit_autotools = None
160 autotools_func_call = None
161 for num, line in enumerate(contents):
162 comment = _comment_re.match(line)
163 if comment is None:
164 - if inherit_autotools and autotools_func_call is None:
165 + if inherit_autotools is None:
166 + inherit_autotools = _inherit_autotools_re.match(line)
167 + if inherit_autotools is not None and \
168 + autotools_func_call is None:
169 autotools_func_call = _autotools_func_re.search(line)
170 if iuse_def is None:
171 iuse_def = _iuse_def_re.match(line)
172
173 --
174 gentoo-commits@l.g.o mailing list