mirror of
https://github.com/YunoHost-Apps/codimd_ynh.git
synced 2024-09-03 18:16:32 +02:00
Update ynh_add_extra_apt_repos__3
This commit is contained in:
parent
d03bc6b275
commit
d17dacc5d2
1 changed files with 12 additions and 12 deletions
|
@ -27,7 +27,7 @@ ynh_pin_repo () {
|
||||||
name="${name:-$app}"
|
name="${name:-$app}"
|
||||||
append=${append:-0}
|
append=${append:-0}
|
||||||
|
|
||||||
if [ $append -eq 1 ]
|
if [ "$append" -eq 1 ]
|
||||||
then
|
then
|
||||||
append="tee -a"
|
append="tee -a"
|
||||||
else
|
else
|
||||||
|
@ -128,7 +128,7 @@ ynh_install_extra_repo () {
|
||||||
local component="${repo##$uri $suite }"
|
local component="${repo##$uri $suite }"
|
||||||
|
|
||||||
# Add the repository into sources.list.d
|
# Add the repository into sources.list.d
|
||||||
ynh_add_repo --uri="$uri" --suite="$suite" --component="$component" --name="$name" $append
|
ynh_add_repo --uri="$uri" --suite="$suite" --component="$component" --name="$name" "$append"
|
||||||
|
|
||||||
# Pin the new repo with the default priority, so it won't be used for upgrades.
|
# Pin the new repo with the default priority, so it won't be used for upgrades.
|
||||||
# Build $pin from the uri without http and any sub path
|
# Build $pin from the uri without http and any sub path
|
||||||
|
@ -139,13 +139,13 @@ ynh_install_extra_repo () {
|
||||||
then
|
then
|
||||||
priority="--priority=$priority"
|
priority="--priority=$priority"
|
||||||
fi
|
fi
|
||||||
ynh_pin_repo --package="*" --pin="origin \"$pin\"" $priority --name="$name" $append
|
ynh_pin_repo --package="*" --pin="origin \"$pin\"" "$priority" --name="$name" "$append"
|
||||||
|
|
||||||
# Get the public key for the repo
|
# Get the public key for the repo
|
||||||
if [ -n "$key" ]
|
if [ -n "$key" ]
|
||||||
then
|
then
|
||||||
mkdir -p "/etc/apt/trusted.gpg.d"
|
mkdir -p "/etc/apt/trusted.gpg.d"
|
||||||
wget -q "$key" -O - | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/$name.gpg > /dev/null
|
wget -q "$key" -O - | gpg --dearmor | $wget_append /etc/apt/trusted.gpg.d/"$name".gpg > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update the list of package with the new repo
|
# Update the list of package with the new repo
|
||||||
|
@ -200,13 +200,13 @@ ynh_install_extra_app_dependencies () {
|
||||||
key="--key=$key"
|
key="--key=$key"
|
||||||
fi
|
fi
|
||||||
# Add an extra repository for those packages
|
# Add an extra repository for those packages
|
||||||
ynh_install_extra_repo --repo="$repo" $key --priority=995 --name=$name
|
ynh_install_extra_repo --repo="$repo" "$key" --priority=995 --name="$name"
|
||||||
|
|
||||||
# Install requested dependencies from this extra repository.
|
# Install requested dependencies from this extra repository.
|
||||||
ynh_add_app_dependencies --package="$package"
|
ynh_add_app_dependencies --package="$package"
|
||||||
|
|
||||||
# Remove this extra repository after packages are installed
|
# Remove this extra repository after packages are installed
|
||||||
ynh_remove_extra_repo --name=$app
|
ynh_remove_extra_repo --name="$app"
|
||||||
}
|
}
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -252,7 +252,7 @@ ynh_install_app_dependencies () {
|
||||||
dependencies="$(echo "$dependencies" | sed 's/\([^(\<=\>]\)\([\<=\>]\+\)\([^,]\+\)/\1 (\2 \3)/g')"
|
dependencies="$(echo "$dependencies" | sed 's/\([^(\<=\>]\)\([\<=\>]\+\)\([^,]\+\)/\1 (\2 \3)/g')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat > /tmp/${dep_app}-ynh-deps.control << EOF # Make a control file for equivs-build
|
cat > /tmp/"${dep_app}"-ynh-deps.control << EOF # Make a control file for equivs-build
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Package: ${dep_app}-ynh-deps
|
Package: ${dep_app}-ynh-deps
|
||||||
|
@ -262,10 +262,10 @@ Architecture: all
|
||||||
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
|
||||||
ynh_package_install_from_equivs /tmp/${dep_app}-ynh-deps.control \
|
ynh_package_install_from_equivs /tmp/"${dep_app}"-ynh-deps.control \
|
||||||
|| ynh_die --message="Unable to install dependencies" # Install the fake package and its dependencies
|
|| ynh_die --message="Unable to install dependencies" # Install the fake package and its dependencies
|
||||||
rm /tmp/${dep_app}-ynh-deps.control
|
rm /tmp/"${dep_app}"-ynh-deps.control
|
||||||
ynh_app_setting_set --app=$app --key=apt_dependencies --value="$dependencies"
|
ynh_app_setting_set --app="$app" --key=apt_dependencies --value="$dependencies"
|
||||||
}
|
}
|
||||||
|
|
||||||
ynh_add_app_dependencies () {
|
ynh_add_app_dependencies () {
|
||||||
|
@ -279,12 +279,12 @@ ynh_add_app_dependencies () {
|
||||||
replace=${replace:-0}
|
replace=${replace:-0}
|
||||||
|
|
||||||
local current_dependencies=""
|
local current_dependencies=""
|
||||||
if [ $replace -eq 0 ]
|
if [ "$replace" -eq 0 ]
|
||||||
then
|
then
|
||||||
local dep_app=${app//_/-} # Replace all '_' by '-'
|
local dep_app=${app//_/-} # Replace all '_' by '-'
|
||||||
if ynh_package_is_installed --package="${dep_app}-ynh-deps"
|
if ynh_package_is_installed --package="${dep_app}-ynh-deps"
|
||||||
then
|
then
|
||||||
current_dependencies="$(dpkg-query --show --showformat='${Depends}' ${dep_app}-ynh-deps) "
|
current_dependencies="$(dpkg-query --show --showformat='${Depends}' "${dep_app}"-ynh-deps) "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
current_dependencies=${current_dependencies// | /|}
|
current_dependencies=${current_dependencies// | /|}
|
||||||
|
|
Loading…
Add table
Reference in a new issue