Skip to content
Snippets Groups Projects
Commit 794a2b50 authored by Christopher Spinrath's avatar Christopher Spinrath
Browse files

Introduce a generic method to hold packages

This replaces the hold_ubiquity functions. Packages that must not
be upgraded during the remaster process can be listed in the
contrib/rootfs/hold_packages file.
Since we have more than one function that reads a list of packages
from a file now, the code is moved to a new function
"get_packages_from_file".
parent 18fd235f
No related branches found
No related tags found
No related merge requests found
#List of packages that should not be upgraded or deleted
#during the remaster process.
#required because of launchpad bug #1373033
ubiquity
...@@ -52,17 +52,22 @@ function prepare_install() ...@@ -52,17 +52,22 @@ function prepare_install()
apt-get update apt-get update
} }
function install_packages_from_file() function get_packages_from_file()
{ {
FILENAME="$1" FILENAME="$1"
APT_OPTIONS=$2
if [ ! -e "$FILENAME" ]; then if [ ! -e "$FILENAME" ]; then
echo "Error: package file $FILENAME does not exist!" echo "Error: package file $FILENAME does not exist!"
exit 3 exit 3
fi fi
PKGS=$(grep -v "^#" "$FILENAME" | tr '\n' ' ') echo "$(grep -v "^#" "$FILENAME" | tr '\n' ' ')"
}
function install_packages_from_file()
{
APT_OPTIONS=$2
PKGS=$(get_packages_from_file "$1")
aptitude install -y $APT_OPTIONS $PKGS aptitude install -y $APT_OPTIONS $PKGS
} }
...@@ -113,18 +118,25 @@ function copy_modprobe_d() ...@@ -113,18 +118,25 @@ function copy_modprobe_d()
update-initramfs -u update-initramfs -u
} }
function prevent_ubiquity_update() function hold_packages()
{ {
echo "ubiquity hold" | dpkg --set-selections for PKG in $@; do
echo "$(echo "$PKG" | tr "[:blank:]") hold" | dpkg --set-selections
done
} }
function allow_ubiquity_update()
function unhold_packages()
{ {
echo "ubiquity install" | dpkg --set-selections for PKG in $@; do
echo "$(echo "$PKG" | tr -d "[:blank:]") install" | dpkg --set-selections
done
} }
divert_initctl divert_initctl
prevent_ubiquity_update #required because of launchpad bug #1373033 PKGS_TO_HOLD=$(get_packages_from_file "$CONTRIB_DIR/hold_packages")
hold_packages $PKGS_TO_HOLD
prepare_install prepare_install
copy_modprobe_d copy_modprobe_d
...@@ -139,7 +151,7 @@ patch_all "$SCRIPT_DIR/patches/" "/" ...@@ -139,7 +151,7 @@ patch_all "$SCRIPT_DIR/patches/" "/"
#echo "compiling glib2 schemas..." #echo "compiling glib2 schemas..."
#glib-compile-schemas /usr/share/glib-2.0/schemas #glib-compile-schemas /usr/share/glib-2.0/schemas
allow_ubiquity_update #required because of launchpad bug #1373033 unhold_packages $PKGS_TO_HOLD
revert_initctl revert_initctl
finalize finalize
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment