The following commit has been merged in the master branch: commit ff6e32d3588cf11258a7d0a2311461971abe51f3 Author: Guillem Jover <guil...@debian.org> Date: Fri May 6 05:06:54 2011 +0200
dpkg: Rename isdirectoryinuse() to dir_is_used_by_others() This clarifies the action performed by the function, which could be easily confused as being used by the given package, instead of by other packages. diff --git a/src/help.c b/src/help.c index 8f6a2fc..4a2256f 100644 --- a/src/help.c +++ b/src/help.c @@ -490,17 +490,17 @@ dir_has_conffiles(struct filenamenode *file, struct pkginfo *pkg) * false otherwise. */ bool -isdirectoryinuse(struct filenamenode *file, struct pkginfo *pkg) +dir_is_used_by_others(struct filenamenode *file, struct pkginfo *pkg) { struct filepackages_iterator *iter; struct pkginfo *other_pkg; - debug(dbg_veryverbose, "isdirectoryinuse `%s' (except %s)", file->name, + debug(dbg_veryverbose, "dir_is_used_by_others '%s' (except %s)", file->name, pkg ? pkg->name : "<none>"); iter = filepackages_iter_new(file); while ((other_pkg = filepackages_iter_next(iter))) { - debug(dbg_veryverbose, "isdirectoryinuse considering %s ...", + debug(dbg_veryverbose, "dir_is_used_by_others considering %s ...", other_pkg->name); if (other_pkg == pkg) continue; @@ -508,7 +508,7 @@ isdirectoryinuse(struct filenamenode *file, struct pkginfo *pkg) } filepackages_iter_free(iter); - debug(dbg_veryverbose, "isdirectoryinuse no"); + debug(dbg_veryverbose, "dir_is_used_by_others no"); return false; } diff --git a/src/main.h b/src/main.h index 177fb1c..12d12e7 100644 --- a/src/main.h +++ b/src/main.h @@ -248,7 +248,7 @@ void post_postinst_tasks_core(struct pkginfo *pkg); void post_postinst_tasks(struct pkginfo *pkg, enum pkgstatus new_status); void clear_istobes(void); -bool isdirectoryinuse(struct filenamenode *namenode, struct pkginfo *pkg); +bool dir_is_used_by_others(struct filenamenode *namenode, struct pkginfo *pkg); bool dir_has_conffiles(struct filenamenode *namenode, struct pkginfo *pkg); void log_action(const char *action, struct pkginfo *pkg); diff --git a/src/processarc.c b/src/processarc.c index 2ee685f..6e7ea09 100644 --- a/src/processarc.c +++ b/src/processarc.c @@ -888,7 +888,8 @@ void process_archive(const char *filename) { if (!stat(namenode->name,&stab) && S_ISDIR(stab.st_mode)) { debug(dbg_eachfiledetail, "process_archive: %s is a directory", namenode->name); - if (isdirectoryinuse(namenode,pkg)) continue; + if (dir_is_used_by_others(namenode, pkg)) + continue; } if (lstat(fnamevb.buf, &oldfs)) { diff --git a/src/remove.c b/src/remove.c index ac57dd2..a33518d 100644 --- a/src/remove.c +++ b/src/remove.c @@ -257,7 +257,8 @@ removal_bulk_remove_files(struct pkginfo *pkg) push_leftover(&leftover,namenode); continue; } - if (isdirectoryinuse(namenode,pkg)) continue; + if (dir_is_used_by_others(namenode, pkg)) + continue; } debug(dbg_eachfiledetail, "removal_bulk removing `%s'", fnvb.buf); if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue; @@ -336,7 +337,8 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) { push_leftover(&leftover,namenode); continue; } - if (isdirectoryinuse(namenode,pkg)) continue; + if (dir_is_used_by_others(namenode, pkg)) + continue; } debug(dbg_eachfiledetail, "removal_bulk removing `%s'", fnvb.buf); -- dpkg's main repository -- To UNSUBSCRIBE, email to debian-dpkg-cvs-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org