Based on a patch by Ian Jackson <ian@davenant.greenend.org.uk>.
+2008-03-28 Ian Jackson <ian@davenant.greenend.org.uk>,
+ Guillem Jover <guillem@debian.org>
+
+ * src/main.h (post_postinst_tasks): New prototype.
+ * src/help.c (post_postinst_tasks): New function.
+ * src/cleanup.c (cu_prermupgrade): Use post_postinst_tasks instead of
+ duplicate code.
+ (cu_prermdeconfigure): Likewise.
+ (cu_prerminfavour): Likewise.
+ (cu_prermremove): Likewise.
+ * src/configure.c (deferred_configure): Likewise.
+
2008-03-28 Guillem Jover <guillem@debian.org>
* src/packages.c (process_queue): Fix typo in comment.
versiondescribe(&pkg->available.version,
vdew_nonambig),
NULL);
- pkg->status= stat_installed;
pkg->eflag &= ~eflagf_reinstreq;
- modstatdb_note(pkg);
+ post_postinst_tasks(pkg, stat_installed);
cleanup_pkg_failed--;
}
NULL);
}
- deconf->status= stat_installed;
- modstatdb_note(deconf);
+ post_postinst_tasks(deconf, stat_installed);
}
void cu_prerminfavour(int argc, void **argv) {
versiondescribe(&infavour->available.version,
vdew_nonambig),
NULL);
- conflictor->status= stat_installed;
conflictor->eflag &= ~eflagf_reinstreq;
- modstatdb_note(conflictor);
+ post_postinst_tasks(conflictor, stat_installed);
cleanup_conflictor_failed--;
}
if (cleanup_pkg_failed++) return;
maintainer_script_installed(pkg,POSTINSTFILE,"post-installation",
"abort-remove", NULL);
- pkg->status= *oldpkgstatus;
pkg->eflag &= ~eflagf_reinstreq;
- modstatdb_note(pkg);
+ post_postinst_tasks(pkg, *oldpkgstatus);
cleanup_pkg_failed--;
}
vdew_nonambig) : "",
NULL);
- pkg->status= stat_installed;
pkg->eflag= eflagv_ok;
- modstatdb_note(pkg);
+ post_postinst_tasks(pkg, stat_installed);
}
onerr_abort--;
}
+void
+post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status)
+{
+ pkg->status = new_status;
+ modstatdb_note(pkg);
+}
+
static void setexecute(const char *path, struct stat *stab) {
if ((stab->st_mode & 0555) == 0555) return;
if (!chmod(path,0755)) return;
const char *scriptname, const char *description,
const char *cidir, char *cidirrest,
const char *ifok, const char *iffallback);
+void post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status);
+
void clear_istobes(void);
int isdirectoryinuse(struct filenamenode *namenode, struct pkginfo *pkg);
int hasdirectoryconffiles(struct filenamenode *namenode, struct pkginfo *pkg);