mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Trigger error if app dependency install fails (Redmine 1006) + allow for 'or' in dependencies (#381)
* Solve issue https://dev.yunohost.org/issues/1006 I purpose this change to improve the helper 'ynh_install_app_dependencies'. Before this change if the dependences are not installable the install didn't fail. By these change the helper generate an error and the install stop. * Get the error if apt fail * Remove old change * Add dependence choice
This commit is contained in:
parent
6c7fb0cef2
commit
ab2b7db0cf
1 changed files with 8 additions and 3 deletions
|
@ -109,7 +109,7 @@ ynh_package_install_from_equivs () {
|
|||
&& equivs-build ./control 1>/dev/null \
|
||||
&& sudo dpkg --force-depends \
|
||||
-i "./${pkgname}_${pkgversion}_all.deb" 2>&1 \
|
||||
&& ynh_package_install -f)
|
||||
&& ynh_package_install -f) || ynh_die "Unable to install dependencies"
|
||||
[[ -n "$TMPDIR" ]] && rm -rf $TMPDIR # Remove the temp dir.
|
||||
|
||||
# check if the package is actually installed
|
||||
|
@ -121,8 +121,13 @@ ynh_package_install_from_equivs () {
|
|||
#
|
||||
# usage: ynh_install_app_dependencies dep [dep [...]]
|
||||
# | arg: dep - the package name to install in dependence
|
||||
# You can give a choice between some package with this syntax : "dep1|dep2"
|
||||
# Example : ynh_install_app_dependencies dep1 dep2 "dep3|dep4|dep5"
|
||||
# This mean in the dependence tree : dep1 & dep2 & (dep3 | dep4 | dep5)
|
||||
ynh_install_app_dependencies () {
|
||||
local dependencies=$@
|
||||
local dependencies=${dependencies// /, }
|
||||
local dependencies=${dependencies//|/ | }
|
||||
local manifest_path="../manifest.json"
|
||||
if [ ! -e "$manifest_path" ]; then
|
||||
manifest_path="../settings/manifest.json" # Into the restore script, the manifest is not at the same place
|
||||
|
@ -139,7 +144,7 @@ Section: misc
|
|||
Priority: optional
|
||||
Package: ${dep_app}-ynh-deps
|
||||
Version: ${version}
|
||||
Depends: ${dependencies// /, }
|
||||
Depends: ${dependencies}
|
||||
Architecture: all
|
||||
Description: Fake package for ${app} (YunoHost app) dependencies
|
||||
This meta-package is only responsible of installing its dependencies.
|
||||
|
@ -158,4 +163,4 @@ EOF
|
|||
ynh_remove_app_dependencies () {
|
||||
local dep_app=${app//_/-} # Replace all '_' by '-'
|
||||
ynh_package_autopurge ${dep_app}-ynh-deps # Remove the fake package and its dependencies if they not still used.
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue