Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jun 2009 01:42:35 GMT
From:      David Forsythe <dforsyth@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 163453 for review
Message-ID:  <200906040142.n541gZ2b080469@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=163453

Change 163453 by dforsyth@squirrel on 2009/06/04 01:42:22

	Started adding a way to parse contents from text.

Affected files ...

.. //depot/projects/soc2009/dforsyth_libpkg/Makefile#3 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/Makefile#3 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.c#7 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg.h#6 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_contents.c#3 delete
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_contents.h#2 delete
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_plist.c#1 add
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_plist.h#1 add
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_private.h#3 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.c#8 edit
.. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkgdb.h#5 edit
.. //depot/projects/soc2009/dforsyth_libpkg/pkg_info/Makefile#2 edit

Differences ...

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


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

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

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

@@ -53,6 +53,7 @@
 	if (p->comment == NULL) {
 		/* Something bad happened...  I should probably let people know
 		 * about it... */
+		return (p);
 	}
 	
 	/* Blot out a trailing '\n'. */
@@ -66,7 +67,7 @@
 
 #if 0
 struct pkg *
-pkg_set_pkg_contents(struct pkg *p, struct pkg_contents *pc)
+pkg_set_pkg_plist(struct pkg *p, struct pkg_plist *pc)
 {
 	return (p);
 }

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

@@ -37,10 +37,10 @@
 
 void pkgdb_free_hierdb(struct pkgdb *db);
 
-/* pkg_contents */
+/* pkg_plist */
 
-struct pkg_contents;
+struct pkg_plist;
 
-struct pkg_contents *pkg_contents_read_info_from_text(const char *text);
+struct pkg_plist *pkg_plist_parse_contents_from_text(const char *text);
 
 #endif

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

@@ -7,7 +7,7 @@
 	char *ident; /* User given name for this pkg. */
 	
 	char *comment; /* Mmmmm, should be 70 or less, right? */
-	struct pkg_contents *contents;
+	struct pkg_plist *contents;
 };
 
 #endif

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

@@ -12,7 +12,7 @@
 #include <unistd.h>
 
 #include "pkg_util.h"
-#include "pkg_contents.h"
+#include "pkg_plist.h"
 #include "pkgdb.h"
 #include "pkg_private.h"
 #include "pkg.h"
@@ -117,6 +117,7 @@
 	char *text;
 	struct stat sb;
 	struct pkg *p;
+	struct pkg_plist *pc;
 
 	p = pkg_new(ident);
 	path = pkgdb_pkg_path(db, p);
@@ -134,6 +135,9 @@
 
 	text = pkgdb_read_file_to_text(db, p, COMMENT_FILE);
 	pkg_set_comment(p, text);
+	free(text);
+	text = pkgdb_read_file_to_text(db, p, CONTENTS_FILE);
+	pc = pkg_plist_parse_contents_from_text(text);
 	
 	free(text);
 	return (p);

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

@@ -1,7 +1,7 @@
 #ifndef __PKGDB_H__
 #define __PKGDB_H__
 
-#include "pkg_contents.h"
+#include "pkg_plist.h"
 #include <sys/queue.h>
 
 

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906040142.n541gZ2b080469>