Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg-clean: Show files to delete first
Bryan Drewery committed 11 years ago
commit e3412f4b69f0a6f35c6b2752a1eaac4d0a36cee9
parent fcd167d
1 file changed +10 -2
modified src/clean.c
@@ -67,6 +67,7 @@ static int
add_to_dellist(struct dl_head *dl,  const char *path)
{
	struct deletion_list	*dl_entry;
+
	static bool first_entry = true;

	assert(path != NULL);

@@ -78,6 +79,15 @@ add_to_dellist(struct dl_head *dl, const char *path)

	dl_entry->path = strdup(path);

+
	if (!quiet) {
+
		if (first_entry) {
+
			first_entry = false;
+
			printf("The following package files will be deleted:"
+
			    "\n");
+
		}
+
		printf("\t%s\n", dl_entry->path);
+
	}
+

	STAILQ_INSERT_TAIL(dl, dl_entry, next);

	return (EPKG_OK);
@@ -103,8 +113,6 @@ delete_dellist(struct dl_head *dl)
	int			count = 0;

	STAILQ_FOREACH(dl_entry, dl, next) {
-
		if (!quiet)
-
			printf("\t%s\n", dl_entry->path);
		if (unlink(dl_entry->path) != 0) {
			warn("unlink(%s)", dl_entry->path);
			count++;