Index: debian/pkgsel.templates =================================================================== --- debian/pkgsel.templates (revision 34762) +++ debian/pkgsel.templates (working copy) @@ -26,3 +26,8 @@ # The text is used at the end of the installation phase while # cleaning up pkgsel's stuff _Description: Cleaning up... + +Template: pkgsel/include-packages +Type: string +Description: space-separated list of extra packages to install + For preseeding only; not translated. Index: debian/postinst =================================================================== --- debian/postinst (revision 34762) +++ debian/postinst (working copy) @@ -50,7 +50,7 @@ db_progress INFO pkgsel/progress/tasksel ret=0 -in-target sh -c "$config tasksel --new-install --debconf-apt-progress='--from 5 --to 95 --logstderr'" || ret=$? +in-target sh -c "$config tasksel --new-install --debconf-apt-progress='--from 5 --to 90 --logstderr'" || ret=$? if [ "$ret" != 0 ]; then # In case packages failed to install, try to clean up. in-target dpkg --configure -a || true @@ -64,6 +64,25 @@ exit $ret fi +db_get pkgsel/include-packages +if [ "$RET" ]; then + in-target sh -c "$config debconf-apt-progress --from 90 --to 95 --logstderr -- aptitude -q --without-recommends -y install $RET" || ret=$? + if [ "$ret" != 0 ]; then + # In case packages failed to install, try to clean up. + in-target dpkg --configure -a || true + + # TODO useful error message here (for ret != 30) + db_progress INFO pkgsel/progress/cleanup + if ! cleanup; then + log "cleanup failed" + fi + db_progress STOP + exit $ret + fi +else + db_progress STEP 5 +fi + db_progress INFO pkgsel/progress/cleanup if ! cleanup; then log "cleanup failed"