Commit 755813ec authored by anonym's avatar anonym

Rename function.

Some people don't like mixing declarative and imperative styles! :)
parent 1e6829fa
......@@ -11,13 +11,13 @@ echo "Localize each supported browser locale"
# Import language_code_from_locale()
. /usr/local/lib/tails-shell-library/localization.sh
# Import strip_nondeterminism_wrapper() and build_hook_dependency()
# Import strip_nondeterminism_wrapper() and ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
# Import TAILS_WIKI_SUPPORTED_LANGUAGES
. /etc/amnesia/environment
build_hook_dependency p7zip imagemagick
ensure_hook_dependency_is_installed p7zip imagemagick
TBB_LOCALIZED_SEARCHPLUGINS_DIR="${TBB_INSTALL}/distribution/searchplugins/locale/"
BROWSER_LOCALIZATION_DIR="/usr/share/tails/browser-localization"
......
......@@ -4,10 +4,10 @@ set -e
echo "Converting uBlock database dump into sqlite blob"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency sqlite3
ensure_hook_dependency_is_installed sqlite3
DUMP="/usr/share/tails/ublock-origin/ublock0.dump"
DATABASE="/etc/tor-browser/profile/extension-data/ublock0.sqlite"
......
......@@ -4,10 +4,10 @@ set -e
echo "Set up Tor Browser bookmarks"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency sqlite3
ensure_hook_dependency_is_installed sqlite3
# Create a symlink to places.sqlite in browser profile from a
# dedicated "bookmarks" directory, so that it can be easily made
......
......@@ -4,10 +4,10 @@ set -e
echo "Installing AppArmor profile for Tor Browser"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency patch
ensure_hook_dependency_is_installed patch
PATCH='/usr/share/tails/torbrowser-AppArmor-profile.patch'
PROFILE='/etc/apparmor.d/torbrowser'
......
......@@ -7,10 +7,10 @@ set -e
echo "Updating the system DConf databases"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency dconf-cli
ensure_hook_dependency_is_installed dconf-cli
dconf update
chmod 0644 /etc/dconf/db/local
......@@ -8,7 +8,7 @@ echo "Building dkms modules"
. /usr/share/amnesia/build/variables
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
# Import install_fake_package
......@@ -17,23 +17,23 @@ echo "Building dkms modules"
# Install gcc-6 and fake linux-compiler-gcc-7-x86
# (linux-headers-4.14+ depends on it, but Stretch hasn't GCC 7)
# XXX:Buster: remove this hack.
build_hook_dependency gcc-6
ensure_hook_dependency_is_installed gcc-6
NEWEST_INSTALLED_KERNEL_VERSION="$(
dpkg-query --showformat '${Version}\n' --show 'linux-image-*-amd64' \
| sort --version-sort | tail -n1
)"
build_hook_dependency \
ensure_hook_dependency_is_installed \
linux-compiler-gcc-7-x86 \
"${NEWEST_INSTALLED_KERNEL_VERSION}~0tails1"
ln -s /usr/bin/gcc-6 /usr/bin/gcc-7
# Any -dkms package must be installed *after* dkms to be properly registered
build_hook_dependency \
ensure_hook_dependency_is_installed \
build-essential \
dkms \
libelf-dev
build_hook_dependency \
ensure_hook_dependency_is_installed \
"linux-headers-${KERNEL_VERSION}-amd64" \
aufs-dkms \
virtualbox-guest-dkms
......
......@@ -6,10 +6,10 @@ set -e
echo "Compiling and installing a custom udev-watchdog program"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency build-essential binutils libudev-dev
ensure_hook_dependency_is_installed build-essential binutils libudev-dev
SRC="/usr/src/udev-watchdog.c"
DST="/usr/local/sbin/udev-watchdog"
......
......@@ -4,10 +4,10 @@ set -e
echo "Registering and tweaking menus"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency xdg-utils
ensure_hook_dependency_is_installed xdg-utils
for app in tails-installer tails-persistence-delete tails-persistence-setup tails-about tails-documentation; do
xdg-desktop-menu install --novendor \
......
......@@ -4,10 +4,10 @@ set -e
echo "Configuring compression of the initramfs"
# Import build_hook_dependency()
# Import ensure_hook_dependency_is_installed()
. /usr/local/lib/tails-shell-library/build.sh
build_hook_dependency initramfs-tools xz-utils
ensure_hook_dependency_is_installed initramfs-tools xz-utils
# Compress the initramfs using a more size-wise efficient algorithm.
......
......@@ -13,7 +13,7 @@ strip_nondeterminism_wrapper() {
# are installed now, they will be marked as "automatically installed"
# so the next `apt-get autoremove` action *unless* they are later
# explicitly installed (or other packages depends on them).
build_hook_dependency() {
ensure_hook_dependency_is_installed() {
# Filter out already installed packages from $@.
for p in "${@}"; do
shift
......@@ -30,7 +30,7 @@ install_fake_package() {
name="${1}"
version="${2}"
section="${3:-misc}"
build_hook_dependency equivs
ensure_hook_dependency_is_installed equivs
tmp="$(mktemp -d)"
control_file="${tmp}/${name}_${version}.control"
cat > "${control_file}" << EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment