From owner-p4-projects@FreeBSD.ORG Mon Oct 25 02:01:59 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id EB4941065675; Mon, 25 Oct 2010 02:01:58 +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 ADECB106564A for ; Mon, 25 Oct 2010 02:01:58 +0000 (UTC) (envelope-from dforsyth@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 905828FC0C for ; Mon, 25 Oct 2010 02:01:58 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id o9P21wTB074803 for ; Mon, 25 Oct 2010 02:01:58 GMT (envelope-from dforsyth@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id o9P21wOi074800 for perforce@freebsd.org; Mon, 25 Oct 2010 02:01:58 GMT (envelope-from dforsyth@FreeBSD.org) Date: Mon, 25 Oct 2010 02:01:58 GMT Message-Id: <201010250201.o9P21wOi074800@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to dforsyth@FreeBSD.org using -f From: David Forsythe To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 185063 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 02:01:59 -0000 http://p4web.freebsd.org/@@185063?ac=10 Change 185063 by dforsyth@skunk on 2010/10/25 02:01:05 Small naming fixes. Apparently I broke pkg_info a lot of pkg_info output, so started fixing that. Also add reqby. Affected files ... .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/database.c#6 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.c#4 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.h#4 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/freebsd_plist.c#5 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.c#8 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.h#7 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_internal.h#6 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_pkg.h#7 edit .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/reqby.c#1 add .. //depot/projects/soc2010/dforsyth_libpkg/libpkg/reqby.h#1 add .. //depot/projects/soc2010/dforsyth_libpkg/pkg_install/pkg_info/pkg_info.c#4 edit Differences ... ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/database.c#6 (text+ko) ==== @@ -144,7 +144,7 @@ /* Do the add and set up pkg. */ if (db->add(db, pkg, name, origin, comment, description) != PKG_OK) { - pkg_free(pkg); + pkg_release(pkg); return (NULL); } ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.c#4 (text+ko) ==== @@ -13,6 +13,12 @@ return (calloc(1, sizeof(struct pkg_file))); } +void +pkg_file_release(struct pkg_file *file) +{ + free(file); +} + const char * pkg_file_prefix(struct pkg_file *file) { ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/file.h#4 (text+ko) ==== @@ -29,6 +29,7 @@ TAILQ_HEAD(pkg_file_list, pkg_file); struct pkg_file *pkg_file_alloc(void); +void pkg_file_release(struct pkg_file *); const char *pkg_file_prefix(struct pkg_file *); const char *pkg_file_pathname(struct pkg_file *); @@ -38,6 +39,9 @@ const struct stat *pkg_file_stat(struct pkg_file *); +/* These only set the fields in the immediate object, they don't touch the db. + * */ + void _pkg_file_set_prefix(struct pkg_file *, const char *); void _pkg_file_set_pathname(struct pkg_file *, const char *); ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/freebsd_plist.c#5 (text+ko) ==== ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.c#8 (text+ko) ==== @@ -24,18 +24,11 @@ struct pkg * pkg_alloc(void) { - struct pkg *pkg; - - pkg = calloc(1, sizeof(*pkg)); - if (pkg == NULL) { - return (NULL); - } - - return (pkg); + return (calloc(1, sizeof(struct pkg))); } void -pkg_free(struct pkg *pkg) +pkg_release(struct pkg *pkg) { free(pkg); } ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg.h#7 (text+ko) ==== ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_internal.h#6 (text+ko) ==== @@ -67,6 +67,6 @@ TAILQ_HEAD(pkg_list, pkg); struct pkg *pkg_alloc(void); -void pkg_free(struct pkg *); +void pkg_release(struct pkg *); #endif ==== //depot/projects/soc2010/dforsyth_libpkg/libpkg/pkg_pkg.h#7 (text+ko) ==== @@ -37,16 +37,23 @@ const char *, int); void _pkg_append_file(struct pkg *, struct pkg_file *); +void pkg_file_finish(struct pkg *pkg, + struct pkg_file *file); struct pkg_depend *pkg_add_depend(struct pkg *, const char *, const char *); void _pkg_append_depend(struct pkg *, struct pkg_depend *); +void pkg_depend_finish(struct pkg *pkg, + struct pkg_depend *); + struct pkg_conflict *pkg_add_conflict(struct pkg *, const char *, const char *); void _pkg_append_conflict(struct pkg *, struct pkg_conflict *); +void pkg_conflict_finish(struct pkg *, + struct pkg_conflict *); struct pkg_file_list *pkg_files(struct pkg *); /* This should take a prefix argument. */ ==== //depot/projects/soc2010/dforsyth_libpkg/pkg_install/pkg_info/pkg_info.c#4 (text+ko) ==== @@ -559,10 +559,6 @@ printf("%s%s:", _c->info_prefix, pkg_name(pkg)); if (_c->show_flags & SHOW_PLIST) - if (!_c->quiet) - printf("%sPacking list:\n", _c->info_prefix); - - if (_c->show_flags & SHOW_PLIST) /* TODO: Write a show plist function for this flag * because the output is jacked in this case. */ if (!_c->quiet) @@ -596,7 +592,7 @@ pkg_depend_origin(depend)); } /* Separator. */ - printf("\n"); + // printf("\n"); } if (_c->show_flags & SHOW_REQBY) { @@ -662,7 +658,7 @@ files = pkg_files(pkg); TAILQ_FOREACH(file, files, next) { if (last_prefix == NULL) - pkg_file_prefix(file); + last_prefix = pkg_file_prefix(file); else { /* Check to see is the prefix has * changes. */