]> git.tuebingen.mpg.de Git - osl.git/commitdiff
Rename base_dir to database-dir and check in fsck.ggo.
authorAndre Noll <maan@systemlinux.org>
Fri, 6 Jun 2008 09:03:10 +0000 (11:03 +0200)
committerAndre Noll <maan@systemlinux.org>
Fri, 6 Jun 2008 09:03:10 +0000 (11:03 +0200)
fsck.c
fsck.ggo [new file with mode: 0644]

diff --git a/fsck.c b/fsck.c
index 1eb850bc6ffea78f68cf92fe99be4c5de3415c09..37195fce6e029924f0dab82fdb24eff3a668fd5a 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1086,11 +1086,11 @@ out:
        return ret;
 }
 
-static int check_table(char *base_dir, char *table_name)
+static int check_table(char *db_dir, char *table_name)
 {
        struct osl_table_description desc = {
                .column_descriptions = NULL,
-               .dir = base_dir,
+               .dir = db_dir,
                .name = table_name
        };
        int ret;
@@ -1113,11 +1113,11 @@ out:
        return ret;
 }
 
-static int check_all_tables(char *base_dir)
+static int check_all_tables(char *db_dir)
 {
        DIR *dir;
        struct dirent *entry;
-       int cwd_fd, ret2, ret = para_opendir(base_dir, &dir, &cwd_fd);
+       int cwd_fd, ret2, ret = para_opendir(db_dir, &dir, &cwd_fd);
 
        if (ret < 0)
                return ret;
@@ -1133,7 +1133,7 @@ static int check_all_tables(char *base_dir)
                m = s.st_mode;
                if (!S_ISDIR(m))
                        continue;
-               ret = check_table(base_dir, entry->d_name);
+               ret = check_table(db_dir, entry->d_name);
                if (ret < 0)
                        break;
        }
@@ -1148,7 +1148,7 @@ static int check_all_tables(char *base_dir)
 int main(int argc, char **argv)
 {
        int i, ret;
-       char *base_dir = NULL;
+       char *db_dir = NULL;
        struct fsck_cmdline_parser_params params = {
                .override = 0,
                .initialize = 1,
@@ -1164,20 +1164,20 @@ int main(int argc, char **argv)
        }
        loglevel = conf.loglevel_arg;
        HANDLE_VERSION_FLAG("fsck", conf);
-       if (conf.base_dir_given)
-               base_dir = para_strdup(conf.base_dir_arg);
+       if (conf.database_dir_given)
+               db_dir = para_strdup(conf.database_dir_arg);
        else {
                char *home = para_homedir();
-               base_dir = make_message("%s/.paraslash/afs_database", home);
+               db_dir = make_message("%s/.paraslash/afs_database", home);
                free(home);
        }
-       INFO_LOG("base_dir: %s\n", base_dir);
+       INFO_LOG("database dir: %s\n", db_dir);
        if (!conf.inputs_num) {
-               ret = check_all_tables(base_dir);
+               ret = check_all_tables(db_dir);
                goto out;
        }
        for (i = 0; i < conf.inputs_num; i++) {
-               ret = check_table(base_dir, conf.inputs[i]);
+               ret = check_table(db_dir, conf.inputs[i]);
                if (ret < 0)
                        break;
        }
@@ -1189,7 +1189,7 @@ out:
                                conf.loglevel_arg - 1);
        } else
                NOTICE_LOG("success\n");
-       if (base_dir)
-               free(base_dir);
+       if (db_dir)
+               free(db_dir);
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;
 }
diff --git a/fsck.ggo b/fsck.ggo
new file mode 100644 (file)
index 0000000..e863f04
--- /dev/null
+++ b/fsck.ggo
@@ -0,0 +1,49 @@
+option "loglevel" l
+#~~~~~~~~~~~~~~~~~~
+
+"set loglevel (0-6)"
+
+       int typestr="level"
+       default="3"
+       optional
+
+option "database-dir" d
+#~~~~~~~~~~~~~~~~~~~~~~
+"Full path to the database directory"
+string typestr="path"
+required
+details="
+       Unless non-option arguments are given, all subdirectories
+       of \"path\" are considered osl tables which oslfsck will try
+       to fix.
+"
+
+option "dump_dir" D
+#~~~~~~~~~~~~~~~~~~
+"If path is non-empty, para_fsck will write a
+dump of all given tables to the specified
+path."
+
+       string typestr="path"
+       optional
+       default=""
+
+option "no_fsck" n
+#~~~~~~~~~~~~~~~~~
+"Disable fsck mode."
+
+       flag off
+
+option "force" f
+#~~~~~~~~~~~~~~~
+"Force fsck even if the table is dirty.
+Ignored if -n is given."
+
+       flag off
+
+option "dry_run" -
+#~~~~~~~~~~~~~~~~~
+"Only report problems, don't try to fix them."
+
+       flag off
+