diff -ru dpkg-1.14.25/lib/dpkg.h dpkg-1.14.25+iPhone/lib/dpkg.h --- dpkg-1.14.25/lib/dpkg.h 2009-02-01 06:18:59.000000000 +0000 +++ dpkg-1.14.25+iPhone/lib/dpkg.h 2009-04-11 01:20:50.000000000 +0000 @@ -80,6 +80,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.14.25/src/processarc.c dpkg-1.14.25+iPhone/src/processarc.c --- dpkg-1.14.25/src/processarc.c 2009-02-01 06:19:02.000000000 +0000 +++ dpkg-1.14.25+iPhone/src/processarc.c 2009-04-11 01:19:29.000000000 +0000 @@ -596,6 +596,16 @@ p1[0] = -1; waitsubproc(c1,BACKEND " --fsys-tarfile",PROCPIPE); + if (oldversionstatus == stat_notinstalled || oldversionstatus == stat_configfiles) { + maintainer_script_new(pkg->name, EXTRAINSTFILE, "extra-installation", cidir, cidirrest, + "install", (char *)0); + } else { + maintainer_script_new(pkg->name, EXTRAINSTFILE, "extra-installation", cidir, cidirrest, + "upgrade", versiondescribe(&pkg->installed.version, + vdew_nonambig), + (char *)0); + } + if (oldversionstatus == stat_halfinstalled || oldversionstatus == stat_unpacked) { /* Packages that were in `installed' and `postinstfailed' have been reduced * to `unpacked' by now, by the running of the prerm script.