From owner-p4-projects@FreeBSD.ORG Thu Jul 16 04:53:05 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id CABD61065673; Thu, 16 Jul 2009 04:53:04 +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 896D6106566C for ; Thu, 16 Jul 2009 04:53:04 +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 5D6B68FC1F for ; Thu, 16 Jul 2009 04:53:04 +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 n6G4r4gZ011495 for ; Thu, 16 Jul 2009 04:53:04 GMT (envelope-from dforsyth@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6G4r4ZZ011493 for perforce@freebsd.org; Thu, 16 Jul 2009 04:53:04 GMT (envelope-from dforsyth@FreeBSD.org) Date: Thu, 16 Jul 2009 04:53:04 GMT Message-Id: <200907160453.n6G4r4ZZ011493@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 166153 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, 16 Jul 2009 04:53:05 -0000 http://perforce.freebsd.org/chv.cgi?CH=166153 Change 166153 by dforsyth@squirrel on 2009/07/16 04:52:10 Fix pkg_dump Affected files ... .. //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_util.c#12 edit Differences ... ==== //depot/projects/soc2009/dforsyth_libpkg/libpkg/pkg_util.c#12 (text+ko) ==== @@ -87,7 +87,7 @@ const char *comment; const char *name; const char *origin; - const char *mtree_file; + /* const char *mtree_file; */ const char *cwd; const char *path; @@ -130,40 +130,43 @@ fprintf(stream, "\tfiles:\n"); files = pkg_files(p); - while ((file = *files++) != NULL) { - path = file; - cwd = pkg_file_get_cwd(p, file); - md5 = pkg_file_get_md5(p, file); - owner = pkg_file_get_owner(p, file); - group = pkg_file_get_group(p, file); - mode = pkg_file_get_mode(p, file); + if (files != NULL) + while ((file = *files++) != NULL) { + path = file; + cwd = pkg_file_get_cwd(p, file); + md5 = pkg_file_get_md5(p, file); + owner = pkg_file_get_owner(p, file); + group = pkg_file_get_group(p, file); + mode = pkg_file_get_mode(p, file); - fprintf(stream, "\t\t%s\n", - (path != NULL ? path : BAD_OR_UNKNOWN_VALUE)); - fprintf(stream, "\t\t\tCWD: %s\n", - (cwd != NULL ? cwd : BAD_OR_UNKNOWN_VALUE)); - fprintf(stream, "\t\t\tMD5: %s\n", - (md5 != NULL ? md5 : BAD_OR_UNKNOWN_VALUE)); - fprintf(stream, "\t\t\tOWNER: %s\n", - (owner != NULL ? owner : BAD_OR_UNKNOWN_VALUE)); - fprintf(stream, "\t\t\tGROUP: %s\n", - (group != NULL ? group : BAD_OR_UNKNOWN_VALUE)); - fprintf(stream, "\t\t\tMODE: %s\n", - (mode != NULL ? mode : BAD_OR_UNKNOWN_VALUE)); - } + fprintf(stream, "\t\t%s\n", + (path != NULL ? path : BAD_OR_UNKNOWN_VALUE)); + fprintf(stream, "\t\t\tCWD: %s\n", + (cwd != NULL ? cwd : BAD_OR_UNKNOWN_VALUE)); + fprintf(stream, "\t\t\tMD5: %s\n", + (md5 != NULL ? md5 : BAD_OR_UNKNOWN_VALUE)); + fprintf(stream, "\t\t\tOWNER: %s\n", + (owner != NULL ? owner : BAD_OR_UNKNOWN_VALUE)); + fprintf(stream, "\t\t\tGROUP: %s\n", + (group != NULL ? group : BAD_OR_UNKNOWN_VALUE)); + fprintf(stream, "\t\t\tMODE: %s\n", + (mode != NULL ? mode : BAD_OR_UNKNOWN_VALUE)); + } fprintf(stream, "\tdepends:\n"); depends = pkg_depends(p); - while ((depend = *depends++) != NULL) { - name = depends; - origin = pkg_depend_get_origin(p, depends); - fprintf(stream, "\t\t%s : %s\n", name, origin); - } + if (depends != NULL) + while ((depend = *depends++) != NULL) { + name = depend; + origin = pkg_depend_get_origin(p, depend); + fprintf(stream, "\t\t%s : %s\n", name, origin); + } fprintf(stream, "\tconflicts:\n"); conflicts = pkg_conflicts(p); - while ((conflict = *conflicts++) != NULL) { - name = conflict; - fprintf(stream, "\t\t%s\n", name); - } + if (conflicts != NULL) + while ((conflict = *conflicts++) != NULL) { + name = conflict; + fprintf(stream, "\t\t%s\n", name); + } }