From 18fd235f3128606a98adbecf21e2a3e9b108d9de Mon Sep 17 00:00:00 2001 From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de> Date: Fri, 17 Oct 2014 23:25:42 +0200 Subject: [PATCH] Moved the remaining uck function out of remaster_rootfs --- scripts/remaster_rootfs.sh | 24 +++++++----------------- scripts/uck_functions.sh | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 scripts/uck_functions.sh diff --git a/scripts/remaster_rootfs.sh b/scripts/remaster_rootfs.sh index 294b42d..544ed11 100755 --- a/scripts/remaster_rootfs.sh +++ b/scripts/remaster_rootfs.sh @@ -10,6 +10,13 @@ if [ -e "$SCRIPT_DIR/scripts/common_functions.sh" ]; then source "$SCRIPT_DIR/scripts/common_functions.sh" fi +if [ -e "$SCRIPT_DIR/scripts/uck_functions.sh" ]; then + source "$SCRIPT_DIR/scripts/uck_functions.sh" +else + echo "Error: $SCRIPT_DIR/scripts/uck_functions.sh is missing." + exit 1 +fi + if [ ! -d "$SCRIPT_DIR" ]; then echo "Error: Missing remaster directory/files. Abort." exit 2 @@ -60,23 +67,6 @@ function install_packages_from_file() aptitude install -y $APT_OPTIONS $PKGS } -function install_lang_packages() -{ - #the content of this function is extracted from UCK - MISSING_LANG_PKG="$(check-language-support -l de_DE)" - MISSING_LANG_PKG="$(check-language-support -l en_US) $MISSING_LANG_PKG" # check for missing packages for de_DE and en_US - - if [ -n "$MISSING_LANG_PKG" ]; then - aptitude install $MISSING_LANG_PKG -y - fi - - EXTRA_LANG_PKG="$(dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support|firefox-locale|thunderbird-locale|libreoffice-help|libreoffice-l10n)' | grep -Ev "[-](de|en)\>")" # remove extra language packages - - if [ -n "$EXTRA_LANG_PKG" ]; then - aptitude purge $EXTRA_LANG_PKG -y - fi -} - function install_packages() { apt-get dist-upgrade --assume-yes --force-yes diff --git a/scripts/uck_functions.sh b/scripts/uck_functions.sh new file mode 100644 index 0000000..3890171 --- /dev/null +++ b/scripts/uck_functions.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +function install_lang_packages() +{ + #the content of this function is extracted from UCK + MISSING_LANG_PKG="$(check-language-support -l de_DE)" + MISSING_LANG_PKG="$(check-language-support -l en_US) $MISSING_LANG_PKG" # check for missing packages for de_DE and en_US + + if [ -n "$MISSING_LANG_PKG" ]; then + aptitude install $MISSING_LANG_PKG -y + fi + + EXTRA_LANG_PKG="$(dpkg-query --show | cut -f1 | grep -E '^(language-pack|language-support|firefox-locale|thunderbird-locale|libreoffice-help|libreoffice-l10n)' | grep -Ev "[-](de|en)\>")" # remove extra language packages + + if [ -n "$EXTRA_LANG_PKG" ]; then + aptitude purge $EXTRA_LANG_PKG -y + fi +} -- GitLab