diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/oe-go-mod-fetcher.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/scripts/oe-go-mod-fetcher.py b/scripts/oe-go-mod-fetcher.py index 5c866928..af8cbb03 100755 --- a/scripts/oe-go-mod-fetcher.py +++ b/scripts/oe-go-mod-fetcher.py | |||
| @@ -2079,6 +2079,7 @@ def _execute(args: argparse.Namespace) -> int: | |||
| 2079 | debug_limit=debug_limit, | 2079 | debug_limit=debug_limit, |
| 2080 | skip_verify=args.skip_verify, | 2080 | skip_verify=args.skip_verify, |
| 2081 | verify_jobs=args.verify_jobs, | 2081 | verify_jobs=args.verify_jobs, |
| 2082 | exclude_modules=args.exclude_module, | ||
| 2082 | ) | 2083 | ) |
| 2083 | 2084 | ||
| 2084 | if success: | 2085 | if success: |
| @@ -3869,7 +3870,7 @@ def discover_modules(source_dir: Path, gomodcache: Optional[str] = None) -> List | |||
| 3869 | def generate_recipe(modules: List[Dict], source_dir: Path, output_dir: Optional[Path], | 3870 | def generate_recipe(modules: List[Dict], source_dir: Path, output_dir: Optional[Path], |
| 3870 | git_repo: str, git_ref: str, validate_only: bool = False, | 3871 | git_repo: str, git_ref: str, validate_only: bool = False, |
| 3871 | debug_limit: Optional[int] = None, skip_verify: bool = False, | 3872 | debug_limit: Optional[int] = None, skip_verify: bool = False, |
| 3872 | verify_jobs: int = 10) -> bool: | 3873 | verify_jobs: int = 10, exclude_modules: Optional[List[str]] = None) -> bool: |
| 3873 | """ | 3874 | """ |
| 3874 | Phase 2: Recipe Generation | 3875 | Phase 2: Recipe Generation |
| 3875 | 3876 | ||
| @@ -3897,6 +3898,17 @@ def generate_recipe(modules: List[Dict], source_dir: Path, output_dir: Optional[ | |||
| 3897 | 3898 | ||
| 3898 | unresolved_commits: List[Tuple[str, str, str, str, str]] = [] | 3899 | unresolved_commits: List[Tuple[str, str, str, str, str]] = [] |
| 3899 | 3900 | ||
| 3901 | # Filter out excluded modules (e.g., deleted upstream repos that must use gomod://) | ||
| 3902 | if exclude_modules: | ||
| 3903 | before_count = len(modules) | ||
| 3904 | excluded_prefixes = [e.strip() for e in exclude_modules] | ||
| 3905 | modules = [m for m in modules if not any( | ||
| 3906 | m.get('module_path', '').startswith(prefix) for prefix in excluded_prefixes | ||
| 3907 | )] | ||
| 3908 | excluded_count = before_count - len(modules) | ||
| 3909 | if excluded_count: | ||
| 3910 | print(f"\n⚙️ Excluded {excluded_count} modules matching: {', '.join(excluded_prefixes)}") | ||
| 3911 | |||
| 3900 | total_modules = len(modules) | 3912 | total_modules = len(modules) |
| 3901 | if debug_limit is not None: | 3913 | if debug_limit is not None: |
| 3902 | print(f"\n⚙️ Debug limit active: validating first {debug_limit} modules (total list size {total_modules})") | 3914 | print(f"\n⚙️ Debug limit active: validating first {debug_limit} modules (total list size {total_modules})") |
| @@ -4518,6 +4530,13 @@ Examples: | |||
| 4518 | ) | 4530 | ) |
| 4519 | 4531 | ||
| 4520 | parser.add_argument( | 4532 | parser.add_argument( |
| 4533 | "--exclude-module", | ||
| 4534 | metavar="PREFIX", | ||
| 4535 | action="append", | ||
| 4536 | help="Exclude modules matching PREFIX from git:// generation (use gomod:// in recipe instead)" | ||
| 4537 | ) | ||
| 4538 | |||
| 4539 | parser.add_argument( | ||
| 4521 | "--version", | 4540 | "--version", |
| 4522 | action="version", | 4541 | action="version", |
| 4523 | version=f"%(prog)s {VERSION}" | 4542 | version=f"%(prog)s {VERSION}" |
