diff options
| author | Kyrylo Yatsenko <hedrok@gmail.com> | 2026-06-19 11:30:19 +0300 |
|---|---|---|
| committer | Kyrylo Yatsenko <hedrok@gmail.com> | 2026-06-19 11:58:29 +0300 |
| commit | c596d7eea261c79822b0730d2056ea64c8e7281f (patch) | |
| tree | 1bf283daf916915766ea461d8035b29c904c28cc /scripts | |
| parent | 09bf43ea505de68fc1e646148e89d5a688490936 (diff) | |
| download | vyos-build-c596d7eea261c79822b0730d2056ea64c8e7281f.tar.gz vyos-build-c596d7eea261c79822b0730d2056ea64c8e7281f.zip | |
T8599: Use .orig suffix for 3.0 source format only
1.0 source format version needs tarball without '.orig' suffix as described in https://www.man7.org/linux/man-pages/man1/dpkg-source.1.html.
Only if debian/source/format exists and contains 3.0, use '.orig'
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/package-build/build.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/package-build/build.py b/scripts/package-build/build.py index deac13a3..d637703e 100755 --- a/scripts/package-build/build.py +++ b/scripts/package-build/build.py @@ -153,8 +153,17 @@ def build_package(package: list, patch_dir: Path) -> None: # On failure fallback to repo name package_name = repo_name + # 1.0 version needs 'native' format - without '.orig' + # 3.0 needs '.orig' + source_format_suffix = '' + if (repo_dir / 'debian/source/format').exists(): + with open(repo_dir / 'debian/source/format') as f: + source_format_version = f.read() + if '3.0' in source_format_version: + source_format_suffix = '.orig' + # Build a tarball for the package - tarball_name = f'{package_name}_{package_version}.orig.tar.gz' + tarball_name = f'{package_name}_{package_version}{source_format_suffix}.tar.gz' run(['tar', '--exclude=.git', '--exclude=.github', '-czf', tarball_name, '-C', str(repo_dir.parent), repo_name], check=True) print(f"I: Tarball created: {tarball_name}") |
