summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2008-02-04 21:20:04 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2008-02-04 21:20:04 +0000
commit2d12b253ae14769fdb808c972ca8e92f4416b3bb (patch)
tree6dd8e8a919e14d03d294df319353cc9b03554bc7
parentbed73ee759569f44e9595440746b51ad3ccdcc3f (diff)
downloadrockbox-2d12b253ae14769fdb808c972ca8e92f4416b3bb.zip
rockbox-2d12b253ae14769fdb808c972ca8e92f4416b3bb.tar.gz
rockbox-2d12b253ae14769fdb808c972ca8e92f4416b3bb.tar.bz2
rockbox-2d12b253ae14769fdb808c972ca8e92f4416b3bb.tar.xz
add support for database.unignore files (adds dirs to the database which would be skipped because of a database.ignore file)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16214 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagcache.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 6c38300..a53bdc7 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -4062,11 +4062,12 @@ static bool check_deleted_files(void)
return true;
}
-static bool check_dir(const char *dirname)
+static bool check_dir(const char *dirname, int add_files)
{
DIR *dir;
int len;
int success = false;
+ int ignore, unignore;
char newpath[MAX_PATH];
dir = opendir(dirname);
@@ -4078,12 +4079,15 @@ static bool check_dir(const char *dirname)
/* check for a database.ignore file */
snprintf(newpath, MAX_PATH, "%s/database.ignore", dirname);
- if (file_exists(newpath))
- {
- closedir(dir);
- return false;
- }
-
+ ignore = file_exists(newpath);
+ /* check for a database.unignore file */
+ snprintf(newpath, MAX_PATH, "%s/database.unignore", dirname);
+ unignore = file_exists(newpath);
+
+ /* don't do anything if both ignore and unignore are there */
+ if (ignore != unignore)
+ add_files = unignore;
+
/* Recursively scan the dir. */
#ifdef __PCTOOL__
while (1)
@@ -4113,8 +4117,8 @@ static bool check_dir(const char *dirname)
processed_dir_count++;
if (entry->attribute & ATTR_DIRECTORY)
- check_dir(curpath);
- else
+ check_dir(curpath, add_files);
+ else if (add_files)
{
tc_stat.curentry = curpath;
@@ -4193,7 +4197,7 @@ void build_tagcache(const char *path)
if (strcmp("/", path) != 0)
strcpy(curpath, path);
- ret = check_dir(path);
+ ret = check_dir(path, true);
/* Write the header. */
header.magic = TAGCACHE_MAGIC;