From owner-p4-projects@FreeBSD.ORG Fri Jul 27 06:04:44 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8549016A41F; Fri, 27 Jul 2007 06:04:44 +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 352C916A41A for ; Fri, 27 Jul 2007 06:04:44 +0000 (UTC) (envelope-from gcooper@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 277FD13C4A8 for ; Fri, 27 Jul 2007 06:04:44 +0000 (UTC) (envelope-from gcooper@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6R64iER035781 for ; Fri, 27 Jul 2007 06:04:44 GMT (envelope-from gcooper@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6R64hvY035778 for perforce@freebsd.org; Fri, 27 Jul 2007 06:04:43 GMT (envelope-from gcooper@FreeBSD.org) Date: Fri, 27 Jul 2007 06:04:43 GMT Message-Id: <200707270604.l6R64hvY035778@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gcooper@FreeBSD.org using -f From: Garrett Cooper To: Perforce Change Reviews Cc: Subject: PERFORCE change 124160 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: Fri, 27 Jul 2007 06:04:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=124160 Change 124160 by gcooper@optimus-revised_pkgtools on 2007/07/27 06:04:37 - Submit some more pseudo-code. - Remove a dup variable declaration. Affected files ... .. //depot/projects/soc2007/revised_fbsd_pkgtools/v2/add/main.c#2 edit .. //depot/projects/soc2007/revised_fbsd_pkgtools/v2/delete/main.c#2 edit .. //depot/projects/soc2007/revised_fbsd_pkgtools/v2/info/main.c#2 edit .. //depot/projects/soc2007/revised_fbsd_pkgtools/v2/register/main.c#2 edit .. //depot/projects/soc2007/revised_fbsd_pkgtools/v2/version/main.c#2 edit Differences ... ==== //depot/projects/soc2007/revised_fbsd_pkgtools/v2/add/main.c#2 (text+ko) ==== @@ -1,0 +1,40 @@ +#include + +int main(int argc, char **argv) +{ + + /** Process arguments **/ + + /** Connect to server process **/ + + /** + * Do: + * - Check to see if entry exists on server. + * If so. + * -> Register files from MANIFEST in file database. + * -> Register package in package database. + * If not, and client specified a force flag, install standard + * /var/db/pkg/ files, but avoid adding to global database. + * This may be usable for backwards compatibility. + * + * - If interrupted, roll back installed files, and added files to file and package database(s). + * Don't forget to communicate this to the server process! + * + * Other things to do locally (before installing?): + * - Check to see if the sandbox / target devices have enough space to install the files to + * (libarchive to the rescue?). + * + * Also run PRE and POST install scripts. + * + **/ + + + /** + * Close and quit + * + * - Clean up temp files. + * - Delete sandbox(es). + **/ + return 0; + +} ==== //depot/projects/soc2007/revised_fbsd_pkgtools/v2/delete/main.c#2 (text+ko) ==== @@ -1,0 +1,33 @@ +#include + +int main(int argc, char **argv) +{ + + /** Process arguments **/ + + /** Connect to server process **/ + + /** + * Do: + * Search for package entry database. + * - If found... + * ... and package has dependencies (and upward recursiveness isn't specified)... + * ... delete and deinstall, if forced. Issue warning message. + * ... fail semi-nicely if not forced. + * ... and package doesn't have dependencies, simply uninstall. + * + * - Complete any necessary prereqs, like pre and post deinstall scripts. + * + * - Finalize all entry additions and removals to the... + * ... file database. + * ... package entry database. + + * If interrupted, roll back changes to package and file databases (effectively, 'reinstall' package). + * + **/ + + /** Close and quit **/ + + return 0; + +} ==== //depot/projects/soc2007/revised_fbsd_pkgtools/v2/info/main.c#2 (text+ko) ==== @@ -1,0 +1,23 @@ +#include + +int main(int argc, char **argv) +{ + + /** Process arguments **/ + + /** Connect to server process **/ + + /** Do: + * + * If string specified is a file, get the info from +CONTENTS/+DESCRIPTION. + * Else, search entry database for [ pattern, straight query ] and get equivalent info. + * + * Same as version, if interrupted just close connection.. + * + **/ + + /** Close and quit **/ + + return 0; + +} ==== //depot/projects/soc2007/revised_fbsd_pkgtools/v2/register/main.c#2 (text+ko) ==== @@ -1,7 +1,5 @@ #include "lib/prototypes.h" -int exit_code=0; - int main(int argc, char **argv) { ==== //depot/projects/soc2007/revised_fbsd_pkgtools/v2/version/main.c#2 (text+ko) ==== @@ -1,0 +1,33 @@ +#include + +int main(int argc, char **argv) +{ + + /** Process arguments **/ + + /** Connect to server process **/ + + /** Do: + * If a string's provided... + * ... and it is a file, get the info from directly from +CONTENTS. + * ... and it's not a file... + * ... and it's a glob, pattern search the package entry database. + * ... and it's not a glob, do a straight search in the package entry database. + * + * Else, report all version information for any install packages. + * + * For all package information obtained output, compare package database value versus INDEX + * value and output... + * ... '< 'for lesser package version obtained. + * ... '=' for same package version obtained. + * ... '>' for greater package versio obtained. + * + * If interrupted, just close connections and exit. Don't worry about cleaning up or doing anything.. + * + **/ + + /** Close and quit **/ + + return 0; + +}