Date: Mon, 17 Aug 2009 23:44:26 GMT From: David Forsythe <dforsyth@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 167457 for review Message-ID: <200908172344.n7HNiQNv042291@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=167457 Change 167457 by dforsyth@squirrel on 2009/08/17 23:43:29 pkg_info prints deinstall directory remove commands. Affected files ... .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.c#46 edit .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.h#41 edit .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_conflict.c#8 edit .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_manifest.c#8 edit .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_manifest.h#7 edit .. //depot/projects/soc2009/dforsyth_libpkg/pkg_info/main.c#33 edit Differences ... ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.c#46 (text+ko) ==== @@ -375,6 +375,16 @@ return (pkg_manifest_unexec_cmd_list(p->pm)); } +const char *const * +pkg_dirrms(struct pkg *p) +{ + pkg_check_magic(p, __func__); + if (p->pm == NULL && p->in_db != NULL) + pkg_parse_manifest(p); + + return (pkg_manifest_dirrm_cmd_list(p->pm)); +} + /* Add a file to a package. This is fairly useless at this point * because... well, there the hell is the file coming from? */ ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.h#41 (text+ko) ==== @@ -52,13 +52,13 @@ int pkg_clone(struct pkg *src, struct pkg *dest); int pkg_force_parse_manifest(struct pkg *p); -/* Add mtree_dirs, display, etc, etc. */ - +/* rename a few of these. */ const char *const *pkg_files(struct pkg *p); const char *const *pkg_depends(struct pkg *p); const char *const *pkg_conflicts(struct pkg *p); const char *const *pkg_execs(struct pkg *p); const char *const *pkg_unexecs(struct pkg *p); +const char *const *pkg_dirrms(struct pkg *p); int pkg_add_pkg_file(struct pkg *p, const char *path, const char *cwd, ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_conflict.c#8 (text+ko) ==== @@ -87,7 +87,7 @@ { const struct pkg_conflict *pca; const struct pkg_conflict *pcb; - + pca = a; pcb = b; ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_manifest.c#8 (text+ko) ==== @@ -14,6 +14,7 @@ static void pkg_manifest_clear_file_entries(struct pkg_manifest *pm); static void pkg_manifest_clear_exec_list(struct pkg_manifest *pm); static void pkg_manifest_clear_unexec_list(struct pkg_manifest *pm); +static void pkg_manifest_clear_dirrm_list(struct pkg_manifest *pm); static void pkg_manifest_init(struct pkg_manifest *pm); void @@ -90,6 +91,7 @@ pkg_manifest_clear_file_entries(pm); pkg_manifest_clear_exec_list(pm); pkg_manifest_clear_unexec_list(pm); + pkg_manifest_clear_dirrm_list(pm); pkg_manifest_init(pm); } @@ -254,7 +256,7 @@ pm->conflict_list[pm->conflict_count - 1] = pc->name; pm->conflict_list[pm->conflict_count] = NULL; - + return (pc); } @@ -460,6 +462,15 @@ return; } +void +pkg_manifest_remove_dirrm_cmd(struct pkg_manifest *pm, int cmdidx) +{ + pkg_manifest_check_magic(pm, __func__); + if (cmdidx < 0) + return; + return; +} + static void pkg_manifest_clear_conflict_entries(struct pkg_manifest *pm) { @@ -500,6 +511,14 @@ pkg_manifest_remove_unexec_cmd(pm, pm->unexec_count); } +static void +pkg_manifest_clear_dirrm_list(struct pkg_manifest *pm) +{ + pkg_manifest_check_magic(pm, __func__); + while (pm->dirrm_count > 0) + pkg_manifest_remove_dirrm_cmd(pm, pm->dirrm_count); +} + struct pkg_conflict * pkg_manifest_select_conflict(struct pkg_manifest *pm, const char *name) { ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_manifest.h#7 (text+ko) ==== @@ -144,6 +144,8 @@ void pkg_manifest_remove_unexec_cmd(struct pkg_manifest *pm, int cmdidx); +void pkg_manifest_remove_dirrm_cmd(struct pkg_manifest *pm, int cmdidx); + const char *const *pkg_manifest_conflict_list(struct pkg_manifest *pm); const char *const *pkg_manifest_depend_list(struct pkg_manifest *pm); ==== //depot/projects/soc2009/dforsyth_libpkg/pkg_info/main.c#33 (text+ko) ==== @@ -349,12 +349,18 @@ buff, pkg_pkg_file_md5(p, buff)); } } - - for (klist = pkg_execs(p); klist != NULL && *klist != NULL; buff = *klist++) + + klist = pkg_execs(p); + while (klist != NULL && (buff = *klist++) != NULL) printf("\tEXEC '%s'\n", buff); - for (klist = pkg_unexecs(p); klist != NULL && *klist != NULL; buff = *klist++) + + klist = pkg_unexecs(p); + while (klist != NULL && (buff = *klist++) != NULL) printf("\tUNEXEC '%s'\n", buff); - + + klist = pkg_dirrms(p); + while (klist != NULL && (buff = *klist++) != NULL) + printf("\tDeinstall directory remove: %s\n", buff); } if (flags & OPT_SHOW_REQUIRE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908172344.n7HNiQNv042291>