Prevent to rewrite the previous control file

This commit is contained in:
Maniack Crudelis 2017-03-16 18:35:57 +01:00 committed by GitHub
parent 2bb32c26b6
commit 5f3fcefc88

View file

@ -116,6 +116,10 @@ ynh_app_dependencies () {
fi
version=$(sudo python3 -c "import sys, json;print(json.load(open(\"$manifest_path\"))['version'])") # Retrieve the version number in the manifest file.
dep_app=${app//_/-} # Replace all '_' by '-'
if ynh_package_is_installed "${dep_app}-ynh-deps"; then
echo "A package named ${dep_app}-ynh-deps is already installed" >&2
else
cat > ./${dep_app}-ynh-deps.control << EOF # Make a control file for equivs-build
Section: misc
Priority: optional
@ -129,6 +133,7 @@ EOF
ynh_package_install_from_equivs ./${dep_app}-ynh-deps.control \
|| ynh_die "Unable to install dependencies" # Install the fake package and its dependencies
ynh_app_setting_set $app apt_dependencies $dependencies
fi
}
# Remove fake package and its dependencies