Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ function build-deb {
#@ Category: Package Management
echo "🏗️ Building Debian package..."

# Save output directory explicitly (don't rely on $OLDPWD)
OUTPUT_DIR="$PWD"

# Create a build area with the project as a subdirectory
# This allows dpkg-buildpackage to write to the parent directory
BUILD_AREA=$(mktemp -d)
PROJECT_NAME=$(basename "$PWD")

echo "📁 Build area: $BUILD_AREA"
echo "📁 Output dir: $OUTPUT_DIR"

# Copy source to build area
cp -a . "$BUILD_AREA/$PROJECT_NAME"
cd "$BUILD_AREA/$PROJECT_NAME"
Expand All @@ -122,8 +128,19 @@ function build-deb {
uv sync
dpkg-buildpackage -us -uc -b

# List what was built
echo "📦 Built packages:"
ls -la "$BUILD_AREA"/*.deb "$BUILD_AREA"/*.buildinfo "$BUILD_AREA"/*.changes 2>/dev/null || echo "Warning: No packages found in $BUILD_AREA"

# Move artifacts back to original directory
mv "$BUILD_AREA"/*.deb "$BUILD_AREA"/*.buildinfo "$BUILD_AREA"/*.changes "$OLDPWD/" 2>/dev/null || true
echo "📦 Moving packages to $OUTPUT_DIR..."
mv "$BUILD_AREA"/*.deb "$OUTPUT_DIR/" 2>/dev/null || echo "Warning: Failed to move .deb files"
mv "$BUILD_AREA"/*.buildinfo "$OUTPUT_DIR/" 2>/dev/null || echo "Warning: Failed to move .buildinfo files"
mv "$BUILD_AREA"/*.changes "$OUTPUT_DIR/" 2>/dev/null || echo "Warning: Failed to move .changes files"

# Verify files exist in output directory
echo "📦 Verifying packages in $OUTPUT_DIR:"
ls -la "$OUTPUT_DIR"/*.deb 2>/dev/null || echo "Warning: No .deb files in $OUTPUT_DIR"

# Cleanup
rm -rf "$BUILD_AREA"
Expand Down