Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ jobs:
build/${{ matrix.binary }} \
build

dpkg-deb --info build/${{ matrix.binary }}_0.1.${{ github.run_number }}_arm64.deb
dpkg-deb --contents build/${{ matrix.binary }}_0.1.${{ github.run_number }}_arm64.deb
dpkg-deb --info build/lisa-${{ matrix.binary }}_0.1.${{ github.run_number }}_arm64.deb
dpkg-deb --contents build/lisa-${{ matrix.binary }}_0.1.${{ github.run_number }}_arm64.deb

- name: Archive arm64 deb artifact
if: matrix.mode == 'binary'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: ${{ matrix.binary }}
path: build/${{ matrix.binary }}_*.deb
path: build/lisa-${{ matrix.binary }}_*.deb
retention-days: 1

deploy:
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ jobs:

- name: Verify deb package contents
run: |
package=build/${{ matrix.binary }}_0.1.0_arm64.deb
package=build/lisa-${{ matrix.binary }}_0.1.0_arm64.deb

dpkg-deb --info "$package"
dpkg-deb --contents "$package"

dpkg-deb --field "$package" Package | grep -Fx ${{ matrix.binary }}
dpkg-deb --field "$package" Package | grep -Fx lisa-${{ matrix.binary }}
dpkg-deb --field "$package" Version | grep -Fx 0.1.0
dpkg-deb --field "$package" Architecture | grep -Fx arm64
dpkg-deb --contents "$package" | grep -F ./usr/bin/${{ matrix.binary }}
Expand All @@ -115,10 +115,18 @@ jobs:
target/deb-check/${{ matrix.binary }} \
build

package=build/${{ matrix.binary }}_0.1.0_amd64.deb
package=build/lisa-${{ matrix.binary }}_0.1.0_amd64.deb

dpkg-deb --field "$package" Architecture | grep -Fx amd64

- name: Verify distro package replacement
if: matrix.binary == 'elisa'
run: |
package=build/lisa-${{ matrix.binary }}_0.1.0_arm64.deb

dpkg-deb --field "$package" Conflicts | grep -Fx elisa
dpkg-deb --field "$package" Replaces | grep -Fx elisa

test:
runs-on: ubuntu-24.04-arm
needs: [fmt, clippy, deny]
Expand Down
15 changes: 13 additions & 2 deletions scripts/package_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ version="$2"
binary_path="$3"
output_dir="$4"
arch="${ARCH:-arm64}"
package_name="lisa-$service"

case "$service" in
elisa|elisheba|isabel) ;;
Expand Down Expand Up @@ -44,13 +45,23 @@ install -d \
installed_size="$(du -k "$binary_path" | awk '{ print $1 }')"

cat > "$package_root/DEBIAN/control" <<EOF
Package: $service
Package: $package_name
Version: $version
Section: utils
Priority: optional
Architecture: $arch
Maintainer: chipp
Depends: $depends
EOF

if [ "$service" = "elisa" ]; then
cat >> "$package_root/DEBIAN/control" <<EOF
Conflicts: elisa
Replaces: elisa
EOF
fi
Comment on lines +57 to +62

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since all services (elisa, elisheba, and isabel) are being renamed to have the lisa- prefix (e.g., lisa-elisheba, lisa-isabel), they will all encounter file conflicts during upgrades if the old packages are already installed (since they install files to the same paths like /usr/bin/$service).

To ensure a smooth upgrade path and prevent dpkg file conflict errors for all services, we should unconditionally declare Conflicts and Replaces against the old $service name, rather than limiting this only to elisa.

Suggested change
if [ "$service" = "elisa" ]; then
cat >> "$package_root/DEBIAN/control" <<EOF
Conflicts: elisa
Replaces: elisa
EOF
fi
cat >> "$package_root/DEBIAN/control" <<EOF
Conflicts: $service
Replaces: $service
EOF


cat >> "$package_root/DEBIAN/control" <<EOF
Installed-Size: $installed_size
Description: Lisa $service service
EOF
Expand Down Expand Up @@ -117,4 +128,4 @@ install -m 644 "$repo_dir/packaging/deb/env/$service.env.example" \

install -d "$output_dir"
dpkg-deb --build --root-owner-group "$package_root" \
"$output_dir/${service}_${version}_${arch}.deb"
"$output_dir/${package_name}_${version}_${arch}.deb"
Loading