hi,

i am running pacman db inside a loop (humm to speed up some pacman operation) 
and when i run pacman -Sc (or -Scc); i got
...
Do you want to remove unused repositories? [Y/n] y
Do you want to remove /var/lib/pacman/lost+found? [Y/n] n

it's because i have a lost+found directory in /var/lib/pacman because it's the 
root of a filesystem.

i find the question annyoing, as lost+found is NOT an unused repository.

may be you could just ignore lost+found (on -Sc) so that the last question 
above is not asked ? that will be be really unfortunate if a real repo uses 
that name. 
so simply do not ask the user.

on the other hand, as the user is asked about that where is the problem ?
if ever there are some files in lost+found, he/she would have still plenty of 
time to fix it because he/she has to run manually a -Sc command. and if there 
is a problem the first to do is not to run -Sc !

a good or bad idea ?

your call
From 6b07694fa73499bb89556c151be39160c5ecad2a Mon Sep 17 00:00:00 2001
From: solsTiCe d'Hiver <[EMAIL PROTECTED]>
Date: Sun, 20 Jul 2008 09:32:18 +0200
Subject: [PATCH] ignore lost+found directory when cleaning unsused repository directory

---
 src/pacman/sync.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index fdc5ed0..a696751 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -67,6 +67,11 @@ static int sync_cleandb(const char *dbpath, int keep_used) {
 			continue;
 		}
 
+		/* skip lost+found directory */
+		if(!strcmp(dname, "lost+found")) {
+			continue;
+		}
+
 		/* build the full path */
 		snprintf(path, PATH_MAX, "%s%s", dbpath, dname);
 		/* skip entries that are not dirs (lock file, etc.) */
-- 
1.5.6.3

_______________________________________________
pacman-dev mailing list
[email protected]
http://archlinux.org/mailman/listinfo/pacman-dev

Reply via email to