PERFORCE change 164074 for review
David Forsythe
dforsyth at FreeBSD.org
Thu Jun 11 07:37:29 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=164074
Change 164074 by dforsyth at squirrel on 2009/06/11 07:36:38
Committing changes to prevent data loss. Still overhauling pkgdb.
Affected files ...
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.h#13 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_util.h#6 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb.c#2 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb.h#2 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb_pkgdb_sub.c#2 edit
Differences ...
==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.h#13 (text+ko) ====
@@ -1,6 +1,9 @@
#ifndef __PKG_H__
#define __PKG_H__
+/* When I get more than one, I'll plop it into an enum type. */
+#define HIERDB 0
+
/* TODO: Error codes. */
/* pkg_file */
==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_util.h#6 (text+ko) ====
@@ -4,8 +4,11 @@
#include <dirent.h>
int subdir_sel(struct dirent *ent);
+
char *path_strdup(const char *name);
+char *path_build(const char *prefix, const char *suffix);
+
void arg_rage_quit(const char *function, const char *message, int ret);
#endif
==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb.c#2 (text+ko) ====
@@ -9,13 +9,15 @@
#include "pkgdb.h"
int
-pkgdb_hierdb_dbopen(struct pkgdb *db, const char *db_root)
+pkgdb_hierdb_db_open(struct pkgdb *db, const char *db_root)
{
int s;
struct stat sb;
char *new_db_root;
-
- if (!VALID_DB(db))
+#if 0
+ if (!VALID_DB(db))a
+#endif
+ if (db == NULL)
arg_rage_quit(__func__, "Not a valid database.", RAGE_AT_CLIENT);
if (db_root == NULL)
arg_rage_quit(__func__, "Not a valid root directory for
@@ -48,8 +50,10 @@
int status;
struct pkgdb_sub *dbs;
struct dirent **ents;
-
+#if 0
if (!VALID_DB(db))
+#endif
+ if (db == NULL);
arg_rage_quit(__func__, "Not a valid database.", RAGE_AT_CLIENT);
/* TODO: Add dirty check. */
@@ -134,3 +138,8 @@
return (status);
}
+int
+pkgdb_hierdb_db_close(struct pkgdb *db)
+{
+ return (0);
+}
==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb.h#2 (text+ko) ====
@@ -1,0 +1,14 @@
+#ifndef __PKGDB_HIERDB_H__
+#define __PKGDB_HIERDB_H__
+
+int pkgdb_hierdb_db_open(struct pkgdb *db, const char *db_root);
+
+int pkgdb_hier_db_init(struct pkgdb *db);
+
+
+int pkgdb_hierdb_read_pkgdb_sub(struct pkgdb *db, struct pkgdb_sur *dbs,
+ const char *ident);
+
+int pkgdb_hierdb_db_close(struct pkgdb *db);
+
+#endif
==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb_hierdb_pkgdb_sub.c#2 (text+ko) ====
@@ -45,7 +45,10 @@
struct stat sb;
/* Only called internally, this should never be an issue. */
+#if 0
if (!VALID_DB(owner))
+#endif
+ if (db == NULL)
arg_rage_quit(__func__, "Owner must be a valid database.",
RAGE_AT_LIB);
if (dbs == NULL)
More information about the p4-projects
mailing list