Skip to content

Commit 83a6bd8

Browse files
committed
Update script to put generated package under dist/debian/ #341
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent db7b283 commit 83a6bd8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

build_deb_docker.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
python build_deb_docker.py
1313
1414
This script will generate the Debian package files and place them in the
15-
dist/ directory.
15+
dist/debian/ directory.
1616
"""
1717

1818
import os
@@ -53,10 +53,14 @@ def build_deb_with_docker():
5353
# Build the wheel
5454
python3 -m build --wheel
5555
56+
# Move wheel to dist/debian/
57+
mkdir -p dist/debian
58+
mv dist/*.whl dist/debian/
59+
5660
# Get the wheel file name
57-
WHEEL_FILE=$(ls dist/*.whl)
61+
WHEEL_FILE=$(ls dist/debian/*.whl)
5862
if [ -z "$WHEEL_FILE" ]; then
59-
echo "Error: No wheel file found in dist/." >&2
63+
echo "Error: No wheel file found in dist/debian/." >&2
6064
exit 1
6165
fi
6266
@@ -83,24 +87,24 @@ def build_deb_with_docker():
8387
EOF
8488
8589
# Build the .deb package
86-
dpkg-deb --build "$PKG_DIR" dist/
90+
dpkg-deb --build "$PKG_DIR" dist/debian/
8791
8892
# Clean up
8993
rm -rf "$TEMP_DIR"
9094
9195
# Fix permissions for Windows host
92-
chmod -R u+rwX dist
96+
chmod -R u+rwX dist/debian/
9397
"""
9498
]
9599

96100
try:
97101
subprocess.run(docker_cmd, check=True)
98102
# Verify the existence of the .deb
99-
deb_file = next(Path('dist').glob('*.deb'), None)
103+
deb_file = next(Path('dist/debian').glob('*.deb'), None)
100104
if deb_file:
101105
print(f"\nSuccess! Debian package built: {deb_file}")
102106
else:
103-
print("Error: Debian package not found in dist/", file=sys.stderr)
107+
print("Error: Debian package not found in dist/debian/", file=sys.stderr)
104108
sys.exit(1)
105109
except subprocess.CalledProcessError as e:
106110
print(f"Build failed: {e}", file=sys.stderr)

0 commit comments

Comments
 (0)