diff -ru dpkg-1.18.10/lib/dpkg/dpkg.h dpkg-1.18.10+iPhone/lib/dpkg/dpkg.h --- dpkg-1.18.10/lib/dpkg/dpkg.h 2016-07-05 01:55:13.000000000 +0000 +++ dpkg-1.18.10+iPhone/lib/dpkg/dpkg.h 2016-08-15 23:45:06.000000000 +0000 @@ -68,6 +68,7 @@ #define CONTROLFILE "control" #define CONFFILESFILE "conffiles" #define PREINSTFILE "preinst" +#define EXTRAINSTFILE "extrainst_" #define POSTINSTFILE "postinst" #define PRERMFILE "prerm" #define POSTRMFILE "postrm" diff -ru dpkg-1.18.10/src/unpack.c dpkg-1.18.10+iPhone/src/unpack.c --- dpkg-1.18.10/src/unpack.c 2016-07-05 02:00:41.000000000 +0000 +++ dpkg-1.18.10+iPhone/src/unpack.c 2016-08-15 23:43:41.000000000 +0000 @@ -1434,6 +1434,16 @@ tar_deferred_extract(newfiles_queue.head, pkg); + if (oldversionstatus == PKG_STAT_NOTINSTALLED || oldversionstatus == PKG_STAT_CONFIGFILES) { + maintscript_new(pkg, EXTRAINSTFILE, "extra-installation", cidir, cidirrest, + "install", NULL); + } else { + maintscript_new(pkg, EXTRAINSTFILE, "extra-installation", cidir, cidirrest, + "upgrade", + versiondescribe(&pkg->installed.version, vdew_nonambig), + NULL); + } + if (oldversionstatus == PKG_STAT_HALFINSTALLED || oldversionstatus == PKG_STAT_UNPACKED) { /* Packages that were in ‘installed’ and ‘postinstfailed’ have been