|
3 | 3 | import subprocess |
4 | 4 |
|
5 | 5 | from pkgcore.operations import observer as observer_mod |
6 | | -from pkgcore.restrictions import packages |
| 6 | +from pkgcore.restrictions import packages, values |
7 | 7 | from pkgcore.util.parserestrict import parse_match |
8 | 8 | from snakeoil.cli import arghparse |
9 | 9 |
|
|
52 | 52 | In addition to matching the specified restriction, restrict to targets |
53 | 53 | which are marked as modified by git, including untracked files. |
54 | 54 | """) |
| 55 | +manifest_opts.add_argument( |
| 56 | + '--ignore-fetch-restricted', dest='ignore_fetch_restricted', help='Ignore fetch restricted ebuilds', |
| 57 | + action='store_true', |
| 58 | + docs=""" |
| 59 | + Ignore attempting to update manifest entries for ebuilds which are |
| 60 | + fetch restricted. |
| 61 | + """) |
55 | 62 |
|
56 | 63 |
|
57 | 64 | def _restrict_targets(repo, targets): |
@@ -86,10 +93,12 @@ def _restrict_modified_files(repo): |
86 | 93 | def _manifest_validate(parser, namespace): |
87 | 94 | targets = namespace.target if namespace.target else [namespace.cwd] |
88 | 95 |
|
89 | | - namespace.restriction = _restrict_targets(namespace.repo, targets) |
| 96 | + restrictions = [_restrict_targets(namespace.repo, targets)] |
90 | 97 | if namespace.if_modified: |
91 | | - namespace.restriction = packages.AndRestriction(namespace.restriction, |
92 | | - _restrict_modified_files(namespace.repo)) |
| 98 | + restrictions.append(_restrict_modified_files(namespace.repo)) |
| 99 | + if namespace.ignore_fetch_restricted: |
| 100 | + restrictions.append(packages.PackageRestriction('restrict', values.ContainmentMatch('fetch', negate=True))) |
| 101 | + namespace.restriction = packages.AndRestriction(*restrictions) |
93 | 102 |
|
94 | 103 |
|
95 | 104 | @manifest.bind_main_func |
|
0 commit comments