90-cleanup-pkgs 794 Bytes
Newer Older
1
#!/bin/sh -efu
2
### create a postinstall script to drop temporarily needed packages
3 4 5

if [ -n "$GLOBAL_VERBOSE" ]; then
	echo "** GLOBAL_CLEANUP_PACKAGES: $GLOBAL_CLEANUP_PACKAGES"
6
	echo "** GLOBAL_CLEANUP_BASE_PACKAGES: $GLOBAL_CLEANUP_BASE_PACKAGES"
7 8
fi >&2

9
export GLOBAL_CLEANUP_PACKAGES="$GLOBAL_CLEANUP_PACKAGES \
10 11
	$GLOBAL_CLEANUP_BASE_PACKAGES"

12
SCRIPT="/usr/share/install2/postinstall.d/01-remove-pkgs"
13

14 15 16 17 18 19 20 21
cat > "$SCRIPT" << EOF
#!/bin/sh -efu

. install2-init-functions

# don't override the script start message on the same line
echo "removing $GLOBAL_CLEANUP_PACKAGES"

22
# remove temporary packages from the installed system
23 24 25 26
list="\$(exec_chroot rpmquery -a --qf='%{NAME}\\n' $GLOBAL_CLEANUP_PACKAGES)"
[ -z "\$list" ] || exec_chroot apt-get remove -f -y  -- \$list
EOF
chmod +x "$SCRIPT"