You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
794 B
27 lines
794 B
3 years ago
|
#!/bin/sh -efu
|
||
|
### create a postinstall script to drop temporarily needed packages
|
||
|
|
||
|
if [ -n "$GLOBAL_VERBOSE" ]; then
|
||
|
echo "** GLOBAL_CLEANUP_PACKAGES: $GLOBAL_CLEANUP_PACKAGES"
|
||
|
echo "** GLOBAL_CLEANUP_BASE_PACKAGES: $GLOBAL_CLEANUP_BASE_PACKAGES"
|
||
|
fi >&2
|
||
|
|
||
|
export GLOBAL_CLEANUP_PACKAGES="$GLOBAL_CLEANUP_PACKAGES \
|
||
|
$GLOBAL_CLEANUP_BASE_PACKAGES"
|
||
|
|
||
|
SCRIPT="/usr/share/install2/postinstall.d/01-remove-pkgs"
|
||
|
|
||
|
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"
|
||
|
|
||
|
# remove temporary packages from the installed system
|
||
|
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"
|