summaryrefslogtreecommitdiff
path: root/src/selfstrap
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2017-09-04 05:46:48 -0400
committerAndrew Cady <d@jerkface.net>2017-09-04 05:46:48 -0400
commit6382a62f3d3d40a685f0f17a82c03af221fa782b (patch)
tree318c70f785d64235a6cd47239f32d4d98a20cc38 /src/selfstrap
parent784deb109816167799aa24accdf493fec09f102b (diff)
selfstrap: set up /var/lib/dpkg/tmp.ci before running inst scripts
Diffstat (limited to 'src/selfstrap')
-rwxr-xr-xsrc/selfstrap19
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
257remove_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`
264extract_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
257dpkg_configure_from_apt_actions() 272dpkg_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) ;;