mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
helpers/apt: rely on simpler dpkg-deb --build rather than equivs to create .deb for app virtual dependencies
This commit is contained in:
parent
1bb81e8f69
commit
f6fbd69c39
3 changed files with 16 additions and 19 deletions
2
debian/control
vendored
2
debian/control
vendored
|
@ -28,7 +28,7 @@ Depends: ${python3:Depends}, ${misc:Depends}
|
||||||
, redis-server
|
, redis-server
|
||||||
, acl
|
, acl
|
||||||
, git, curl, wget, cron, unzip, jq, bc, at, procps, j2cli
|
, git, curl, wget, cron, unzip, jq, bc, at, procps, j2cli
|
||||||
, lsb-release, haveged, fake-hwclock, equivs, lsof, whois
|
, lsb-release, haveged, fake-hwclock, lsof, whois
|
||||||
Recommends: yunohost-admin
|
Recommends: yunohost-admin
|
||||||
, ntp, inetutils-ping | iputils-ping
|
, ntp, inetutils-ping | iputils-ping
|
||||||
, bash-completion, rsyslog
|
, bash-completion, rsyslog
|
||||||
|
|
|
@ -186,21 +186,19 @@ ynh_package_install_from_equivs() {
|
||||||
|
|
||||||
# Build and install the package
|
# Build and install the package
|
||||||
local TMPDIR=$(mktemp --directory)
|
local TMPDIR=$(mktemp --directory)
|
||||||
|
mkdir -p ${TMPDIR}/${pkgname}/DEBIAN/
|
||||||
# Make sure to delete the legacy compat file
|
|
||||||
# It's now handle somewhat magically through the control file
|
|
||||||
rm -f /usr/share/equivs/template/debian/compat
|
|
||||||
|
|
||||||
# Note that the cd executes into a sub shell
|
# Note that the cd executes into a sub shell
|
||||||
# Create a fake deb package with equivs-build and the given control file
|
# Create a fake deb package with equivs-build and the given control file
|
||||||
# Install the fake package without its dependencies with dpkg
|
# Install the fake package without its dependencies with dpkg
|
||||||
# Install missing dependencies with ynh_package_install
|
# Install missing dependencies with ynh_package_install
|
||||||
ynh_wait_dpkg_free
|
ynh_wait_dpkg_free
|
||||||
cp "$controlfile" "${TMPDIR}/control"
|
cp "$controlfile" "${TMPDIR}/${pkgname}/DEBIAN/control"
|
||||||
(
|
(
|
||||||
cd "$TMPDIR"
|
cd "$TMPDIR"
|
||||||
LC_ALL=C equivs-build ./control 2>&1
|
# Install the fake package without its dependencies with dpkg --force-depends
|
||||||
LC_ALL=C dpkg --force-depends --install "./${pkgname}_${pkgversion}_all.deb" 2>&1 | tee ./dpkg_log
|
LC_ALL=C dpkg-deb --build ${pkgname} ${pkgname}.deb > ./dpkg_log 2>&1 || { cat ./dpkg_log; false; }
|
||||||
|
LC_ALL=C dpkg --force-depends --install "./${pkgname}.deb" 2>&1 | tee ./dpkg_log
|
||||||
)
|
)
|
||||||
|
|
||||||
ynh_package_install --fix-broken \
|
ynh_package_install --fix-broken \
|
||||||
|
@ -323,6 +321,7 @@ Package: ${dep_app}-ynh-deps
|
||||||
Version: ${version}
|
Version: ${version}
|
||||||
Depends: ${dependencies}
|
Depends: ${dependencies}
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
Maintainer: root@localhost
|
||||||
Description: Fake package for ${app} (YunoHost app) dependencies
|
Description: Fake package for ${app} (YunoHost app) dependencies
|
||||||
This meta-package is only responsible of installing its dependencies.
|
This meta-package is only responsible of installing its dependencies.
|
||||||
EOF
|
EOF
|
||||||
|
|
|
@ -90,27 +90,25 @@ ynh_apt_install_dependencies() {
|
||||||
dependencies="$current_dependencies, $dependencies"
|
dependencies="$current_dependencies, $dependencies"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# #############################
|
# ################
|
||||||
# Actual install using equivs #
|
# Actual install #
|
||||||
# #############################
|
# ################
|
||||||
|
|
||||||
# Prepare the virtual-dependency control file for equivs
|
# Prepare the virtual-dependency control file for dpkg-deb --build
|
||||||
local TMPDIR=$(mktemp --directory)
|
local TMPDIR=$(mktemp --directory)
|
||||||
cat >${TMPDIR}/control <<EOF # Make a control file for equivs-build
|
mkdir -p ${TMPDIR}/${app_ynh_deps}/DEBIAN
|
||||||
|
cat >${TMPDIR}/${app_ynh_deps}/DEBIAN/control <<EOF
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Package: ${app_ynh_deps}
|
Package: ${app_ynh_deps}
|
||||||
Version: ${version}
|
Version: ${version}
|
||||||
Depends: ${dependencies}
|
Depends: ${dependencies}
|
||||||
Architecture: all
|
Architecture: all
|
||||||
|
Maintainer: root@localhost
|
||||||
Description: Fake package for ${app} (YunoHost app) dependencies
|
Description: Fake package for ${app} (YunoHost app) dependencies
|
||||||
This meta-package is only responsible of installing its dependencies.
|
This meta-package is only responsible of installing its dependencies.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Make sure to delete equivs' legacy compat file
|
|
||||||
# It's now handle somewhat magically through the control file
|
|
||||||
rm -f /usr/share/equivs/template/debian/compat
|
|
||||||
|
|
||||||
_ynh_apt update
|
_ynh_apt update
|
||||||
|
|
||||||
_ynh_wait_dpkg_free
|
_ynh_wait_dpkg_free
|
||||||
|
@ -119,8 +117,8 @@ EOF
|
||||||
# NB: this is in a subshell (though not sure why exactly not just use pushd/popd...)
|
# NB: this is in a subshell (though not sure why exactly not just use pushd/popd...)
|
||||||
cd "$TMPDIR"
|
cd "$TMPDIR"
|
||||||
# Install the fake package without its dependencies with dpkg --force-depends
|
# Install the fake package without its dependencies with dpkg --force-depends
|
||||||
LC_ALL=C equivs-build ./control > ./equivs_log 2>&1 || { cat ./equivs_log; false; }
|
LC_ALL=C dpkg-deb --build ${app_ynh_deps} ${app_ynh_deps}.deb > ./dpkg_log 2>&1 || { cat ./dpkg_log; false; }
|
||||||
LC_ALL=C dpkg --force-depends --install "./${app_ynh_deps}_${version}_all.deb" > ./dpkg_log 2>&1
|
LC_ALL=C dpkg --force-depends --install "./${app_ynh_deps}.deb" > ./dpkg_log 2>&1
|
||||||
)
|
)
|
||||||
|
|
||||||
# Then install the missing dependencies with apt install
|
# Then install the missing dependencies with apt install
|
||||||
|
|
Loading…
Add table
Reference in a new issue