+2008-07-06 Guillem Jover <guillem@debian.org>
+
+ * src/main.h: Remove comment about side effect in namenodetouse.
+ * src/help.c (namenodetouse): Move call to trig_file_activate to ...
+ * src/archives.c (tarobject): ... here.
+ * src/processarc.c (process_archive): Likewise.
+ * src/remove.c (removal_bulk_remove_files): Likewise.
+ (removal_bulk_remove_leftover_dirs): Likewise.
+
2008-07-06 Michel Lespinasse <walken@zoy.org>
* dselect/baselist.cc (baselist::startdisplay): Create the
static struct varbuf conffderefn, hardlinkfn, symlinkfn;
static int fd;
const char *usename;
+ struct filenamenode *usenode;
struct conffile *conff;
struct tarcontext *tc= (struct tarcontext*)ti->UserData;
}
}
- usename= namenodetouse(nifd->namenode,tc->pkg)->name + 1; /* Skip the leading `/' */
+ usenode = namenodetouse(nifd->namenode, tc->pkg);
+ usename = usenode->name + 1; /* Skip the leading '/'. */
+
+ trig_file_activate(usenode, tc->pkg);
if (nifd->namenode->flags & fnnf_new_conff) {
/* If it's a conffile we have to extract it next to the installed
if (!namenode->divert) {
r = namenode;
- goto found;
+ return r;
}
debug(dbg_eachfile,"namenodetouse namenode=`%s' pkg=%s",
namenode->divert->pkg ? namenode->divert->pkg->name : "<none>",
r->name);
- found:
- trig_file_activate(r, pkg);
return r;
}
const char **failed);
void checkpath(void);
-/* NB side effect! This not only computes the appropriate filename
- * to use including thinking about any diversions, but also activates
- * any file triggers. */
struct filenamenode *namenodetouse(struct filenamenode*, struct pkginfo*);
/* all ...'s are const char*'s ... */
*/
reversefilelist_init(&rlistit,pkg->clientdata->files);
while ((namenode= reversefilelist_next(&rlistit))) {
+ struct filenamenode *usenode;
+
if ((namenode->flags & fnnf_new_conff) ||
(namenode->flags & fnnf_new_inarchive))
continue;
+ usenode = namenodetouse(namenode, pkg);
+ trig_file_activate(usenode, pkg);
+
fnamevb.used= fnameidlu;
- varbufaddstr(&fnamevb, namenodetouse(namenode,pkg)->name);
+ varbufaddstr(&fnamevb, usenode->name);
varbufaddc(&fnamevb,0);
if (!stat(namenode->name,&stab) && S_ISDIR(stab.st_mode)) {
reversefilelist_init(&rlistit,pkg->clientdata->files);
leftover = NULL;
while ((namenode= reversefilelist_next(&rlistit))) {
+ struct filenamenode *usenode;
+
debug(dbg_eachfile, "removal_bulk `%s' flags=%o",
namenode->name, namenode->flags);
if (namenode->flags & fnnf_old_conff) {
push_leftover(&leftover,namenode);
continue;
}
+
+ usenode = namenodetouse(namenode, pkg);
+ trig_file_activate(usenode, pkg);
+
varbufreset(&fnvb);
varbufaddstr(&fnvb,instdir);
- varbufaddstr(&fnvb,namenodetouse(namenode,pkg)->name);
+ varbufaddstr(&fnvb, usenode->name);
before= fnvb.used;
varbufaddstr(&fnvb,DPKGTEMPEXT);
reversefilelist_init(&rlistit,pkg->clientdata->files);
leftover = NULL;
while ((namenode= reversefilelist_next(&rlistit))) {
+ struct filenamenode *usenode;
+
debug(dbg_eachfile, "removal_bulk `%s' flags=%o",
namenode->name, namenode->flags);
if (namenode->flags & fnnf_old_conff) {
continue;
}
+ usenode = namenodetouse(namenode, pkg);
+ trig_file_activate(usenode, pkg);
+
varbufreset(&fnvb);
varbufaddstr(&fnvb,instdir);
- varbufaddstr(&fnvb,namenodetouse(namenode,pkg)->name);
+ varbufaddstr(&fnvb, usenode->name);
varbufaddc(&fnvb,0);
if (!stat(fnvb.buf,&stab) && S_ISDIR(stab.st_mode)) {