Skip to content

Commit c596d7e

Browse files
committed
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'
1 parent 09bf43e commit c596d7e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

scripts/package-build/build.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,17 @@ def build_package(package: list, patch_dir: Path) -> None:
153153
# On failure fallback to repo name
154154
package_name = repo_name
155155

156+
# 1.0 version needs 'native' format - without '.orig'
157+
# 3.0 needs '.orig'
158+
source_format_suffix = ''
159+
if (repo_dir / 'debian/source/format').exists():
160+
with open(repo_dir / 'debian/source/format') as f:
161+
source_format_version = f.read()
162+
if '3.0' in source_format_version:
163+
source_format_suffix = '.orig'
164+
156165
# Build a tarball for the package
157-
tarball_name = f'{package_name}_{package_version}.orig.tar.gz'
166+
tarball_name = f'{package_name}_{package_version}{source_format_suffix}.tar.gz'
158167
run(['tar', '--exclude=.git', '--exclude=.github', '-czf', tarball_name, '-C', str(repo_dir.parent), repo_name], check=True)
159168
print(f"I: Tarball created: {tarball_name}")
160169

0 commit comments

Comments
 (0)