From owner-p4-projects@FreeBSD.ORG Thu Jun 4 01:42:36 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 290261065672; Thu, 4 Jun 2009 01:42:36 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD6C6106566C for ; Thu, 4 Jun 2009 01:42:35 +0000 (UTC) (envelope-from dforsyth@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CB1E28FC1B for ; Thu, 4 Jun 2009 01:42:35 +0000 (UTC) (envelope-from dforsyth@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n541gZrA080471 for ; Thu, 4 Jun 2009 01:42:35 GMT (envelope-from dforsyth@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n541gZ2b080469 for perforce@freebsd.org; Thu, 4 Jun 2009 01:42:35 GMT (envelope-from dforsyth@FreeBSD.org) Date: Thu, 4 Jun 2009 01:42:35 GMT Message-Id: <200906040142.n541gZ2b080469@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to dforsyth@FreeBSD.org using -f From: David Forsythe To: Perforce Change Reviews Cc: Subject: PERFORCE change 163453 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 01:42:37 -0000 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 ==== //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 #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 ==== //depot/projects/soc2009/dforsyth_libpkg/pkg_info/Makefile#2 (text+ko) ====