diff options
Diffstat (limited to 'src/selfstrap')
-rwxr-xr-x | src/selfstrap | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/selfstrap b/src/selfstrap index 9c43f2d..265fa25 100755 --- a/src/selfstrap +++ b/src/selfstrap | |||
@@ -254,6 +254,21 @@ verbosely() | |||
254 | fi | 254 | fi |
255 | } | 255 | } |
256 | 256 | ||
257 | remove_tmp_ci() | ||
258 | { | ||
259 | [ ! -e "$TARGET"/var/lib/dpkg/tmp.ci ] || rm -r "$TARGET"/var/lib/dpkg/tmp.ci | ||
260 | } | ||
261 | |||
262 | # /var/lib/dpkg/tmp.ci/control is read by debconf to determine the owner package | ||
263 | # See `grep -A3 control /usr/share/debconf/frontend` | ||
264 | extract_tmp_ci() | ||
265 | { | ||
266 | local deb="$1" | ||
267 | remove_tmp_ci | ||
268 | mkdir "$TARGET"/var/lib/dpkg/tmp.ci | ||
269 | dpkg --ctrl-tarfile "$deb" | tar -C "$TARGET"/var/lib/dpkg/tmp.ci -x | ||
270 | } | ||
271 | |||
257 | dpkg_configure_from_apt_actions() | 272 | dpkg_configure_from_apt_actions() |
258 | { | 273 | { |
259 | while read line; do | 274 | while read line; do |
@@ -267,14 +282,18 @@ dpkg_configure_from_apt_actions() | |||
267 | export DPKG_MAINTSCRIPT_NAME=preinst | 282 | export DPKG_MAINTSCRIPT_NAME=preinst |
268 | preinst=/var/lib/dpkg/info/${package}${multiarch}.preinst | 283 | preinst=/var/lib/dpkg/info/${package}${multiarch}.preinst |
269 | if [ -x "$TARGET"/"$preinst" ]; then | 284 | if [ -x "$TARGET"/"$preinst" ]; then |
285 | extract_tmp_ci "$deb" | ||
270 | verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$preinst" install | 286 | verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$preinst" install |
287 | remove_tmp_ci | ||
271 | fi | 288 | fi |
272 | ;; | 289 | ;; |
273 | Conf) | 290 | Conf) |
274 | export DPKG_MAINTSCRIPT_NAME=postinst | 291 | export DPKG_MAINTSCRIPT_NAME=postinst |
275 | postinst=/var/lib/dpkg/info/${package}${multiarch}.postinst | 292 | postinst=/var/lib/dpkg/info/${package}${multiarch}.postinst |
276 | if [ -x "$TARGET"/"$postinst" ]; then | 293 | if [ -x "$TARGET"/"$postinst" ]; then |
294 | extract_tmp_ci "$deb" | ||
277 | verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$postinst" configure | 295 | verbosely ${CHROOT_PROG:-chroot} "$TARGET" "$postinst" configure |
296 | remove_tmp_ci | ||
278 | fi | 297 | fi |
279 | ;; | 298 | ;; |
280 | Remv) ;; | 299 | Remv) ;; |