Skip to content

Commit

Permalink
- Package only the deb packages that doesn't exist in the debian repo
Browse files Browse the repository at this point in the history
- Add trace for errors
  • Loading branch information
sdepassio committed Dec 19, 2024
1 parent 580f190 commit c743332
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/perl-cpan-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,20 @@ jobs:
echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT
shell: bash

- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
name: Check if package already exists
run: |
package_info=$(apt-cache policy $package_name)
if [[ -n $package_info ]]; then
echo "Package already exists in the repository."
candidate_version=$(echo "$package_info" | grep 'Candidate:' | awk '{print $2}')
if [[ "$candidate_version" == "${{ steps.package-version.outputs.package_version }}"* ]]; then
echo "Package already exists in the repository with the same version."
exit 0
fi
fi
shell: bash

- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }}
run: |
apt-get install -y ruby libcurl4-openssl-dev libssh-dev uuid-dev libczmq-dev
Expand Down Expand Up @@ -654,14 +668,16 @@ jobs:
# If the dependency has been built in the same workflow, install it
for dependency_package in $(find . -maxdepth 1 -regex "\.\/${dependency}_[0-9].*all\.deb" -o -regex "\.\/${dependency}_[0-9].*${{ matrix.arch }}\.deb"); do
echo "Installing dependency: $dependency_package"
error_output=$(apt-get install -y ./$dependency_package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
echo $(dpkg-deb --info $package)
error_output=$(apt-get -o Debug::pkgProblemResolver=true -o Debug::dpkg=true -o Debug::pkgDepCache::Marker=true install -y ./$dependency_package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
done
done
echo $(df -h)
echo $(free -h)
# Install package, then uninstall it with all his dependencies
echo "Package installation..."
error_output=$(apt-get install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo $(dpkg-deb --info $package)
error_output=$(apt-get -o Debug::pkgProblemResolver=true -o Debug::dpkg=true -o Debug::pkgDepCache::Marker=true install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
echo "Package installation done."
echo $(df -h)
echo $(free -h)
Expand Down

0 comments on commit c743332

Please sign in to comment.