mkimage-profiles/features.in/cleanup/install2/image-scripts.d/90cleanup-pkgs
Michael Shigorin c4a5515b64 tagged scripts breakage partially fixed
It appears that features.in/Makefile functioned a bit
differently by now than was described back then: after
loops and pushds got rearranged for robustness, it stopped
to pick up a cleanup feature tagged script.

That particular script is now better de-tagged and simply
placed as a script to be merged into install2 subprofile.

The tagged scripts still require a bit more comprehension
to understand the use cases (e.g., do we need per-subprofile
tagged script subdirs or just a toplevel one should be looked
at, with script names telling where to put them).

README used to mix up subprofiles and features; fixed.
2011-11-19 11:45:59 +02:00

22 lines
622 B
Bash
Executable File

#!/bin/sh -efu
### create a postinstall script to drop temporarily needed packages
if [ -n "$GLOBAL_VERBOSE" ]; then
echo "** GLOBAL_CLEANUP_PACKAGES: $GLOBAL_CLEANUP_PACKAGES"
fi >&2
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 extra packages from 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"