PERFORCE change 163398 for review

David Forsythe dforsyth at FreeBSD.org
Wed Jun 3 04:20:36 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=163398

Change 163398 by dforsyth at squirrel on 2009/06/03 04:20:14

	Cleaned up the build.

Affected files ...

.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/Makefile#2 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.c#6 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_contents.c#2 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_private.h#2 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.c#7 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.h#4 edit
.. //depot/projects/soc2009/dforsyth_libpkg/pkg_info/main.c#2 edit

Differences ...

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/Makefile#2 (text+ko) ====

@@ -1,7 +1,7 @@
 LIB=	pkg
 INCS=	pkg.h
 WARNS?=	6
-SRCS=	pkgdb.c pkg_info.c pkg.c pkg_util.c
+SRCS=	pkgdb.c pkg_contents.c pkg.c pkg_util.c
 NO_MAN=	yes
 
 .include <bsd.lib.mk>

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.c#6 (text+ko) ====

@@ -45,7 +45,7 @@
 
 	if (comment == NULL) {
 		/* embrace it... */
-		p->comment = comment;
+		p->comment = NULL;
 		return (p);
 	}
 
@@ -64,11 +64,13 @@
 	return (p);
 }
 
+#if 0
 struct pkg *
 pkg_set_pkg_contents(struct pkg *p, struct pkg_contents *pc)
 {
 	return (p);
 }
+#endif
 	
 
 char *

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_contents.c#2 (text+ko) ====

@@ -31,10 +31,6 @@
 struct pkg_contents *
 pkg_contents_read_info_from_text(const char *text)
 {
-	int newline_pos;
-	int line_len;
-	char *line;
-	int meta;
 	struct pkg_contents *pi;
 
 	/* This function will parse text and create a pkg_contents */

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_private.h#2 (text+ko) ====

@@ -1,6 +1,13 @@
 #ifndef __PKG_PRIVATE_H__
 #define __PKG_PRIVATE_H__
 
-/* Hey look at me I'm empty. */
+struct pkg {
+	TAILQ_ENTRY(pkg) next;
+
+	char *ident; /* User given name for this pkg. */
+	
+	char *comment; /* Mmmmm, should be 70 or less, right? */
+	struct pkg_contents *contents;
+};
 
 #endif

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.c#7 (text+ko) ====

@@ -6,8 +6,10 @@
 #include <sys/queue.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/uio.h>
 #include <dirent.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 #include "pkg_util.h"
 #include "pkg_contents.h"

==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.h#4 (text+ko) ====

@@ -1,17 +1,9 @@
 #ifndef __PKGDB_H__
 #define __PKGDB_H__
 
-#include "pkg_info.h"
+#include "pkg_contents.h"
 #include <sys/queue.h>
 
-struct pkg {
-	TAILQ_ENTRY(pkg) next;
-
-	char *ident; /* User given name for this pkg. */
-	
-	char *comment; /* Mmmmm, should be 70 or less, right? */
-	struct pkg_contents *contents;
-};
 
 struct pkgdb {
 	int dirty; /* changes have been made to this database. */
@@ -26,4 +18,13 @@
 	/* Callbacks */
 };
 
+void pkgdb_pkg_list_init(struct pkgdb *db);
+struct pkg *pkgdb_pkg_list_first(struct pkgdb *db);
+void pkgdb_pkg_list_append(struct pkgdb *db, struct pkg *p);
+
+char *pkgdb_read_file_to_text(struct pkgdb *db, struct pkg *p,
+	const char *filename);
+
+void pkgdb_free_pkg_list(struct pkgdb *db);
+
 #endif

==== //depot/projects/soc2009/dforsyth_libpkg/pkg_info/main.c#2 (text+ko) ====

@@ -13,11 +13,13 @@
 short opt_show_comment = 0;
 char *info_targets;
 
+#if 0
 static char opts[] = "a";
 static struct option lopts[] = {
 	{"all", no_argument, NULL, 'a'},
 	{NULL, 0, NULL, 0}, // <-- something that pkg_add in 7.2 forgot...
 };
+#endif
 
 /* Mock pkg_info for testing, */
 
@@ -32,11 +34,11 @@
 	const char *db_root;
 	struct pkgdb *db;
 
-	if (argc == 1) {
+	if (argc == 1 && argv != NULL /* Giving argv something to do */) {
 		opt_all = 1;
 	}
 
-	parse_opts(argc, argv);
+	/* parse_opts(argc, argv); */
 	
 	db_root = getenv("PKG_DBDIR"); /* User set it */
 	if (db_root == NULL)
@@ -60,18 +62,20 @@
 	exit(exit_val);
 }
 
+#if 0
 void
 parse_opts(int argc, char **argv)
 {
 	/* Ehh... Worthless to write this at this point. */
 	opt_all = 1;
 }
+#endif
 
 void
 perform_on_db(struct pkgdb *db)
 {
 	int count;
-	char *target;
+	/* char *target; */
 	struct pkg *p;
 
 	/* There will be cases where an init is useless, but since I haven't


More information about the p4-projects mailing list